<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Journal <?php echo $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"><?php echo $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 <?php echo $menu_label ?></td>
    </tr>
	<tr>
		<td colspan="6" class="s1">&nbsp;</td>
    </tr>
    <tr>
		<td width="30" class="s4">Account No</td>
		<td width="40" 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 height="23" class="s3" colspan="6"> <?php echo 'Transaksi Number : ';?> <?php echo $detail->OIncomeNumber; ?> <?php echo 'Description : ';?> <?php echo $detail->OIncomeDesc; ?></td>
	</tr>
  <?php	   
	foreach($list as $row){
		if($row->OInSaldoCredit > 0){

				$debit_prime 	= abs($row->AmountCurrency);
				$credit_prime 	= 0; 
  ?>
	<tr>
	      <td class="s3"><?php echo $row->AccountNumber; ?></td>
    		<td class="s5"><?php echo $row->AccountName; ?></td>
    		<td class="s5" align="right"><?php echo number_format($row->OInSaldoDebet,"2",",","."); ?></td>
    		<td class="s5" align="right"><?php echo number_format($row->OInSaldoCredit,"2",",","."); ?></td>
        <td class="s5" align="right"><?=number_format($credit_prime,"2",",",".")?></td>
        <td class="s5" align="right"><?=number_format($debit_prime,"2",",",".")?></td>
    </tr>
    <?php
    	}else{

    		$acc_no 			= $row->AccountNumber;
    		$acc_name 			= $row->AccountName;
    		$row_debet 			= $row->OInSaldoDebet;
    		$row_credit 		= $row->OInSaldoCredit;

			$deb_prime 	= 0;
			$cre_prime 	= abs($row->AmountCurrency);abs($row->AmountCurrency);		  
    ?>
  <?php
  		}
	}	   
  ?>
  	<tr>
	    <td class="s3"><?php echo $acc_no; ?></td>
		<td class="s5"><?php echo $acc_name ?></td>
		<td class="s5" align="right"><?php echo number_format($row_debet,"2",",","."); ?></td>
		<td class="s5" align="right"><?php echo number_format($row_credit,"2",",","."); ?></td>
        <td class="s5" align="right"><?=number_format($cre_prime,"2",",",".")?></td>
        <td class="s5" align="right"><?=number_format($deb_prime,"2",",",".")?></td>
    </tr>
    <tr>
		<td class="s5" align="right" colspan="6"></td>
	</tr>
</table>
</body></html>

