ria/app/Views/cashbookyearlyreport.php
2024-09-11 08:54:25 +05:30

213 lines
7.2 KiB
PHP
Executable File

<?php
$finyear ='';
$ti=0.00;
$tvt=0.00;
$opening_balances = 0.00;
$zero=0.00;
$curr_balances=0.00;
?>
<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;;
}
</style>
<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>Year Report <?php if(!empty ($fyears) ){
echo '('.$fyears.')'; }
else { echo ''; }//echo $finyear?></b></p></h3></center>
<!-- <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 method="post" action="<?php echo base_url() ?>report/yearly_incexp">
<div class="col-md-8">
<select class="form-control" id="financialyear" name="financialyear">
<option value=" ">Select Year</option>
<?php
foreach($financialyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
<div class="col-md-2">
<input type="submit" class="btn btn-success" id="yearly" name="btn_submit" value="View Report">
</div>
</form>
<!-- </div> -->
</center>
</div>
<div class="col-md-12">
<div class="box-body">
<div>
<table id="yearlypayment" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead >
<tr>
<th>Month</th>
<th style="text-align:right;"> Receipt (&#8377;)</th>
<th style="text-align:right;"> Payment (&#8377;)</th>
<th>Current Balances (&#8377;)</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($yearlyreport)){
if(!empty($yearlybalances)){
foreach ($yearlybalances as $prevttl)
{
$opening_balances = $prevttl->opening_amt ;
}}
?>
<tr>
<td style="text-align:left;"><strong>Previous Year Balance(opening balances)</strong></td>
<?php //$in = $recamt-$payamt;?>
<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($yearlyreport as $yr)
{
?>
<tr>
<td align="left"><a href="<?= base_url() ?>report/yearmonthwise?sid=<?php echo $yr->month;?>"><span><?php echo $yr->month?></span></a></td>
<td align="right"><span><?php
$ti= $ti + number_format($yr->inc,2,'.','');
echo number_format($yr->inc,2,'.','');?></span></td>
<td align="right"><span><?php
$tvt= $tvt + number_format($yr->exp,2,'.','');
echo number_format($yr->exp,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 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 width="100%">
<tr>
<td style="text-align:left;"><strong>Current Year Closing Balances</strong></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>&nbsp;</td>
</tr>
</tfoot>
<?php } ?>
<!-- else { ?> <td style="text-align:center" colspan="4"><strong> No Data Found</strong></td> </tbody> }?> -->
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div><!-- content-wrapper -->
<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 = $('#yearlypayment').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'
]
} );
<?php if(!empty ($fyears) ){ ?>
$('#financialyear option[value="<?php echo $fyears ?>"]').attr("selected", "selected");
<?php } ?>
} );
$('#yearly').click(function() {
if($("option:selected", $("#financialyear")).val() == " ")
{
alert('Please Select/Choose Financial year ');
$("#financialyear").focus();
return false;
}
//alert('finished');
});
//
</script>