<!DOCTYPE html>
<html>
<head>
	<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
	<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
	<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
	<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
	<link href="assets/css/main.css" rel="stylesheet" type="text/css">
	<link href="assets/css/my-custom-styles.css" rel="stylesheet" type="text/css">
	<link href="css/jquery.toast.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="css/jquery-confirm.min.css">
	<meta charset="utf-8">
	<!------ Include the above in your HEAD tag ---------->
	<style>
	.invoice-title h2, .invoice-title h3 {
		display: inline-block;
	}

	.table > tbody > tr > .no-line {
		border-top: none;
	}

	.table > thead > tr > .no-line {
		border-bottom: none;
	}

	.table > tbody > tr > .thick-line {
		border-top: 2px solid;
	}
	</style>
	<meta charset="utf-8">
</head>
<body onafterprint="afterprint()">
	<div class="container">
		<div class="row">
			<div class="col-xs-12">
				<div class="invoice-title">
						<center><img src="img/printlogo.png"></center>
					<hr>
					<center><b style="font-size: x-large;"><?php echo e(__('mylanguage.inc_exp_rpt')); ?></b></center>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<table id="datatable-data-export" class="table table-sorting table-striped table-hover table-bordered datatable">
			<thead>
				<tr>
					<th style='width: 35px;'><?php echo e(__('report.slno')); ?></th>
					<!--<th style='width: 75px;'><?php echo e(__('report.billno')); ?></th> -->
					 <th style='width: 100px;'><?php echo e(__('report.transaction_date')); ?></th>
					<th><?php echo e(__('report.transaction_method')); ?></th>
					<th><?php echo e(__('report.transaction_type')); ?></th>
					<?php /* <th>{{ __('report.transaction_particular') }}</th> */ ?>
					<th style='width: 65px;text-align: right;'><?php echo e(__('report.income')); ?></th>
					<th style='width: 65px;text-align: right;'><?php echo e(__('report.expense')); ?></th>
					<th style='width: 65px;text-align: right;'><?php echo e(__('report.transaction_sum')); ?></th>		
				</tr>
			</thead>
					<tbody>
			<?php
			$payable = 0;
			$paid = 0;
			$totamt = 0;
			$slno = 1;
			?>
						<?php $__currentLoopData = $data['trn_transaction']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trn_val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
if($trn_val->trn_type == "Income" || $trn_val->trn_type == "Expense" || $trn_val->trn_type == "Loan")
{
				if($trn_val->trn_type == "Income")
				{
					$fundtype =  __('fundtype.income_transaction');
				}
				else if($trn_val->trn_type == "Expense")
				{
					$fundtype =  __('fundtype.expense_transaction');
				}
				else if($trn_val->trn_type == "Loan")
				{
					$fundtype =  __('fundtype.loan_transaction');
				}

		echo "<tr style='color: #2b2121;'>";
		echo "<td>" . $slno . "</td>";
		//echo "<td>" . $fundtype . "</td>";
		echo "<td>" . date("d-m-Y",strtotime($trn_val->trn_date))  . "</td>";
		echo "<td>" . $fundtype  . "</td>";
		echo "<td>";
		if($trn_val->trn_type == "Payment")
		{
			echo $trn_val->trn_type;
		}
		else
		{
			echo $trn_val->ftyp_fundtype;
		}
		echo "</td>";
		//echo "<td>" . $trn_val->ftyp_fundtype . "</td>";
	if($trn_val->trn_type == "Income" || $trn_val->trn_type == "Loan")
	{
		$payable = $payable + $trn_val->billamt;
		$totamt = $totamt + $trn_val->billamt;
		echo "<th style='text-align: right;'>"  . $trn_val->billamt  ."</th>";
	}
	else
	{
		echo "<th style='text-align: right;'></th>";
	}
	if($trn_val->trn_type == "Expense")
	{
		$totamt = $totamt - $trn_val->billamt;
		$paid = $paid + $trn_val->billamt;
		echo "<th style='text-align: right;'>"  . $trn_val->billamt  ."</th>";
	}
	else
	{
		echo "<th style='text-align: right;'></th>";
	}
		echo  "<th style='text-align: right;'>"  . $totamt  ."</th>";
		echo  "</tr>";
		$slno=$slno+1;
}
?>						
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>	
						<tr>
							<th></th>
							<th></th>
							<th></th>
							<th style='text-align: right;'>Total :</th>
							<th style='text-align: right;'><?php echo e($payable); ?></th>	 	 
							<th style='text-align: right;'><?php echo e($paid); ?></th>
							<th style='text-align: right;'><?php echo e($totamt); ?></th>				
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</body>
<script>
$(document).ready(function()
{
	window.print();
});
function afterprint()
{
	window.close();
}
</script>
</html>