<style>
    @media print{

        tr > .myblack {
            border: 1px solid black !important;
        }


        .myleft{
            padding-top: 20px !important;
        }
        .myright{

            margin-top: 50px !important;
            float: right !important;
            margin-bottom: 10px !important;
        }
        .margintop{
            margin-top: 50px  !important;
        }

    }
</style>



<div class="row">
    <div class="col-lg-8">
        <div class="form-group">

            <label class="col-lg-4 control-label">رقم الفاتورة</label>
            <div class="col-lg-4">
                <p class="form-control-static">
                    {$billData->sellbillserial}{$billData->returnsellbillserial}
                </p>
            </div>
        </div><!-- end of form-group-->
        <div class="form-group">

            <label class="col-lg-4 control-label">الرقم التسلسلي</label>
            <div class="col-lg-8">

                <p class="form-control-static">
                    {$billData->sellbillid}{$billData->returnsellbillid}
                    <input type="hidden" name="bill_is_hidden" id="bill_is_hidden" value="{$bill_is}"/>
                    <input type="hidden" name="bill_is_hidden_id" id="bill_is_hidden_id" value="{$billData->sellbillid}{$billData->returnsellbillid}"/>
                </p>
            </div>
        </div><!-- end of form-group-->
        <div class="form-group" {if {$billsettingsData[5]->billsettingsvalue} eq 0} style="display:block" {else} style="display:none" {/if} >

            <label class="col-lg-4 control-label">تاريخ الفاتورة</label>
            <div class="col-lg-8">

                <p class="form-control-static">
                    {$billData->sellbilldate}{$billData->returnsellbilldate}
                </p>
            </div>
        </div><!-- end of form-group-->

    </div><!-- end of bill no-->

    <div class="col-lg-4">
        <div class="form-group mg-bt5">
            <label class="col-lg-4 control-label myleft">اسم العميل</label>
            <div class="col-lg-8">
                <p class="form-control-static">

                    {$billData->sellbillclientname}

                </p>
            </div>
        </div><!-- end of form-group-->

        <div class="form-group mg-bt5" >
            <label class="col-lg-4 control-label myleft">نوع السعر</label>
            <div class="col-lg-8">
                <p class="form-control-static">
                    {if $bill_is == "sell" || $bill_is == "sellAndRet"}
                    {assign var=billpricetype value={$billDetailsDataSell[0]->pricetype}}
                    {else}
                    {assign var=billpricetype value={$billDetailsDataRet[0]->pricetype}}
                    {/if}

                    {if $billpricetype eq 1}
                    تجزئة
                    {elseif $billpricetype eq 0}
                    جملة
                    {elseif $billpricetype eq 2}
                    نصف جملة
                    {/if}
                </p>
            </div>
        </div><!-- end of form-group-->


        <hr class="mg-bt5 mg-tp5 hidden-print"/>
        <div class="form-group mg-bt5">
            <label class="col-lg-4 control-label myleft">المخزن</label>
            <div class="col-lg-8">
                <p class="form-control-static">
                    {$billData->storeName}
                </p>
            </div>
        </div><!-- end of form-group-->
    </div><!-- end of client info-->

</div><!-- end of frist row-->

<div class="clearfix"></div>
<!-- =================================================   -->

<div class="row">
    <div class="row">
        <hr class="hidden-print" style="width: 95%;"/>
        <div class="col-lg-6">
            <h4>المبيعات</h4>
        </div>

    </div><!-- end of title row-->

    <div class="table-responsive">
        <table class="table billtable table-bordered table-black" id="containerpros">
            <thead>
                <tr>
                    <th class="wdt60 myblack" {if {$billsettingsData[40]->billsettingsvalue} eq 0}  {else} style="display:none !important;" {/if}>رقم</th>
                    <th class='myblack' {if {$billsettingsData[59]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if} class="wdt120">الباركود</th>

                    <th class="wdt120 myblack">اسم المنتج</th>
                    {if {$billsettingsData[26]->billsettingsvalue} eq 0}
                    <th  class="wdt240 myblack">المخزن</th>
                    {/if}
                    <th class='myblack hidden-print' {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt240">ملاحظات</th>

                    <th class='myblack' {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt100n">الوحدة</th>



                    <th class="wdt100n myblack" {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>العدد</th>
                    <th  class="wdt100n myblack"   {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if} >{$Programsettingdata->scunitname}</th>

                    <th class="wdt100n myblack">السعر</th>

                    <th  class='myblack' {if {$billsettingsData[57]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if} class="wdt100">الخصم</th>
                    <th class="wdt100n myblack"> الاجمالى</th>


                </tr>
            </thead>
            <tbody>
                {assign var=y value=1}
                {foreach $billDetailsDataSell as $sellbilldetail}
                <tr>
                    <td class='myblack' {if {$billsettingsData[40]->billsettingsvalue} eq 0}  {else} style="display:none !important;" {/if}>{$y}</td>
                    <td class='myblack' {if {$billsettingsData[59]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                        <div id="productparcode1" >
                            <p class="form-control-static">
                                {$sellbilldetail->parcode}
                            </p>
                        </div>
                    </td>

                    <td class='myblack'>
                        <div id="productdiv1">
                            <p class="form-control-static">
                                {$sellbilldetail->productName}/{$sellbilldetail->productCatName}
                            </p>
                        </div>
                    </td>

                    {if {$billsettingsData[26]->billsettingsvalue} eq 0}
                    {if {$sellbilldetail->storeName} <> ""}
                    <td class='myblack'>
                        <div id="productparcode1" >
                            <p class="form-control-static"> {$sellbilldetail->storeName} </p>
                        </div>
                    </td>
                    {else}
                    <td class='myblack'>
                        <div id="productparcode1" >
                            <p class="form-control-static">

                                {$billData->storeName}
                            </p>
                        </div>
                    </td>
                    {/if}

                    {/if}

                    <td class='myblack {if  $sellbilldetail->note eq ''} hidden-print{/if}' {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}>
                                 <p class="form-control-static">
                                     {$sellbilldetail->note}
                                 </p>
                             </td>


                             <td class='myblack' {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                 <div id="productunitdiv1">
                                     <p class="form-control-static">

                                         {$sellbilldetail->unitName}
                                     </p>
                                 </div>
                             </td>



                             <td class='myblack' {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                                 <p class="form-control-static">
                                     {$sellbilldetail->sellbilldetailquantity}
                                 </p>
                             </td>
                             <td {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                                 {$sellbilldetail->otherdetailquantity}
                             </td>

                             <td class='myblack'>
                                 <div id="propricechange1">
                                     <p class="form-control-static">
                                         {$sellbilldetail->sellbilldetailprice}
                                     </p>
                                 </div>
                             </td>


                             <td class='myblack' {if {$billsettingsData[57]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                                 <p class="form-control-static">

                                     {if {$billsettingsData[34]->billsettingsvalue} eq 0}{$sellbilldetail->discountvalue} {else}  {$sellbilldetail->discounttype} {/if}
                                 </p>
                             </td>


                             <td class='myblack'>
                                 <p class="form-control-static">
                                     {$sellbilldetail->sellbilldetailtotalprice}
                                 </p>
                             </td>





                    </tr>
                    {capture assign=y}{$y+1}{/capture}
                    {/foreach}
                </tbody>
            </table>
        </div>
        <!--<button type="button" class="btn btn-primary pull-left ft-nor"> اجمالى المبيعات <span class="badge wht-clo"><div id="sellbilltotal">{$billData->sellbillprice}</div></span>-->
    </div>
    <!-- end of second row-->




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

    <div class="margintop"></div>


    <div class="row" {if {$billsettingsData[0]->billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}>
        <div class="row">
            <hr class="hidden-print"/>
            <div class="col-lg-6">
                <h4>مردودات المبيعات</h4>
            </div>

        </div><!-- end of title row-->
        <div class="table-responsive">
            <table class="table billtable table-bordered table-black" id="containerReturn" {if {$billsettingsData[0]->
                billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}>
                <thead>
                    <tr>
                        <th class="wdt60 myblack" {if {$billsettingsData[40]->billsettingsvalue} eq 0}  {else} style="display:none !important;" {/if}>رقم</th>
                        <th class="wdt120 myblack" {if {$billsettingsData[59]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>الباركود</th>
                        <th class="wdt120 myblack">اسم المنتج</th>
                        {if {$billsettingsData[26]->billsettingsvalue} eq 0}

                        <th  class="wdt240 myblack">المخزن</th>

                        {/if}
                        <th class="wdt240 myblack hidden-print" {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>ملاحظات</th>
                        <th class="wdt100n myblack" {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>الوحدة</th>

                        <th class="wdt100n myblack" {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>العدد</th>
                        <th  class="wdt100n myblack"   {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if} >{$Programsettingdata->scunitname}</th>

                        <th class="wdt100n myblack">السعر</th>
                        <th class="wdt100n myblack" {if {$billsettingsData[57]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>الخصم</th>
                        <th class="wdt100n myblack">الاجمالى</th>


                    </tr>
                </thead>
                <tbody>
                    {assign var=x value=1}
                    {foreach $billDetailsDataRet as $ruternbilldetail}
                    <tr>
                        <td class="myblack" {if {$billsettingsData[40]->billsettingsvalue} eq 0}  {else} style="display:none !important;" {/if}>{$x}</td>

                        <td  class="myblack" {if {$billsettingsData[59]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>

                            <div id="returnproductparcode1">
                                <p class="form-control-static">
                                    {$ruternbilldetail->parcode}
                                </p>
                            </div>
                        </td>

                        <td class="myblack">
                            <div id="returnproductdiv1">
                                <p class="form-control-static">
                                    {$ruternbilldetail->productName}/{$ruternbilldetail->productCatName}
                                </p>

                            </div>
                        </td>
                        {if {$billsettingsData[26]->billsettingsvalue} eq 0}
                        {if {$ruternbilldetail->storeName} <> ""}
                        <td class="myblack">
                            <div id="productparcode1" >
                                <p class="form-control-static"> {$ruternbilldetail->storeName} </p>
                            </div>
                        </td>
                        {/if}
                        {/if}

                        <td class="myblack  {if  $ruternbilldetail->note eq ''} hidden-print{/if}" {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            <p class="form-control-static">
                                {$ruternbilldetail->note}
                            </p>
                        </td>


                        <td class="myblack" {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            <div id="returnproductunitdiv1">
                                <p class="form-control-static">
                                    {$ruternbilldetail->unitName}
                                </p>
                            </div>
                        </td>



                        <td class="myblack" {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                            <p class="form-control-static">
                                {$ruternbilldetail->sellbilldetailquantity}
                            </p>
                        </td>

                        <td {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                            {$ruternbilldetail->otherdetailquantity}
                        </td>

                        <td class="myblack">
                            <div id="returnpropricechange1">
                                <p class="form-control-static">
                                    {$ruternbilldetail->sellbilldetailprice}
                                </p>
                            </div>
                        </td>


                        <td class="myblack" {if {$billsettingsData[57]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                            <p class="form-control-static">

                                {if {$billsettingsData[34]->billsettingsvalue} eq 0}{$ruternbilldetail->discountvalue} {else}  {$ruternbilldetail->discounttype} {/if}
                            </p>
                        </td>


                        <td class="myblack">
                            <p class="form-control-static" id="reurnprototal1"> {$ruternbilldetail->sellbilldetailtotalprice}</p>

                        </td>



                    </tr>
                    {capture assign=x}{$x+1}{/capture}
                    {/foreach}
                </tbody>
            </table>
        </div>
        <!--<button type="button" class="btn btn-primary pull-left ft-nor" {if {$billsettingsData[0]->billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}> اجمالى  مردودات المبيعات<span class="badge wht-clo" id="returnsellbilltotal">{$billData->returnsellbillprice}</span>-->

    </button>
</div>

<!-- end of third row-->





<div class="row">

    <div class="col-lg-5">
        <hr class="hidden-print"/>
        <!--
                                <div class="form-group mg-bt5">

                                    <label class="col-lg-5 control-label">قيمة الفاتورة</label>
                                    <div class="col-lg-7">

                                        <p class="form-control-static" id="gentotal">{$billData->sellbilltotalbill}</p>

                                    </div>
                                </div> end of form-group-->

        {if {$billsettingsData[90]->billsettingsvalue} eq 1 && $billnameAddData->extraDiscountPlace == 1}
        <div class="form-group mg-bt5"  >
            <label class="col-lg-5 control-label">خصم اضافى </label>
            <div class="col-lg-7">
                <p class="form-control-static"> {$billData->extraDiscountVal} </p>
            </div>
        </div>
        {/if}

        <div class="form-group mg-bt5" {if {$billsettingsData[57]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>

            <label class="col-lg-5 control-label">نوع الخصم</label>
            <div class="col-lg-7">

                <p class="form-control-static">
                    {if $bill_is == "sell" || $bill_is == "sellAndRet"}
                    {assign var=billpricetype value=$billData->sellbilldiscounttype}
                    {else}
                    {assign var=billpricetype value=$billData->returnsellbilldiscounttype}
                    {/if}

                    {if $billpricetype eq 1}
                    مباشر
                    {else}
                    بنسبة
                    {/if}
                </p>
            </div>
        </div><!-- end of form-group-->

        <div class="form-group mg-bt5" {if {$billsettingsData[57]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>

            <label class="col-lg-5 control-label">قيمة الخصم</label>
            <div class="col-lg-7">

                <p class="form-control-static">
                    {if $bill_is == "sell" || $bill_is == "sellAndRet"}
                    {assign var=sellbilldiscount value=$billData->sellbilldiscount}
                    {else}
                    {assign var=sellbilldiscount value=$billData->returnsellbilldiscount}
                    {/if}

                    {$sellbilldiscount}
                </p>
            </div>
        </div><!-- end of form-group-->

        {if {$billsettingsData[90]->billsettingsvalue} eq 1 && $billnameAddData->extraDiscountPlace == 0}
        <div class="form-group mg-bt5"  >
            <label class="col-lg-5 control-label">خصم اضافى </label>
            <div class="col-lg-7">
                <p class="form-control-static"> {$billData->extraDiscountVal} </p>
            </div>
        </div>
        {/if}

        <div {if {$billsettingsData[31]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
            <hr class="mg-tp5 mg-bt5 hidden-print"/>
            <div class="form-group mg-bt5">

                <label class="col-lg-5 control-label">ضريبه القيمة المضافة</label>
                <div class="col-lg-7">
                    <div class="input-group">
                        <p class="form-control-static">
                            {$billData->tax}%</p>
                    </div>
                    <div class="input-group" style="padding-top: 1px;">
                        <p class="form-control-static">
                            {$taxvalue}
                        </p>
                    </div>

                </div>
            </div>
        </div>
        <div {if {$billsettingsData[89]->billsettingsvalue} eq 0} style="display:none"    {/if}>
            <hr class="mg-tp5 mg-bt5 hidden-print"/>
            <div class="form-group mg-bt5">

                <label class="col-lg-5 control-label"> ضريبه خصم </label>
                <div class="col-lg-7">
                    <p class="form-control-static">

                        {$billData->taxOfDiscountVal}</p>
                </div>
            </div>
        </div>

        <div class="form-group mg-bt5" {if {$billsettingsData[54]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>

            <label class="col-lg-5 control-label">المدفوع</label>

            {if $bill_is == "sell" || $bill_is == "sellAndRet"}
            {assign var=payed value=$billData->sellbilltotalpayed}
            {else}
            {assign var=payed value=$billData->returnsellbilltotalpayed}
            {/if}

            <div class="col-lg-7">

                {if {$billsettingsData[86]->billsettingsvalue} eq 0}
                <p class="form-control-static"> {$payed} </p>
                <input type="hidden" name="genpayvisa" id="genpayvisa" value="0"/>
                <input type="hidden" name="visaAccount" id="visaAccount" value="0"/>
                <input type="hidden" name="isBankAccountTransfer" id="isBankAccountTransfer" value="0"/>
                {else}
                <div class="form-group mg-bt5"  {if {$billsettingsData[54]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                    <label class="col-lg-5 control-label">كاش</label>
                    <div class="col-lg-7">
                        <p class="form-control-static"> {$payed - $billData->visaPayed} </p>
                    </div>
                </div>
                <div class="form-group mg-bt5"  {if {$billsettingsData[54]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                    <label class="col-lg-5 control-label">دفع الكترونى</label>
                    <div class="col-lg-7">
                        <p class="form-control-static"> {$billData->visaPayed} </p>
                    </div>
                </div>

                <div class="form-group mg-bt5"  {if {$billsettingsData[54]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                    <label class="col-lg-5 control-label">حساب الدفع</label>
                    <div class="col-lg-7">
                        <p class="form-control-static"> {$bankAccount->accountname}/{$bankAccount->bankname} </p>
                    </div>
                </div>
                <div class="form-group mg-bt5"  {if {$billnameAddData->isBankAccountTransfer} eq 1} {else}  style="display:none"    {/if}>
                    <label class="col-lg-5 control-label">تحويل بنكى</label>
                    <div class="col-lg-7">
                        <p class="form-control-static">{if $billData->isBankAccountTransfer == 1} نعم {else} لا{/if} </p>
                    </div>
                </div>
                {/if}
            </div>
        </div><!-- end of form-group-->
    </div><!-- end of totals center-->
</div><!-- end of fourth row-->






