
{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 $organizations == 3  }
                    <th>   Contract Price      </th>
                    {/if}


                    {if $login_role != 19 }
                    <td>   Total      </td>
                    <td>   Discount   </td>
                    <td>   Cash </td>
                    <td>   Visa  </td>
                    <td>   Debt </td>
                    {/if}

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

                    {if $referDrShow == 1 && $share != 1 }  <th>   Refer Dr</th> {/if}

                    <td>   Notes    </td>
                    <td>   User name  </td>
                    <td>   Visit Date</td>
                    {if $share == 2 }  <td>   Visit Hour</td> {/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>

                    {if $showBranchCol  == 1}    <td> {$data.branch_name}</td>      {/if} 

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

                    {if $organizations == 3  }
                    <td>{$data.contract_price}</td>
                    {/if}

                    {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.drFees}</td>

                    {if $referDrShow == 1 && $share != 1 }  <td>    {$data.refer}</td> {/if}


                    <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="wds15"> Cost</td>
                <td class="wds15"> Discount</td>
                <td class="wds15"> Cash</td>
                <td class="wds15"> Visa</td>
                <td class="wds15"> Debt</td>
                <td class="wds10"> Dr Fee</td>
            </tr>
            </tr>
            <tr>
                <td>New Visits</td>
                <td> {$totalCost}</td>
                <td> {$totalDiscount}</td>
                <td> {$totalCash}</td>
                <td> {$totalVisa}</td>
                <td> {$totalDept}</td>
                <td></td>
            </tr>
            <tr>
                <td>Old Debts</td>
                <td> </td>
                <td> </td>
                <td> {$totalOldCash}</td>
                <td> {$totalOldVisa}</td>
                <td></td>
                <td></td>
            </tr>
            <tr  style="background-color: #efc9cc;"  >
                <td>Refund</td>
                <td> </td>
                <td> </td>
                <td> {$totalRefundCash}</td>
                <td> {$totalRefundVisa}</td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td>Total</td>
                <td> </td>
                <td> </td>
                <td> {$totalC}</td>
                <td>{$totalV} </td>
                <td> </td>
                <td>{$totalDrFees} </td>
            </tr>
        </table>
        {/if}   {/if}
    </div>