cashbook report issues fixed

This commit is contained in:
venbatechnologies@gmail.com 2018-03-02 14:17:33 +05:30
parent a2a8032058
commit c669e3af7f
8 changed files with 111 additions and 125 deletions

View File

@ -2130,14 +2130,15 @@ if ($cname!= ''){
}
//home--this year//
function yearexpensereport($fa,$aa)
{
{
$sql="select monthname(date) as month,
sum(if(type='PAYMENT',total,0)) as exp,
sum(if(type='RECEIPT',total,0)) as inc,
sum(total) as total
from t_income_expense
where date >= '".$fa."-04-01' and date <= '".$aa."-03-31'
group by month ";
group by month
ORDER BY FIELD(month,'April','May','June','July','August','September','October','November','December','January', 'February', 'March')";
$query = $this->db->query($sql);
return $query->result();
@ -2154,7 +2155,8 @@ if ($cname!= ''){
function monthwise_data($value='')
{
$sql="SELECT type,Sum(total) as monthlydata FROM t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate())";
$sql="SELECT type,Sum(total) as monthlydata FROM t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate()) AND YEAR(date) = YEAR(curdate())";
//$sql="SELECT type,Sum(total) as monthlydata FROM resicoin_RIADev.t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate()) And YEAR(date) = YEAR(curdate())"
$query = $this->db->query($sql,array($value));
return $query->result();

View File

@ -16,7 +16,6 @@ if(!empty($departmentwise))
?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
@ -130,9 +129,6 @@ if(!empty($departmentwise))
</section><!-- /. content -->
</div><!-- /. content-wrapper -->
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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>

View File

@ -15,7 +15,7 @@ foreach($departmentwise as $dw)
?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
@ -138,7 +138,7 @@ foreach($departmentwise as $dw)
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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>

View File

@ -37,7 +37,7 @@ $monthName = $dateObj->format('F');
// }}
?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
@ -135,8 +135,10 @@ $(function() {
<th style="text-align:right;"> Payment (&#8377;)</th>
<th style="text-align:right;"> Current Balances(&#8377;)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"><strong>Previous Month Balance(Opening Balances)</strong></td>
<td>&nbsp;</td>
@ -145,8 +147,9 @@ $(function() {
<td style="text-align:right"><strong><?php echo number_format($zero,2,'.','');?></strong></td>
<td>&nbsp;</td>
</tr>
<tbody>
<?php
<?php
if(!empty($monthlyreport)){
foreach($monthlyreport as $mr)
{
@ -166,17 +169,16 @@ $(function() {
}
}
?>
</tbody>
<tfoot width="100%">
<tr>
?>
<tr>
<td style="text-align:left;"><strong>Total</strong></td>
<td>&nbsp;</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>
</tr>
</tbody>
<tfoot>
<tr>
<td style="text-align:left;"><strong>Current Month Closing Balances</strong></td>
<td>&nbsp;</td>
@ -194,12 +196,6 @@ $(function() {
</section>
</div>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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>
@ -208,35 +204,34 @@ $(function() {
<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>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: $('h3').text(),
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
"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)

View File

@ -18,7 +18,6 @@ $tvt=0.00;
}}
?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
@ -64,9 +63,11 @@ $tvt=0.00;
<th style="text-align:right;"> Payment (&#8377;)</th>
<th>Description</th>
<th>Action</th>
<th>Current Balances</th>
<th>Current Balances (&#8377;)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"><strong>Yesterday Balances (opening balances)</strong></td>
<td>&nbsp;</td>
@ -78,8 +79,8 @@ $tvt=0.00;
<td style="text-align:right"><strong><?php echo number_format($zero,2,'.','');?></strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tbody>
<?php
if(!empty($tdy)){
foreach($tdy as $t)
@ -111,9 +112,7 @@ $tvt=0.00;
}
?>
</tbody>
<tfoot width="100%">
<tr>
<tr>
<td style="text-align:left;"><strong>Total</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
@ -125,6 +124,9 @@ $tvt=0.00;
<td>&nbsp;</td>
<td style="text-align:right"><strong><?php $curr_balances = $in+$ti-$tvt; echo number_format($curr_balances,2,'.','');?></strong></td>
</tr>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:left;"><strong>Today Closing Balances</strong></td>
@ -146,7 +148,7 @@ $tvt=0.00;
</div>
</section>
</div>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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>
@ -161,6 +163,7 @@ $tvt=0.00;
"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: [
{

View File

@ -10,7 +10,6 @@ $zero=0.00;
$curr_balances=0.00;
//print_r($fyears);
if(!empty($Indiancurrency))
{
foreach ($Indiancurrency as $inr)
@ -31,9 +30,7 @@ if(!empty($Indiancurrency))
?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<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 {
@ -61,15 +58,6 @@ if(!empty($Indiancurrency))
</style>
<div class="content-wrapper">
<section class="content">
<div class="box">
@ -117,9 +105,11 @@ if(!empty($Indiancurrency))
<th>Month</th>
<th style="text-align:right;"> Receipt (&#8377;)</th>
<th style="text-align:right;"> Payment (&#8377;)</th>
<th>Current Balances</th>
<th>Current Balances (&#8377;)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"><strong>Previous Year Balance(opening balances)</strong></td>
<?php $in = $recamt-$payamt;?>
@ -128,7 +118,6 @@ if(!empty($Indiancurrency))
<td></td>
</tr>
<tbody>
<?php
if(!empty($yearlyreport)){
foreach($yearlyreport as $yr)
@ -150,14 +139,14 @@ if(!empty($Indiancurrency))
}
?>
</tbody>
<tfoot width="100%">
<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 = $in+$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>
@ -174,43 +163,43 @@ if(!empty($Indiancurrency))
</section>
</div><!-- content-wrapper -->
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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 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( {
"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>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: $('h3').text(),
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
"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 } ?>

View File

@ -1,4 +1,4 @@
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
@ -84,8 +84,6 @@
</section><!-- /. content -->
</div><!-- /. content-wrapper -->
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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>
@ -103,6 +101,7 @@ $(document).ready(function() {
"dom": "<'row'<'col-md-5'l><'col-md-7'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: [
{

View File

@ -1,5 +1,4 @@
<?php
$today_in='';
$today_ex='';
@ -26,7 +25,7 @@ if(!empty($monthlywiseincome))
{
foreach ($monthlywiseincome as $mi)
{
$month_in = $mi->monthlydata;
$month_in = $mi->monthlydata;
}}
if(!empty($monthlywiseexpense))
@ -78,7 +77,6 @@ if(!empty($yearincome))
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
@ -120,7 +118,7 @@ div.dt-buttons {
<div class="info-box">
<span class="info-box-icon bg-red" style="height: 90px;padding:25px;"><i class="fa fa-hourglass-end"></i></span>
<div class="info-box-content">
<span class="info-box-number" ><a href="<?php echo base_url().'report/daily_incexp' ?>" data-toggle="tooltip" title="Click here to View Today's payments" ><?php echo "Today" ?></a></span>
<span class="info-box-number" ><a href="<?php echo base_url().'report/daily_incexp' ?>" data-toggle="tooltip" title="Click here to View Today's Reports" ><?php echo "Today" ?></a></span>
<span class="info-box-text text-center"><strong>Receipt :</strong>&#8377;<?php echo number_format($today_in,2,'.',''); ?> </span>
<span class="info-box-text text-center"><strong>Payment :</strong>&#8377;<?php echo number_format($today_ex,2,'.',''); ?> </span>
@ -135,7 +133,7 @@ div.dt-buttons {
<div class="info-box">
<span class="info-box-icon bg-aqua" style="height: 90px;padding:25px;"><i<i class="fa fa-spinner"></span>
<div class="info-box-content">
<span class="info-box-number"><a href="<?php echo base_url().'report/monthly_incexp' ?>" data-toggle="tooltip" title="Click here to View Monthly payments"><?php echo "This Month" ?></a></span>
<span class="info-box-number"><a href="<?php echo base_url().'report/monthly_incexp' ?>" data-toggle="tooltip" title="Click here to View Monthly Reports"><?php echo "This Month" ?></a></span>
<span class="info-box-text text-center"><strong>Receipt :</strong>&#8377;<?php echo number_format($month_in,2,'.',''); ?></span>
<span class="info-box-text text-center"><strong>Payment :</strong>&#8377;<?php echo number_format($month_ex,2,'.',''); ?></span>
</div>
@ -148,7 +146,7 @@ div.dt-buttons {
<div class="info-box">
<span class="info-box-icon bg-green" style="height: 90px;padding:25;"><i class="fa fa-industry" style="padding: 5px;"></i></span>
<div class="info-box-content">
<span class="info-box-number"><a href="<?php echo base_url().'report/yearly_incexp' ?>" data-toggle="tooltip" title="Click here to View Yearly payments"><?php echo "This Year" ?></a></span>
<span class="info-box-number"><a href="<?php echo base_url().'report/yearly_incexp' ?>" data-toggle="tooltip" title="Click here to View Yearly Reports"><?php echo "This Year" ?></a></span>
<span class="info-box-text text-center"><strong>Receipt :</strong>&#8377;<?php echo number_format($year_in,2,'.',''); ?></span>
<span class="info-box-text text-center"><strong>Payment :</strong>&#8377;<?php echo number_format($year_ex,2,'.',''); ?></span>
</div>
@ -181,14 +179,15 @@ div.dt-buttons {
<th>Type</th>
<th>Received From</th>
<th>Paid To</th>
<th style="text-align:right;"> Receipt (&#8377;)</th>
<th style="text-align:right;"> Payment (&#8377;)</th>
<th>Description</th>
<th>File</th>
<th>Current Balances</th>
<th style="text-align:right;"> Receipt (&#8377;)</th>
<th style="text-align:right;"> Payment (&#8377;)</th>
<th>Description</th>
<th>File</th>
<th>Current Balances(&#8377;)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"><strong>Yesterday Balances (opening balances)</strong></td>
<td>&nbsp;</td>
@ -202,7 +201,7 @@ div.dt-buttons {
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tbody>
<?php
$ti=0.00;
$tvt=0.00;
@ -213,19 +212,19 @@ div.dt-buttons {
<tr>
<td><span><?php echo $t->date?></span></td>
<td align="left"><span><?php echo $t->name?></span></td>
<td align="left"><span><?php echo $t->name?></span></td>
<td align="left"><span><?php echo $t->type?></span></td>
<td align="left"><span><?php echo $t->receiptname?></span></td>
<td align="left"><span><?php echo $t->paymentname?></span></td>
<td align="right"><span><?php
$ti= $ti + number_format($t->income,2,'.','');
echo number_format($t->income,2,'.','');?></span></td>
<td align="right"><span><?php
<td align="right"><span><?php
$tvt= $tvt + number_format($t->expense,2,'.','');
echo number_format($t->expense,2,'.','');?></span></td>
<td align="left"><span><?php echo $t->description?></span></td>
<td><?php
<td align="left"><span><?php echo $t->description?></span></td>
<td><?php
if(!empty($t->document))
{
?>
@ -244,9 +243,7 @@ div.dt-buttons {
}
}
?>
</tbody>
<tfoot width="100%">
<tr>
<tr>
<td style="text-align:left;"><strong>Total</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
@ -258,7 +255,11 @@ div.dt-buttons {
<td>&nbsp;</td>
<td style="text-align:right"><strong><?php $curr_balances = $in+$ti-$tvt; echo number_format($curr_balances,2,'.','');?></strong></td>
</tr>
<tr>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:left;"><strong>Today Closing Balances</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
@ -269,7 +270,7 @@ div.dt-buttons {
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tr>
</tfoot>
</table>
</div>
@ -282,7 +283,7 @@ div.dt-buttons {
</div><!-- /.content wrapper -->
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<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>
@ -297,6 +298,7 @@ $(document).ready(function() {
"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: [
{