
{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 Report</h4></center>
        <table class="table table-hover portlet light bg-inverse" id="repTable">
            <thead>
                <tr>
                    <td style="width: 10px !important;">#</td>
                    <td>  Rec. No. </td>
                    <td>   Patient Name</td>
                    <td>   Patient No.</td>
                    <td>   Type</td>
                    {if $login_role != 19 }
                    <td>   Total      </td>
                    <td>   Discount   </td>
                    <td>   Cash </td>
                    <td>   Visa  </td>
                    <td>   Debt </td>
                    {/if}

                    {if $share == 1 }
                    <th>RFC</th>
                    <th>Refer Dr.</th>
                    <th>Doctor</th>
                    {/if}
                    <td>Visit Doctor</td>


                    <td>   Notes    </td>
                    <td>   User name  </td>
                    <td>   Visit Date</td>
                    {if $share == 2 }  <th>   Visit Hour</th> {/if}
                </tr>
            </thead>
            <tbody>
                {assign var="i" value="1"}
                {foreach $allData as $data}
                <tr class="odd " {if $data.detectionid == 9999} style="background-color: #efc9cc;"  {/if}>
                    <td>{$i}</td>
                    <td>{$data.printserial}</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>{$data.type}</td>

                    {if $login_role != 19 }
                    <td>
                        {$data.totaldetectionvalue}
                    </td>
                    <td>
                        {$data.discount}
                    </td>
                    <td>
                        {$data.detectionvalue_cash}
                    </td>
                    <td>
                        {$data.detectionvalue_visa}
                    </td>
                    <td>
                        {$data.restdetectionvalue}
                    </td>
                    {/if}

                    {if $share == 1 }
                    <td>  
                        {$data.rfc}
                    </td>
                    <td>
                        {$data.refer}
                    </td>

                    {if  $data.for_husband == 1 }
                    <td>
                        {$data.h_doctor}
                    </td>
                    {else}
                    <td>
                        {$data.doctor}
                    </td>
                    {/if}
                    {/if}

                    <td> {$data.visitDoctor}</td>

                    <td>
                        {$data.vnotes}
                    </td>
                    <td>
                        {$data.insert_user}
                    </td>
                    <td>{$data.visitdate}</td>
                    {if $share == 2 }
                    <td>{$data.visitHour}</td>
                    {/if}
                </tr>
                {assign var="i" value={$i+1}}
                {/foreach}
            </tbody>
        </table>

        {if $login_role != 19 }
        {if !empty($allData)}
        <table class="table table-hover portlet light bg-inverse ">
            <tr>
            <tr>
                <td class="wds15"> </td>
                <td class="wds17"> Cost</td>
                <td class="wds17"> Discount</td>
                <td class="wds17"> Cash</td>
                <td class="wds17"> Visa</td>
                <td class="wds17"> Debt</td>
            </tr>
            </tr>
            <tr>
                <td>New Visits</td>
                <td> {$totalCost}</td>
                <td> {$totalDiscount}</td>
                <td> {$totalCash}</td>
                <td> {$totalVisa}</td>
                <td> {$totalDept}</td>
            </tr>
            <tr>
                <td>Old Debts</td>
                <td> </td>
                <td> </td>
                <td> {$totalOldCash}</td>
                <td> {$totalOldVisa}</td>
                <td></td>
            </tr>
            <tr  style="background-color: #efc9cc;"  >
                <td>Refund</td>
                <td> </td>
                <td> </td>
                <td> {$totalRefundCash}</td>
                <td> {$totalRefundVisa}</td>
                <td></td>
            </tr>
            <tr>
                <td>Total</td>
                <td> </td>
                <td> </td>
                <td> {$totalC}</td>
                <td>{$totalV} </td>
                <td> </td>
            </tr>
        </table>
        {/if}   {/if}
    </div>