@extends('layouts/acc_layout') @section('title', '| Receipt Payment Statement') @section('content') @include('successMsg') @php function printOpeningBalance($data) { if ($data['voucherTypeSelected']==2) { if ($data['searchMethodSelected']==1){ echo " ASSET ". " OPENING BALANCE ".number_format(0,2)." ".number_format(0,2)." ". " CASH IN HAND ".number_format(0,2)." ".number_format(0,2)." ". " CASH AT BANK ".number_format(0,2)." ".number_format(0,2)." " ; } else if($data['searchMethodSelected']==2){ echo " ASSET ". " OPENING BALANCE ".number_format(0,2)." ".number_format(0,2)." ". " CASH IN HAND ".number_format(0,2)." ".number_format(0,2)." ". " CASH AT BANK ".number_format(0,2)." ".number_format(0,2)." " ; } else if ($data['searchMethodSelected']==3) { echo " ASSET ". " OPENING BALANCE ".number_format(0,2)." ". " CASH IN HAND ".number_format(0,2)." ". " CASH AT BANK ".number_format(0,2)." " ; } } //If It is not only JV else{ $startDate = $data['startDate']; $endDate = $data['endDate']; $currectFiscalYearId = DB::table('gnr_fiscal_year')->where('fyStartDate','<=',$startDate)->where('fyEndDate','>=',$startDate)->value('id'); //previous fiscal year id $currentFiscalYearStartDate = DB::table('gnr_fiscal_year')->where('id',$currectFiscalYearId)->value('fyStartDate'); $dateToCompare = date('Y-m-d', strtotime('-1 day', strtotime($currentFiscalYearStartDate))); $previousfiscalYearId = DB::table('gnr_fiscal_year')->where('fyEndDate',$dateToCompare)->value('id'); //previous previous fiscal year id $previousfiscalYearStartDate = DB::table('gnr_fiscal_year')->where('id',$previousfiscalYearId)->value('fyStartDate'); $dateToCompareTwo = date('Y-m-d', strtotime('-1 day', strtotime($previousfiscalYearStartDate))); $previousPreviousfiscalYearId = DB::table('gnr_fiscal_year')->where('fyEndDate',$dateToCompareTwo)->value('id'); //Cash Type Ledgers $cashTypeLedgers = DB::table('acc_account_ledger')->where('accountTypeId',4)->pluck('id')->toArray(); //Bank Type Ledgers $bankTypeLedgers = DB::table('acc_account_ledger')->where('accountTypeId',5)->pluck('id')->toArray(); // IF Search By Fiscal Year if ($data['searchMethodSelected']==1) { if ($previousfiscalYearId!=null) { $cashInHandForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); if ($previousPreviousfiscalYearId!=null) { $cashInHandForPreviousFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousPreviousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInHandForPreviousFiscalYear = 0; } } else{ $cashInHandForCurrentFiscalYear = 0; $cashInHandForPreviousFiscalYear = 0; } if ($previousfiscalYearId!=null) { $cashInBankForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); if ($previousPreviousfiscalYearId!=null) { $cashInBankForPreviousFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousPreviousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInBankForPreviousFiscalYear = 0; } } else{ $cashInBankForCurrentFiscalYear = 0; $cashInBankForPreviousFiscalYear = 0; } if ($data['voucherTypeSelected']==2) { $cashInHandForPreviousFiscalYear = 0; $cashInBankForPreviousFiscalYear = 0; $cashInHandForCurrentFiscalYear = 0; $cashInBankForCurrentFiscalYear = 0; } if ($data['roundUpSelected']==1) { echo " ASSET ". " OPENING BALANCE ".number_format($cashInHandForPreviousFiscalYear+$cashInBankForPreviousFiscalYear,2)." ".number_format($cashInHandForCurrentFiscalYear+$cashInBankForCurrentFiscalYear,2)." ". " CASH IN HAND ".number_format($cashInHandForPreviousFiscalYear,2)." ".number_format($cashInHandForCurrentFiscalYear,2)." ". " CASH AT BANK ".number_format($cashInBankForPreviousFiscalYear,2)." ".number_format($cashInBankForCurrentFiscalYear,2)." " ; } else{ echo " ASSET ". " OPENING BALANCE ".number_format($cashInHandForPreviousFiscalYear+$cashInBankForPreviousFiscalYear,2,'.','')." ".number_format($cashInHandForCurrentFiscalYear+$cashInBankForCurrentFiscalYear,2,'.','')." ". " CASH IN HAND ".number_format($cashInHandForPreviousFiscalYear,2,'.','')." ".number_format($cashInHandForCurrentFiscalYear,2,'.','')." ". " CASH AT BANK ".number_format($cashInBankForPreviousFiscalYear,2,'.','')." ".number_format($cashInBankForCurrentFiscalYear,2,'.','')." " ; } } // IF Search By Current Year elseif ($data['searchMethodSelected']==2) { if ($previousfiscalYearId!=null) { $cashInHandForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInHandForCurrentFiscalYear = 0; } if ($previousfiscalYearId!=null) { $cashInBankForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInBankForCurrentFiscalYear = 0; } $obThisMonth = $cashInHandForCurrentFiscalYear+$data['thisMonthTransactionOfCashTypeDebit']-$data['thisMonthTransactionOfCashTypeCredit']+$cashInBankForCurrentFiscalYear+$data['thisMonthTransactionOfBankTypeDebit']-$data['thisMonthTransactionOfBankTypeCredit']; $obThisYear = $cashInHandForCurrentFiscalYear+$cashInBankForCurrentFiscalYear; if ($data['roundUpSelected']==1) { echo " ASSET ". " OPENING BALANCE ".number_format($obThisMonth,2)." ".number_format($obThisYear,2)." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisMonthTransactionOfCashTypeDebit']-$data['thisMonthTransactionOfCashTypeCredit'],2)." ".number_format($cashInHandForCurrentFiscalYear,2)." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisMonthTransactionOfBankTypeDebit']-$data['thisMonthTransactionOfBankTypeCredit'],2)." ".number_format($cashInBankForCurrentFiscalYear,2)." " ; } else{ echo " ASSET ". " OPENING BALANCE ".number_format($obThisMonth,2,'.','')." ".number_format($obThisYear,2,'.','')." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisMonthTransactionOfCashTypeDebit']-$data['thisMonthTransactionOfCashTypeCredit'],2,'.','')." ".number_format($cashInHandForCurrentFiscalYear,2,'.','')." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisMonthTransactionOfBankTypeDebit']-$data['thisMonthTransactionOfBankTypeCredit'],2,'.','')." ".number_format($cashInBankForCurrentFiscalYear,2,'.','')." " ; } } // IF Search By Date Range elseif ($data['searchMethodSelected']==3) { if ($previousfiscalYearId!=null) { $cashInHandForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInHandForCurrentFiscalYear = 0; } if ($previousfiscalYearId!=null) { $cashInBankForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInBankForCurrentFiscalYear = 0; } $obThisPeriod = $cashInHandForCurrentFiscalYear+$data['thisPeriodTransactionOfCashTypeDebit']-$data['thisPeriodTransactionOfCashTypeCredit']+$cashInBankForCurrentFiscalYear+$data['thisPeriodTransactionOfBankTypeDebit']-$data['thisPeriodTransactionOfBankTypeCredit']; if ($data['roundUpSelected']==1) { echo " ASSET ". " OPENING BALANCE ".number_format($obThisPeriod,2)." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisPeriodTransactionOfCashTypeDebit']-$data['thisPeriodTransactionOfCashTypeCredit'],2)." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisPeriodTransactionOfBankTypeDebit']-$data['thisPeriodTransactionOfBankTypeCredit'],2)." " ; } else{ echo " ASSET ". " OPENING BALANCE ".number_format($obThisPeriod,2,'.','')." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisPeriodTransactionOfCashTypeDebit']-$data['thisPeriodTransactionOfCashTypeCredit'],2,'.','')." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisPeriodTransactionOfBankTypeDebit']-$data['thisPeriodTransactionOfBankTypeCredit'],2,'.','')." " ; } } } } function printClosingBalance($data) { if ($data['voucherTypeSelected']==2) { if ($data['searchMethodSelected']==1) { echo " ASSET ". " CLOSING BALANCE ".number_format(0,2)." ".number_format(0,2)." ". " CASH IN HAND ".number_format(0,2)." ".number_format(0,2)." ". " CASH AT BANK ".number_format(0,2)." ".number_format(0,2)." " ; } else if ($data['searchMethodSelected']==2) { echo " ASSET ". " CLOSING BALANCE ".number_format(0,2)." ".number_format(0,2)." ".number_format(0,2)." ". " CASH IN HAND ".number_format(0,2)." ".number_format(0,2)." ".number_format(0,2)." ". " CASH AT BANK ".number_format(0,2)." ".number_format(0,2)." ".number_format(0,2)." " ; } else if ($data['searchMethodSelected']==3) { echo " ASSET ". " CLOSING BALANCE ".number_format(0,2)." ". " CASH IN HAND ".number_format(0,2)." ". " CASH AT BANK ".number_format(0,2)." " ; } } //If not search by Only JV else{ $startDate = $data['startDate']; $endDate = $data['endDate']; $currectFiscalYearId = DB::table('gnr_fiscal_year')->where('fyStartDate','<=',$startDate)->where('fyEndDate','>=',$startDate)->value('id'); //previous fiscal year id $currentFiscalYearStartDate = DB::table('gnr_fiscal_year')->where('id',$currectFiscalYearId)->value('fyStartDate'); $dateToCompare = date('Y-m-d', strtotime('-1 day', strtotime($currentFiscalYearStartDate))); $previousfiscalYearId = DB::table('gnr_fiscal_year')->where('fyEndDate',$dateToCompare)->value('id'); //previous previous fiscal year id $previousfiscalYearStartDate = DB::table('gnr_fiscal_year')->where('id',$previousfiscalYearId)->value('fyStartDate'); $dateToCompareTwo = date('Y-m-d', strtotime('-1 day', strtotime($previousfiscalYearStartDate))); $previousPreviousfiscalYearId = DB::table('gnr_fiscal_year')->where('fyEndDate',$dateToCompareTwo)->value('id'); //Cash Type Ledgers $cashTypeLedgers = DB::table('acc_account_ledger')->where('accountTypeId',4)->pluck('id')->toArray(); //Bank Type Ledgers $bankTypeLedgers = DB::table('acc_account_ledger')->where('accountTypeId',5)->pluck('id')->toArray(); // IF Search By Fiscal Year if ($data['searchMethodSelected']==1) { if ($previousfiscalYearId!=null) { $cashInHandForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); if ($previousPreviousfiscalYearId!=null) { $cashInHandForPreviousFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousPreviousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInHandForPreviousFiscalYear = 0; } } else{ $cashInHandForCurrentFiscalYear = 0; $cashInHandForPreviousFiscalYear = 0; } if ($previousfiscalYearId!=null) { $cashInBankForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); if ($previousPreviousfiscalYearId!=null) { $cashInBankForPreviousFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousPreviousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInBankForPreviousFiscalYear = 0; } } else{ $cashInBankForCurrentFiscalYear = 0; $cashInBankForPreviousFiscalYear = 0; } //Transaction $previousFiscalYearCashDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['previousfiscalYearVouchers'])->whereIn('debitAcc',$cashTypeLedgers)->sum('amount'); $previousFiscalYearCashCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['previousfiscalYearVouchers'])->whereIn('creditAcc',$cashTypeLedgers)->sum('amount'); $previousFiscalYearCash = $previousFiscalYearCashDebit - $previousFiscalYearCashCredit; $previousFiscalYearBankDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['previousfiscalYearVouchers'])->whereIn('debitAcc',$bankTypeLedgers)->sum('amount'); $previousFiscalYearBankCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['previousfiscalYearVouchers'])->whereIn('creditAcc',$bankTypeLedgers)->sum('amount'); $previousFiscalYearBank = $previousFiscalYearBankDebit - $previousFiscalYearBankCredit; $currentFiscalYearCahDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('debitAcc',$cashTypeLedgers)->sum('amount'); $currentFiscalYearCashCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('creditAcc',$cashTypeLedgers)->sum('amount'); $currentFiscalYearCash = $currentFiscalYearCahDebit - $currentFiscalYearCashCredit; $currentFiscalYearBankDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('debitAcc',$bankTypeLedgers)->sum('amount'); $currentFiscalYearBankCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('creditAcc',$bankTypeLedgers)->sum('amount'); $currentFiscalYearBank = $currentFiscalYearBankDebit - $currentFiscalYearBankCredit; //End Transaction if ($data['roundUpSelected']==1) { echo " ASSET ". " CLOSING BALANCE ".number_format($cashInHandForPreviousFiscalYear+$previousFiscalYearCash+$cashInBankForPreviousFiscalYear+$previousFiscalYearBank,2)." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash+$cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2)." ". " CASH IN HAND ".number_format($cashInHandForPreviousFiscalYear+$previousFiscalYearCash,2)." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash,2)." ". " CASH AT BANK ".number_format($cashInBankForPreviousFiscalYear+$previousFiscalYearBank,2)." ".number_format($cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2)." " ; } else{ echo " ASSET ". " CLOSING BALANCE ".number_format($cashInHandForPreviousFiscalYear+$previousFiscalYearCash+$cashInBankForPreviousFiscalYear+$previousFiscalYearBank,2,'.','')." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash+$cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2,'.','')." ". " CASH IN HAND ".number_format($cashInHandForPreviousFiscalYear+$previousFiscalYearCash,2,'.','')." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash,2,'.','')." ". " CASH AT BANK ".number_format($cashInBankForPreviousFiscalYear+$previousFiscalYearBank,2,'.','')." ".number_format($cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2,'.','')." " ; } } // IF Search By Current Year elseif ($data['searchMethodSelected']==2) { if ($previousfiscalYearId!=null) { $cashInHandForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); // echo $cashInHandForCurrentFiscalYear; // print_r($cashTypeLedgers); //348, 412 // $previousfiscalYearId = 2; // $data['projectSelected'] = 1; // print_r($data['projectTypeId']) = 1,2,3,7,8,9,10,11,12,13,14; // print_r($data['branchId'])=1; // $cashInHandForCurrentFiscalYear = 24849; } else{ $cashInHandForCurrentFiscalYear = 0; } if ($previousfiscalYearId!=null) { $cashInBankForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); // echo $data['projectSelected']."
"; // echo "
"; // print_r($data['projectTypeId']) ; // echo "
"; // print_r($data['branchId']) ; // $cashInBankForCurrentFiscalYear=1334207.76 ; // $cashInHandForCurrentFiscalYear=24849 ; // print_r($bankTypeLedgers); // print_r($cashTypeLedgers); = 348,412; // $previousfiscalYearId=2; // projectId=15; //projectType = 1, 2,3 ,7,8,9,10,11,12,13,14 } else{ $cashInBankForCurrentFiscalYear = 0; } $obThisMonth = $cashInHandForCurrentFiscalYear+$data['thisMonthTransactionOfBankTypeDebit']-$data['thisMonthTransactionOfBankTypeCredit']+$cashInBankForCurrentFiscalYear+$data['thisMonthTransactionOfCashTypeDebit']-$data['thisMonthTransactionOfCashTypeCredit']; $obThisYear = $cashInHandForCurrentFiscalYear+$cashInBankForCurrentFiscalYear; // echo $cashInHandForCurrentFiscalYear. "
"; // echo $data['thisMonthTransactionOfBankTypeDebit']. "
"; // echo $data['thisMonthTransactionOfBankTypeCredit']. "
"; // echo $data['thisMonthTransactionOfCashTypeDebit']. "
"; // echo $data['thisMonthTransactionOfCashTypeCredit']. "
"; // echo $cashInBankForCurrentFiscalYear. "
"; //Transaction $thisMonthCashDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisMonthVoucherIds'])->whereIn('debitAcc',$cashTypeLedgers)->sum('amount'); $thisMonthCashCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisMonthVoucherIds'])->whereIn('creditAcc',$cashTypeLedgers)->sum('amount'); $thisMonthCash = $thisMonthCashDebit - $thisMonthCashCredit; $thisMonthBankDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisMonthVoucherIds'])->whereIn('debitAcc',$bankTypeLedgers)->sum('amount'); $thisMonthBankCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisMonthVoucherIds'])->whereIn('creditAcc',$bankTypeLedgers)->sum('amount'); $thisMonthBank = $thisMonthBankDebit - $thisMonthBankCredit; $currentFiscalYearCahDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('debitAcc',$cashTypeLedgers)->sum('amount'); $currentFiscalYearCashCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('creditAcc',$cashTypeLedgers)->sum('amount'); $currentFiscalYearCash = $currentFiscalYearCahDebit - $currentFiscalYearCashCredit; $currentFiscalYearBankDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('debitAcc',$bankTypeLedgers)->sum('amount'); $currentFiscalYearBankCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['vouchers'])->whereIn('creditAcc',$bankTypeLedgers)->sum('amount'); $currentFiscalYearBank = $currentFiscalYearBankDebit - $currentFiscalYearBankCredit; //End Transaction if ($data['roundUpSelected']==1) { echo " ASSET ". " CLOSING BALANCE ".number_format($obThisMonth+$thisMonthCash+$thisMonthBank,2)." ".number_format($obThisYear+$currentFiscalYearCash+$currentFiscalYearBank,2)." ".number_format($obThisYear+$currentFiscalYearCash+$currentFiscalYearBank,2)." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisMonthTransactionOfCashTypeDebit']-$data['thisMonthTransactionOfCashTypeCredit']+$thisMonthCash,2)." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash,2)." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash,2)." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisMonthTransactionOfBankTypeDebit']-$data['thisMonthTransactionOfBankTypeCredit']+$thisMonthBank,2)." ".number_format($cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2)." ".number_format($cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2)." " ; } else{ echo " ASSET ". " CLOSING BALANCE ".number_format($obThisMonth+$thisMonthCash+$thisMonthBank,2,'.','')." ".number_format($obThisYear+$currentFiscalYearCash+$currentFiscalYearBank,2)." ".number_format($obThisYear+$currentFiscalYearCash+$currentFiscalYearBank,2,'.','')." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisMonthTransactionOfCashTypeDebit']-$data['thisMonthTransactionOfCashTypeCredit']+$thisMonthCash,2,'.','')." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash,2,'.','')." ".number_format($cashInHandForCurrentFiscalYear+$currentFiscalYearCash,2,'.','')." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisMonthTransactionOfBankTypeDebit']-$data['thisMonthTransactionOfBankTypeCredit']+$thisMonthBank,2,'.','')." ".number_format($cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2,'.','')." ".number_format($cashInBankForCurrentFiscalYear+$currentFiscalYearBank,2,'.','')." " ; } } // IF Search By Date Range elseif ($data['searchMethodSelected']==3) { if ($previousfiscalYearId!=null) { $cashInHandForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$cashTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInHandForCurrentFiscalYear = 0; } if ($previousfiscalYearId!=null) { $cashInBankForCurrentFiscalYear = DB::table('acc_opening_balance')->whereIn('ledgerId',$bankTypeLedgers)->where('fiscalYearId',$previousfiscalYearId)->where('projectId',$data['projectSelected'])->whereIn('projectTypeId',$data['projectTypeId'])->whereIn('branchId',$data['branchId'])->sum('balanceAmount'); } else{ $cashInBankForCurrentFiscalYear = 0; } $obThisPeriod = $cashInHandForCurrentFiscalYear+$data['thisPeriodTransactionOfCashTypeDebit']-$data['thisPeriodTransactionOfCashTypeCredit']+$cashInBankForCurrentFiscalYear+$data['thisPeriodTransactionOfBankTypeDebit']-$data['thisPeriodTransactionOfBankTypeCredit']; //Transaction $thisPeriodCashDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisPeriodVoucherIds'])->whereIn('debitAcc',$cashTypeLedgers)->sum('amount'); $thisPeriodCashCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisPeriodVoucherIds'])->whereIn('creditAcc',$cashTypeLedgers)->sum('amount'); $thisPeriodCash = $thisPeriodCashDebit - $thisPeriodCashCredit; $thisPeriodBankDebit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisPeriodVoucherIds'])->whereIn('debitAcc',$bankTypeLedgers)->sum('amount'); $thisPeriodBankCredit = DB::table('acc_voucher_details')->whereIn('voucherId',$data['thisPeriodVoucherIds'])->whereIn('creditAcc',$bankTypeLedgers)->sum('amount'); $thisPeriodBank = $thisPeriodBankDebit - $thisPeriodBankCredit; //End Transaction if ($data['roundUpSelected']==1) { echo " ASSET ". " CLOSING BALANCE ".number_format($obThisPeriod+$thisPeriodCash+$thisPeriodBank,2)." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisPeriodTransactionOfCashTypeDebit']-$data['thisPeriodTransactionOfCashTypeCredit']+$thisPeriodCash,2)." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisPeriodTransactionOfBankTypeDebit']-$data['thisPeriodTransactionOfBankTypeCredit']+$thisPeriodBank,2)." " ; } else{ echo " ASSET ". " CLOSING BALANCE ".number_format($obThisPeriod+$thisPeriodCash+$thisPeriodBank,2,'.','')." ". " CASH IN HAND ".number_format($cashInHandForCurrentFiscalYear+$data['thisPeriodTransactionOfCashTypeDebit']-$data['thisPeriodTransactionOfCashTypeCredit']+$thisPeriodCash,2,'.','')." ". " CASH AT BANK ".number_format($cashInBankForCurrentFiscalYear+$data['thisPeriodTransactionOfBankTypeDebit']-$data['thisPeriodTransactionOfBankTypeCredit']+$thisPeriodBank,2,'.','')." " ; } } } } @endphp
{{-- Print --}}
{{-- Add Ledger --}}

Receipt Payment Statement

{{--
kxghixd
--}}
{!! Form::open(['url' => 'receiptPaymentStatement','method' => 'get']) !!} @php $userBranchId = Auth::user()->branchId; @endphp @if($userBranchId==1)
{!! Form::label('', 'Project:', ['class' => 'control-label pull-left']) !!}
@endif @if($userBranchId==1)
{!! Form::label('', 'Pro. Type:', ['class' => 'control-label pull-left']) !!}
@endif @if($userBranchId==1)
{!! Form::label('', 'Branch:', ['class' => 'control-label pull-left']) !!}
@endif
{!! Form::label('', 'V. Type:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('voucherType',[''=>'Without JV',1=>'With JV',2=>'Only JV'],$voucherTypeSelected,['class'=>'form-control']) !!}
{!! Form::label('', 'Round Up:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('roundUp',[1=>'Yes',0=>'No'],$roundUpSelected,['class'=>'form-control']) !!}
{!! Form::label('depthLevel', 'Depth Level:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('depthLevel',[''=>'All',1=>'Level-1',2=>'Level-2',3=>'Level-3',4=>'Level-4'],$depthLevelSelected,['class'=>'form-control']) !!}
{!! Form::label('withZero', '\'0\' Balance:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('withZero',[''=>'Yes',1=>'No'],$withZeroSelected,['class'=>'form-control']) !!}
{!! Form::label('', 'Search By:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('searchMethod',['1'=>'Fiscal Year','2'=>'Current Year','3'=>'Date Range'],$searchMethodSelected,['id'=>'searchMethod','class'=>'form-control input-sm']) !!}
{!! Form::label('', ' ', ['class' => 'control-label']) !!}
{!! Form::text('dateFrom',$dateFromSelected,['id'=>'dateFrom','placeholder'=>'From','class'=>'form-control input-sm','readonly','style'=>'cursor:pointer']) !!}
{!! Form::text('dateTo',$dateToSelected,['id'=>'dateTo','placeholder'=>'To','class'=>'form-control input-sm','readonly','style'=>'cursor:pointer']) !!}
{!! Form::submit('Search',['id'=>'search','class'=>'btn btn-primary btn-s','style'=>'font-size:12px;']) !!}
{!! Form::close() !!}
{{-- End Filtering Group --}} @if(!$firstRequest) {{-- @php if($branchSelected===0){ $selectedBranchName = "All Branches"; } else{ $selectedBranchName = DB::table('gnr_branch')->where('id',$branchSelected)->value('name'); } $selectedProjectName = DB::table('gnr_project')->where('id',$projectSelected)->value('name'); $selectedProjectTypeName = DB::table('gnr_project_type')->where('id',$projectTypeSelected)->value('name'); @endphp --}}

Fatal error: Uncaught Error: Class "DB" not found in /home/shikkhaplus/public_html/resources_16_05_2024/views/accounting/reports/receiptPaymentStatement060618.blade.php:1546 Stack trace: #0 {main} thrown in /home/shikkhaplus/public_html/resources_16_05_2024/views/accounting/reports/receiptPaymentStatement060618.blade.php on line 1546