Merged in bugfix/resit-ujrah (pull request #345)

Bugfix/resit ujrah
This commit is contained in:
Muhd hafifie
2025-12-02 12:12:47 +00:00
2 changed files with 14 additions and 11 deletions
+6 -3
View File
@@ -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'));
}
@@ -629,22 +629,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>
@@ -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>