diff --git a/app/Http/Controllers/GadaianController.php b/app/Http/Controllers/GadaianController.php index eb6e6b8..a2615fc 100644 --- a/app/Http/Controllers/GadaianController.php +++ b/app/Http/Controllers/GadaianController.php @@ -601,9 +601,8 @@ class GadaianController extends Controller $totalBayaranAnsuran = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/norujukan/total/ansuran',['norujukan'=>$id])->json(); - $totalrebate = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/reports/totalrebate',['norujukan'=>$id])->json(); + // $totalrebate = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/reports/totalrebate',['norujukan'=>$id])->json(); - // dd($wakil); $surat_wakil = []; if(sizeof($wakil) != 0) { $wakil = $wakil[0]; @@ -612,8 +611,12 @@ class GadaianController extends Controller $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); + $ujrah_rebate = $transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']; + $keuntungan_rebate = $transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']; + + if($gadai['tagbaru'] == 1) { - return view('print.resittebus_ujrah',compact('surat_wakil','totalrebate','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); + return view('print.resittebus_ujrah',compact('ujrah_rebate','keuntungan_rebate','surat_wakil','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); } else { return view('print.resittebus',compact('surat_wakil', 'transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); } diff --git a/resources/views/print/resittebus_ujrah.blade.php b/resources/views/print/resittebus_ujrah.blade.php index 11e6ced..dffc1e1 100644 --- a/resources/views/print/resittebus_ujrah.blade.php +++ b/resources/views/print/resittebus_ujrah.blade.php @@ -629,22 +629,22 @@ Keuntungan - : RM {{ number_format($penebusan['onepercent'], 2) }} + : RM {{ number_format($transaction_tebus['onepercent'],2) }} (-) Rebat Untung : RM - {{ number_format($totalrebate['onepercent'], 2) }} + {{ number_format($keuntungan_rebate,2) }} Lain-Lain Caj - : RM {{ number_format($penebusan['ujrah'], 2) }} + : RM {{ number_format($transaction_tebus['ujrah'],2) }} (-) Rebat Lain-Lain Caj : RM - {{ number_format($totalrebate['ujrah'], 2) }} + {{ number_format($ujrah_rebate, 2) }} @@ -859,22 +859,22 @@ Keuntungan - : RM {{ number_format($penebusan['onepercent'], 2) }} + : RM {{ number_format($transaction_tebus['onepercent'], 2) }} (-) Rebat Untung : RM - {{ number_format($totalrebate['onepercent'], 2) }} + {{ number_format($keuntungan_rebate, 2) }} Lain-Lain Caj - : RM {{ number_format($penebusan['ujrah'], 2) }} + : RM {{ number_format($transaction_tebus['ujrah'], 2) }} (-) Rebat Lain-Lain Caj : RM - {{ number_format($totalrebate['ujrah'], 2) }} + {{ number_format($ujrah_rebate, 2) }}