From 90f0c74598ca435d442d3b357d6c3c7ed9734548 Mon Sep 17 00:00:00 2001 From: MUHD HAFIFIE Date: Tue, 5 Oct 2021 12:45:15 +0800 Subject: [PATCH] kodcaw --- app/Http/Controllers/TebusController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/TebusController.php b/app/Http/Controllers/TebusController.php index 5e46613..639d45e 100644 --- a/app/Http/Controllers/TebusController.php +++ b/app/Http/Controllers/TebusController.php @@ -952,11 +952,16 @@ class TebusController extends Controller $keuntungan_data = TransaksiKeuntungan::on('mysql7') ->where('transaksi_keuntungan.tarikh_bayaran' ,'<=', $daterequest) ->whereYear('transaksi_keuntungan.tarikh_bayaran','=',$current->year) + ->where('kodcaw',$kodcaw) ->pluck('norujukan'); $gadaiData = Gadai::on($cawangan['mysql'])->whereIn('norujukan', $keuntungan_data)->whereNull('hargajualan')->pluck('norujukan'); - $keuntungan = TransaksiKeuntungan::on('mysql7')->whereIn('norujukan',$gadaiData)->sum('bayaran_keuntungan'); + $keuntungan = TransaksiKeuntungan::on('mysql7') + ->where('tarikh_bayaran' ,'<=', $daterequest) + ->whereYear('tarikh_bayaran','=',$current->year) + ->whereIn('norujukan',$gadaiData) + ->sum('bayaran_keuntungan'); // //Keuntungan Selepas Tawarruq // $keuntungan_data = TransaksiKeuntungan::on('mysql7')