{literal}
<style>
    .prntbl2 {
        padding: 0px !important;
        width: 95% !important;
        margin: 0px auto !important;
    }

    .prntbl2 table {
        border-collapse: collapse !important;
        width: 100% !important;
        margin: 0px !important;
        padding: 0px !important;
    }

    .prntbl2 table th {
        background-color: #2D2D2D !important;
        background: #2D2D2D !important;
        border: 0px solid #000000 !important;
        border-width: 0px 0px 1px 1px !important;
        font-size: 15px !important;
        font-family: Arial !important;
        font-weight: bold !important;
        color: #FFFFFF !important;
        text-align: center !important;
    }

    .prntbl2 tr:hover td {}

    .prntbl2 tr:nth-child(odd) {
        background-color: #E0E0E0 !important;
    }

    .prntbl2 tr:nth-child(even) {
        background-color: #ffffff !important;
    }

    .prntbl2 td {
        border: 1px solid #000000 !important;
        padding: 0px 3px !important;
        font-size: 13px !important;
        font-family: tahoma !important;
        color: #000000 !important;
        text-align: left !important;
    }


    .prntbl2 th,
    .prntbl2 tt,
    .prntbl2 td {
        line-height: 20px !important;
        padding: 1px 5px !important;


    }

    .prntbl2 span {
        font-weight: 700;
    }
</style>

{/literal}
<div class="prntbl2">
    {literal}
    <style>
        .prntbl2 {
            padding: 0px !important;
            width: 95% !important;
            margin: 0px auto !important;
        }

        .prntbl2 table {
            border-collapse: collapse !important;
            width: 100% !important;
            margin: 0px !important;
            padding: 0px !important;
        }

        .prntbl2 table th {
            background-color: #2D2D2D !important;
            background: #2D2D2D !important;
            border: 0px solid #000000 !important;
            border-width: 0px 0px 1px 1px !important;
            font-size: 15px !important;
            font-family: Arial !important;
            font-weight: bold !important;
            color: #FFFFFF !important;
            text-align: center !important;
        }

        .prntbl2 tr:hover td {}

        .prntbl2 tr:nth-child(odd) {
            background-color: #E0E0E0 !important;
        }

        .prntbl2 tr:nth-child(even) {
            background-color: #ffffff !important;
        }

        .prntbl2 td {
            border: 1px solid #000000 !important;
            padding: 0px 3px !important;
            font-size: 13px !important;
            font-family: tahoma !important;
            color: #000000 !important;
            text-align: left !important;
        }


        .prntbl2 th,
        .prntbl2 tt,
        .prntbl2 td {
            line-height: 20px !important;
            padding: 1px 5px !important;


        }

        .prntbl2 span {
            font-weight: 700;
        }
    </style>

    {/literal}
    <div class="prntbl2">
        <center>
            <h4 class="modal-title">Financial Lab Report</h4>
        </center>
        <table class="table">
            <thead>
                <tr>
                    <td style="width: 10px !important;">#</td>
                    <th> Visit Date</th>
                    <th> Refer Dr</th>
                    <th> Patient Name</th>
                    <th> Patient No.</th>
                    <th class=""> Patient National ID.</th>
                    <th> Phone No.</th>
                    <td> Rec. No. </td>
                    {if $login_role != 19 }
                    <th> Total </th>
                    <th> Discount </th>
                    <th> Remain </th>
                    <th> VAT </th>
                    <th> Paid </th>
                    {/if}
                </tr>
            </thead>
            <tbody>
                {assign var="i" value="1"}
                {assign var="totalTotals" value="0"}
                {assign var="totalDiscount" value="0"}
                {assign var="totalRemain" value="0"}
                {assign var="totalVat" value="0"}
                {assign var="totalPaid" value="0"}
                {foreach $allData as $data}

                {assign var="totalTotals" value=$totalTotals + $data.totaldetectionvalue}
                {assign var="totalDiscount" value=$totalDiscount + $data.discount}
                {assign var="totalRemain" value=$totalRemain + $data.restdetectionvalue}
                {assign var="totalVat" value=$totalVat + $data.vat_value}
                {assign var="totalPaid" value=$totalPaid + $data.detectionvalue_cash+$data.detectionvalue_visa}
                <tr class="odd " {if $data.detectionid==9999 || $data.billType==1 } style="background-color: #efc9cc;"
                    {else if $data.customer_add==1} style="background-color: #f1f16d;" {/if}>
                    <td>{$i}</td>
                    <td>{$data.visitdate}</td>
                    <td> {$data.refer}</td>
                    <td>
                        {if $data.for_husband == 1 }
                        {$data.husdandname}
                        {else if $data.for_husband == 2}
                        طفل / {$data.wifename}
                        {else}
                        {$data.wifename}
                        {/if}
                    </td>
                    <td>{$data.statusno}</td>
                    <td class="">{$data.wifenationalid}</td>
                    <td>{$data.phone}</td>
                    <td>{$data.printserial}</td>
                    {if $login_role != 19 }
                    <td>
                        {$data.totaldetectionvalue}
                    </td>
                    <td>
                        {$data.discount}
                    </td>
                    <td>
                        {$data.restdetectionvalue}
                    </td>
                    <td>
                        {$data.vat_value}
                    </td>
                    <td>
                        {($data.detectionvalue_cash+$data.detectionvalue_visa)|string_format:"%.2f"}
                    </td>
                    {/if}
                </tr>
                {assign var="i" value={$i+1}}
                {/foreach}
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="8">
                        Total
                    </td>
                    <td>{$totalTotals}</td>
                    <td>{$totalDiscount}</td>
                    <td>{$totalRemain}</td>
                    <td>{$totalVat}</td>
                    <td>{$totalPaid|string_format:"%.2f"}</td>
                </tr>
            </tfoot>
        </table>
    </div>