<!--- = editor
        ******************************************************************************************* -->
<script type="text/javascript" src="{$path}/js/customBuyBill.js"></script>
<script type="text/javascript" src="{$path}/js/buyBillNewProductScript.js"></script>


<section id="container" class="container_12">
    <!-- ====================================================== .breadCrumb ======= -->

    <section class="grid_12">
        <div class="box aw_mb10">
            <div class="title">
                <div class="layout"> here will be breadCrumb </div>
            </div>
        </div>
    </section>
    <!-- ====================================================== -->
    <!-- ====================================================== .grid_12 - block begin ======= -->
    <form action="buyBillController.php?do=show" method="post" id="billform">

        <!-- =========================== BUY BILL SETTINGS ================================== -->

        <input type="hidden" name="billnameid" id="billnameid" value="{$billnameid}"/>
        <input type="hidden" name="returnBillSetting" id="returnBillSetting" value="{$billSettingsData[0]->billsettingsvalue}"/>
        <input type="hidden" name="storeSetting" id="storeSetting" value="{$billSettingsData[2]->billsettingsvalue}"/>
        <input type="hidden" name="parcodeSetting" id="parcodeSetting" value="{$billSettingsData[4]->billsettingsvalue}"/>
        <input type="hidden" name="dateSetting" id="dateSetting" value="{$billSettingsData[5]->billsettingsvalue}"/>
        <input type="hidden" name="newProductSetting" id="newProductSetting" value="{$billSettingsData[6]->billsettingsvalue}"/>
        <input type="hidden" name="noteSetting" id="noteSetting" value="{$billSettingsData[7]->billsettingsvalue}"/>
        <input type="hidden" name="productDiscountSetting" id="productDiscountSetting" value="{$billSettingsData[8]->billsettingsvalue}"/>

        <!-- ====================================================== -->

        {literal}
        <style>
            .aw_lb{
                float:right;
            }
            .clear{
                clear: both;
            }
            .aw_label{
                width: 75px;
                float: right;
                margin: 3px 5px 3px 0px;
            }
            .aw_width {
                width: 100%;
                float: right;
                text-align: right;
                padding: 5px 0;
            }
            .aw_lb{
                margin-right: 0px !important;
            }
            .sizew190 {
                width: 190px!important;
            }
            .dataTables_filter label input {
                border: 1px solid #ccc;
                border-radius: 2px;
                -webkit-border-radius: 2px;
                -moz-border-radius: 2px;
                outline: none;
                padding: 2px 4px;
            }
            .aw_left {
                float: left;
            }
            .aw_w2 {
                width: 35%;
            }
            .aw_rllb {
                margin-right: 0px !important;
                float: right;
            }
            .dataTables_filter label {
                margin-right: 10px;
            }
            .aw_right {
                float: right;
            }
            .aw_w1 {
                width: 35%;
            }
            .aw_m1 {
                max-width: 350px;
                width: 195px;
            }
            .container_12{
                width:100% !important;
            }
            .aw_ras {
                float: right;
                margin: 5px 30px 0 0;
            }
        </style>
        {/literal}
        <section class="grid_12">
            <div class="box aw_mb10">
                <div class="title">
                    <div class="layout">الفاتورة</div>
                </div>
                <div class="inside">
                    <div class="aw_width dataTables_filter" id="datatable_2_filter">
                        <div class="aw_right aw_w1">
                            <label>
                                <div class="aw_label">اسم المورد : </div>
                                {$buyBillData->suppliername}
                            </label>

                            <!--------------------->
                            <div   {if $billSettingsData[2]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>
                                <label class="aw_lb">
                                    <div class="aw_label">المخزن : </div>
                                    {$buyBillData->storeName}
                                </label>
                            </div>
                            <!--------------------->

                            <label class="aw_rllb">
                                <div class="aw_label">رقم عملية السداد: </div>
                                {$buyBillData->buybillSerial}
                            </label>
                        </div>

                        <!--------------------->
                        <div class="aw_left aw_w2">
                            <label class="aw_rllb">
                                <div class="aw_label">المديونية السابقة: </div>
                                <div id="debt" class="aw_ras"> </div>
                                {$buyBillData->buybilltotaldeptbefor}
                            </label>

                            <!--------------------->

                            <!--------------------->

                            <div class="clear"></div>
                            <div  {if $billSettingsData[5]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>
                                <label class="aw_lb">
                                    <div class="aw_label">التاريخ : </div>
                                    {$buyBillData->buybilldate}
                                </label>
                            </div>
                            <div class="clear"></div>

                            <!--------------------->

                        </div>
                        <div class="clear"></div>
                        <label class="aw_lb">
                            <div class="aw_label">التعليق : </div>
                            {$buyBillData->comment}
                        </label>
                        <div class="clear"></div>
                    </div>
                </div>
        </section>
        <!-- ====================================================== .grid_12 - block end ======= -->

        <!-- ====================================================== .grid_12 - block begin ======= -->
        <section class="grid_12">
            <div class="box">
                <div class="title">
                    <div class="layout">المنتجات</div>
                </div>
                <div class="inside">
                    <table id="containerpros" border="1" class="aw_fatora table-black" width="100px">
                        <tr class="aw">
                            <td colspan="11" class="noborder aw_wa10"><div class="aw_maa555"><a name="addpro" id="addpro" class="button">إضافة عنصر</a></div></td>
                        </tr>
                        <tr class="aw_bg1f86c2">
                            <td {if $billSettingsData[4]->billsettingsvalue eq 0} style="display:table-cell !important;" {else} style="display:none !important;" {/if}>الباركود</td>
                            <td class="aw_proname" >اسم المنتج</td>
                            <td class="aw_proprice" width="5px" {if $billSettingsData[7]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>ملاحظات</td>
                            <td class="aw_proprice">الوحدة</td>
                            <td class="aw_proprice" width="5px">السعر</td>
                            <td class="aw_pronum">العدد</td>
                            <td class="aw_prodis" {if $billSettingsData[8]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>الخصم</td>
                            <td class="aw_prototal">الإجمالي</td>
                            <td class="aw_prodel aw_none">&nbsp;
                                <input name="hidden_itr" id="hidden_itr" type="hidden" value="0" /></td>
                        </tr>
                        <!-- ------------------------------------------------------------------->
                        {foreach $buyBillDetails as $detail}
                        <tr class="aw_td" id="newProduct1">
                            <td {if $billSettingsData[4]->billsettingsvalue eq 0} style="display:table-cell !important;" {else} style="display:none !important;" {/if}>
                                <div id="parcodeDiv1"> {$detail->parcode} </div></td>
                            <td><div id="productdiv1" class="aw_width aw_mt5"> {$detail->productName} / {$detail->productCatName}
                                    </option>
                                    </select>
                                </div></td>
                            <td {if $billSettingsData[7]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>
                                {$detail->note}</td>
                            <td><div id="unitDiv1"> {$detail->unitName} </div></td>
                            <td><div id="propricechange1"> {$detail->buybilldetailprice} </div></td>
                            <td> {$detail->buybilldetailquantity}</td>
                            <td {if $billSettingsData[8]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>
                                {$detail->discountvalue}</td>
                            <td class="aw_totalprice"><div id="prototal1" class="aw_mt">{$detail->buybilldetailtotalprice}</div></td>
                        </tr>
                        {/foreach}
                    </table>

                    <!---------------------------- End buy bill ------------------------------------------------>

                    <table class="aw_table30">
                        <tr class="aw_fff">
                            <td class="aw_tdnoborder">عدد القطع</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="totalQty">{$countBillDetails}</div></td>
                        </tr>
                        <tr class="aw_ddd">
                            <td class="aw_tdnoborder fulltotal">إجمالى الفاتوره</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gentotal">{$buyBillData->buybilltotalbill} </div>
                                <span class="aw_right">&nbsp; ج &nbsp;</span></td>
                        </tr>
                        <tr class="aw_fff">
                            <td class="aw_tdnoborder">نوع الخصم</td>
                            <td class="aw_tdnoborder"> {if $buyBillData->buybilldiscountrype eq 0}
                                خصم مباشر
                                {else}
                                خصم بنسبه مئويه
                                {/if} </td>
                        </tr>
                        <tr class="aw_fff">
                            <td class="aw_tdnoborder">قيمه الخصم</td>
                            <td class="aw_tdnoborder">{$buyBillData->buybilldiscount}</td>
                        </tr>
                        <tr>
                            <td class="aw_tdnoborder" colspan="2"><hr /></td>
                        </tr>
                        <tr class="aw_ddd">
                            <td class="aw_tdnoborder">المبلغ بعد الخصم</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gen2total">{$buyBillData->buybillaftertotalbill}</div>
                                <span class="aw_right">&nbsp; ج &nbsp;</span></td>
                        </tr>
                        <tr class="aw_fff">
                            <td class="aw_tdnoborder">المدفوع</td>
                            <td class="aw_tdnoborder">{$buyBillData->buybilltotalpayed}</td>
                        </tr>
                        <tr>
                            <td class="aw_tdnoborder" colspan="2"><hr /></td>
                        </tr>
                        <tr class="aw_ddd">
                            <td class="aw_tdnoborder">المتبقى</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gen3total">{$buyBillData->buybillfinalbill}</div>
                                <span class="aw_right">&nbsp; ج &nbsp;</span></td>
                        </tr>
                        <tr class="aw_eee">
                            <td class="aw_tdnoborder">إجمالى المديونيه</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gen4total">{$buyBillData->buybilltotaldeptafter}</div>
                                <span class="aw_right">&nbsp; ج &nbsp;</span></td>
                        </tr>
                    </table>

                    <!--Form footer begin-->
                    <section class="box_footer">
                        <div class="grid-12-12">
                            <input type="submit" class="left button green" tabindex="604" id="billsure" value="رجوع"/>
                            <div class="clear"></div>
                        </div>
                </div>
        </section>

        <!--Form footer end-->

        <div class="clear"></div>
        </div>
</section>
</form>
<div class="clear"></div>
</section>
