<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>
                {if $message != ""}
                {$message}
                {/if}
                <a href="{$youtubes[128]->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="supplierReportsnewController.php?do=supplierShow2"
                    method="post">
                    <div class="form-group">
                        <label class="sr-only">المورد</label>
                        <select class="select2 wdt300" name="supplierId" id="supplierId">
                            <option value="-1">اختر المورد</option>


                            {foreach $supplierData as $mysupplierData}


                            <option value="{$mysupplierData->supplierid}">{$mysupplierData->suppliername}</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>
                        <th>التعليق</th>



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



                    <tr {if $data->supplierdebtchangetype eq 0} class="danger" {else} {/if}>

                        <td>{$data->supplierdebtchangedate}</td>
                        <td>{$data->processname}</td>
                        <td>{if $data->tablename eq "buyBillController.php" || $data->tablename eq
                            "returnBuyBillController.php" || $data->tablename eq "buyAndReturnBillController.php"}
                            <a class="hidden-print" href="{$data->link}" target="_blank"
                                style="color: blue;"><u>{$data->supplierdebtchangemodelid}</u></a>
                            {else} -
                            {/if}
                        </td>
                        <td class="hidden-print">
                            {if $data->link != "#" && $data->link != ""}
                            <a class="hidden-print" href="{$data->link}" target="_blank"
                                style="color: blue;"><u>التفاصيل</u></a>
                            {else}
                            -
                            {/if}
                        </td>

                        <td>{$data->supplierdebtchangebefore}</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->supplierdebtchangeafter}</td>
                        <td>{$data->billComment}</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>
            {if {$supplierDebt}}
            <div class="col-lg-offset-8 col-lg-4">
                <div class="well well-sm">
                    <h4 class="text-center"> الدين الحالي للمورد {$supplierDebt}</h4>
                </div>
            </div>
            {/if}
            <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>