<?php defined('BASEPATH') OR exit('No direct script access allowed');
$letterPadHeader = 'export/letterpadHeader';
$headColor = (empty($is_email) ? $bgColor : $color);
if(!empty($printColors)) {
	$headColor = $printColors;
}

$title = array("JV" => "JOURNAL", "JC" => "CONTRA");
?>
<table border="0" cellspacing="0" cellpadding="0" class="noborder nopadding vat">
	<tr>
		<td> <?php $this->view($letterPadHeader); ?> </td>
	<tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="noborder nopadding vat">
	<tr>
		<td class="ac fs-20"><b><?php echo lang((!empty($title[$tType]) ? $title[$tType] . "_" : "") . "VOUCHER"); ?></b></td>
	</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="noborder nopadding vat">
	<tr>
		<td class="al"><?php echo lang("Date")?> :<?php echo $tDate;?></td>
		<td class="ar"><?php echo lang("No")?>  : <?php echo $tNo;?></td>
	<tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="vat" style="margin-top: 1rem;">
						
<?php 	$conname = false;
		 foreach($acc['acc_details'] as $key => $val){
			 if (!empty($val['conName'])){
			 	$conname = true;
			 }
		}
?>
	<thead>
		<tr>
			<th class="al"><?php echo lang("Account/Contacts");?></th>
			<th  class="ar"><?php echo lang("Debit"); ?></th>
			<th  class="ar"><?php echo lang("Credit");?></th>
			<th><?php echo("Description");?></th>
			<?php if (!empty($conname)){?>
			<th class="al"><?php echo("Contact");?></th>
			<?php }?>
		</tr>
	</thead>
	<tbody>
		
		<?php		
		 foreach($acc['acc_details'] as $key => $val){
			$val['debit'] = formatAmount($val['debit'], $currencyCode, "-", true,$currFraction);
			$val['credit'] = formatAmount($val['credit'], $currencyCode, "-", true,$currFraction);
		?>
		<tr>
		<td width="20%"><?php echo $val['accName'];?></td>
		<td width="15%" class="ar"><?php echo $val['debit'];?></td>
		<td width="15%" class="ar"><?php echo $val['credit'];?></td>
		<td width="30%"><?php echo $val['desc'];?></td>
		<?php if (!empty($conname)){?>
		<td width="20%"><?php echo $val['conName'];?></td>
		<?php }?>
		</tr>
		<?php }?>
	</tbody>
	
</table>
<?php if($notes){?>
	<br>
	<span><b>Notes</b></span><br>
	<span class="nm notes pretxt"><?php echo $notes; ?></span>
<?php } ?>
<br>
<table align="left" cellspacing="0" border="0" cellpadding="0" class="noborder footTable nbt wpw" autosize="1" style="page-break-inside: avoid">
	<!--<col style="width:50%;">
	<col style="width:50%;">-->
	<tbody>
		<tr>

			<td class="ar bgColor" colspan="2"><?php echo lang("ForcompanyName");?></td>
		</tr>
		<tr>
			<td valign="bottom" class="vab nbr custsign bgColor" style="height: "><span class="" style="margin-top:40px;color:#3682CD"></span></td>
			<td valign="bottom" class="vab ar authsign bgColor" ><br><br><span class="" style="margin-top:40px;float:right;">
			<?php echo lang("AuthorizedSignature");?></span></td></tr>
	</tbody>
</table>
