

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">الفواتير </a></li>
            <li><a href="#">فواتير </a></li>
            <li class="active">مرتجع  فاتورة </li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title">مرتجع  فاتورة</h3>
            </div>
            <div class="panel-body">

                <!-- end box / title -->

                <form  method="post" id="billForm" action="?do=add" class="nameToBeChecked form-horizontal" >

                    <div id="printAll">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">اسم العميل </label>
                            <div class="col-lg-4">
                                <p class="form-control-static"> {$bill->clientname} </p>
                            </div>

                            <label class="col-lg-2 control-label">تاريخ الاستلام  </label>
                            <div class="col-lg-4">              <p class="form-control-static"> {$bill->receivedate} </p>            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-lg-2 control-label">رقم الفاتورة </label>
                            <div class="col-lg-4">              <p class="form-control-static"> {$bill->billno} </p>            </div>

                            <label class="col-lg-2 control-label">التعليق</label>
                            <div class="col-lg-4">              <p class="form-control-static"> {$bill->comment} </p>            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-lg-2 control-label">تاريخ الفاتورة   </label>
                            <div class="col-lg-4">              <p class="form-control-static"> {$bill->billdate} </p>            </div>
                            <label class="col-lg-2 control-label">نوع الكشف</label>
                            <div class="col-lg-4">              <p class="form-control-static"> {if $bill->kashftype == 1} خارجى {else} داخلى  {/if}</p>            </div>

                        </div>

                        <div class="form-group">
                            <label class="col-lg-2 control-label">الحد الأقصى للسداد</label>
                            <div class="col-lg-4">              <p class="form-control-static"> {$bill->alloweddays} </p>            </div>
                            <label class="col-lg-2 control-label">نوع السعر</label>
                            <div class="col-lg-4">              <p class="form-control-static"> {if $bill->pricetype == 1} تجزئة {else if $bill->pricetype == 2} نصف جملة  {else if $bill->kashftype == 0} جملة  {/if}</p>            </div>

                        </div>

                        {if $bill->kashftype == 1}

                        <div class="form-group">
                            <label class="col-lg-2 control-label">مكان الكشف</label>
                            <div class="col-lg-4">              <p class="form-control-static"> {$bill->kashfplace} </p>            </div>
                            <label class="col-lg-2 control-label">تاريخ الكشف</label>
                            <div class="col-lg-4">              <p class="form-control-static"> {$bill->kashfdate}</p>            </div>

                        </div>
                        {/if}

                        <div class="row">
                            <hr/>
                            <div class="col-lg-6">
                                <h4></h4>
                            </div>
                            <div class="col-lg-6">
                                <h4></h4>
                            </div>
                        </div>



                        <div id="externalKashf">
<div class="row">
                                <div class="col-lg-6 col-xs-12" style="border: 1px solid #ccc;">


                                    <table class='table-black'>
                                        <tr>

                                            <td style="padding-right: 259px;padding-top: 30px;font-size: 20px;padding-bottom: 13px;" colspan="6"> <label class="sr-only">Left Eye</label> </td>

                                        </tr>
                                        <tr>

                                            <td></td>
                                            <td style="padding-right: 36px;" > <label class="sr-only">L-va</label> </td>
                                            <td style="padding-right: 36px;" > <label class="sr-only">L-prism</label> </td>
                                            <td style="padding-right: 36px;" > <label class="sr-only">L-axis</label> </td>
                                            <td style="padding-right: 22px;" > <label class="sr-only">L-cylinder</label> </td>
                                            <td style="padding-right: 22px;" >   <label class="sr-only">L-sphere</label> </td>


                                        </tr>
                                        <tr>


                                            <td> <label class="sr-only">المسافة</label> </td>
                                            <td> <input   type="text" name="D_Lva" disabled="" readonly="" value="{if $kashf->ldva >0}{/if}{$kashf->ldva}"   class="form-control" /> </td>
                                            <td> <input   type="text" name="D_Lprism" disabled="" readonly="" value="{if $kashf->ldprism >0}{/if}{$kashf->ldprism}"    class="form-control" /> </td>
                                            <td> <input   type="text" name="D_Laxis"  disabled="" readonly="" value="{$kashf->ldaxis}"    class="form-control" /> </td>

                                            <td> <input   type="text" name="D_Lcylinder"  disabled="" readonly="" value="{if $kashf->ldcylinder >0}{/if}{$kashf->ldcylinder}"  class="form-control" /> </td>

                                            <td> <input  type="text"  name="D_Lsphere" disabled="" readonly="" value="{if $kashf->ldsphere >0}{/if}{$kashf->ldsphere}"  class="form-control" /> </td>


                                        </tr>
                                        <tr>


                                            <td> <label class="sr-only">القراءة</label> </td>
                                            <td> <input   type="text" name="N_Lva"  disabled="" readonly="" value="{if $kashf->lnva >0}{/if}{$kashf->lnva}"    class="form-control" /> </td>

                                            <td> <input   type="text" name="N_Lprism"  disabled="" readonly="" value="{if $kashf->lnprism >0}{/if}{$kashf->lnprism}"   class="form-control" /> </td>

                                            <td> <input   type="text" name="N_Laxis" disabled="" readonly="" value="{$kashf->lnaxis}"    class="form-control" /> </td>

                                            <td> <input   type="text" name="N_Lcylinder"  disabled="" readonly="" value="{if $kashf->lncylinder >0}{/if}{$kashf->lncylinder}"   class="form-control" /></td>

                                            <td> <input   type="text" name="N_Lsphere"  disabled="" readonly="" value="{if $kashf->lnsphere >0}{/if}{$kashf->lnsphere}"  class="form-control" /> </td>

                                        </tr>
                                    </table>
                                </div>


                            <!-- Left table -->

                                <div class="col-lg-6 col-xs-12" style="border: 1px solid #ccc;">



                                    <table class='table-black'>
                                        <tr>

                                            <td  style="padding-right: 194px;padding-top: 30px;font-size: 20px;padding-bottom: 13px;" colspan="6"> <label class="sr-only">Right Eye</label>  </td>

                                        </tr>
                                        <tr>

                                            <td style="padding-right: 36px;" > <label class="sr-only">R-va</label> </td>
                                            <td style="padding-right: 36px;" > <label class="sr-only">R-prism</label> </td>

                                            <td style="padding-right: 36px;" > <label class="sr-only">R-axis</label> </td>

                                            <td style="padding-right: 22px;" > <label class="sr-only">R-cylinder</label> </td>
                                            <td style="padding-right: 22px;" > <label class="sr-only">R-sphere</label> </td>

                                            <td></td>

                                        </tr>
                                        <tr>


                                            <td>  <input   type="text" name="D_Rva"  disabled="" readonly="" value="{if $kashf->rdva >0}{/if}{$kashf->rdva}"   class="form-control" /> </td>

                                            <td> <input   type="text" name="D_Rprism"  disabled="" readonly="" value="{if $kashf->rdprism >0}{/if}{$kashf->rdprism}"  class="form-control" /> </td>

                                            <td> <input   type="text" name="D_Raxis"  disabled="" readonly="" value="{$kashf->rdaxis}"   class="form-control" /> </td>

                                            <td>  <input   type="text" name="D_Rcylinder" disabled="" readonly="" value="{if $kashf->rdcylinder >0}{/if}{$kashf->rdcylinder}"    class="form-control" /></td>

                                            <td> <input   type="text" name="D_Rsphere"  disabled="" readonly="" value="{if $kashf->rdsphere >0}{/if}{$kashf->rdsphere}"  class="form-control" /> </td>

                                            <td> <label style="    margin-left: 21px;" class="sr-only">Distance</label> </td>
                                        </tr>
                                        <tr>


                                            <td>   <input   type="text" name="N_Rva" disabled="" readonly="" value="{if $kashf->rnva >0}{/if}{$kashf->rnva}"   class="form-control" /> </td>
                                            <td> <input   type="text" name="N_Rprism"  disabled="" readonly="" value="{if $kashf->rnprism >0}{/if}{$kashf->rnprism}"   class="form-control" /> </td>


                                            <td> <input   type="text" name="N_Raxis"  disabled="" readonly="" value="{$kashf->rnaxis}"   class="form-control" /> </td>

                                            <td>  <input   type="text" name="N_Rcylinder"  disabled="" readonly="" value="{if $kashf->rncylinder >0}{/if}{$kashf->rncylinder}"  class="form-control" /> </td>

                                            <td>  <input   type="text" name="N_Rsphere"   disabled="" readonly="" value="{if $kashf->rnsphere >0}{/if}{$kashf->rnsphere}"   class="form-control" /> </td>

                                            <td> <label style="    margin-right: 24px;" class="sr-only">Near</label> </td>

                                        </tr>
                                    </table>



                                </div>
</div>
                        </div>
                        <div class="row">
                            <div class="row">
                                <hr/>
                                <div class="col-lg-6">
                                    <h4></h4>
                                </div>
                                <div class="col-lg-6">
                                </div>
                            </div>
                            <input name="hidden_itr" id="hidden_itr" type="hidden" value="1" />
                            <!-- end of title row-->
                            <div class="table-responsive bd-gr">
                                <table class="table billtable table-bordered table-black" >
                                    <thead>
                                        <tr>
                                            <th class="wdt400">اسم المنتج</th>
                                            <th class="wdt240">ملاحظات</th>
                                            <th class="wdt100n">العدد</th>
                                            <th class="wdt100n">عدد المرتجع سابقا </th>
                                            <th class="wdt100n">العدد الصافى </th>
                                            <th class="wdt80">السعر</th>
                                            <th class="wdt100n">الاجمالى</th>
                                            <th class="wdt100n">عدد المرتجع </th>
                                            <th class="wdt100n">اجمالى المرتجع </th>

                                        </tr>
                                    </thead>
                                    <tbody id="productsTable">
                                        {foreach $billProducts as $product}
                                        <tr>
                                            <td>
                                                <p class="form-control-static"> {$product->productName} </p>

                                            </td>
                                            <td>
                                                <p class="form-control-static"> {$product->note}  </p>
                                            </td>

                                            <td>
                                                <p class="form-control-static"> {$product->productno}  </p>
                                            </td>
                                            <td>
                                                <p class="form-control-static"> {$product->retproductno}  </p>
                                            </td>
                                            <td>
                                                <p class="form-control-static"> {$product->netproductno}  </p>
                                            </td>
                                            <td>
                                                <p class="form-control-static"> {$product->productprice}  </p>
                                            </td>
                                            <td>
                                                <p class="form-control-static"> {$product->producttotalprice}  </p>
                                            </td>
                                            <td>
                                                <p class="form-control-static"> {$product->retno}  </p>
                                            </td>

                                            <td class="aw_totalprice">
                                                <div  class="aw_mt form-control-static"><span id="prototal1">{$product->retprice}</span> <span> {$currency}</span></div>
                                            </td>

                                        </tr>

                                        {/foreach}
                                    </tbody>
                                </table>
                            </div>


                        </div>




                        <div class="col-lg-12">
                            <div class="form-group ">
                                <label class="col-lg-2 control-label bg-yel">اجمالى الفاتورة  </label>
                                <div class="col-lg-6 bg-yel">
                                    <p class="form-control-static mg-tp10" id="oldNetP">{$bill->finalnetbillvalue}</p>
                                    <input class="form-control" name="oldNet" id="oldNet"   type="hidden" value="{$bill->finalnetbillvalue}"  />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-2 control-label">عدد القطع المرتجعة</label>
                                <div class="col-lg-2">
                                    <p class="form-control-static mg-tp10">{$billRetNo}</p>
                                </div>

                                <label class="col-lg-2 control-label">قيمة القطع المرتجعة</label>
                                <div class="col-lg-2">
                                    <p class="form-control-static mg-tp10">{$billsReturn->returnedprice}</p>
                                </div>
                            </div>
                            <div class="form-group ">
                                <label class="col-lg-2 control-label bg-yel">الصافى </label>
                                <div class="col-lg-6 bg-yel">
                                    <p class="form-control-static mg-tp10">{$bill->netbillvalue}</p>
                                </div>
                            </div>
                        </div>



                    </div>




                    <div class="form-group">
                        <div class="col-lg-12">
                            <!--a href="bills.php?do=print&id={$bill->id}&go=no&type=0" style="color: white;" type="button" class="btn btn-primary pull-left"> طباعة</a-->
                        </div>

                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


</div></div>

