<html>
    <head>
		<title>Journal <?=$menu_label?></title>
    </head>
    <style type="text/css">
	@media print {
	.noPrint { display: none; }
	}
	</style>
	<body style="width:auto; margin:auto">
        
        <div style="padding:2px">
            <a href="#" class="easyui-linkbutton noPrint" data-options="plain:true,iconCls:'icon-print'" onClick="window.print()">Print</a>
        </div>
        
        <br />
        
        <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td colspan="6" class="s0"><?=$this->load->model('file/m_new_company')->get_company_name($this->session->userdata('company'))?></td>
        </tr>
        <tr>
            <td colspan="6" class="s0"><?php echo $detail->BranchName;?></td>
        </tr>
        <tr>
            <td colspan="6" class="s1">Journal <?=$menu_label?></td>
        </tr>
        <tr>
            <td colspan="6" class="s1">&nbsp;</td>
        </tr>
        <tr>
            <td width="20" class="s4">Account No</td>
            <td width="43" class="s4">Account Name</td>
            <td width="118" class="s4" align="right">Debit(Base)</td>
            <td width="85" class="s4" align="right">Credit(Base)</td>
            <td width="118" class="s4" align="right">Debit(Prime)</td>
            <td width="85" class="s4" align="right">Credit(Prime)</td>
        </tr>
        <tr>
            <td colspan="6" class="s3" style="padding-bottom:7px;">Invoice Number: <?=$detail->PDpayNumber?> Description: </td>
        </tr>
        <?php	   
        foreach($list as $row){ 
            if($row->PDpayJDebet>0){
                $debit_prime 	= abs($row->AmountCurrency);
                $crebit_prime 	= 0;
            }
            else{
                $debit_prime 	= 0;
                $crebit_prime 	= abs($row->AmountCurrency);
            }
        ?>
        <tr>
            <td class="s5"><?=$row->AccountNumber?></td>
            <td class="s5"><?=$row->AccountName?></td>
            <td class="s5" align="right"><?=number_format($row->PDpayJDebet,"2",",",".")?></td>
            <td class="s5" align="right"><?=number_format($row->PDpayJCredit,"2",",",".")?></td>
            <td class="s5" align="right"><?=number_format($debit_prime,"2",",",".")?></td>
            <td class="s5" align="right"><?=number_format($crebit_prime,"2",",",".")?></td>
        </tr> 
        <?php
        }	   
        ?>
        <tr>
            <td class="s5" align="right" colspan="4">&nbsp;</td>
        </td>
        </table>
	</body>
</html>

