
<style>

</style>
<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="storemovementController.php?do=show">التحويل بين المخازن</a></li>
            <li class="active">اضافة تحويل</li>
        </ol>
        <h3>اضافة تحويل بين المخازن</h3>
        <hr/>
        <form class="form-horizontal " role="form" action="storemovementController.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="{if $Programsettingdata->storeserial eq 0} hidden {/if}">
                    <label style="margin-right: -17;" class="col-lg-2 "> رقم ايصال التحويل</label> <span  style="margin-right: 23px;">
                        <input style="margin-bottom: 7px;"  class="positiveNo" type="text" name="operationnum" id="operationnum" value="{$nextId}" {if $Programsettingdata->operationnumEdit == 1}readonly{/if}/></span>
                </div>
                <div id="opNoError" style="display:none;"></div>
                <!-- =================================================   -->
                <!--                <div class="form-group" style="display: none;">
                                    <label class="col-lg-2 control-label">الرقم التسلسلي</label>
                                    <div class="col-lg-3">
                                        <input type="text" disabled class="form-control wdt300" value="{$nextId}"/>
                                    </div>
                                </div>-->

                <!-- =================================================   -->
                <div class="form-group">
                    <label class="col-lg-2 control-label">من المخزن</label>
                    <div class="col-lg-8"> <span id="spryselect1">
                            <select class="select2 wdt300" name="storeidfrom" id="storeidfrom" onChange="loadStoreTo(this.value);" >
                                <option value="-1">اختر مخزن</option>


                                {foreach $storeData as $store}


                                <option value="{$store->storeId}">{$store->storeName}</option>


                                {/foreach}



                            </select>
                            <span class="selectInvalidMsg">*</span></span> </div>
                </div>
                <div class="form-group storeTo">
                    <label class="col-lg-2 control-label">إلى المخزن</label>
                    <div class="col-lg-8">
                        <select class="select2 wdt300" name="storeidto" id="storeidto"  >
                            <option value="-1">اختر مخزن</option>
                        </select>
                    </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>
            <!-- end of frist row-->
            <input name="storenegative" type="hidden" value="{$storenegative}" id="storenegative" />
            <input name="parcodesetting" type="hidden" value="{$Programsettingdata->parcode}" id="parcodesetting" />


            <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="addpro2" 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="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 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 style="display: inline">
                                        <select class="select2 productCat productCat1" style="width:40%;display: inline" data-level="0" data-itr ="1" name="product1" id="productCatId0_1" >
                                            <option value="-1">اختر تصنيف</option>
                                            {foreach $catDataReport as $data}
                                            <option value="{$data->productCatId}">{$data->productCatName}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                    <input type="hidden" id="level_1" data-itr ="1" name="level_1" value="0">
                                    <div id="manyParents_1"  data-itr ="1" style="display: inline">

                                    </div>
                                    <!--div id="productdiv1">
                                        <input type="hidden" id="product1" name="product1"  class="productchange wdt100" data-newR="0"  data-itr="1"  data-placeholder="اختر منتج"  tabindex="7" />
                                    </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"  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>
                </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}