<meta charset="utf-8">
<table>
    <table>
        <tr>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->clientname} </th><th>اسم العميل</th>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->receivedate} </th><th>تاريخ الاستلام</th>
        </tr>
        <tr>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->billno} </th><th>رقم الفاتورة </th>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->comment} </th><th>التعليق </th>
        </tr>
        <tr>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->billdate} </th><th>تاريخ الفاتورة</th>
            <th></th><th></th><th></th><th></th>
            <th>{if $bill->kashftype == 1} خارجى {else} داخلى  {/if}</th><th>نوع الكشف</th>
        </tr>
        <tr>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->alloweddays}</th><th>الحد الأقصى للسداد</th>
            <th></th><th></th><th></th><th></th>
            <th>{if $bill->pricetype == 1} تجزئة {else if $bill->pricetype == 2} نصف جملة  {else if $bill->kashftype == 0} جملة  {/if}</th><th>نوع السعر</th>
        </tr>
        {if $bill->kashftype == 1}
        <tr>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->kashfplace}</th><th>مكان الكشف</th>
            <th></th><th></th><th></th><th></th>
            <th>{$bill->kashfdate}</th><th>تاريخ الكشف</th>

        </tr>
        {/if}
    </table>
    <table class='table-black'>
        <tr>
            <!--right eye-->
            <td></td>
            <td></td>
            <td>Right Eye</td>
            <td></td>
            <td></td>
            <td></td>
            <!--left eye-->
            <td></td>
            <td></td>
            <td></td>
            <td>Left Eye</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <!--right eye-->
            <td></td>
            <td>Rva</td>
            <td>Rprism</td>
            <td>Raxis</td>
            <td>Rcylinder</td>
            <td>Rsphere</td>
            <!--left eye-->
            <td>Lva</td>
            <td>Lprism</td>
            <td>Laxis</td>
            <td>Lcylinder</td>
            <td>Lsphere</td>
            <td></td>

        </tr>
        <tr>
            <!--right eye-->
            <td>Distance</td>
            <td>{if $kashf->rdva > 0}+{/if}{$kashf->rdva}</td>
            <td>{if $kashf->rdprism > 0}+{/if}{$kashf->rdprism}</td>
            <td>{$kashf->rdaxis}</td>
            <td>{if $kashf->rdcylinder > 0}+{/if}{$kashf->rdcylinder}</td>
            <td>{if $kashf->rdsphere > 0}+{/if}{$kashf->rdsphere}</td>
            <!--left eye-->
            <td>{if $kashf->ldva > 0}+{/if}{$kashf->ldva}</td>
            <td>{if $kashf->ldprism > 0}+{/if}{$kashf->ldprism}</td>
            <td>{$kashf->ldaxis}</td>
            <td>{if $kashf->ldcylinder > 0}+{/if}{$kashf->ldcylinder}</td>
            <td>{if $kashf->ldsphere > 0}+{/if}{$kashf->ldsphere}</td>
            <td>المسافة</td>
        </tr>
        <tr>
            <!--right eye-->
            <td>Near</td>
            <td>{if $kashf->rnva > 0}+{/if}{$kashf->rnva}</td>
            <td>{if $kashf->rnprism > 0}+{/if}{$kashf->rnprism}</td>
            <td>{$kashf->rnaxis}</td>
            <td>{if $kashf->rncylinder > 0}+{/if}{$kashf->rncylinder}</td>
            <td>{if $kashf->rnsphere > 0}+{/if}{$kashf->rnsphere}</td>
            <!--left eye-->
            <td>{if $kashf->lnva > 0}+{/if}{$kashf->lnva}</td>
            <td>{if $kashf->lnprism > 0}+{/if}{$kashf->lnprism}</td>
            <td>{$kashf->lnaxis}</td>
            <td>{if $kashf->lncylinder > 0}+{/if}{$kashf->lncylinder}</td>
            <td>{if $kashf->lnsphere > 0}+{/if}{$kashf->lnsphere}</td>
            <td>القراءة</td>
        </tr>
    </table>
    <table>
        <tr><th>Biofocal</th><th>Add</th><th></th><th></th><th></th><th>PD</th><th>{$kashf->pd}</th><th></th><th></th><th></th><th>Biofocal</th><th>Add</th></tr>
        <tr><th>{if $kashf->rbiofocal > 0}+{/if}{$kashf->rbiofocal}</th><th>{if $kashf->radd > 0}+{/if}{$kashf->radd}</th><th></th><th></th><th></th><th>BVD</th><th>{$kashf->bvd}</th><th></th><th></th><th></th><th>{if $kashf->lbiofocal > 0}+{/if}{$kashf->lbiofocal}</th><th>{if $kashf->ladd > 0}+{/if}{$kashf->ladd}</th></tr>
    </table>
    <table>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><th>{$kashf->notes}</th><th>ملاحظات</th></tr>
    </table>
    <table class="table billtable table-bordered table-black" >
        <thead>
            <tr>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th class="wdt100n">الاجمالى</th>
                <th class="wdt80">السعر</th>
                <th class="wdt100n">العدد</th>
                <th class="wdt240">ملاحظات</th>
                <th class="wdt400">اسم المنتج</th>

            </tr>
        </thead>
        <tbody id="productsTable">
            {foreach $billProducts as $product}
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>{$product->producttotalprice}</td>
                <td>{$product->productprice}</td>
                <td>{$product->productno}</td>
                <td>{$product->note}</td>
                <td>{$product->productName}</td>
            </tr>

            {/foreach}
        </tbody>
    </table>
    <table>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>{$bill->productstotalprice}</td><td>إجمالي المشتريات</td></tr>
    </table>
    <table>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>{$bill->kashfvalue}</td><td>قيمة الكشف </td></tr>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>{$bill->kashfdiscount}</td><td>الخصم</td></tr>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>{$bill->netbillvalue}</td><td>الاجمالى</td></tr>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>{if $bill->discounttype == 1} مباشر {else if $bill->discounttype == 2}نسبة{/if}</td><td>نوع الخصم</td></tr>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>{$bill->discountvalue}</td><td>قيمة الخصم</td></tr>
        <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>{$bill->finalnetbillvalue}</td><td>الصافى</td></tr>
    </table>
</table>