241 lines
7.9 KiB
PHP
Executable File
241 lines
7.9 KiB
PHP
Executable File
<?php
|
|
$ti=0.00;
|
|
$tvt=0.00;
|
|
$opening_balances = 0.00;
|
|
$zero=0.00;
|
|
$curr_balances=0.00;
|
|
$monthyr = '';
|
|
$mthyr = '' ;
|
|
$monthNum = '' ;
|
|
$yearNum = '';
|
|
|
|
|
|
if(!empty($monthyearvalue))
|
|
{
|
|
$monthyr = explode("-",$monthyearvalue);
|
|
$monthNum = $monthyr[0];
|
|
$yearNum = $monthyr[1];
|
|
$dateObj = DateTime::createFromFormat('!m', $monthNum);
|
|
$monthName = $dateObj->format('F');
|
|
}
|
|
|
|
?>
|
|
|
|
<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: #00d976;;
|
|
border-color: #00d976;;
|
|
}
|
|
.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 RIAStartYear = year - 2007;
|
|
var mindt = year-70;
|
|
var maxdt = year-15;
|
|
|
|
|
|
$('#monthyear').datepicker( {
|
|
minDate : new Date(year-RIAStartYear,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: #00d976;"><b>Month Report <?php if($monthyr != ''){ echo '('.$monthName.'-'.$yearNum.')'; } else { echo ''; }//<?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/monthly_incexp" method="post" enctype="multipart/form-data">
|
|
<div class="col-md-8">
|
|
<label for="monthyear">Month year :</label>
|
|
<?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 >
|
|
<tr>
|
|
<th>Account Name</th>
|
|
<th>Type</th>
|
|
<th style="text-align:right;"> Receipt (₹)</th>
|
|
<th style="text-align:right;"> Payment (₹)</th>
|
|
<th style="text-align:right;"> Current Balances(₹)</th>
|
|
</tr>
|
|
|
|
|
|
</thead>
|
|
<tbody>
|
|
<?php if(!empty($monthlyreport)){
|
|
if(!empty($monthlybalances))
|
|
{
|
|
foreach ($monthlybalances as $prevttl){
|
|
|
|
$opening_balances = $prevttl->opening_amt;
|
|
|
|
}}
|
|
?>
|
|
<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($opening_balances,2,'.','') ?></strong></td>
|
|
<td style="text-align:right"><strong><?php echo number_format($zero,2,'.','');?></strong></td>
|
|
<td> </td>
|
|
</tr>
|
|
|
|
|
|
<?php
|
|
|
|
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($opening_balances+$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 = $opening_balances+$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>
|
|
<?php } ?>
|
|
</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( {
|
|
"language": {
|
|
"emptyTable": "<center> Data Not Found ! </center>"
|
|
},
|
|
"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>
|