add imbang duga api and lejeram api and fix round down

This commit is contained in:
Hafifie PKB
2023-12-05 09:27:10 +08:00
parent 1d00acd1db
commit e76a9571b1
7 changed files with 170 additions and 52 deletions
+7 -5
View File
@@ -3120,11 +3120,11 @@ class AdminPageController extends Controller
$year = $current->year;
$month = $tarikh->month;
$test = Gadai::on($cawangan['mysql'])
->whereBetween('tempoh',[0.5,1])
->where('sttebus','<>','')
->whereYear('t_gadai',$current->year())
->pluck('norujukan');
// $test = Gadai::on($cawangan['mysql'])
// ->whereBetween('tempoh',[0.5,1])
// ->where('sttebus','<>','')
// ->whereYear('t_gadai',$current->year())
// ->pluck('norujukan');
$get_norujukan = Gadai::on($cawangan['mysql'])
->selectRaw("norujukan,CASE WHEN (YEAR(t_gadai) = YEAR(t_update) and MONTH(t_gadai) = MONTH(t_update)) THEN '1' ELSE '0' END AS result")
@@ -3143,6 +3143,7 @@ class AdminPageController extends Controller
})
->whereIn('trans.norujukan',$get_norujukan)
->where('transaction.trans_type','T')
->where('onepercent','=',0)
->sum('keuntungan_rebet');
$sum_keun_ansuran = Transaction::on('mysql7')
@@ -3153,6 +3154,7 @@ class AdminPageController extends Controller
})
->whereIn('trans.norujukan',$get_norujukan)
->where('transaction.trans_type','A')
->where('onepercent','=',0)
->sum('bayaran_keuntungan');
$total = $sum_keun_tebus + $sum_keun_ansuran;