cashbook report and igr files issues fixes

This commit is contained in:
venbatechnologies@gmail.com 2018-05-29 10:32:02 +05:30
parent a71a3783b9
commit 8f04f538df
10 changed files with 237 additions and 207 deletions

View File

@ -994,19 +994,25 @@ class report extends BaseController
$data['getTotalrevenuePoCount'] = $this->dahsboard_Model->getTotalrevenuePoCount();
$data['cashbook']=$this->dahsboard_Model->cashbook();
$income="RECEIPT";
$expense="PAYMENT";
$data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data($income);
$data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data($expense);
$data['todayincome']=$this->dahsboard_Model->today_data($income);
$data['todayexpense']=$this->dahsboard_Model->today_data($expense);
$data['yearincome']=$this->dahsboard_Model->yearwise_data($income);
$data['yearexpense']=$this->dahsboard_Model->yearwise_data($expense);
// $income="RECEIPT";
// $expense="PAYMENT";
// $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data($income);
// $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data($expense);
// $data['todayincome']=$this->dahsboard_Model->today_data($income);
// $data['todayexpense']=$this->dahsboard_Model->today_data($expense);
// $data['yearincome']=$this->dahsboard_Model->yearwise_data($income);
// $data['yearexpense']=$this->dahsboard_Model->yearwise_data($expense);
$data['dailyIncomeExpense']=$this->dahsboard_Model->today_data();
$data['monthlyIncomeExpense']=$this->dahsboard_Model->monthwise_data();
$data['yearlyIncomeExpense']=$this->dahsboard_Model->yearwise_data();
$data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal();
$data['tdy']=$this->dahsboard_Model->today();
//echo ($data['tdy']);
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
//print_r($data['gettoptotal1']);
//echo ($data['tdy']);
//print_r($data['gettoptotal1']);
// $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data_income();
// $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data_expense();
// $data['todayincome']=$this->dahsboard_Model->today_data_income();
@ -1066,8 +1072,12 @@ class report extends BaseController
$premonth = $premonth == '00' ? '12' : $premonth;
$yearvalue = $premonth == '12' ? $year-1 : $year;
$data['prevmonthtotal']=$this->dahsboard_Model->monthbeforetotal($premonth,$yearvalue);
$lastdate = cal_days_in_month(CAL_GREGORIAN,$premonth,$yearvalue);
$dateformat = $yearvalue.'-'.$premonth.'-'.$lastdate;
$data['monthlybalances']=$this->dahsboard_Model->getMonthlyOpeningAmt($dateformat);
//$data['prevmonthtotal']=$this->dahsboard_Model->monthbeforetotal($premonth,$yearvalue);
$data['monthlyreport']=$this->dahsboard_Model->month_incexp_report($month,$year);
@ -1098,14 +1108,18 @@ class report extends BaseController
//echo $data['fyears'];
$fa=substr( $fyear,0,-5);
$aa=substr( $fyear,5,5);
$finyear = explode("-",$fyear);
$b4oneyear = $finyear[0] -1;
$b4twoyear = $finyear[1] -1;
$prev_year = $finyear[0];
// $b4oneyear = $finyear[0] -1;
// $b4twoyear = $finyear[1] -1;
$data['yearlyreport']=$this->dahsboard_Model->yearexpensereport($fa,$aa);
$data['b4finyeartotal']=$this->dahsboard_Model->yearbeforetotal($b4oneyear,$b4twoyear);
//$data['b4finyeartotal']=$this->dahsboard_Model->yearbeforetotal($b4oneyear,$b4twoyear);
$data['yearlybalances']=$this->dahsboard_Model->getYearlyOpeningAmt($prev_year);
//$this->loadviews("cashbookyearlyreport",$this->global,$data, NULL);

View File

@ -1445,7 +1445,7 @@ ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)))
- round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
pb.FilePath as file
im.file as ifile,pb.FilePath as file
from T_IGR_Master im
join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO
join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
@ -1545,7 +1545,7 @@ ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)))
- round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
pb.FilePath as file
im.file as ifile,pb.FilePath as file
from T_IGR_Master im
join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO
join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
@ -1633,7 +1633,7 @@ $sql.="group by pono,material_name,category,supplier_name";
$sql="select pono,potype,date_format(created_date,'%d-%m-%Y') as created_date,supplier_name,
sum(total) as total,file
sum(total) as total,file,ifile
from igr
where status != 'ST030'
";
@ -2258,40 +2258,83 @@ if ($cname!= ''){
}
//home--report--Day Wise Report //
function today_data($value='')
function today_data()
{
$sql="SELECT type,Sum(total) as todaydata FROM t_income_expense WHERE type = ? AND DATE(date) = CURRENT_DATE";
$query = $this->db->query($sql,array($value));
return $query->result();
$sql="SELECT sum(if(type = 'RECEIPT',total,0)) as daily_income_amt,
sum(if(type = 'PAYMENT',total,0)) as daily_expenses_amt
FROM t_income_expense
WHERE DATE(date) = CURRENT_DATE";
$query = $this->db->query($sql);
return $query->result();
}
function monthwise_data($value='')
{
$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();
}
function yearwise_data($value='')
{
if (date('m') >= 4) {
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$sql="SELECT type,sum(total) as yearlydata from t_income_expense
where
type = ? and (date >= '".$fa."-04-01' and date <= '".$aa."-03-31')";
$query = $this->db->query($sql,array($value));
return $query->result();
function monthwise_data()
{
//$sql="SELECT type,Sum(total) as monthlydata FROM t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate())";
$sql="SELECT sum(if(type = 'RECEIPT',total,0)) as monthly_income_amt,
sum(if(type = 'PAYMENT',total,0)) as monthly_expenses_amt
FROM t_income_expense
WHERE YEAR(date) = YEAR(curdate()) AND MONTH(date) = MONTH(curdate())";
$query = $this->db->query($sql);
//,array($value));
return $query->result();
}
function yearwise_data()
{
if (date('m') >= 4) {
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$sql="SELECT sum(if(type = 'RECEIPT',total,0)) as yearly_income_amt,
sum(if(type = 'PAYMENT',total,0)) as yearly_expenses_amt
FROM t_income_expense
WHERE (date >= '".$fa."-04-01' and date <= '".$aa."-03-31')";
$query = $this->db->query($sql);
return $query->result();
}
function getYearlyOpeningAmt($prev_year){
$sql="SELECT min(date),(sum(if(type = 'RECEIPT',total,0)) - sum(if(type = 'PAYMENT',total,0)) ) as opening_amt
FROM t_income_expense
WHERE date >= (select min(date) from t_income_expense) and date <= '".$prev_year."-03-31' ";
$query = $this->db->query($sql);
return $query->result();
//print_r($query->result());
}
//function monthbeforetotal($month,$year){
function getMonthlyOpeningAmt($dateformat){
$sql="SELECT month('".$dateformat."') as monthnum ,year('".$dateformat."') as yearnum,
(sum(if(type = 'RECEIPT',total,0)) - sum(if(type = 'PAYMENT',total,0))) as opening_amt
FROM t_income_expense
WHERE date >= (select min(date) from t_income_expense) and date <= '".$dateformat."'";
//WHERE month(date) between (select month(min(date)) from t_income_expense) and '".$month."' and year(date) = '".$year."'";
$query = $this->db->query($sql);
return $query->result();
}
//function daybeforetotal($yesterday){
function getDailyOpeningAmt($yesterday){
$sql="select date,(sum(if(type = 'RECEIPT',total,0)) - sum(if(type = 'PAYMENT',total,0))) as opening_amt
from t_income_expense
where date between (select min(date) from t_income_expense) and '".$yesterday."'";
$query = $this->db->query($sql);
return $query->result();
}
function departmentwise($sid='',$d='',$c='')
{
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,

View File

@ -225,12 +225,14 @@ if(!empty($mms))
?></span></td>
<td style="text-align:center"><span>
<?php
if(!empty($rel->file1)){ ?>
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file1 ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
if(!empty($rel->file)){ ?>
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
<?php }else if(!empty($rel->ifile)) { ?>
<a target="_blank" href="<?php echo base_url().''. $rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
<?php
}else
{
echo 'Not Available';
echo 'Not Available';//echo 'N/A';
}
?>
</span></td>

View File

@ -321,15 +321,11 @@ table.dataTable thead > tr > td.sorting {
$tot_tot= $tot_tot + round($rel->total,2);
?>
<?php
if(!empty($rel->file)){ ?>
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
<?php
}else
{
echo number_format($rel->total,2,'.','');
}
?>
<?php }else if(!empty($rel->ifile)) { ?><!-- else if for igr file -->
<a target="_blank" href="<?php echo base_url().''.$rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
<?php }else { echo number_format($rel->total,2,'.',''); } ?><!-- both inwardpo file and Igr file empty means -->
</span></td>

View File

@ -1,9 +1,7 @@
<?php
$ti=0.00;
$tvt=0.00;
$in=0.00;
$payamt=0.00;
$recamt = 0.00;
$opening_balances = 0.00;
$zero=0.00;
$curr_balances=0.00;
$monthyr = '';
@ -11,15 +9,7 @@ $mthyr = '' ;
$monthNum = '' ;
$yearNum = '';
if(!empty($prevmonthtotal))
{
foreach ($prevmonthtotal as $prevttl){
// $payamt = $prevmonthtotal[0]->payment_amt;
$payamt = $prevttl->payment_amt;
// $recamt = $prevmonthtotal[0]->receipt_amt;
$recamt = $prevttl->receipt_amt;
}}
if(!empty($monthyearvalue))
{
$monthyr = explode("-",$monthyearvalue);
@ -28,13 +18,6 @@ $yearNum = $monthyr[1];
$dateObj = DateTime::createFromFormat('!m', $monthNum);
$monthName = $dateObj->format('F');
}
// $inrsymbol='';
// if(!empty($Indiancurrency))
// {
// foreach ($Indiancurrency as $inr)
// {
// $inrsymbol = $inr->FontCode2000;
// }}
?>
@ -138,19 +121,28 @@ $(function() {
</thead>
<tbody>
<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>&nbsp;</td>
<?php $in = $recamt-$payamt;//prevmonthincome-prevmonthexpense ?>
<td style="text-align:right"><strong><?php echo number_format($in,2,'.','') ?></strong></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>&nbsp;</td>
</tr>
<?php
if(!empty($monthlyreport)){
foreach($monthlyreport as $mr)
{
?>
@ -163,19 +155,19 @@ $(function() {
<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($in+$ti-$tvt,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>&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>
<td style="text-align:right"><strong><?php $curr_balances = $opening_balances+$ti-$tvt; echo number_format($curr_balances,2,'.','');?></strong></td>
</tr>
</tbody>
<tfoot>
@ -187,6 +179,7 @@ $(function() {
<td>&nbsp;</td>
</tr>
</tfoot>
<?php } ?>
</table>
</div>
</div>
@ -209,6 +202,9 @@ $(function() {
// 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>>",

View File

@ -1,21 +1,11 @@
<?php
$strdayttl = '';
$in=0.00;
$payamt=0.00;
$recamt = 0.00;
$opening_balances = 0.00;
$zero=0.00;
$curr_balances=0.00;
$ti=0.00;
$tvt=0.00;
// [date] => 2018-02-21 [payment_amt] => 0 [receipt_amt] => 13 ) )
if(!empty($yesterdaytotal))
{
foreach ($yesterdaytotal as $ttl)
{
$strdayttl = $ttl->date;
$payamt = $ttl->payment_amt;
$recamt = $ttl->receipt_amt;
}}
?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
@ -68,23 +58,34 @@ $tvt=0.00;
</thead>
<tbody>
<?php
if(!empty($tdy)){
if(!empty($yesterdaytotal))
{
foreach ($yesterdaytotal as $ttl)
{
$opening_balances = $ttl->opening_amt;
}}
$open = $yesterdaytotal[0]->opening_amt;
echo $open;
echo $yesterdaytotal[0]->opening_amt;
?>
<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($in,2,'.','');?></strong></td>
<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>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php
if(!empty($tdy)){
foreach($tdy as $t)
{
foreach($tdy as $t)
{
?>
<tr>
<td><span><?php echo $t->date?></span></td>
@ -105,12 +106,12 @@ $tvt=0.00;
<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($opening_balances+$ti-$tvt,2,'.',''); ?></span></td>
</tr>
<?php
}
}
?>
<tr>
<td style="text-align:left;"><strong>Total</strong></td>
@ -122,7 +123,7 @@ $tvt=0.00;
<td style="text-align:right"><strong> <?php echo number_format($tvt,2,'.','');?> </strong> </td>
<td>&nbsp;</td>
<td>&nbsp;</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 = $opening_balances+$ti-$tvt; echo number_format($curr_balances,2,'.','');?></strong></td>
</tr>
</tbody>
@ -141,6 +142,7 @@ $tvt=0.00;
<td>&nbsp;</td>
</tr>
</tfoot>
<?php } ?>
</table>
</div>
</div>
@ -159,7 +161,11 @@ $tvt=0.00;
<script>
$(document).ready(function() {
table = $('#cbdaily').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>>",

View File

@ -1,33 +1,11 @@
<?php
$inrsymbol='';
$finyear ='';
$ti=0.00;
$tvt=0.00;
$in=0.00;
$payamt=0.00;
$recamt = 0.00;
$opening_balances = 0.00;
$zero=0.00;
$curr_balances=0.00;
//print_r($fyears);
if(!empty($Indiancurrency))
{
foreach ($Indiancurrency as $inr)
{
$inrsymbol = $inr->FontCode2000;
}}
if(!empty($b4finyeartotal)){
foreach ($b4finyeartotal as $prevttl)
{
//$payamt = $b4finyeartotal[0]->payment_amt;
//$recamt = $b4finyeartotal[0]->receipt_amt;
$payamt = $prevttl->payment_amt;
$recamt = $prevttl->receipt_amt;
}}
?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
@ -110,16 +88,26 @@ if(!empty($Indiancurrency))
</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($in,2,'.','') ?></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
if(!empty($yearlyreport)){
foreach($yearlyreport as $yr)
{
?>
@ -132,18 +120,18 @@ if(!empty($Indiancurrency))
<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($in+$ti-$tvt,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 = $in+$ti-$tvt; echo number_format($curr_balances,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%">
@ -154,6 +142,8 @@ if(!empty($Indiancurrency))
<td>&nbsp;</td>
</tr>
</tfoot>
<?php } ?>
<!-- else { ?> <td style="text-align:center" colspan="4"><strong> No Data Found</strong></td> </tbody> }?> -->
</table>
</div>
</div>
@ -179,6 +169,9 @@ if(!empty($Indiancurrency))
$(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>>",

View File

@ -472,9 +472,16 @@ $('<input>').attr({
$('#IGRappend').append(trHTML);
// $('#IGRappend tr').each(function() {
// var Pending_Qty = $(this).find("td").eq(6).html();
// if( Pending_Qty == 0.00 ){
// swal('The Order is completed!!');
// //$("#IGRLink").hide();
// }
// });
}
});
@ -482,7 +489,7 @@ $('<input>').attr({
if(status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>' )
{
swal('The Order is completed!!');
swal('The Order is completed!!');
$("#IGRLink").hide();
}
else

View File

@ -7,73 +7,37 @@ $month_ex='';
$year_in='';
$year_ex='';
if(!empty($todayincome))
{
foreach ($todayincome as $ti)
{
$today_in=$ti->todaydata;
}}
$zero=0.00;
$curr_balances=0.00;
$ti=0.00;
$tvt=0.00;
$strday_balances=0.00;
if(!empty($todayexpense))
if(!empty($dailyIncomeExpense))
{
foreach ($todayexpense as $te)
foreach ($dailyIncomeExpense as $t)
{
$today_ex=$te->todaydata;
}}
if(!empty($monthlywiseincome))
{
foreach ($monthlywiseincome as $mi)
{
$month_in = $mi->monthlydata;
}}
if(!empty($monthlywiseexpense))
{
foreach ($monthlywiseexpense as $me)
{
$month_ex = $me->monthlydata;
}}
if(!empty($yearexpense))
{
foreach ($yearexpense as $ye)
{
$year_ex=$ye->yearlydata;
}}
$today_in = $t->daily_income_amt;
$today_ex = $t->daily_expenses_amt;
}}
if(!empty($yearincome))
if(!empty($monthlyIncomeExpense))
{
foreach ($yearincome as $yi)
foreach ($monthlyIncomeExpense as $m)
{
$year_in = $yi->yearlydata;
}}
// $inrsymbol='';
// if(!empty($Indiancurrency))
// {
// foreach ($Indiancurrency as $inr)
// {
// $inrsymbol = $inr->FontCode2000;
// }}
$in=0.00;
$payamt=0.00;
$recamt = 0.00;
$zero=0.00;
$curr_balances=0.00;
$ti=0.00;
$tvt=0.00;
// [date] => 2018-02-21 [payment_amt] => 0 [receipt_amt] => 13 ) )
if(!empty($yesterdaytotal))
{
foreach ($yesterdaytotal as $ttl)
{
$strdayttl = $ttl->date;
$payamt = $ttl->payment_amt;
$recamt = $ttl->receipt_amt;
}}
?>
$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;
}}
?>
@ -188,14 +152,22 @@ div.dt-buttons {
</tr>
</thead>
<tbody>
<?php if(!empty($tdy)){
if(!empty($yesterdaybalances))
{
foreach ($yesterdaybalances as $ttl)
{
$strday_balances = $ttl->opening_amt;
}}
?>
<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($in,2,'.','');?></strong></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>
@ -203,11 +175,8 @@ div.dt-buttons {
</tr>
<?php
$ti=0.00;
$tvt=0.00;
if(!empty($tdy)){
foreach($tdy as $t)
{
foreach($tdy as $t)
{
?>
<tr>
@ -236,12 +205,12 @@ div.dt-buttons {
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>
@ -253,7 +222,7 @@ div.dt-buttons {
<td style="text-align:right"><strong><?php echo number_format($tvt,2,'.','');?></strong></td>
<td>&nbsp;</td>
<td>&nbsp;</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>
@ -272,6 +241,7 @@ div.dt-buttons {
<td>&nbsp;</td>
</tr>
</tfoot>
<?php } ?>
</table>
</div>
</div><!-- /.box body-->
@ -295,6 +265,9 @@ div.dt-buttons {
$(document).ready(function() {
table = $('#dailyentries').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>>",

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB