

<div id="addproduct" style="display:none">

    {foreach $productData as $product}
    <option value="{$product->productid}">{$product->productName}</option>
    {/foreach}

</div>

<div id="addnewstor" style="display:none">
    {foreach $storeData as $store}
    <option value="{$store->storeId}">{$store->storeName}</option>
    {/foreach}
</div>



<div id="imageClose" style="display:none">
    <img alt="" src="{$path}/images/close.png" />

</div>




<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">المخازن</a></li>
            <li><a href="storemovementController.php?do=show">التحويل بين المخازن</a></li>
            <li class="active">اضافة تحويل</li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">اضافة تحويل بين المخازن</h3>
            </div>
            <div class="panel-body">

                <form  class="nameToBeChecked form-horizontal"  role="form" action="otherstoremovementController.php?do=add" method="post" id="sellbillForm">

                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>

                    <input name="storenegative" type="hidden" value="{$storenegative}" id="storenegative" />

                    {if $Programsettingdata->clientserial eq 1}

                    <div class="form-group">
                        <label class="col-lg-2 control-label">رقم ايصال التحويل</label>
                        <div class="col-lg-4">
                            <!--<input type="text" class="positiveNo" name="serail" id="serail"  onblur="checkserail();"/>-->
                            <input type="text" class="positiveNo" name="serail" id="serail2" value="{$nextId}" onblur="checkserail();" {if $Programsettingdata->operationnumEdit == 1}readonly{/if}/>
                            <div id="serialError" style="display:none;"></div>
                        </div>
                    </div>
                    <!--                    <div class="form-group">
                                            <label class="col-lg-2 control-label">الرقم التسلسلي</label>
                                            <div class="col-lg-4">
                                                <input type="text" disabled readonly value="{$nextId}"/>
                                            </div>
                                        </div>-->
                    {/if}

                    <div class="form-group">
                        <label class="col-lg-2 control-label">التعليق</label>
                        <div class="col-lg-4">

                            <textarea name="comment" cols="53" rows="2"  ></textarea>

                        </div>
                    </div>


                    <div class="form-group"  >
                        <label class="col-lg-2 control-label">تاريخ التحويل</label>
                        <div class="col-lg-4">
                            <input type="text" class="form-control awdatepicker" autocomplete="off"  data-date-format="yyyy-mm-dd" placeholder="تاريخ الفاتورة" value="{$today}" name="mydate" id="mydate">
                            <div id="dateError" style="display:none;"></div>

                        </div>
                    </div>



                    <div class="form-group">
                        <h4>المنتجات</h4>

                        <div class="col-lg-4">
                            <button type="button" name="addpro" id="addpro" class="btn btn-primary pull-left ft-nor"> اضافة جديد</button>
                            <input type="hidden"  id="searchinonestore" value="{$searchinonestore}">

                        </div>
                    </div>
                    <div class="form-group">
                        <!-- end of title row-->
                        <div class="table-responsive">
                            <table class="table billtable table-bordered table-black" id="containerpros">
                                <thead>
                                    <tr>
                                        <th class="wdt200">من </th>
                                        <th class="wdt200">الى</th>
                                        <th class="wdt200">اسم المنتج</th>
                                        <th >الكمية الحالية</th>
                                        <th >الكمية المحولة</th>
                                        <th  class="wdt200 ck_expireDate {if {$Programsettingdata->expiredate} eq 1}  hidden {/if}" >ت الصلاحية</th>
                                        <th>حذف</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>

                                        {if $searchinonestore neq 0}

                                        <td style="width: 120px">
                                             <input type="hidden" name="storeidfrom1" id="storeidfrom1"  value="{$storeid}" onChange="loadStoreTo(this.value, 1);" >
                                             <input type="hidden"  id="searchstoreName" value="{$storedef->storeName}">
                                             <input type="hidden"  id="searchstorid" value="{$storeid}">
                                             {$storedef->storeName}
                                        </td>
                                        <td>
                                            <div id="storeTo1">

                                                <div class="col-lg-8">
                                                    <select class="select2 wdt300" name="storeidto1" id="storeidto1"  >
                                                        <option value="-1">اختر مخزن</option>
                                                        {foreach $storeData as $store}
                                                         {if $store->storeId != $storeid}
                                                        <option value="{$store->storeId}">{$store->storeName}</option>
                                                        {/if}
                                                        {/foreach}
                                                    </select>
                                                </div>
                                            </div>
                                        </td>
                                        {else}
                                        <td>
                                            <select class="select2 wdt300 " name="storeidfrom1" id="storeidfrom1" onChange="loadStoreTo(this.value, 1);" >
                                                <option value="-1">اختر مخزن</option>
                                                {foreach $stores as $store}
                                                <option value="{$store->storeId}">{$store->storeName}</option>
                                                {/foreach}
                                            </select>
                                        </td>
                                        <td>
                                            <div id="storeTo1">

                                                <div class="col-lg-8">
                                                    <select class="select2 wdt300" name="storeidto1" id="storeidto1"  >
                                                        <option value="-1">اختر مخزن</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </td>
                                        {/if}
                                        <td>
                                            <div id="myproductselect">
                                                <input type="hidden" class="select2product wdt300 "   name="product1" id="product1" data-placeholder="اختر منتج"  />
                                            </div>


                                        </td>
                                        <td>
                                            <div id="quantity1">
                                                <input type="text" name="currentquantity1" id="currentquantity1"  class="form-control getprototal  positiveNo txt-nonraduis" value="0" tabindex="7" readonly />
                                            </div>
                                        </td>
                                        <td>
                                            <input type="text" name="productamount1" id="productamount1"  onkeyup="checkdata(1)" class="form-control getprototal  positiveNo txt-nonraduis" value="0" tabindex="7"   />
                                        </td>

                                        <!-- onkeyup="checkquantity(1);"-->
                                        <td class="{if {$Programsettingdata->expiredate} eq 1}  hidden {/if}">
                                            <input type="hidden" name="proSerials1" id="proSerials1" data-itr="1" value="">
                                        </td>
                                        <td id="1">
                                            <button id="remove1" type="button" class="close flt-none removeicon removeproduct" aria-hidden="true">&times;</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <button type="button" class="btn btn-primary pull-left ft-nor">
                                اجمالى الكمية المحولة <span class="badge wht-clo">
                                    <div id="totalQuantityMove">0</div>
                                </span>
                            </button>
                        </div>
                    </div>



                    <!-- end of second row-->

                    <input type="hidden" name="productitr" id="productitr" value="1"/>
                    <div class="row" id="subbtn"   >
                        <button type="button"  id="saveBtn" class="btn btn-primary">حفظ</button>
                    </div>
                    <!-- end of fifth row-->

                </form>
            </div>

            <!-- end of container-->
        </div>
        {literal}
        <script type="text/javascript">
            $('#serail').val(Math.floor((Math.random() * 1000000) + 1));
            var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
        </script>
        {/literal}
        <script type="text/javascript">
            var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
        </script>
