<style>
    @media print{
        .showPrint{
            display: block !important;
        }
    }
    .paymentnetworks{
        display:none;
    }

    .bold {
        font-weight:bold;
    }
    .block {
        display:block;
    }

    body {
        background-color: #fff;
        font-family:"Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
        margin: 0px;
        padding: 0px;
        color: #696969;
    }
    /*
    ul.myErrorClass, input.myErrorClass, textarea.myErrorClass, select.myErrorClass {
        border: 1px solid #cc0000 !important;
        background: #f3d8d8 url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/blitzer/images/ui-bg_diagonals-thick_75_f3d8d8_40x40.png) 50% 50% repeat !important;
    }
    */
    a.myErrorClass, ul.myErrorClass, input.myErrorClass, textarea.myErrorClass, select.myErrorClass {
        border-width: 1px !important;
        border-style: solid !important;
        border-color: #cc0000 !important;
        background-color: #f3d8d8 !important;
        background-image: url(http://goo.gl/GXVcmC) !important;
        background-position: 50% 50% !important;
        background-repeat: repeat !important;
    }

    label.myErrorClass {
        color: red;
        font-size: 11px;
        /*    font-style: italic;*/
        display: block;
    }

    #client_dept_bills th , #client_dept_bills td{
        text-align: center;
    }
    .temphide{
        display: none;
    }
</style>
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#"> العملاء</a></li>
            <li class="active">السداد على فاتورة بيع للعميل</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading"><span class="hidden-print"> السداد على فاتورة بيع للعميل</span>
                <span class="temphide showPrint" style="color:white !important"> فواتير مؤجلة</span>
                <br class="hidden-print"/>
                {if $message != ""}
                {$message}
                {/if}
                <a href="{$youtubes[281]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
            </div>
            <div class="panel-body">
                <form class="form-inline  hidden-print" action="clientPayedDeptSellBillsController.php" id="search_form" method="post">
                    <div class="form-group">
                        <label class="sr-only">اختر عميل</label>
                        <input  type="hidden" id="client_2" name="client"  class="wdt100"  />
                    </div>
                    <div class="form-group">
                        <label class="sr-only"> رقم الفاتورة</label>
                        <input  type="hidden" id="bill_no" name="bill_no"  class="wdt100"  />
                    </div>
                    <div class="form-group" style="vertical-align: top;">
                        <label class="sr-only"> نوع الفاتورة</label>
                        <div class="input-group">
                            <label>  <input value="1" name="obgyBillType" id="obgyBillType" type="radio">
                                مباشر</label>
                            <label>
                                <input value="2" name="obgyBillType" id="obgyBillType" type="radio">
                                مستهلك</label>
                            <label>
                                <input value="3" name="obgyBillType" id="obgyBillType" type="radio">
                                استقبال</label>
                        </div>
                    </div>
                    <br />
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd"  name="from" id="datepicker_from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd"  name="to" id="datepicker_to"  >
                    </div>

                    <button type="submit" class="btn btn-primary  hidden-print">بحث</button>
                </form>
            </div>
            <!--            <div class="col-lg-offset-8 col-lg-4">
                            <div class="well well-sm"><h4 class="text-center">الإجمالي:  {$sum} {$currency}</h4></div>
                        </div>-->
            <div id="resultDiv"><!------ Start result --------->

                <hr/>
                <table class="table table-black" id="client_dept_bills">
                    <thead>
                        <tr>
                            <th>   رقم الفاتورة</th>
                            <th>   العميل</th>
                            <th>   التاريخ</th>
                            <th>  قيمة الفاتورة</th>
                            <th>  قيمة الدين</th>
                            <th> القيمة المسددة </th>
                            <th>  المستخدم</th>
                            <!--<th> طريقة السداد السابقة</th>-->
                            <th class="hidden-print">   تفاصيل الفاتورة </th>
                            <th class="hidden-print"> قيمة السداد </th>
                            <th class="hidden-print" style="width:150px;">  نوع الدفع </th>
                        </tr>
                    </thead>
                    <tbody>
                        {assign var=totalBill value=0}
                        {assign var=totalDebt value=0}
                        {assign var=totalPayed value=0}
                        {foreach $client_bills as $data}

                        <tr class="gradeA " id="bill_tr_{$data.billno}">

                            <td>{$data.billno}</td>
                            <td>{$data.clientName}</td>
                            <td>{$data.billDate}</td>
                            <td>{$data.finalnetbillvalue}</td>

                            <td> <span id='waitvalue_{$data.billno}'>{$data.waitvalue}</span></td>
                            <td>
                                {$data.total_payed}
                            </td>
                            <td> {$data.userName}</td>
                            <!--                            <td class="hide paytype_text" id="paytype_text_{$data.billno}">
                                                            <span></span>
                                                        </td>-->
                            <td class="hidden-print"> <a href="sellbillController.php?do=showDetail&sellbillid={$data.id}" target="_blank" type="button" class="btn btn-default btn-lg notesicon"></a> </td>
                            <td class="hidden-print"><input type="text" name="" style="width: 100px;" class='bill_pay positivefloat' data-id='{$data.billno}' id="" /></td>
                            <td class="paytype_radio hidden-print" id="paytype_radio_{$data.billno}">
                                <input type="radio"  class="paytype"  data-id="{$data.billno}" id="paytype_{$data.billno}"  name="paytype_{$data.billno}" value="save" checked> خزنة
                                <input type="radio"  class="paytype"  data-id="{$data.billno}" id="paytype_{$data.billno}"  name="paytype_{$data.billno}" value="bank"> بنك
                                <div id="save_Div_{$data.billno}">
                                    <input type="hidden" id="save_{$data.billno}" name="save_{$data.billno}"  class="wdt50 save"/>
                                </div>
                                <div id="bank_Div_{$data.billno}" style="display:none">
                                    <input type="hidden" id="bankAccount_{$data.billno}" name="bankAccount_{$data.billno}"  class="wdt50 bankAccount"/>
                                    <!--<input type="text" id="chekNo_{$data.billno}" name="chekNo_{$data.billno}"  class="wdt50"/>-->
                                </div>
                            </td>
                        </tr>

                        {assign var=totalBill value=$totalBill+$data.finalnetbillvalue}
                        {assign var=totalDebt value=$totalDebt+$data.waitvalue}
                        {assign var=totalPayed value=$totalPayed+$data.total_payed}
                        {/foreach}
                    </tbody>
                    <tfoot style="font-size: 14px;font-weight: bold;background-color: #f5f5f5">
                        <tr>
                            <td colspan="3"> الاجمالى</td>
                            <td> {$totalBill}</td>
                            <td> {$totalDebt}</td>
                            <td> {$totalPayed}</td>
                            <td colspan="4"> </td>
                        </tr>
                    </tfoot>
                </table>
                <div class="col-lg-offset-8 col-lg-4 hidden-print">
                    <div class="well well-sm"><h4 class="text-center">اجمالى قيمة السداد : <span id='total_value'>0</span> </h4> </div>
                    <input type="hidden" name="total_value_h" id="total_value_h" />
                </div>
            </div> <!------ End result --------->



            <input type="hidden" name="client_id" id="client_id" value="{$client_id}"/>
            <div class="clearfix"></div>
            <hr class="hidden-print"/>
            <div  class=" hidden-print">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-4">
                            <button type="button" data-print='no'  class="btn btn-success pull-right save_payment">سداد </button>
                            <button type="button" data-print='yes'  class="btn btn-success pull-right save_payment" style="margin-right: 10px;">سداد وطباعة</button>
                            <button type="button" class="btn btn-success pull-right" style="margin-right: 10px;" onclick="window.print()">طباعة</button>

                        </div>

                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>

    </div>
</div>


