<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head><title>Payment Afiliasi</title></head>
	
	<body style="width:auto; margin:auto">
<style type="text/css">
@media print {
.noPrint { display: none; }
}
</style>
		<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="80%" border="0" cellspacing="0" cellpadding="0" style="margin-left:100px; margin-top:10px;">
			<tr>
				<td colspan="8" class="s0"><?= $branch_by_company_to->CompanyName;?></td>
			</tr>
			<tr>
				<td colspan="8" class="s1">Journal Payment Afiliasi</td>
			</tr>
			<tr>
				<td width="" class="s4">Account No</td>
				<td width="" class="s4">Account Name</td>
				<td width="" class="s4" align="right">Debet(Base)</td>
				<td width="" class="s4" align="right">Credit(Base)</td>
				<td width="" class="s4" align="right">Debet(Prime)</td>
				<td width="" class="s4" align="right">Credit(Prime)</td>
			</tr>
			<?php $no = 0;?>
			<?php foreach($detail_journal as $row_to):?>
				<?php if($row_to->company_code == $company->CompRecpCode):?>
					<?php if($no == 0):?>
						<tr>
							<td class="s5"><b><?= $row_to->AInjDate;?></b></td>
							<td class="s3"><b><?= "Payment Afiliasi";?></b></td>
							<td class="s5" align="left">
								<b><?= $row_to->AInjNumber;?></b>
							</td>
							<td class="s5"></td>
							<td class="s5"></td>
							<td class="s5"></td>
						</tr>
						<tr><td height="8" colspan="6"></td></tr>
					<?php endif;?>
					<tr>
						<td class="s3"><?php echo $row_to->AInjAccountNumber; ?></td>
						<td class="s5"><?php echo $row_to->AccountName; ?></td>
						<?php if($row_to->AInjSaldoDebet > 0):?>
							<td class="s5" align="right"><?php echo number_format($row_to->AInjSaldoDebet,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format($row_to->AmountCurrency,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
						<?php else:?>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format($row_to->AInjSaldoCredit,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format($row_to->AmountCurrency,"2",",",".");?></td>
						<?php endif;?>
					</tr>
					<?php $no++;?>
				<?php endif;?>
			<?php endforeach;?>
		</table>

		<br>

		<table width="80%" border="0" cellspacing="0" cellpadding="0" style="margin-left:100px; margin-top:10px;">
			<tr>
				<td colspan="8" class="s0"><?= $branch_by_company_from->CompanyName;?></td>
			</tr>
			<tr>
				<td colspan="8" class="s1">Journal Piutang Afiliasi</td>
			</tr>
			<tr>
				<td width="" class="s4">Account No</td>
				<td width="" class="s4">Account Name</td>
				<td width="" class="s4" align="right">Debet(Base)</td>
				<td width="" class="s4" align="right">Credit(Base)</td>
				<td width="" class="s4" align="right">Debet(Prime)</td>
				<td width="" class="s4" align="right">Credit(Prime)</td>
			</tr>
			<?php $no = 0;?>
			<?php foreach($detail_journal as $row_to):?>
				<?php if($row_to->company_code == $company->CompTransCode):?>
					<?php if($no == 0):?>
						<tr>
							<td class="s5"><b><?= $row_to->AInjDate;?></b></td>
							<td class="s3"><b><?= "Piutang Afiliasi";?></b></td>
							<td class="s5" align="left">
								<b><?= $row_to->AInjNumber;?></b>
							</td>
							<td class="s5"></td>
							<td class="s5"></td>
							<td class="s5"></td>
						</tr>
						<tr><td height="8" colspan="6"></td></tr>
					<?php endif;?>
					<tr>
						<td class="s3"><?php echo $row_to->AInjAccountNumber; ?></td>
						<td class="s5"><?php echo $row_to->AccountName; ?></td>
						<?php if($row_to->AInjSaldoDebet > 0):?>
							<td class="s5" align="right"><?php echo number_format($row_to->AInjSaldoDebet,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format($row_to->AmountCurrency,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
						<?php else:?>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format($row_to->AInjSaldoCredit,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format(0,"2",",",".");?></td>
							<td class="s5" align="right"><?php echo number_format($row_to->AmountCurrency,"2",",",".");?></td>
						<?php endif;?>
					</tr>
					<?php $no++;?>
				<?php endif;?>
			<?php endforeach;?>
		</table>
		
	</body>
</html>