<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 $countSell neq '0'}
<div class="row">
    <div class="container">
        <div class="panel panel-default panel-m">
            <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"> اجمالى المدفوع : {$totalpayedSell}</h4>
                </div>
            </div>

            <table class="table table-black dataTableClass22">
                <thead>
                    <tr>
                        <th>رقم تسلسل الفاتورة</th>
                        <th>تاريخ الفاتورة</th>

                        <th>العميل</th>
                        <th>المستخدم</th>
                        <th>{if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if}</th>
                        <th>اجمالى الفاتورة</th>

                        <th>الخصم</th>
                        <!--<th>ضريبه المبيعات</th>-->
                        <th>المدفوع</th>
                        <th>عدد القطع</th>

                        <th class="hidden-print">تفاصيل الفاتورة</th>
                    </tr>
                </thead>
                <tbody>

                    {foreach $sellbillData as $sellbill}

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

                    <tr> {/if}
                        <td>{$sellbill->sellbillid}</td>
                        <td>{$sellbill->sellbilldate}</td>
                        <td> {if {$sellbill->clientname} eq ""}
                            نقدى
                            {else}
                            {$sellbill->clientname}
                            {/if} </td>
                        <td>{$sellbill->username}</td>
                        <td>{$sellbill->employeename}</td>
                        <td>{$sellbill->sellbillaftertotalbill}</td>

                        <td>{$sellbill->sellbilldiscount}</td>
                        <!--<td>{$sellbill->tax} </td>-->
                        <td>{$sellbill->sellbilltotalpayed}</td>
                        <td>{$sellbill->sellQuantity}</td>


                        <td class="hidden-print">
                            {if $sellbill->type eq "sell"}
                            <a href="sellbillController.php?do=showDetail&sellbillid={$sellbill->sellbillid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                        {else if $sellbill->type eq "sellAndReturn"}
                <a href="sellbillandruternController.php?do=showDetail&sellbillid={$sellbill->sellbillid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                {/if}
                </tr>
                {/if}
                {/foreach}

                </tbody>

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

            <div class="clearfix"></div>
            </form>
        </div>
    </div>
</div>
{/if}
