fix skit2

This commit is contained in:
hafifierahman
2022-01-08 11:02:16 +08:00
parent b776924e71
commit d8c0615073
7 changed files with 140 additions and 5 deletions
+7 -1
View File
@@ -660,10 +660,14 @@ class TebusController extends Controller
->whereNotNull('hargajualan');
$tebustawarruqansuran = Tebus::on($cawangan['mysql'])
->select('tebus.bakiupah','tebus.norujukan')
->join('gadai as gad','gad.norujukan','=','tebus.norujukan')
->where('t_tebus','=',$request->tarikh)
->whereNotNull('hargajualan')
->where('hargajualan','<>','bakihargajualan');
->where('hargajualan','<>','bakihargajualan')
->get()->toArray();
// dd($tebustawarruqansuran);
// $totalpenebusantawarruq = ($tebustawarruq->sum('tebus.pinjaman') - $tebustawarruqansuran->sum('gad.pinjaman')) + $tebustawarruqansuran->sum('gad.bakipjm');
$totalpenebusantawarruq = $tebustawarruq->sum('tebus.pinjaman');
@@ -671,6 +675,8 @@ class TebusController extends Controller
$totalrebatetawarruq = $tebustawarruq->sum('tebus.rebate');
$totalkeuntungantawarruq = $tebustawarruq->sum('tebus.bakiupah');
// dd($totalkeuntunganarrahn,$totalkeuntungantawarruq);
$array_penebusan = ['bilarrahn' => $bilpenebusanarrahn, 'totalarrahn' => $totalpenebusanarrahn, 'keuntunganarrahn' => $totalkeuntunganarrahn, 'biltawarruq' => $bilpenebusantawarruq, 'totaltawarruq' => $totalpenebusantawarruq,'totalrebate' => $totalrebatetawarruq,'keuntungantawarruq' => $totalkeuntungantawarruq];
return response()->json($array_penebusan);