333 lines
13 KiB
PHP
333 lines
13 KiB
PHP
<?php
|
|
$strday_balances = '';
|
|
$premonth_balances = '' ;
|
|
$preyear_balances = '' ;
|
|
$today_in='';
|
|
$today_ex='';
|
|
$month_in='';
|
|
$month_ex='';
|
|
$year_in='';
|
|
$year_ex='';
|
|
$zero=0.00;
|
|
$curr_balances=0.00;
|
|
|
|
if(!empty($dailyIncomeExpense))
|
|
{
|
|
foreach ($dailyIncomeExpense as $t)
|
|
{
|
|
$today_in = $t->daily_income_amt;
|
|
$today_ex = $t->daily_expenses_amt;
|
|
}}
|
|
|
|
|
|
if(!empty($monthlyIncomeExpense))
|
|
{
|
|
foreach ($monthlyIncomeExpense as $m)
|
|
{
|
|
$month_in = $m->monthly_income_amt;
|
|
$month_ex = $m->monthly_expenses_amt;
|
|
}}
|
|
|
|
if(!empty($yearlyIncomeExpense))
|
|
{
|
|
foreach ($yearlyIncomeExpense as $y)
|
|
{
|
|
$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;
|
|
}
|
|
}
|
|
?>
|
|
<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 {
|
|
position: relative;
|
|
float: right;
|
|
|
|
}
|
|
.btn-success {
|
|
background-color: #3c8dbc;
|
|
border-color: #3c8dbc;
|
|
}
|
|
</style>
|
|
<div class="content-wrapper">
|
|
<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: 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/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>
|
|
|
|
<!-- 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-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/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>
|
|
|
|
<!-- 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-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/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>
|
|
|
|
</div>
|
|
|
|
|
|
<!--<div class="row">
|
|
<div class="col-md-12">
|
|
<div id="container"></div>
|
|
|
|
</div>
|
|
</div>-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Left col -->
|
|
<div class="col-md-12">
|
|
<!-- TABLE: LATEST ORDERS -->
|
|
<div class="box box-info">
|
|
<!--<div class="box-header with-border">-->
|
|
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
|
|
<!--</div>-->
|
|
<!-- /.box-header -->
|
|
|
|
|
|
|
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Day Wise Report</b></p></h3></center>
|
|
<div class="box-body">
|
|
<div>
|
|
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Date</th>
|
|
<th>Account Name</th>
|
|
<th>Type</th>
|
|
<th>Received From</th>
|
|
<th>Paid To</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>Description</th>
|
|
<th>File</th>
|
|
<th>Current Balances (<i class="fa fa-rupee ">)</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left;"><strong>Yesterday Balances (opening balances)</strong></td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </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> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
</tr>
|
|
<?php
|
|
$ti=0.00;
|
|
$tvt=0.00;
|
|
if(!empty($tdy)){
|
|
foreach($tdy as $t)
|
|
{
|
|
?>
|
|
<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->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
|
|
$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
|
|
if(!empty($t->document))
|
|
{
|
|
?>
|
|
<a target="_blank" href="<?php echo base_url().$t->document ?>"><i class="fa fa-download" ></i></a>
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
{
|
|
echo "NO FILE";
|
|
}
|
|
?>
|
|
|
|
</td>
|
|
<!-- <td align="right"><span><?php echo number_format($in+$ti-$tvt,2,'.',''); ?></span></td> -->
|
|
<td align="right"><span><?php echo number_format($strday_balances+$ti-$tvt,2,'.',''); ?></span></td>
|
|
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
<tr>
|
|
<td style="text-align:left;"><strong>Total</strong></td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </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> </td>
|
|
<td> </td>
|
|
<!-- <td style="text-align:right"><strong><?php $curr_balances = $in+$ti-$tvt; echo number_format($curr_balances,2,'.','');?></strong></td> -->
|
|
<td style="text-align:right"><strong><?php $curr_balances = $strday_balances+$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>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </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>
|
|
<td> </td>
|
|
<td> </td>
|
|
</tr>
|
|
|
|
</tfoot>
|
|
</table>
|
|
|
|
</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>
|
|
<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>
|
|
$(document).ready(function() {
|
|
table = $('#req').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'
|
|
]
|
|
} );
|
|
} );
|
|
</script>
|