
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="clientReportsController.php?do=show">العملاء</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=clientShow2" 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 class="hidden-print"> <a class="hidden-print" href="{$data->link}" target="_blank" >التفاصيل</a></td>

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

                        <td>
                            {$data->totalbill}

                        </td>


                        <td>{$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>
