246 lines
8.2 KiB
PHP
Executable File
246 lines
8.2 KiB
PHP
Executable File
<?php
|
|
$ti=0.00;
|
|
$tvt=0.00;
|
|
$in=0.00;
|
|
$payamt=0.00;
|
|
$recamt = 0.00;
|
|
$zero=0.00;
|
|
$curr_balances=0.00;
|
|
$monthyr = '';
|
|
$mthyr = '' ;
|
|
$monthNum = '' ;
|
|
$yearNum = '';
|
|
|
|
if(!empty($prevmonthtotal))
|
|
{
|
|
foreach ($prevmonthtotal as $prevttl){
|
|
|
|
// $payamt = $prevmonthtotal[0]->payment_amt;
|
|
$payamt = $prevttl->payment_amt;
|
|
// $recamt = $prevmonthtotal[0]->receipt_amt;
|
|
$recamt = $prevttl->receipt_amt;
|
|
}}
|
|
if(!empty($monthyearvalue))
|
|
{
|
|
$monthyr = explode("-",$monthyearvalue);
|
|
$monthNum = $monthyr[0];
|
|
$yearNum = $monthyr[1];
|
|
$dateObj = DateTime::createFromFormat('!m', $monthNum);
|
|
$monthName = $dateObj->format('F');
|
|
}
|
|
// $inrsymbol='';
|
|
// if(!empty($Indiancurrency))
|
|
// {
|
|
// foreach ($Indiancurrency as $inr)
|
|
// {
|
|
// $inrsymbol = $inr->FontCode2000;
|
|
// }}
|
|
|
|
?>
|
|
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
|
<style>
|
|
.dataTables_filter input {padding: 4px;}
|
|
.dataTables_filter {
|
|
width: 50%;
|
|
float: right;
|
|
text-align: right;
|
|
}
|
|
.dataTables_paginate {
|
|
width: 50%;
|
|
float: right;
|
|
text-align: right;
|
|
}
|
|
div.dt-buttons {
|
|
font-size: 15px;
|
|
position: relative;
|
|
float: right;
|
|
}
|
|
.btn-success {
|
|
background-color: #3c8dbc;
|
|
border-color: #3c8dbc;
|
|
}
|
|
.ui-datepicker-calendar {
|
|
display: none;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
|
|
var d = new Date();
|
|
|
|
//var month = d.getMonth();
|
|
var month = d.getMonth() + 1;
|
|
month = month < 10 ? '0' + month : '' + month;
|
|
var day = d.getDate();
|
|
var year = d.getFullYear() ;
|
|
var SIAStartYear = year - 2015;
|
|
var mindt = year-70;
|
|
var maxdt = year-15;
|
|
|
|
|
|
$('#monthyear').datepicker( {
|
|
//minDate : new Date(year-SIAStartYear,0,1),
|
|
//maxDate :'now',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
showButtonPanel: true,
|
|
dateFormat: 'mm-yy',
|
|
onClose: function(dateText, inst) {
|
|
$(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1));
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
<div class="content-wrapper">
|
|
<section class="content">
|
|
<div class="box">
|
|
<div class="container-fluid">
|
|
<div class="box-header">
|
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Month Report <?php if($monthyr != ''){ echo '('.$monthName.'-'.$yearNum.')'; } else { echo ''; }//<?php ($month=date('F');echo $month;)?></b></p></h3></center>
|
|
<!-- <center><h3 class="box-title"><p style="color:#3c8dbc"><b>Month Report(<?php $month=date('F');echo $month;?>)</b></p></h3></center> -->
|
|
</div>
|
|
<div class="col-xs-12 col-md-6 col-md-offset-6">
|
|
<center>
|
|
<!-- <div class="panel-body"> -->
|
|
|
|
<form role="form" id="monthlycashbook" action="<?php echo base_url() ?>report/monthexpenses" method="post" enctype="multipart/form-data">
|
|
<div class="col-md-8">
|
|
<label for="monthyear">Month year : </label><span style="color:red" ><?php echo '*' ?></span>
|
|
<?php if($monthyearvalue !=''){?>
|
|
<input name="monthyear" id="monthyear" class="date-picker" value="<?php echo $monthyearvalue; ?>"/>
|
|
<?php } else{ ?>
|
|
<input name="monthyear" id="monthyear" class="date-picker"/>
|
|
<?php } ?>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input type="submit" class="btn btn-success" id="monthly" name="btn_submit" value="View Report">
|
|
</div>
|
|
</form>
|
|
<!-- </div> -->
|
|
</center>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="box-body">
|
|
<div>
|
|
<table id="cbmthly" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
|
<thead style="background-color:#ddf">
|
|
<tr>
|
|
<th>Account Name</th>
|
|
<th>Type</th>
|
|
<th style="text-align:right;"> Receipt (<i class="fa fa-rupee ">)</th>
|
|
<th style="text-align:right;"> Payment (<i class="fa fa-rupee ">)</th>
|
|
<th style="text-align:right;"> Current Balances(<i class="fa fa-rupee ">)</th>
|
|
</tr>
|
|
|
|
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left;"><strong>Previous Month Balance(Opening Balances)</strong></td>
|
|
<td> </td>
|
|
<?php $in = $recamt-$payamt;//prevmonthincome-prevmonthexpense ?>
|
|
<td style="text-align:right"><strong><?php echo number_format($in,2,'.','') ?></strong></td>
|
|
<td style="text-align:right"><strong><?php echo number_format($zero,2,'.','');?></strong></td>
|
|
<td> </td>
|
|
</tr>
|
|
|
|
|
|
<?php
|
|
if(!empty($monthlyreport)){
|
|
foreach($monthlyreport as $mr)
|
|
{
|
|
?>
|
|
<tr>
|
|
<td align="left"><a href="<?php echo base_url(); ?>report/cashbookdepartment?sid=<?php echo $mr->account_code;?>&d=<?php echo $mr->month?>&c=<?php echo $mr->type?>"><span><?php echo $mr->name?></span></a></td>
|
|
<td align="left"><span><?php echo $mr->type?></span></td>
|
|
<td align="right"><span><?php
|
|
$ti= $ti + number_format($mr->income,2,'.','');
|
|
echo number_format($mr->income,2,'.','');?></span></td>
|
|
<td align="right"><span><?php
|
|
$tvt= $tvt + number_format($mr->expense,2,'.','');
|
|
echo number_format($mr->expense,2,'.','');?></span></td>
|
|
<td align="right"><span><?php echo number_format($in+$ti-$tvt,2,'.',''); ?></span></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
<tr>
|
|
<td style="text-align:left;"><strong>Total</strong></td>
|
|
<td> </td>
|
|
<td style="text-align:right"><strong><?php echo number_format($ti,2,'.','');?></strong></td>
|
|
<td style="text-align:right"><strong><?php echo number_format($tvt,2,'.','');?></strong></td>
|
|
<td style="text-align:right"><strong><?php $curr_balances = $in+$ti-$tvt; echo number_format($curr_balances,2,'.','');?></strong></td>
|
|
</tr>
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<td style="text-align:left;"><strong>Current Month Closing Balances</strong></td>
|
|
<td> </td>
|
|
<td style="text-align:right"><strong><?php echo number_format($curr_balances,2,'.','');?></strong></td>
|
|
<td style="text-align:right"><strong><?php echo number_format($zero,2,'.','');?></strong></td>
|
|
<td> </td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
|
|
|
<script>
|
|
|
|
// Bootstrap datepicker
|
|
// Set up your table
|
|
$(document).ready(function() {
|
|
table = $('#cbmthly').DataTable( {
|
|
"dom": "<'row'<'col-md-3'l><'col-md-9'Bf>>" +
|
|
"<'row'<'col-md-6'><'col-md-6'>>" +
|
|
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
|
"bSort": false,
|
|
buttons: [
|
|
|
|
{
|
|
extend: 'excelHtml5',
|
|
footer: 'true',
|
|
//messageTop: $('h3').text(),
|
|
title: $('h3').text(),
|
|
exportOptions: {
|
|
columns: ':visible'
|
|
|
|
}
|
|
},
|
|
|
|
'colvis'
|
|
]
|
|
} );
|
|
} );
|
|
|
|
|
|
$('#monthly').click(function() {
|
|
|
|
if($("#monthyear").val().length < 1)
|
|
{
|
|
alert('Please Select/Choose Month Year');
|
|
$("#monthyear").focus();
|
|
return false;
|
|
}
|
|
//alert('finished');
|
|
});
|
|
</script>
|