Add laporan keseluruhan ringkasan harian

This commit is contained in:
Afiq Hamzah
2023-12-28 16:52:04 +08:00
parent f8c76a8466
commit 18bec1c507
8 changed files with 1671 additions and 5 deletions
+5 -5
View File
@@ -23,7 +23,7 @@ class OnePercentService
public function getTotalRounded($type='B',$start = '2023-12-14',$end = '2023-12-14'){
if($type == 'B'){
if($type == 'B'){
$rounded = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function($join)
{
@@ -37,19 +37,19 @@ class OnePercentService
$rounded = TransaksiKeuntungan::on('mysql7')
->whereDate('tarikh_bayaran','>=',$start)
->whereDate('tarikh_bayaran','<=',$end)
->sum('rounded');;
->sum('rounded');;
}
return $rounded;
}
public function getTotalKeuntungan($type = 'B',$start = '2023-12-14',$end = '2023-12-14') : Float{
public function getTotalKeuntungan($type = 'B',$start = '2023-12-14',$end = '2023-12-14') : Float{
if($type == 'B'){
$akrual = Gadai::on($this->cawangan['mysql'])->where([['sttebus',''],['tagbaru',1]])->sum('tunggakanonepercent');
$norujukan = Gadai::on($this->cawangan['mysql'])->where('sttebus','T')->where('tagbaru',1)->pluck('norujukan');
$keuntungan = TransaksiKeuntungan::on('mysql7')
->whereIn('norujukan',$norujukan)
->sum('onepercent_rebet');
@@ -99,5 +99,5 @@ class OnePercentService
return $totalujrah;
}
}