<div class="portlet box grey-cascade">
    <div class="portlet-title">
        <div class="caption fright">تحصيل من مريض 
            {if $lastAdvAll   > 3 }
            <a class="label  label-success getLastAdvAll"   id="getLastAdvAll" 
               data-patientId="{$patientId}"    >عرض الكل  ({$lastAdvAll})</a> 
            {/if}
        </div>
        <div class="tools  fleft">
            <a href="#" class="collapse" title="تصغير / تكبير"></a>
        </div>
    </div>
    <div class="portlet-body">
        <div class="row">
            <div id="ultrasoundgynaDiv">
                <div class="row">
                    <div class="portlet-body form" >
                        <div class="form-body">

                            <table class="table table-bordered  table-hover rtl" style="margin-bottom: 5px;">
                                <tr>
                                    <th  class="wds7">  كاش </th>
                                    <td class="wds10">
                                        <input  class="form-control positivefloat"  type="text"  id="advanceCash" value="0" >
                                    </td>
                                    <th  class="wds7">  فيزا </th>
                                    <td class="wds10">
                                        <input  class="form-control positivefloat"  type="text"  id="advanceVisa" value="0">
                                    </td>
                                    <th  class="wds7">  ملاحظة  </th>
                                    <td><input  class="form-control ltr"  type="text"  id="advanceNotes" value=""></td>
                                    <td class="wds10">
                                        <a class="btn btn-sm bg-blue " id="saveAdvancePay" >إضافة دفعة  </a>
                                        <span id="advancePayError" style="color:red;" > </span>
                                    </td>
                                </tr>
                            </table>

                            {if $advancePaysCount > 0 }
                            <table class="table table-bordered table-striped table-hover rtl" style="margin-bottom: 0px;">
                                <thead>
                                    <tr>
                                        <th class="wds9">تاريخ الدفع  </th>
                                        <th class="wds10"> كاش   </th>
                                        <th class="wds10">فيزا    </th>
                                        <th>  ملاحظات  </th>
                                        <th class="wds5">   </th>
                                    </tr>

                                    {foreach  $advancePays  as   $data }
                                    <tr>
                                        <td>{$data.pay_date}</td>
                                        <td>{$data.detectionvalue_cash}</td>
                                        <td>{$data.detectionvalue_visa}</td>
                                        <td>{$data.visitNote}</td>
                                        <td>
                                            {if $data.printserial > 0 && $data.detectionvalue_cash > 0 } 
                                            <a class="label  label-success printAdvReceipt"  data-id="{$data.advanceId}" ><i class="fa fa-print"></i></a>
                                            {/if}
                                        </td>
                                    </tr>

                                    {/foreach}
                                </thead>
                                <tbody>

                                </tbody>
                            </table>

                            {/if}


                            {literal}
                            <script>
                                $(".positivefloat").forcepositivefloat();
                            </script>


                            {/literal}


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