fix latest

This commit is contained in:
hafifierahman
2022-01-03 10:59:01 +08:00
parent 3da5630115
commit ba47124d94
2 changed files with 22 additions and 15 deletions
+8 -8
View File
@@ -1090,7 +1090,7 @@ class TebusController extends Controller
// ->join($cawangan['db_name'].'.gadai as db2','transaksi_keuntungan.norujukan','=','db2.norujukan')
->whereDate('transaksi_keuntungan.tarikh_bayaran' ,'>=', $request->mula)
->whereDate('transaksi_keuntungan.tarikh_bayaran' ,'<=', $request->hingga)
->whereYear('transaksi_keuntungan.tarikh_bayaran','=',$current->year)
// ->whereYear('transaksi_keuntungan.tarikh_bayaran','=',$current->year)
// ->whereNull('db2.hargajualan')
// ->sum('bayaran_keuntungan');
// ->get();
@@ -1112,18 +1112,18 @@ class TebusController extends Controller
$upahtebus = Tebus::on($cawangan['mysql'])
->where([['t_tebus','>=',$request->mula],['t_tebus','<=',$request->hingga],['t_tebus','>','2013-12-31']])
->whereYear('t_tebus','=',$current->year)
// ->whereYear('t_tebus','=',$current->year)
->sum('upahdibayar');
$upahlelong = Lelong::on($cawangan['mysql'])
->where([['t_jual','>=',$request->mula],['t_jual','<=',$request->hingga],['t_jual','>','2013-12-31']])
->whereYear('t_jual','=',$current->year)
// ->whereYear('t_jual','=',$current->year)
->sum('bakiupah');
$upahansur = Advansur::on($cawangan['mysql'])
->where('tarikh','>=',$request->mula)
->where('tarikh','<=',$request->hingga)
->whereYear('tarikh','=',$current->year)
// ->whereYear('tarikh','=',$current->year)
->sum('upahdibayar');
@@ -1664,7 +1664,7 @@ class TebusController extends Controller
$keuntungan_data = TransaksiKeuntungan::on('mysql7')
->whereDate('transaksi_keuntungan.tarikh_bayaran', '<=', $request->hingga)
->whereDate('transaksi_keuntungan.tarikh_bayaran' ,'<', $dateSM)
->whereYear('tarikh_bayaran','=',$current->year)
// ->whereYear('tarikh_bayaran','=',$current->year)
->where('kodcaw',$request->kodcaw)
->pluck('norujukan');
@@ -1676,13 +1676,13 @@ class TebusController extends Controller
->whereDate('tarikh_bayaran', '<=', $request->hingga)
->whereDate('tarikh_bayaran', '>=', $request->mula)
->whereDate('tarikh_bayaran' ,'<', $dateSM)
->whereYear('tarikh_bayaran','=',$current->year)
// ->whereYear('tarikh_bayaran','=',$current->year)
->sum('bayaran_keuntungan');
$keuntunganreducing_data = TransaksiKeuntungan::on('mysql7')
->whereDate('transaksi_keuntungan.tarikh_bayaran' ,'<=', $request->hingga)
->whereDate('transaksi_keuntungan.tarikh_bayaran','>=', $request->mula)
->whereYear('tarikh_bayaran','=',$current->year)
// ->whereYear('tarikh_bayaran','=',$current->year)
->where('kodcaw',$request->kodcaw)
->pluck('norujukan');
@@ -1692,7 +1692,7 @@ class TebusController extends Controller
->whereIn('norujukan',$gadaiData)
->whereDate('tarikh_bayaran' ,'<=', $request->hingga)
->whereDate('tarikh_bayaran','>=', $request->mula)
->whereYear('tarikh_bayaran','=',$current->year)
// ->whereYear('tarikh_bayaran','=',$current->year)
->sum('keuntungan_rebet');
$total = ($keuntungan + $keuntunganreducing);