added account service
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Reports;
|
||||
|
||||
use App\Cawangan;
|
||||
use App\imbangdugabackup;
|
||||
use App\Services\Reports\Account\GeneralLedger;
|
||||
use Carbon\Carbon;
|
||||
class AccountService{
|
||||
public function checkAccount($kodcaw,$month){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw',$kodcaw)->first();
|
||||
$date = Carbon::now()->month($month);
|
||||
$firstDay = (clone $date)->startOfMonth();
|
||||
$lastDay = (clone $date)->endOfMonth();
|
||||
$previousMonth = (clone $date)->subMonthNoOverflow()->endOfMonth();
|
||||
|
||||
$BSheetPreviousMonth = imbangdugabackup::on($cawangan['mysql'])->where('tarikh',$previousMonth->toDateString())->get();
|
||||
$BSheetCurrentMonth = imbangdugabackup::on($cawangan['mysql'])->where('tarikh',$lastDay->toDateString())->get();
|
||||
|
||||
$gledger = new GeneralLedger($kodcaw,$firstDay,$lastDay);
|
||||
$loan_given = $gledger->getPinjamanDiberi();
|
||||
$loan_tawarruq = $gledger->getPembiayaanTawarruq();
|
||||
$advance_payment = $gledger->getBayaranPendahuluan();
|
||||
$submission = $gledger->getPendahuluanSerahan();
|
||||
$cash = $gledger->getpanjar();
|
||||
$remain_auction = $gledger->BakiLelongCalculation();
|
||||
$real_profit = $gledger->getKeuntunganSebenar();
|
||||
$current_profit = $gledger->SemakanKeuntunganLejer();
|
||||
$unclaimed_money =$gledger->getwtdLejer();
|
||||
|
||||
$debit = 0;
|
||||
$credit = 0;
|
||||
|
||||
dd($loan_given,$loan_tawarruq,$advance_payment,$submission,$cash,$remain_auction,$real_profit,$current_profit,$unclaimed_money);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user