
<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 "> <div class=" hidden-print" >كشف حساب عميل </div><br />
                {if $message != ""}
                {$message}
                {/if}</div>
            <div class="panel-body">
                <form class="form-inline hidden-print" action="clientReportsnewController.php?do=clientShowbure" method="post">
                    <div class="form-group">
                        <label class="sr-only">العميل</label>
                        <select class="select2 wdt300"  name="clientid" id="clientid" >
                            <option value="-1">اختر عميل</option>


                            {foreach $clientData as $client}


                            <option value="{$client->clientid}">{$client->clientname}</option>


                            {/foreach}



                        </select>

                    </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" >
                    </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" >
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <hr/>
            <table class="table billtable table-bordered table-black">
                <thead>

                    <tr>
                        <th>التاريخ</th>
                        <th>رقم الفاتوره</th>
                        <th>اسم العملية </th>

                        <th class="hidden-print">التفاصيل </th>
                        <th>الرصيد السابق</th>
                        <th>قيمة المنتجات المباعة بالفاتورة </th>

                        <th>  باقى الدين</th>
                        <th>قيمة المرتجع </th>
                        <th>الخصم </th>
                        <th>المدفوع</th>
                        <!--th>قيمه التغير</th-->
                        <th>المتبقى </th>




                    </tr>
                </thead>
                <tbody>
                    {assign var=j value=0}
                    {assign var=k value=0}
                    {foreach $shownData as $data}
                    {if {$data->clientdebtchangeid} > 0}



                    <tr>
                        <td>{$data->clientdebtchangedate}</td>
                         <td>{$data->billid}</td>
<!--                        <td>{if $data->tablename eq "sellbillandruternController.php" ||  $data->tablename eq "sellbillController.php"  ||  $data->tablename eq "returnsellbillController.php" }
                            {$data->clientdebtchangemodelid}
                            {else} {$data->processname}
                            {/if} </td>-->
                        <td> {$data->processname} </td>
                        <td class="hidden-print"> <a class="hidden-print" href="{$data->link}" target="_blank" >التفاصيل</a></td>

                        <td>{$data->clientdebtchangebefore}</td>

                        <td>
                            {$data->totalbill}

                        </td>


                        <td>

                            {math equation="( x + y )" x={$data->clientdebtchangebefore} y={$data->totalbill}}
                            {*$data->totalOperationCost*}</td>
                        <td>{if {$data->discards} <> 0}

                            {$data->discards}
                            {/if}</td>
                        <td>{if {$data->discount} <> 0}
                            {$data->discount}
                            {/if}</td>

                        <td>{$data->payedamount}</td>

                        <!--td>{$data->clientdebtchangeamount}</td-->





                        <td>
                          
                            {$data->clientdebtchangeafter}
                            </td>
                    </tr>

                    {/if}

                    {/foreach}

                    <!--   <tr>
                        <td></td>
                        <td></td>

                          <td></td>

                       <td> </td>


                            <td>{$totalsum}</td>
                             <td></td>
                              <td></td>

                        <td></td>

                            <td></td>





                               <td></td>
                      </tr> -->


                </tbody>
            </table>

            <hr />
            {if {count($shownData)} > 0}
            <div  class="noprint">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-4">
                            <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right hidden-print">طباعة</button>
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            {/if}
            <div class="clearfix"></div>
        </div>
    </div>
</div>
