<style>
    .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;
    }

</style>
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#"> العملاء</a></li>
            <li class="active">عرض السداد على فاتورة بيع للعميل</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><br />
                {if $message != ""}
                {$message}
                {/if}</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">
                    <thead>
                        <tr>
                            <th> <center>   م</center></th>
                    <th><center>  قيمة الفاتورة</center></th>
                    <th><center>  قيمة الدين قبل</center></th>
                    <th><center> القيمة المدفوعة </center></th>
                    <th><center>  قيمة الدين بعد</center></th>
                    <th><center>   تاريخ الدفع</center></th>
                    <th><center>    طريقة الدفع</center></th>
                    <th><center>    المستخدم</center></th>
                    <th><center>    ملاحظة</center></th>
                    <th class="hidden-print" style="width:5%">حذف</th>
                    <th class="hidden-print">قيد اليومية</th>
                    </tr>
                    </thead>

                    <tbody>

                        {foreach $client_bills as $data}
                        <tr class="gradeA ">
                            <td><center> {$data.itra}</center></td>
                    <td><center> {$data.finalnetbillvalue}  </center></td>
                    <td><center> {$data.wait_before}</center></td>
                    <td><center> {$data.clientdebtchangeamount} </center></td>
                    <td><center> {$data.wait_after}</center></td>
                    <td><center> {$data.date} </center></td>
                    <td><center> {$data.paytype} </center></td>
                    <td><center> {$data.userName} </center></td>
                    <td><center> {$data.comment} </center></td>
                    <td class="hidden-print"><a href="#" type="button" class="btn btn-default btn-lg removeicon delPayment" data-id="{$data.clientdebtchangeid}" data-type="{$data.paytype}"></a></td>
                    <td class="hidden-print"><a href="dailyentry.php?id={$data.dailyentryid}" target="_blank" type="button" class="btn btn-default btn-lg editicon"> </a></td>
                    </tr>
                    {/foreach}


                    </tbody>
                </table>
                <br><br>


            </div> <!------ End result --------->



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

                        </div>

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

    </div>
</div>

{literal}
<script>
    $('.delPayment').live('click', function () {
        var btn = $(this);
        if (!btn.hasClass('processing...')) {
            btn.addClass('processing...');


            var id = btn.data('id');
            var type = btn.data('type');
            type = type.split('-');
            if (type[0].trim() == "خزنة")
                type = "save";
            else if (type[0].trim() == "بنك")
                type = "bank";

            $.post('sellbillAjaxController.php?do=delMakeSellBillPayment', {clientdebtchangeId: id, paytype: type}, function (data) {
                btn.removeClass('processing...');
                if (Number(data) == 1) {
                    btn.parent().parent().remove();
                } else {
                    alert('عفوا حدث خطأ.حاول مرة اخرى')
                }
            });
        }
    });

</script>
{/literal}