<!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(__('report.global_report')); ?></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: 50px;'><?php echo e(__('report.billno')); ?></th>
							<th style='width: 100px;'><?php echo e(__('report.transaction_date')); ?></th>
							<th><?php echo e(__('report.transaction_type')); ?></th>
							<th><?php echo e(__('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(__('mylanguage.adv_amt')); ?></th>		
						</tr>
					</thead>
					<tbody>
			<?php
			$payable = 0;
			$paid = 0;
			$totamt = 0;
			$slno = 1;
			?>
			<?php
			if(isset($data['trn_transaction']))
			{
			?>
						<?php $__currentLoopData = $data['trn_transaction']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trn_val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
if($trn_val->bil_type == "Payment" || $trn_val->bil_type == "Advance"  || $trn_val->bil_type == "sPayment"  || $trn_val->bil_type == "Income"   || $trn_val->bil_type == "Expense" || $trn_val->bil_type == "Loan" || $trn_val->bil_type == "Matrimonial")
{
	if($trn_val->bil_type == "Payment")
	{
		$trn_type = "<font color='green'>" ."ಜಮಾತ್ ಪಾವತಿ" ." (". $trn_val->ftyp_fundtype  .")</font>";
	}
	if($trn_val->bil_type == "Advance")
	{
		$trn_type = "<font color='#1d92af'>" ."ಜಮಾತ್ ಪಾವತಿ (ಮುಂಗಡ ಪಾವತಿ)" . "</font>";
	}
	if($trn_val->bil_type == "sPayment")
	{
		$trn_type = "<font color='purple'>" ."ವಿಶೇಷ ಪಾವತಿ" ." (". $trn_val->ftyp_fundtype  .")". "</font>";
	}
	if($trn_val->bil_type == "Income")
	{
		$trn_type = "<font color='#b3842a'>" . __('report.income') ." (". $trn_val->ftyp_fundtype  .")". "</font>";
	}
	if($trn_val->bil_type == "Expense")
	{
		$trn_type = "<font color='red'>" .__('report.expense') ." (". $trn_val->ftyp_fundtype  .")</font>";
	}
	if($trn_val->bil_type == "Loan")
	{
		$trn_type = "<font color='blue'>" .__('report.loan') ." (". $trn_val->ftyp_fundtype  .")</font>";
	}
	if($trn_val->bil_type == "Matrimonial")
	{
		$trn_type = "<font color='#8c2f26'>" .__('matrimonial.mrg_thirodi') ."</font>";
	}
		echo "<tr>";
		echo "<td>" . $slno . "</td>";
		echo "<td>" . $trn_val->trn_billno . "</td>";

		echo "<td>" . date("d-m-Y",strtotime($trn_val->trn_date))  . "</td>";
		echo "<th style='font-size: 14px;'>". $trn_type . "</th>";
		echo "<td> " ;
		if($trn_val->cst_code != 0)
		{
		echo $trn_val->cst_name . "(" . $trn_val->grd_prefix . $trn_val->cst_code .")<br>";
		}
		echo $trn_val->trn_note . "</td>";
	if($trn_val->trn_type == "Payment" || $trn_val->trn_type == "Advance"  || $trn_val->trn_type == "sPayment"  || $trn_val->trn_type == "Income"  || $trn_val->trn_type == "Loan" || $trn_val->trn_type == "Matrimonial")
	{
		$payable = $payable + $trn_val->bil_amt;
		$totamt = $totamt + $trn_val->bil_amt;
		echo "<th style='text-align: right;'>"  . $trn_val->bil_amt  ."</th>";
	}
	else
	{
		echo "<th style='text-align: right;'></th>";
	}
	if($trn_val->trn_type == "Expense")
	{
		$totamt = $totamt - $trn_val->bil_amt;
		$paid = $paid + $trn_val->bil_amt;
		echo "<th style='text-align: right;'>"  . $trn_val->bil_amt  ."</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(); ?>	
					
			<?php
			}
			?>
				
						<tr style='background-color: grey; color: white;'>
							<th></th>
							<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>