

<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="row">
                            <div class="col-md-2">
                                <label class="control-label">اسم المورد </label>
                            </div>
                             <div class="col-md-4">
                                <p> {$bill->clientname} </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->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"> {$bill->alloweddays} </p>            </div>

                        </div>

                        <div class="row">
                            <div class="row">
                                <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="wdt80">السعر</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->productprice}  </p>
                                            </td>
                                            <td class="aw_totalprice">
                                                <div  class="aw_mt form-control-static"><span id="prototal1">{$product->producttotalprice}</span> <span> {$currency}</span></div>
                                            </td>

                                        </tr>

                                        {/foreach}
                                    </tbody>
                                </table>
                            </div>
                            <button type="button" class="btn btn-primary pull-left ft-nor"> إجمالي المشتريات <span class="badge wht-clo">
                                    <div id="buyBillTotal">{$bill->productstotalprice}</div>
                                </span></button>

                            <input name="totalBillPrice" id="totalBillPrice" type="hidden" value="0" />

                        </div>

                        <div class="form-group">
                            <label class="col-lg-2 control-label">نوع الخصم </label>
                            <div class="col-lg-2">
                                <p class="form-control-static"> {if $bill->discounttype == 1} مباشر {else if $bill->discounttype == 2}نسبة{/if} </p>
                            </div>

                            <label class="col-lg-2 control-label">قيمة الخصم  </label>
                            <div class="col-lg-2">
                                <p class="form-control-static"> {$bill->discountvalue} </p>
                            </div>

                            <label class="col-lg-1 control-label">الصافى  </label>
                            <div class="col-lg-2">
                                <p class="form-control-static"> {$bill->finalnetbillvalue} </p>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-lg-2 control-label">طريقة الدفع  </label>
                        </div>


                        <table class="table billtable table-bordered table-black" >
                            {if $bill->card == 1}
                            <thead>
                                <tr>
                                    <th colspan="7">بنك </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td  style="background-color: #ccc;">
                                        <p class="form-control-static"> اسم البنك  </p>
                                    </td>
                                    <td>
                                        <p class="form-control-static"> {$bill->networkname}  </p>
                                    </td>
                                    <td  style="background-color: #ccc;">
                                        <p class="form-control-static"> اسم الحساب  </p>
                                    </td>
                                    <td >
                                        <p class="form-control-static"> {$bill->notifSeen}  </p>
                                    </td>
                                    <th  style="background-color: #ccc;">
                                        <span class="form-control-static ">  القيمة   </span>
                                    </th>
                                    <td colspan="2">
                                        <p class="form-control-static"> {$bill->cardvalue}  </p>
                                    </td>
                                </tr>
                            </tbody>
                            {/if}
                            {if $bill->cash == 1}
                            <thead>
                                <tr>
                                    <th colspan="7">كاش </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <th  >
                                        <span class="form-control-static color-black">  القيمة   </span>
                                    </th>
                                    <td colspan="5">
                                        <p class="form-control-static"> {$bill->cashvalue}  </p>
                                    </td>
                                </tr>
                            </tbody>
                            {/if}
                            <thead>
                                <tr>
                                    <th colspan="7">أجل </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <th >
                                        <span class="form-control-static color-black">  القيمة   </span>
                                    </th>
                                    <td colspan="5">
                                        <p class="form-control-static"> {$bill->waitvalue}  </p>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

                    </div>




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

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



