<style>
    .cust{
        background-color: #ffa4a4;
        padding: 7px;
        text-align: center;
        font-size: 15px;
        font-weight: bold;
    }
    @media print {
        p,h4,h3,h2,h1,span,label,td,th,div.dataTables_info,a,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
        div.dataTables_wrapper div.dataTables_info,.panel-heading, tr.odd td.sorting_1,
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            color:#000!important
        }
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            text-align: center
        }
    }
</style>
{if $countreturnbuyBillData neq '0'}
<div class="row">
    <div class="container">

        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="cust">تقرير فواتير المشتريات و  مردودات المشتريات</div>
            <hr/>

            <div class="col-lg-offset-16 col-lg-3">
                <div class="well well-sm">
                    <h4 class="text-center"> القطع عدد:  {$totalqty}</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي المردودات:  {$totalBills}</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي الخصومات:  {$totaldiscount}</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3">
                <div class="well well-sm">
                    <!--h4 class="text-center"> اجمالى الضرائب:  {$totaltax}</h4-->
                    <h4 class="text-center"> اجمالى المدفوع : {$totalpayed}</h4>
                </div>
            </div>

            <table class="table table-black dataTableClass22">
                <thead>
                    <tr>
                        <th>رقم تسلسل الفاتورة</th>
                        <th>تاريخ الفاتورة</th>
                        <th>العميل</th>
                        <th>المستخدم</th>
                        <th>اجمالى الفاتورة</th>
                        <th>اجمالى الخصم</th>
                        <!--<th>اجمالى الضرائب</th>-->
                        <th>المدفوع</th>
                        <th>عدد القطع</th>
                        <th class="hidden-print">تفاصيل الفاتورة</th>
                    </tr>
                </thead>
                <tbody>

                    {foreach $returnbuyBillData as $myreturnbuyBillData}

                    {if {$myreturnbuyBillData->conditions} <> 1}
                    {if {$myreturnbuyBillData->conditions} eq 1}
                    <tr class="danger"> {elseif {$mybuyBillData->conditions} eq 0}

                    <tr> {/if}

                        <td>{$myreturnbuyBillData->buybillid}</td>
                        <td>{$myreturnbuyBillData->buybilldate}</td>
                        <td> {if {$myreturnbuyBillData->suppliername} eq ""}
                            نقدى
                            {else}
                            {$myreturnbuyBillData->suppliername}
                            {/if} </td>
                        <td>{$myreturnbuyBillData->username}</td>
                        <td>{$myreturnbuyBillData->buybillaftertotalbill}</td>
                        <td>{$myreturnbuyBillData->buybilldiscount}</td>
                        <!--<td>{$myreturnbuyBillData->tax}</td>-->
                        <td>{$myreturnbuyBillData->buybilltotalpayed}</td>
                        <td>{$myreturnbuyBillData->totalqty}</td>
                        <td class="hidden-print">

                            <a href="buyAndReturnBillController.php?do=details&id={$myreturnbuyBillData->buybillid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>

                    </tr>
                    {/if}
                    {/foreach}


                    {foreach $returnBuyBillData1 as $myreturnbuyBillData}

                    {if {$myreturnbuyBillData->conditions} <> 1}
                    {if {$myreturnbuyBillData->conditions} eq 1}
                    <tr class="danger"> {elseif {$mybuyBillData->conditions} eq 0}

                    <tr> {/if}

                        <td>{$myreturnbuyBillData->returnbuybillid}</td>
                        <td>{$myreturnbuyBillData->returnbuybilldate}</td>
                        <td> {if {$myreturnbuyBillData->suppliername} eq ""}
                            نقدى
                            {else}
                            {$myreturnbuyBillData->suppliername}
                            {/if} </td>
                        <td>{$myreturnbuyBillData->username}</td>
                        <td>{$myreturnbuyBillData->returnbuybillaftertotalbill}</td>
                        <td>{$myreturnbuyBillData->returnbuybilldiscount}</td>
                        <!--<td>{$myreturnbuyBillData->tax}</td>-->
                        <td>{$myreturnbuyBillData->buybilltotalpayed}</td>
                        <td>{$myreturnbuyBillData->totalqty}</td>

                        <td class="hidden-print">
                            <a href="returnBuyBillController.php?do=details&id={$myreturnbuyBillData->returnbuybillid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>

                    </tr>
                    {/if}
                    {/foreach}




                </tbody>

            </table>
            <div class="clearfix"></div>
            <hr />
            <!--            <div class="col-lg-offset-8 col-lg-4 ">
                            <div class="well well-sm">
                                <h4 class="text-center">إجمالي المشتريات:  {$totalBills}</h4>
                            </div>
                        </div>
                        <div class="col-lg-offset-8 col-lg-4 ">
                            <div class="well well-sm">
                                <h4 class="text-center">عدد القطع :  {$totalqty}</h4>
                            </div>
                        </div>-->
            <div class="clearfix"></div>
            </form>
        </div>
    </div>
</div>
{/if}
