<div id="addproduct" style="display:none"> {foreach $productData as $product}
    <option value="{$product->productid}">{$product->productName}</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="storetransferrequestController.php?do=show">اذن تحميل بين المخازن</a></li>
            <li class="active">اضافة تحميل</li>
        </ol>
        <h3>اضافة اذن تحميل بين المخازن</h3>
        <hr/>
        <form class="form-horizontal " role="form" action="storetransferrequestController.php?do=add" method="post" id="sellbillForm">
            <div class="row">
                <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                <!---onChange="loadStoreTo(this.value);"-->


                <div class="form-group {if $Programsettingdata->storeserial eq 0} hidden {/if}">

                    <label  class="col-lg-2 control-label"> رقم ايصال التحميل</label>
                    <div class="col-lg-2">
                        <span ><input style="margin-bottom: 7px;"  class="positiveNo" type="text" name="operationnum" id="operationnum" value="{$nextId}" {if $Programsettingdata->operationnumEdit == 1}readonly{/if}/></span>
                    </div>
                </div>
                <!--                <div class="form-group">

                                    <label  class="col-lg-2 control-label"> الرقم التسلسلي</label>
                                    <div class="col-lg-2">
                                        <span ><input style="margin-bottom: 7px;" type="text" disabled readonly value="{$nextId}"/></span>
                                    </div>
                                </div>-->
                <div id="opNoError" style="display:none;"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">من المخزن</label>
                    <div class="col-lg-2"> <span id="spryselect1">
                            <input type="text" readonly="readonly" name="storenamefrom" value="{$loadStoreByUser->storeName}" />
                            <input type="hidden" name="storeidfrom" id="storeidfrom" value="{$loadStoreByUser->storeId}"/>
                    </div>
                </div>
                <div class="form-group storeTo">
                    <label class="col-lg-2 control-label">إلى المخزن</label>
                    <div class="col-lg-4">
                        <select class="select2" name="storeidto" id="storeidto" style='width:91%' >
                            <option value="-1">اختر مخزن</option>
                            {foreach $storeData as $store}
                            {if $store->storeId neq $loadStoreByUser->storeId}
                            <option value="{$store->storeId}">{$store->storeName}</option>
                            {/if}
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="form-group {if $usergroupdata->storeSupervisorShow == 0} hidden {/if}">
                    <label class="col-lg-2 control-label">التحويل </label>
                    <div class="col-lg-8">
                        <div class="radio-inline">
                            <label>
                                <input value="0" class="radioR"  name="recieveType" type="radio" {if $Programsettingdata->storeRecieveType == 0}checked="checked"{/if}>
                                مباشر </label>
                        </div>
                        <div class="radio-inline">
                            <label>
                                <input value="1" class="radioR"  name="recieveType" type="radio" {if $Programsettingdata->storeRecieveType == 1}checked="checked"{/if}>
                                عن طريق مخزن وسيط </label>
                        </div>
                    </div>
                </div>
                {if $Programsettingdata->workerbetweenstores == 0}
                <div class="form-group">
                    <label class="col-lg-2 control-label">السائق</label>
                    <div class="col-lg-8">
                        <select class="select2 wdt300 checkme" id="driver" name="driver">
                            <option value="-1"></option>
                            {foreach $drivers as $data}
                            <option value="{$data->userid}">{$data->employeename}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">مدة انجاز السائق بالساعة</label>
                    <div class="col-lg-8">
                        <input type="text" class="form-control positiveNo checkme" name="drivertimeout" id="drivertimeout" value="{$Programsettingdata->drivertimeout}">
                    </div>
                </div>
                {/if}
                <div class="form-group" style="display:none">
                    <label class="col-lg-2 control-label">اظهر سعر </label>
                    <div class="col-lg-8">
                        <div class="radio-inline">
                            <label>
                                <input value="hide" class="radioR whatPrice" checked="checked" name="whatPrice" id="whatPrice0" type="radio">
                                بدون </label>
                        </div>
                        <div class="radio-inline">
                            <label>
                                <input value="productBuyPrice" class="radioR whatPrice" name="whatPrice" id="whatPrice1" type="radio">
                                الشراء </label>
                        </div>
                        <div class="radio-inline">
                            <label>
                                <input value="productSellAllPrice" class="radioR whatPrice" name="whatPrice" id="whatPrice2" type="radio">
                                جملة </label>
                        </div>
                        <div class="radio-inline">
                            <label>
                                <input value="productSellHalfPrice" class="radioR whatPrice" name="whatPrice" id="whatPrice3" type="radio">
                                نص جملة </label>
                        </div>
                        <div class="radio-inline">
                            <label>
                                <input value="productSellUnitPrice" class="radioR whatPrice" name="whatPrice" id="whatPrice4" type="radio">
                                قطاعى </label>
                        </div>

                    </div>
                </div>
            </div>
            <!-- end of frist row-->
            <input name="storenegative" type="hidden" value="{$storenegative}" id="storenegative" />
            <div class="row">
                <div class="row">
                    <hr/>
                    <div class="col-lg-6">
                        <h4>المنتجات</h4>
                    </div>
                    <div class="col-lg-6 hidden-print">
                        <button type="button" name="addpro" id="addpro" class="btn btn-primary pull-left ft-nor"> اضافة جديد</button>
                    </div>
                </div>
                <!-- 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="wdt120 check_tr {if {$Programsettingdata->parcode} eq 1} hidden {/if}" >الباركود</th>
                                <th class="wdt400">اسم المنتج</th>
                                <th  class="wdt200">الكمية الحالية</th>
                                <th  class="wdt200" >الكمية المحولة</th>
                                <th  class="wdt200 ck_expireDate {if {$Programsettingdata->expiredate} eq 1}  hidden {/if}" >ت الصلاحية</th>
                                <th class="hidden-print">حذف</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>1</td>
                                <td class=" check_tr {if {$Programsettingdata->parcode} eq 1} hidden {/if}">
                                    <input type="text" name="parcode1" id="parcode1"  class="form-control parcode" value="" />
                                </td>
                                <td>
                                    <div id="myproductselect">
                                        <input type="hidden" class="select2product wdt400 myproduct"  data-itr="1" name="product1" id="product1" data-placeholder="اختر منتج"  />
                                    </div>
                                    <!--
                                        <select class="select2 wdt100" id="productid1" name="productid1" tabindex="7" onchange="getProductQuantity(this.value,1);" onblur="anotherProduct(this.value,1);" >


                                       </select>
                                    -->

                                </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"  onkeyup="checkdata(1)" id="productamount1"  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" class="hidden-print">
                                    <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="add_print" id="add_print" value="0"/>

            <input type="hidden" name="productitr" id="productitr" value="1"/>
            <div class="row hidden-print" >
                <button type="button"  id="saveBtn" class="btn btn-primary">حفظ</button>
                <button type="button"  id="add_print_btn" class="btn btn-success">حفظ وطباعة</button>
            </div>
            <!-- end of fifth row-->

        </form>
    </div>
    <!-- end of container-->
</div>
<input type="hidden" name="sumSameProductForStore" id="sumSameProductForStore" value="{$Programsettingdata->sumSameProductForStore}"/>
{literal}
<script type="text/javascript">
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
</script>
{/literal}