<?php
    $CI =& get_instance();
    $CI->load->model('company/company_info_model');
    $company = $CI->company_info_model->companyById(element('compID', $this->session->userdata('logged_in')));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />    
        <link rel="shortcut icon" href="<?php echo base_url()?>img/salihin_logo.png">
        <title><?php if(isset($rptTitle)) echo $rptTitle; ?> || Reporting Tekun</title>
      
        <meta name="viewport" content="width=device-width" />
        <!-- Bootstrap 3.3.5 -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>bootstrap/css/bootstrap.min.css">
        <!-- Font Awesome -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
        <!-- Ionicons -->
        <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
        <!-- DataTables -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/datatables/dataTables.bootstrap.css">
        <!-- Calculator -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/calculator/jquery.calculator.css" id="calcUi">
        <!-- Datepicker style -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>bootstrap/css/bootstrap-datetimepicker.css">
        <!-- Theme style -->
        <link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/AdminLTE.css">
        
        <script src="<?php echo base_url(); ?>dist/accounting.js"></script>
        
         <script src="<?php echo base_url(); ?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
         
        <style>
			.aaaa{ font-weight: bold; }
		
            .thPrint tr{
                height: 41px;
                border-style: solid;
                border-color: #dd4b39 #fff;
            }
            
             .tr_amnt{
                 margin-top: 10px;
                 height: 41px;
                border-style: solid;
                border-color: #dd4b39 #fff #fff #fff;
                
            }
            
             .value{
                border-color: #dd4b39;
                border-style: solid;
                margin-top: 10px;
                padding: 5px;
             }
             
               .amount_td{
		            font-size: 20px;
		            font-weight: 500;
		            margin-top: 10px;
		        }
	
            
            .table thead th{
                  vertical-align: middle;
            }

			@media print {     .no-print, 	.no-print *, #scrollUp {         display: none !important;     } }
            @media print {
                .td-print,.td-print*{display:none !important;}
				.printTbl hr{
					margin:0 !important;
				}
				.thPrint th{
					/*background:url(<?php echo base_url() ?>img/rptPaymentAdvice.png) !important;*/
                	/*-webkit-print-color-adjust: exact;*/
					
				}
                /*body{overflow:visible !important;}*/
                @page{ 
                    size: auto;   /* auto is the initial value */ 

                    /* this affects the margin in the printer settings */ 
                    margin: 10px 10px 10px 10px;  
                } 

                /*table { page-break-after:always; }
                p     { page-break-inside:avoid; page-break-after:avoid; }
                tr    { page-break-inside:avoid; page-break-after:auto; }
                td    { page-break-inside:avoid; page-break-after:auto }
                thead { display:inline; }
                tfoot { display:inline; }*/
                .compLogo{
                    width: 150px;
                }

            }

            .table th,.table td{
                line-height:10px;
            }
            .table1 td{
                border:2px solid #dd4b39 ; 
                padding:5px;
                
            }
            .paid_paid{
                font-weight:700;
                font-size:46px;
                
            }
            .paid_date{
                font-size: 20px;
                font-weight: 700;
                letter-spacing: 2px;
                margin-top: -20px;
            }
            .div_paid{
                -webkit-transform: rotate(312deg);
                -moz-transform: rotate(312deg);
                -o-transform: rotate(312deg);
            }
            
            
            
            
            .btn-icon{
		background-color:#5ebe3a;		
		border: 2px solid #5ebe3a;	
		color: #fff !important;
		display:inline-block;
		*display:inline;*zoom:1;
		padding: 4px;
		margin-bottom:0;
		font-size:11px;
		line-height:20px;
		text-align:center;
		vertical-align:middle;
		cursor:pointer;			
		opacity: .9; 
		filter: alpha(opacity=90); 	
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;
		
	}
	.btn-icon:hover,.btn-icon:focus,.btn-icon:active,.btn-icon.active,.btn-icon.disabled,.btn-icon[disabled]{color: #5ebe3a !important; background-color: transparent !important; }
	.btn-icon:active,.btn-icon.active{background-color: transparent !important;}
	.btn-icon:first-child{*margin-left:0;}
	.btn-icon:hover,.btn-icon:focus{
		color: #5ebe3a !important;
		text-decoration:none;
		background-position:0 -15px;
		-webkit-transition:background-position 0.1s linear;
		-moz-transition:background-position 0.1s linear;
		-o-transition:background-position 0.1s linear;
		transition:background-position 0.1s linear;
	}
	
	/** button form		 **/
	
	.btn-form, .ui-dialog-buttonset button{
		background:#5ebe3a;		
		border: 2px solid #5ebe3a;	
		color: #fff !important;
		display:inline-block;
		*display:inline;*zoom:1;
		padding:4px 6px;
		margin: 0px 0 0 2px;
		font-size:11px;
		line-height:20px;
		text-align:center;
		vertical-align:middle;
		cursor:pointer;		
		opacity: .9; 
		filter: alpha(opacity=90); 		
		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;
		
	}
	.btn-form:hover,.btn-form:focus,.btn-form:active,.btn-form.active,.btn-form.disabled,.btn-form[disabled]{color: #5ebe3a !important; background-color: transparent !important; }
	.btn-form:active,.btn-form.active{background-color: transparent !important;}
	.btn-form:first-child{*margin-left:0;}
	.btn-form:hover,.btn-form:focus,
	.ui-dialog-buttonset button:hover,
    .ui-dialog-buttonset button:active,
	.ui-dialog-buttonset button:focus	{
		color: #5ebe3a !important;
		text-decoration:none;
		background-position:0 -15px;
		-webkit-transition:background-position 0.1s linear;
		-moz-transition:background-position 0.1s linear;
		-o-transition:background-position 0.1s linear;
		transition:background-position 0.1s linear;
	}	
	
	/** button primary		 **/
	
	.btn-primary-form.active,.btn-warning-form.active,.btn-danger-form.active,.btn-success-form.active,.btn-info-form.active,.btn-inverse-form.active{color:rgba(255, 255, 255, 0.75);}
	.btn-primary-form{
		background-color:#5ebe3a;
		border: 2px solid #5ebe3a;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center;				
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;		
	}
	.btn-primary-form:hover,.btn-primary-form:focus,.btn-primary-form:active,.btn-primary-form.active,.btn-primary-form.disabled,.btn-primary-form[disabled]{
		background-color: transparent !important; 
		color: #5ebe3a !important; 
		text-decoration: none;
		text-align: center;		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;
	}
	
	/** button warning		 **/
	
	.btn-warning-form{
		background:#faa732;
		border: 2px solid #faa732;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center;		
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;			
	}
		
	.btn-warning-form:hover,.btn-warning-form:focus,.btn-warning-form:active,.btn-warning-form.active,.btn-warning-form.disabled,.btn-warning-form[disabled]{
		background-color: transparent !important; 
		color: #faa732 !important; 
		text-decoration: none;
		text-align: center; 		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;
	}
	
	/** button danger		 **/
	
	.btn-danger-form{
		background:#da4f49;
		border: 2px solid #da4f49;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center;	
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;			
	}
	.btn-danger-form:hover,.btn-danger-form:focus,.btn-danger-form:active,.btn-danger-form.active,.btn-danger-form.disabled,.btn-danger-form[disabled]{
		background-color: transparent !important; 
		color: #da4f49 !important; 
		text-decoration: none;
		text-align: center; 		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;
	}
	
	/** button success		 **/
		
	.btn-success-form{
		background:#51a351;
		border: 2px solid #51a351;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center; 	
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;	
				
		}
		
	.btn-success-form:hover,.btn-success-form:focus,.btn-success-form:active,.btn-success-form.active,.btn-success-form.disabled,.btn-success-form[disabled]{
		background-color: transparent !important; 
		color: #51a351 !important; 
		text-decoration: none;
		text-align: center;	
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;		
		}
	
	/** button info		 **/
	
	.btn-info-form{
		background:#2f96b4;
		border: 2px solid #2f96b4;		
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center; 	
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;			
	}
	.btn-info-form:hover,.btn-info-form:focus,.btn-info-form:active,.btn-info-form.active,.btn-info-form.disabled,.btn-info-form[disabled]{
		background-color: transparent !important; 
		color: #2f96b4 !important; 
		text-decoration: none;
		text-align: center; 	
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;		
	}
	
	/** button inverse		 **/
		
	.btn-inverse-form{
		background:#363636;
		border: 2px solid #363636;
		color: #fff !important; 
		font-family: 'Tahoma', Arial, sans-serif;  
		font-size: 12px; 
		font-weight: 400;		
		line-height: 18px;
		text-decoration: none;
		text-align: center; 
		opacity: .9; 
		filter: alpha(opacity=90); 
		-webkit-border-radius: 3px; 
		-moz-border-radius: 3px; 
		border-radius: 3px;    
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out; 
		-webkit-backface-visibility: hidden;		
	}
	.btn-inverse-form:hover,.btn-inverse-form:focus,.btn-inverse-form:active,.btn-inverse-form.active,.btn-inverse-form.disabled,.btn-inverse-form[disabled]{
		background-color: transparent !important; 
		color: #363636 !important; 
		text-decoration: none;
		text-align: center; 		
		-webkit-transition: all .1s ease-out; 
		-moz-transition: all .1s ease-out; 
		-o-transition: all .1s ease-out; 
		transition: all .1s ease-out;		
	}	
        
        
      
       
            
        </style>
        
        
        <script type="text/javascript">
			$(document).ready(function(){
				
				
				
		
				//var inHand13 = accounting.unformat($('#inHand13').text());
				
				var totOpeningBal = accounting.unformat($('#totOpeningBal').text());
				
				var rec1 = totOpeningBal + accounting.unformat($('#rec1').text());
				var rec2 = accounting.unformat($('#rec2').text());
				var rec3 = accounting.unformat($('#rec3').text());
				var rec4 = accounting.unformat($('#rec4').text());
				var rec5 = accounting.unformat($('#rec5').text());
				var rec6 = accounting.unformat($('#rec6').text());
				var rec7 = accounting.unformat($('#rec7').text());
				var rec8 = accounting.unformat($('#rec8').text());
				var rec9 = accounting.unformat($('#rec9').text());
				var rec10 = accounting.unformat($('#rec10').text());
				var rec11 = accounting.unformat($('#rec11').text());
				var rec12 = accounting.unformat($('#rec12').text());
				var rec13 = accounting.unformat($('#rec13').text());
				
				/*var cashAvai1 = accounting.unformat($('#cashAvai1').text());
				var cashAvai2 = accounting.unformat($('#cashAvai2').text());
				var cashAvai3 = accounting.unformat($('#cashAvai3').text());
				var cashAvai4 = accounting.unformat($('#cashAvai4').text());
				var cashAvai5 = accounting.unformat($('#cashAvai5').text());
				var cashAvai6 = accounting.unformat($('#cashAvai6').text());
				var cashAvai7 = accounting.unformat($('#cashAvai7').text());
				var cashAvai8 = accounting.unformat($('#cashAvai8').text());
				var cashAvai9 = accounting.unformat($('#cashAvai9').text());
				var cashAvai10 = accounting.unformat($('#cashAvai10').text());
				var cashAvai11 = accounting.unformat($('#cashAvai11').text());
				var cashAvai12 = accounting.unformat($('#cashAvai12').text());*/
				
				var allJan = accounting.unformat($('#allJan').text());
				var allFeb = accounting.unformat($('#allFeb').text());
				var allMac = accounting.unformat($('#allMac').text());
				var allApr = accounting.unformat($('#allApr').text());
				var allMei = accounting.unformat($('#allMei').text());
				var allJun = accounting.unformat($('#allJun').text());
				var allJuly = accounting.unformat($('#allJuly').text());
				var allOgos = accounting.unformat($('#allOgos').text());
				var allSep = accounting.unformat($('#allSep').text());
				var allOkt = accounting.unformat($('#allOkt').text());
				var allNov = accounting.unformat($('#allNov').text());
				var allDis = accounting.unformat($('#allDis').text());
				
				
				var total1 = accounting.unformat($('#total1').text());
				var total2 = accounting.formatNumber((total1 + rec2) - allFeb , 2);
				var total3 = accounting.formatNumber((total2 + rec3) - allMac , 2);
				var total4 = accounting.unformat($('#total4').text());
				var total5 = accounting.unformat($('#total5').text());
				var total6 = accounting.unformat($('#total6').text());
				var total7 = accounting.unformat($('#total7').text());
				var total8 = accounting.unformat($('#total8').text());
				var total9 = accounting.unformat($('#total9').text());
				var total10 = accounting.unformat($('#total10').text());
				var total11 = accounting.unformat($('#total11').text());
				var total12 = accounting.unformat($('#total12').text());
				var total13 = accounting.unformat($('#total13').text());
				
				$('#inHand1').text(accounting.formatNumber(totOpeningBal,2));
				$('#inHand2').text(accounting.formatNumber(rec1 - allJan,2));
				$('#inHand3').text(accounting.formatNumber((rec1 - allJan + rec2) - allFeb,2));
				$('#inHand4').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3) - allMac,2));
				$('#inHand5').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4) - allApr,2));
				$('#inHand6').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5) - allMei,2));
				$('#inHand7').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6) - allJun,2));
				$('#inHand8').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7) - allJuly,2));
				$('#inHand9').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8) - allOgos,2));
				$('#inHand10').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9) - allSep,2));
				$('#inHand11').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep + rec10) - allOkt,2));
				$('#inHand12').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep + rec10 - allOkt + rec11) - allNov,2));
				//$('#inHand13').text(accounting.formatNumber(total12,2));
				
				//alert(allJan);
				
				$('#cashAvai1').text(accounting.formatNumber(inHand1 + rec1,2));
				$('#cashAvai2').text(accounting.formatNumber((rec1 - allJan) + rec2,2));
				$('#cashAvai3').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb) + rec3,2));
				$('#cashAvai4').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac) + rec4,2));
				$('#cashAvai5').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr) + rec5,2));
				$('#cashAvai6').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei) + rec6,2));
				$('#cashAvai7').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun) + rec7,2));
				$('#cashAvai8').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly) + rec8,2));
				$('#cashAvai9').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos) + rec9,2));
				$('#cashAvai10').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep) + rec10,2));
				$('#cashAvai11').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep + rec10 - allOkt) + rec11,2));
				$('#cashAvai12').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep + rec10 - allOkt + rec11 - allNov) + rec12,2));
				
				
				$('#total1').text(accounting.formatNumber(rec1 - allJan,2));
				$('#total2').text(accounting.formatNumber((rec1 - allJan + rec2) - allFeb,2));
				$('#total3').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3) - allMac,2));
				$('#total4').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4) - allApr,2));
				$('#total5').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5) - allMei,2));
				$('#total6').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6) - allJun,2));
				$('#total7').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7) - allJuly,2));
				$('#total8').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8) - allOgos,2));
				$('#total9').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9) - allSep,2));
				$('#total10').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep + rec10) - allOkt,2));
				$('#total11').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep + rec10 - allOkt + rec11) - allNov,2));
				$('#total12').text(accounting.formatNumber((rec1 - allJan + rec2 - allFeb + rec3 - allMac + rec4 - allApr + rec5 - allMei + rec6 - allJun + rec7 - allJuly + rec8 - allOgos + rec9 - allSep + rec10 - allOkt + rec11 - allNov + rec12) - allDis,2));
				
				//$('#inHand3').text(accounting.formatNumber(cashAvai2 - allFeb,2));
				//$('#inHand4').text(accounting.formatNumber(cashAvai3 - allMac,2));
				//$('#inHand5').text(accounting.formatNumber(cashAvai4 - allApr,2));
				//$('#inHand6').text(accounting.formatNumber(cashAvai5 - allMei,2));
				//$('#inHand7').text(accounting.formatNumber(cashAvai6 - allJun,2));
				//$('#inHand8').text(accounting.formatNumber(cashAvai7 - allJuly,2));
				//$('#inHand9').text(accounting.formatNumber(cashAvai8 - allOgos,2));
				//$('#inHand10').text(accounting.formatNumber(cashAvai9 - allSep,2));
				//$('#inHand11').text(accounting.formatNumber(cashAvai10 - allOkt,2));
				//$('#inHand12').text(accounting.formatNumber(cashAvai11 - allNov,2));
				
			});
		</script>

        <script>
			$(document).ready(function(){
				$('.image').height($('.thPrint').height());
				$('.image').width($('.thPrint').width());
			});
        
            function do_print() {
                window.print();
            }

//             function getExcelFile() {
                var url = '<?php echo base_url(); echo isset($myUrl) ? $myUrl:''; echo '/'; echo isset($id)?$id:''; ?>"';
                //var url = "<?php echo base_url() ?>ApTransactionReport/printPaymentAdviceRptExel/<?php echo isset($id)?$id:''; ?>";
//                         window.location.href = url;
//                     }
            function downloadExcel(){
				var url = "<?php echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'/'.true; ?>";
				window.location.href = url;
            }
			
			function close_window(){
				window.close();
			}
        </script>

    </head>
<div>
	<table width="100%" class="printTbl">
        				<tr>
                            <td colspan="12"  style="overflow:hidden; padding-bottom:10px;">
                                <p style="text-align: right; margin:0; padding-right: 10px; font-weight: 500; line-height: 2; padding-bottom: 0px; padding-top: 0px; color: black; font-size: 25px;">
                                    <?php if(isset($rptTitle)) echo $rptTitle; ?>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="12" class="container-fluid">
                            	<div class="col-lg-4 col-md-4 col-sm-4">
                                <?php
                                if (isset($company)) {
                                    foreach ($company as $rowC) {
                                        ?>

                                        <?php if(isset($pdf417)): ?>
                                            <div class="fr">
                                                <?php 
                                                    echo $pdf417;
                                                ?>
                                            </div>
                                        <?php endif; ?>
                                        <p style="text-align:center; font-size:16px; width:355px;margin:0 auto;"> 
                                            <span style=" font-weight:800;"><?php echo $rowC->companyName; ?></span> <span style="font-size:10px;"><?php echo "(".$rowC->companyNo.")";?></span><br />
                                            <span style="font-size:10px;"><?php echo "GST Registration No : ".$rowC->gstRegisteredNo; ?></span><br />
                                        </p>
                                        <p style="width: 355px; text-align:center; font-size:10px; line-height:1.4; padding:0 0 5px; margin:0 auto; ">
                                            
                                            <?php if(!empty($rowC->line1)): ?><span><?php echo $rowC->line1; ?></span><br /><?php endif; ?>
                                            <?php if(!empty($rowC->line2) || !empty($rowC->line3)): ?><span><?php echo $rowC->line2.", ".$rowC->line3; ?></span><br /><?php endif; ?>
                                            <?php if(!empty($rowC->companyPostCode) || !empty($rowC->city)): ?><span><?php echo $rowC->companyPostCode . '  ' . $rowC->city; ?> </span><br /><?php endif; ?>
                                            <?php if(!empty($rowC->fldname) || !empty($rowC->fldcountry)): ?><span><?php echo $rowC->fldname . '  ' . $rowC->fldcountry; ?> </span><br /><?php endif; ?>
                                            <?php if(!empty($rowC->phoneNo) || !empty($rowC->faxNo)): ?><span><?php echo 'Phone : ' . $rowC->phoneNo . '  Fax : ' . $rowC->faxNo; ?> </span><?php endif; ?>
                                        </p>
                                    <?php }
                                }
                                ?>
                                </div>
                                <div class="col-lg-4 col-md-4 col-sm-4">
                                </div>

                            </td>
                        </tr>
                        <?php if(isset($leftContentHeader) || isset($leftContent) || isset($rightContentHeader) || isset($rightContent)): ?>
                        <tr>
                            <td>
                                <?php
                                if (isset($leftContentHeader)){
                                    echo "<p class='modPrint' style='padding-left:10px; margin:0; font-size:11px; '>"
                                    . "<strong>".$leftContentHeader."</strong></p>";
                                }
                                 
                                 if (isset($leftContent)){
                                   echo '<p style="padding-left:10px; margin:0; line-height:1.4;">';
                                    foreach ($leftContent as $value) {
                                         echo $value != ''?"<span>".$value."</span><br />":'';
                                     }
                                      if (isset($sale_invoice_date)){
                                   echo '<div class="div_paid modPrint" style="padding-left: 10px; line-height: 1.4; position: relative; width: 100px; height: 0px; float: right; margin-top: -80px; margin-right: 30%;">';
                                        echo '<div class="paid_paid">PAID</div><div class="paid_date">'.$sale_invoice_date.'</div>';
                                  echo '</div>';
                                 }
                                  echo '</p>';
                                 }
                                 
                                 
                                
                                ?>
                                
                            </td>
                                
                            <td valign="top">
                                <?php if(isset($rightContentHeader) || isset($rightContent)): ?>
                                <div style="line-height:1.4; text-align:left; float:right">
                                    <?php
                                        if (isset($rightContentHeader)){
                                        	echo "<p class='modPrint' style='padding-right:10px; margin:0; font-size:11px; '>"
                                        			. "<strong>".$rightContentHeader."</strong></p>";
                                        } 
                                        if (isset($rightContent)){
                                             foreach ($rightContent as $value) {
                                                echo $value != ''?"<span>".$value."</span><br />":'';
                                            }
                                        }
                                    ?>
                                </div>
                                <?php endif; ?>
                              </td>
                        </tr>
                        <?php endif; ?>
    </table>
    <br />
    <table id="oTable" class="printTbl" width="98%" align="center">
                             <thead>
            					<tr>
                                	<th></th>
                                    <th class='text-center'><?php echo $this->lang->line('beginning') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('jan') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('feb') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('mar') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('apr') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('may') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('jun') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('jul') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('aug') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('sep') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('oct') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('nov') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('dec') ?></th>
                                    <th class='text-center'><?php echo $this->lang->line('total') ?></th>
            					</tr>
                                <tr>
                                	<th><?php echo $this->lang->line('cashOnHandBegin') ?></th>
                                    <th></th>
                                    <th id="inHand1" class='text-right'><?php echo $cashinhandJanExcel; ?></th>
                                    <th id="inHand2" class='text-right'><?php echo $cashinhandFebExcel; ?></th>
                                    <th id="inHand3" class='text-right'><?php echo $cashinhandMacExcel; ?></th>
                                    <th id="inHand4" class='text-right'><?php echo $cashinhandAprExcel; ?></th>
                                    <th id="inHand5" class='text-right'><?php echo $cashinhandMayExcel; ?></th>
                                    <th id="inHand6" class='text-right'><?php echo $cashinhandJunExcel; ?></th>
                                    <th id="inHand7" class='text-right'><?php echo $cashinhandJulExcel; ?></th>
                                    <th id="inHand8" class='text-right'><?php echo $cashinhandAugExcel; ?></th>
                                    <th id="inHand9" class='text-right'><?php echo $cashinhandSepExcel; ?></th>
                                    <th id="inHand10" class='text-right'><?php echo $cashinhandOctExcel; ?></th>
                                    <th id="inHand11" class='text-right'><?php echo $cashinhandNovExcel; ?></th>
                                    <th id="inHand12" class='text-right'><?php echo $cashinhandDisExcel ?></th>
                                    <th id="inHand13" class='text-right'></th>
            					</tr>
            				</thead>
                            
                            <tbody>
							<?php
								$totAll = 0;
								$totAll2 = 0;
								$totAll3 = 0;
								$totAll4 = 0;
								$totAll5 = 0;
								
								$totBalanceDr = 0;
								$totBalanceCr = 0;
								$totBeginningBank = 0;
								$totJan = 0;
								$totFeb = 0;
								$totMac = 0;
								$totApr = 0;
								$totMay = 0;
								$totJun = 0;
								$totJuly = 0;
								$totOgos = 0;
								$totSep = 0;
								$totOkt = 0;
								$totNov = 0;
								$totDis = 0;
								$totRow = 0;
								
								$totJan2 = 0;
								$totFeb2 = 0;
								$totMac2 = 0;
								$totApr2 = 0;
								$totMay2 = 0;
								$totJun2 = 0;
								$totJuly2 = 0;
								$totOgos2 = 0;
								$totSep2 = 0;
								$totOkt2 = 0;
								$totNov2 = 0;
								$totDis2 = 0;
								$totRow2 = 0;
								
								$totJan3 = 0;
								$totFeb3 = 0;
								$totMac3 = 0;
								$totApr3 = 0;
								$totMay3 = 0;
								$totJun3 = 0;
								$totJuly3 = 0;
								$totOgos3 = 0;
								$totSep3 = 0;
								$totOkt3 = 0;
								$totNov3 = 0;
								$totDis3 = 0;
									
								$totRow3 = 0;
								
								$totJan4 = 0;
								$totFeb4 = 0;
								$totMac4 = 0;
								$totApr4 = 0;
								$totMay4 = 0;
								$totJun4 = 0;
								$totJuly4 = 0;
								$totOgos4 = 0;
								$totSep4 = 0;
								$totOkt4 = 0;
								$totNov4 = 0;
								$totDis4 = 0;
									
								$totRow4 = 0;
								
								$totJan5 = 0;
								$totFeb5 = 0;
								$totMac5 = 0;
								$totApr5 = 0;
								$totMay5 = 0;
								$totJun5 = 0;
								$totJuly5 = 0;
								$totOgos5 = 0;
								$totSep5 = 0;
								$totOkt5 = 0;
								$totNov5 = 0;
								$totDis5 = 0;
								
								$totRow5 = 0;
								$totAll5 = 0;
								 
                                if($datatbls1){
									
                                    foreach($datatbls1 as $datatbl):
									
									$totBalanceDr += $datatbl->openingBalanceDr;
									$totBalanceCr += $datatbl->openingBalanceCr;
									$totJan += $datatbl->january;
									$totFeb += $datatbl->february;
									$totMac += $datatbl->march;
									$totApr += $datatbl->april;
									$totMay += $datatbl->may;
									$totJun += $datatbl->june;
									$totJuly += $datatbl->july;
									$totOgos += $datatbl->august;
									$totSep += $datatbl->september;
									$totOkt += $datatbl->october;
									$totNov += $datatbl->november;
									$totDis += $datatbl->december;
									
									$totRow = $datatbl->january + $datatbl->february + $datatbl->march + $datatbl->april + $datatbl->may + $datatbl->june + $datatbl->july + $datatbl->august + $datatbl->september + $datatbl->october + $datatbl->november + $datatbl->december;
									$totAll = $totRow + $totAll;
										?>
                                        <tr>
                                            <td><?php echo $datatbl->acctName; ?></td>
                                            <td class='text-right'><?php if($datatbl->openingBalanceDr){echo number_format($datatbl->openingBalanceDr, 2);}else{echo number_format($datatbl->openingBalanceCr*-1, 2);} ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->january,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->february,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->march,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->april,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->may,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->june,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->july,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->august,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->september,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->october,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->november,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl->december,2); ?></td>
                                            <td class='text-right'><?php echo number_format($totRow,2); ?></td>
                                        </tr>
                                        
                            <?php endforeach; ?>
							
                            			<tr>
                                            <td><strong><?php echo $this->lang->line('totCashReceipt'); ?></strong></td>
                                            <td class='text-right'><strong><?php $totBeginningBank = $totBalanceDr + ($totBalanceCr*-1); echo number_format($totBeginningBank, 2); ?></strong></td>
                                            <td id="rec1" class='text-right'><strong><?php echo number_format($totJan,2); ?></strong></td>
                                            <td id="rec2" class='text-right'><strong><?php echo number_format($totFeb,2); ?></strong></td>
                                            <td id="rec3" class='text-right'><strong><?php echo number_format($totMac,2); ?></strong></td>
                                            <td id="rec4" class='text-right'><strong><?php echo number_format($totApr,2); ?></strong></td>
                                            <td id="rec5" class='text-right'><strong><?php echo number_format($totMay,2); ?></strong></td>
                                            <td id="rec6" class='text-right'><strong><?php echo number_format($totJun,2); ?></strong></td>
                                            <td id="rec7" class='text-right'><strong><?php echo number_format($totJuly,2); ?></strong></td>
                                            <td id="rec8" class='text-right'><strong><?php echo number_format($totOgos,2); ?></strong></td>
                                            <td id="rec9" class='text-right'><strong><?php echo number_format($totSep,2); ?></strong></td>
                                            <td id="rec10" class='text-right'><strong><?php echo number_format($totOkt,2); ?></strong></td>
                                            <td id="rec11" class='text-right'><strong><?php echo number_format($totNov,2); ?></strong></td>
                                            <td id="rec12" class='text-right'><strong><?php echo number_format($totDis,2); ?></strong></td>
                                            <td id="rec13" class='text-right'><strong><?php echo number_format($totAll,2); ?></strong></td>
                                        </tr>
                                        <tr>
                                            <td><strong><?php echo $this->lang->line('totCashAvailable'); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totBeginningBank, 2); ?></strong></td>
                                            <td id="cashAvai1" class="aaaa" align="right"></th>
                                            <td id="cashAvai2" class="aaaa" align="right"><strong><?php echo number_format($totFeb,2); ?></strong></td>
                                            <td id="cashAvai3" class="aaaa" align="right"><strong><?php echo number_format($totMac,2); ?></strong></td>
                                            <td id="cashAvai4" class="aaaa" align="right"><strong><?php echo number_format($totApr,2); ?></strong></td>
                                            <td id="cashAvai5" class="aaaa" align="right"><strong><?php echo number_format($totMay,2); ?></strong></td>
                                            <td id="cashAvai6" class="aaaa" align="right"><strong><?php echo number_format($totJun,2); ?></strong></td>
                                            <td id="cashAvai7" class="aaaa" align="right"><strong><?php echo number_format($totJuly,2); ?></strong></td>
                                            <td id="cashAvai8" class="aaaa" align="right"><strong><?php echo number_format($totOgos,2); ?></strong></td>
                                            <td id="cashAvai9" class="aaaa" align="right"><strong><?php echo number_format($totSep,2); ?></strong></td>
                                            <td id="cashAvai10" class="aaaa" align="right"><strong><?php echo number_format($totOkt,2); ?></strong></td>
                                            <td id="cashAvai11" class="aaaa" align="right"><strong><?php echo number_format($totNov,2); ?></strong></td>
                                            <td id="cashAvai12" class="aaaa" align="right"><strong><?php echo number_format($totDis,2); ?></strong></td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td colspan="15"></td>
                                        </tr>
							<?php }?>
                            
                            <?php
                                if($datatbls2){
									
                                    foreach($datatbls2 as $datatbl5):
									
									$totJan5 += $datatbl5->january;
									$totFeb5 += $datatbl5->february;
									$totMac5 += $datatbl5->march;
									$totApr5 += $datatbl5->april;
									$totMay5 += $datatbl5->may;
									$totJun5 += $datatbl5->june;
									$totJuly5 += $datatbl5->july;
									$totOgos5 += $datatbl5->august;
									$totSep5 += $datatbl5->september;
									$totOkt5 += $datatbl5->october;
									$totNov5 += $datatbl5->november;
									$totDis5 += $datatbl5->december;
									
									$totRow5 = $datatbl5->january + $datatbl5->february + $datatbl5->march + $datatbl5->april + $datatbl5->may + $datatbl5->june + $datatbl5->july + $datatbl5->august + $datatbl5->september + $datatbl5->october + $datatbl5->november + $datatbl5->december;
									
									$totAll5 = $totRow5 + $totAll5;
									
										?>
                                        <tr>
                                            <td><?php echo $datatbl5->acctName; ?></td>
                                            <td class='text-right'><?php echo number_format(0,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->january,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->february,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->march,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->april,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->may,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->june,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->july,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->august,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->september,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->october,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->november,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->december,2); ?></td>
                                            <td class='text-right'><?php echo number_format($totRow5,2); ?></td>
                                        </tr>
                                        
                                        
                            <?php endforeach; 
									if(!$datatbls3){
							?>
                            			<tr>
                                            <td><strong><?php echo $this->lang->line('subtotal'); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format(0, 2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJan5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totFeb5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMac5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totApr5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMay5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJun5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJuly5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOgos5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totSep5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOkt5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totNov5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totDis5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totAll5,2); ?></strong></td>
                                        </tr>
                            <?php 
									}
							}?>
                            
                            <?php
								$totFad = 0;
                                if($datatbls3){
									
                                    foreach($datatbls3 as $datatbl3):
									
									$totJan2 += $datatbl3->january;
									$totFeb2 += $datatbl3->february;
									$totMac2 += $datatbl3->march;
									$totApr2 += $datatbl3->april;
									$totMay2 += $datatbl3->may;
									$totJun2 += $datatbl3->june;
									$totJuly2 += $datatbl3->july;
									$totOgos2 += $datatbl3->august;
									$totSep2 += $datatbl3->september;
									$totOkt2 += $datatbl3->october;
									$totNov2 += $datatbl3->november;
									$totDis2 += $datatbl3->december;
									
									$totRow2 = $datatbl3->january + $datatbl3->february + $datatbl3->march + $datatbl3->april + $datatbl3->may + $datatbl3->june + $datatbl3->july + $datatbl3->august + $datatbl3->september + $datatbl3->october + $datatbl3->november + $datatbl3->december;
									$totAll2 = $totRow2 + $totAll2;
									 
									
										?>
                                        <tr>
                                            <td><?php echo $datatbl3->acctName; ?></td>
                                            <td class='text-right'><?php echo number_format(0, 2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->january,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->february,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->march,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->april,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->may,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->june,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->july,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->august,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->september,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->october,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->november,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl3->december,2); ?></td>
                                            <td class='text-right'><?php echo number_format($totRow2,2); ?></td>
                                        </tr>
                                        
                                        
                            <?php endforeach; 
										$totFad = $totAll2 + $totAll5;
							?>
                            			<tr>
                                            <td><strong><?php echo $this->lang->line('subtotal'); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format(0, 2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJan2 + $totJan5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totFeb2 + $totFeb5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMac2 + $totMac5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totApr2 + $totApr5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMay2 + $totMay5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJun2 + $totJun5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJuly2 + $totJuly5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOgos2 + $totOgos5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totSep2 + $totSep5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOkt2 + $totOkt5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totNov2 + $totNov5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totDis2 + $totDis5,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totFad,2); ?></strong></td>
                                        </tr>
                            <?php }?>
                            
                            <?php
                                if($datatbls4){
									
                                    foreach($datatbls4 as $datatbl4):
									
									$totJan3 += $datatbl4->january;
									$totFeb3 += $datatbl4->february;
									$totMac3 += $datatbl4->march;
									$totApr3 += $datatbl4->april;
									$totMay3 += $datatbl4->may;
									$totJun3 += $datatbl4->june;
									$totJuly3 += $datatbl4->july;
									$totOgos3 += $datatbl4->august;
									$totSep3 += $datatbl4->september;
									$totOkt3 += $datatbl4->october;
									$totNov3 += $datatbl4->november;
									$totDis3 += $datatbl4->december;
									
									$totRow3 = $datatbl4->january + $datatbl4->february + $datatbl4->march + $datatbl4->april + $datatbl4->may + $datatbl4->june + $datatbl4->july + $datatbl4->august + $datatbl4->september + $datatbl4->october + $datatbl4->november + $datatbl4->december;
									$totAll3 = $totRow3 + $totAll3;
										
										?>
                                        <tr>
                                            <td><?php echo $datatbl4->acctName; ?></td>
                                            <td class='text-right'><?php echo number_format(0, 2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->january,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->february,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->march,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->april,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->may,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->june,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->july,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->august,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->september,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->october,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->november,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl4->december,2); ?></td>
                                            <td class='text-right'><?php echo number_format($totRow3,2); ?></td>
                                        </tr>
                                        
                                        
                            <?php endforeach; ?>
                            			<tr>
                                            <td><strong><?php echo $this->lang->line('subtotal'); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format(0, 2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJan3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totFeb3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMac3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totApr3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMay3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJun3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJuly3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOgos3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totSep3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOkt3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totNov3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totDis3,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totAll3,2); ?></strong></td>
                                        </tr>
                            <?php }?>
                            
                            <?php
							$fadddd = 123;
                                if($datatbls5){
									
									
                                    foreach($datatbls5 as $datatbl5):
									
									$totJan4 += $datatbl5->january;
									$totFeb4 += $datatbl5->february;
									$totMac4 += $datatbl5->march;
									$totApr4 += $datatbl5->april;
									$totMay4 += $datatbl5->may;
									$totJun4 += $datatbl5->june;
									$totJuly4 += $datatbl5->july;
									$totOgos4 += $datatbl5->august;
									$totSep4 += $datatbl5->september;
									$totOkt4 += $datatbl5->october;
									$totNov4 += $datatbl5->november;
									$totDis4 += $datatbl5->december;
									
									$totRow4 = $datatbl5->january + $datatbl5->february + $datatbl5->march + $datatbl5->april + $datatbl5->may + $datatbl5->june + $datatbl5->july + $datatbl5->august + $datatbl5->september + $datatbl5->october + $datatbl5->november + $datatbl5->december;
									$totAll4 = $totRow4 + $totAll4;
									
										?>
                                        <tr>
                                            <td><?php echo $datatbl5->acctName; ?></td>
                                            <td class='text-right'><?php echo number_format(0, 2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->january,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->february,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->march,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->april,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->may,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->june,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->july,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->august,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->september,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->october,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->november,2); ?></td>
                                            <td class='text-right'><?php echo number_format($datatbl5->december,2); ?></td>
                                            <td class='text-right'><?php echo number_format($totRow4,2); ?></td>
                                        </tr>
                                        
                                        
                            <?php endforeach; ?>
                            			<tr>
                                            <td><strong><?php echo $this->lang->line('subtotal'); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format(0, 2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJan4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totFeb4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMac4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totApr4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totMay4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJun4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totJuly4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOgos4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totSep4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totOkt4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totNov4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totDis4,2); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format($totAll4,2); ?></strong></td>
                                        </tr>
							<?php }?>
                            <?php if($datatbls1){ ?>
                            			<tr>
                                            <td><strong><?php echo $this->lang->line('totCashPaidOut'); ?></strong></td>
                                            <td class='text-right'><strong><?php echo number_format(0, 2); ?></strong></td>
                                            <td id="allJan" class='text-right'><strong><?php echo number_format($totJan2 + $totJan5 + $totJan3 + $totJan4,2); ?></strong></td>
                                            <td id="allFeb" class='text-right'><strong><?php echo number_format($totFeb2 + $totFeb5 + $totFeb3 + $totFeb4,2); ?></strong></td>
                                            <td id="allMac" class='text-right'><strong><?php echo number_format($totMac2 + $totMac5 + $totMac3 + $totMac4,2); ?></strong></td>
                                            <td id="allApr" class='text-right'><strong><?php echo number_format($totApr2 + $totApr5 + $totApr3 + $totApr4,2); ?></strong></td>
                                            <td id="allMei" class='text-right'><strong><?php echo number_format($totMay2 + $totMay5 + $totMay3 + $totMay4,2); ?></strong></td>
                                            <td id="allJun" class='text-right'><strong><?php echo number_format($totJun2 + $totJun5 + $totJun3 + $totJun4,2); ?></strong></td>
                                            <td id="allJuly" class='text-right'><strong><?php echo number_format($totJuly2 + $totJuly5 + $totJuly3 + $totJuly4,2); ?></strong></td>
                                            <td id="allOgos" class='text-right'><strong><?php echo number_format($totOgos2 + $totOgos5 + $totOgos3 + $totOgos4,2); ?></strong></td>
                                            <td id="allSep" class='text-right'><strong><?php echo number_format($totSep2 + $totSep5 + $totSep3 + $totSep4,2); ?></strong></td>
                                            <td id="allOkt" class='text-right'><strong><?php echo number_format($totOkt2 + $totOkt5 + $totOkt3 + $totOkt4,2); ?></strong></td>
                                            <td id="allNov" class='text-right'><strong><?php echo number_format($totNov2 +  $totNov5 + $totNov3 + $totNov4,2); ?></strong></td>
                                            <td id="allDis" class='text-right'><strong><?php echo number_format($totDis2 + $totDis5 + $totDis3 + $totDis4,2); ?></strong></td>
                                            <td id="allMonthTot" class='text-right'><strong><?php echo number_format($totFad + $totAll3 + $totAll4 + $totAll5,2); ?></strong></td>
                                        </tr>
                             <?php } ?>            
                                        <tr>
                                            <td><strong><?php echo $this->lang->line('cashOnHandEnd'); ?></strong></td>
                                            <td align="right" id="totOpeningBal"><strong><?php echo number_format($totBeginningBank, 2); ?></strong></td>
                                            <td id="total1" class="aaaa" align="right"><strong><?php echo $endMonthJan; ?></strong></td>
                                            <td id="total2" class="aaaa" align="right"><strong><?php echo $endMonthFeb; ?></strong></td>
                                            <td id="total3" class="aaaa" align="right"><strong><?php echo $endMonthMac; ?></strong></td>
                                            <td id="total4" class="aaaa" align="right"><strong><?php echo $endMonthApr; ?></strong></td>
                                            <td id="total5" class="aaaa" align="right"><strong><?php echo $endMonthMay; ?></strong></td>
                                            <td id="total6" class="aaaa" align="right"><strong><?php echo $endMonthJun; ?></strong></td>
                                            <td id="total7" class="aaaa" align="right"><strong><?php echo $endMonthJul; ?></strong></td>
                                            <td id="total8" class="aaaa" align="right"><strong><?php echo $endMonthAug; ?></strong></td>
                                            <td id="total9" class="aaaa" align="right"><strong><?php echo $endMonthSep; ?></strong></td>
                                            <td id="total10" class="aaaa" align="right"><strong><?php echo $endMonthOct; ?></strong></td>
                                            <td id="total11" class="aaaa" align="right"><strong><?php echo $endMonthNov; ?></strong></td>
                                            <td id="total12" class="aaaa" align="right"><strong><?php echo $endMonthDis; ?></strong></td>
                                            <td id="total13" class="aaaa" align="right"><strong><?php //echo $endMonthJan; ?></strong></td>
                                        </tr>
                            
                            </tbody>
                            
                          </table>
    
                                            
</div>
<div style="page-break-after:always"></div>
</html>
