fix the defined variable ujrah_rebate and keuntungan_rebate

This commit is contained in:
Cyclone
2025-11-28 23:15:31 +08:00
parent 98ad8a585e
commit 94abeef80b
2 changed files with 13 additions and 11 deletions
+5 -3
View File
@@ -601,7 +601,7 @@ 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 = [];
@@ -612,10 +612,12 @@ class GadaianController extends Controller
$khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first();
$transaction_keuntungan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/transaksi_keuntungan_latest/'. $id)->json();
$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('transaction_keuntungan','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','totalrebate','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'));
}
@@ -629,22 +629,22 @@
</tr>
<tr>
<td style="width:10px">Keuntungan</td>
<td style="width:10px">: RM {{ number_format($transaction_keuntungan['onepercent'],2) }}</td>
<td style="width:10px">: RM {{ number_format($transaction_tebus['onepercent'],2) }}</td>
</tr>
<tr>
<td style="width:10px">(-) Rebat Untung</td>
<td style="width:10px">: RM
{{ number_format(($transaction_keuntungan['onepercent'] - $transaction_keuntungan['onepercent_rebet']),2) }}
{{ number_format($keuntungan_rebate,2) }}
</td>
</tr>
<tr>
<td style="width:10px">Lain-Lain Caj</td>
<td style="width:10px">: RM {{ number_format($transaction_keuntungan['ujrah'],2) }} </td>
<td style="width:10px">: RM {{ number_format($transaction_tebus['ujrah'],2) }} </td>
</tr>
<tr>
<td style="width:10px">(-) Rebat Lain-Lain Caj</td>
<td style="width:10px">: RM
{{ number_format(($transaction_keuntungan['ujrah'] - $transaction_keuntungan['ujrah_rebet']), 2) }} </td>
{{ number_format($ujrah_rebate, 2) }} </td>
</tr>
<tr>
<td></td>
@@ -859,22 +859,22 @@
</tr>
<tr>
<td style="width:10px">Keuntungan</td>
<td style="width:10px">: RM {{ number_format($penebusan['onepercent'], 2) }}</td>
<td style="width:10px">: RM {{ number_format($transaction_tebus['onepercent'], 2) }}</td>
</tr>
<tr>
<td style="width:10px">(-) Rebat Untung</td>
<td style="width:10px">: RM
{{ number_format($totalrebate['onepercent'], 2) }}
{{ number_format($keuntungan_rebate, 2) }}
</td>
</tr>
<tr>
<td style="width:10px">Lain-Lain Caj</td>
<td style="width:10px">: RM {{ number_format($penebusan['ujrah'], 2) }} </td>
<td style="width:10px">: RM {{ number_format($transaction_tebus['ujrah'], 2) }} </td>
</tr>
<tr>
<td style="width:10px">(-) Rebat Lain-Lain Caj</td>
<td style="width:10px">: RM
{{ number_format($totalrebate['ujrah'], 2) }} </td>
{{ number_format($ujrah_rebate, 2) }} </td>
</tr>
<tr>
<td></td>