cashbook dashboard report opening and closing balances changes

This commit is contained in:
venbatechnologies@gmail.com 2018-07-05 11:58:20 +05:30
parent 8476974083
commit 3a5ccea227
3 changed files with 105 additions and 61 deletions

View File

@ -1022,6 +1022,19 @@ class report extends BaseController
$currentdate = $now->format('Y-m-d'); // MySQL datetime format
$yesterday = date('Y-m-d', strtotime("-1 day"));
$month = $now->format('m') ;
$year = $now->format('y');
$premonth = $month-1;
$premonth = $premonth < 10 ? '0'.$premonth : ''.$premonth;
$premonth = $premonth == '00' ? '12' : $premonth;
$yearvalue = $premonth == '12' ? $year-1 : $year;
$preyear = $yearvalue-1;
$data['yearlybalances']=$this->dahsboard_Model->getYearlyOpeningAmt($yearvalue);
$lastdate =cal_days_in_month(CAL_GREGORIAN,$premonth,$yearvalue);
$dateformat = '20'.$yearvalue.'-'.$premonth.'-'.$lastdate;
$data['monthlybalances']=$this->dahsboard_Model->getMonthlyOpeningAmt($dateformat);
$data['yesterdaybalances'] = $this->dahsboard_Model->getDailyOpeningAmt($yesterday);

View File

@ -1,5 +1,9 @@
<?php
$strday_balances = '';
$premonth_balances = '' ;
$preyear_balances = '' ;
$today_in='';
$today_ex='';
$month_in='';
@ -37,6 +41,31 @@ if(!empty($yearlyIncomeExpense))
$year_in = $y->yearly_income_amt;
$year_ex = $y->yearly_expenses_amt;
}}
if(!empty($yesterdaybalances))
{
foreach ($yesterdaybalances as $ttl)
{
$strdaydate = $ttl->date;
$strday_balances = $ttl->opening_amt;
}}
if(!empty($monthlybalances))
{
foreach ($monthlybalances as $prevttl){
//$premonth_balances = ($prevttl->payment_amt) - ($prevttl->receipt_amt);
$premonth_balances = $prevttl->opening_amt;
}
}
if(!empty($yearlybalances)){
foreach ($yearlybalances as $preyearttl)
{
//$preyear_balances = ($preyearttl->payment_amt) - ($preyearttl->receipt_amt);
$preyear_balances = $preyearttl->opening_amt;
}
}
?>
@ -65,28 +94,29 @@ div.dt-buttons {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
</style>
<div class="content-wrapper">
<div class="col-md-12">
<br>
<section>
<center>
<div>
<section class="content-header">
<!-- Main content -->
<section>
<!-- Info boxes -->
<center>
<div class="col-md-12">
<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4">
<div class="info-box">
<span class="info-box-icon bg-red" style="height: 90px;padding:25px;"><i class="fa fa-hourglass-end"></i></span>
<span class="info-box-icon bg-red" style="height: 117px;padding: 35px;width: 120px;"><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 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>
<span class="info-box-number" ><a href="<?php echo base_url().'report/Viewtoday' ?>" data-toggle="tooltip" title="Click here to View Today's Cashbook Report" ><?php echo "Today" ?></a></span>
<span class="info-box-text text-center"><strong>Opening Balances :</strong><i class="fa fa-rupee "></i><?php echo number_format($strday_balances,2,'.',''); ?> </span>
<span class="info-box-text text-center"><strong>Receipt :</strong><i class="fa fa-rupee "></i><?php echo number_format($today_in,2,'.',''); ?> </span>
<span class="info-box-text text-center"><strong>Payment :</strong><i class="fa fa-rupee "></i><?php echo number_format($today_ex,2,'.',''); ?> </span>
<span class="info-box-text text-center"><strong>Closing Balances :</strong><i class="fa fa-rupee "></i><?php echo number_format(($strday_balances+$today_in-$today_ex),2,'.',''); ?> </span>
</div>
</div>
</div>
@ -95,11 +125,13 @@ div.dt-buttons {
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4">
<div class="info-box">
<span class="info-box-icon bg-aqua" style="height: 90px;padding:25px;"><i<i class="fa fa-spinner"></span>
<span class="info-box-icon bg-aqua" style="height: 117px;padding: 35px;width: 120px;"><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 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>
<span class="info-box-number"><a href="<?php echo base_url().'report/monthexpenses' ?>" data-toggle="tooltip" title="Click here to View Monthly Cashbook Report"><?php echo "This Month" ?></a></span>
<span class="info-box-text text-center"><strong>Opening Balances :</strong><i class="fa fa-rupee "></i><?php echo number_format($premonth_balances,2,'.',''); ?> </span>
<span class="info-box-text text-center"><strong>Receipt :</strong><i class="fa fa-rupee "></i><?php echo number_format($month_in,2,'.',''); ?></span>
<span class="info-box-text text-center"><strong>Payment :</strong><i class="fa fa-rupee "></i><?php echo number_format($month_ex,2,'.',''); ?></span>
<span class="info-box-text text-center"><strong>Closing Balances :</strong><i class="fa fa-rupee "></i><?php echo number_format(($premonth_balances+$month_in-$month_ex),2,'.',''); ?> </span>
</div>
</div>
</div>
@ -108,46 +140,45 @@ div.dt-buttons {
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4">
<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>
<span class="info-box-icon bg-green" style="height: 117px;padding: 35px;width: 120px;"><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 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>
<span class="info-box-number"><a href="<?php echo base_url().'report/yearexpenses' ?>" data-toggle="tooltip" title="Click here to View Yearly Cashbook Report"><?php echo "This Year" ?></a></span>
<span class="info-box-text text-center"><strong>Opening Balances :</strong><i class="fa fa-rupee "></i><?php echo number_format($preyear_balances,2,'.',''); ?></span>
<span class="info-box-text text-center"><strong>Receipt :</strong><i class="fa fa-rupee "></i><?php echo number_format($year_in,2,'.',''); ?></span>
<span class="info-box-text text-center"><strong>Payment :</strong><i class="fa fa-rupee "></i><?php echo number_format($year_ex,2,'.',''); ?></span>
<span class="info-box-text text-center"><strong>Closing Balances :</strong><i class="fa fa-rupee "></i><?php echo number_format($preyear_balances+$year_in-$year_ex,2,'.',''); ?> </span>
</div>
</div>
</div>
</div>
</center>
</section>
</div>
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<section class="content"><br/>
<div class="box">
<div class="container-fluid">
<div class="box-header">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Day Wise Report</b></p></h3></center>
</div>
<div class="col-md-12">
<div class="box-body">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Day Wise Report</b></p></h3></center>
<div class="box-body">
<div>
<table id="dailyentries" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;table-layout:auto;">
<thead style="background-color:#ddf">
<tr>
<th>Date</th>
<th>Date</th>
<th>Account Name</th>
<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(&#8377;)</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>
@ -161,19 +192,18 @@ div.dt-buttons {
}}
?>
<tr>
<td style="text-align:left;"><strong>Yesterday Balances (opening balances)</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<?php //$in = $recamt-$payamt;//prevmonthincome-prevmonthexpense ?>
<td style="text-align:right"><strong><?php echo number_format( $strday_balances ,2,'.','');?></strong></td>
<td style="text-align:left;"><strong>Yesterday Balances (opening balances)</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<?php //$in = $recamt-$payamt;//prevmonthincome-prevmonthexpense ?>
<td style="text-align:right"><strong><?php echo number_format($strday_balances,2,'.','');?></strong></td>
<td style="text-align:right"><strong><?php echo number_format($zero,2,'.','');?></strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php
foreach($tdy as $t)
{
@ -243,16 +273,17 @@ div.dt-buttons {
</tfoot>
<?php } ?>
</table>
</div>
</div><!-- /.box body-->
</div><!-- /.col md 12 -->
</div><!-- /.container-fluid -->
</div><!-- /.box-->
</section>
</div><!-- /.col md row 6 -->
</div><!-- /.content wrapper -->
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</div>
</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>

BIN
uploads/cashbook/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB