From 53038b358d8b0d43dc835cf6251eb656e0f75205 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 26 Nov 2025 15:54:26 +0800 Subject: [PATCH] Bug fixes were applied to receipt A and T for both non-ujrah and ujrah --- app/Http/Controllers/ResitController.php | 15 ++++--- resources/views/resit/resitansuran.blade.php | 17 ++++--- .../views/resit/resitansuran_ujrah.blade.php | 10 ++--- resources/views/resit/resittebus.blade.php | 4 +- .../views/resit/resittebus_ujrah.blade.php | 45 +++++++++---------- 5 files changed, 43 insertions(+), 48 deletions(-) diff --git a/app/Http/Controllers/ResitController.php b/app/Http/Controllers/ResitController.php index 0472600..de1a507 100644 --- a/app/Http/Controllers/ResitController.php +++ b/app/Http/Controllers/ResitController.php @@ -23,8 +23,6 @@ class ResitController extends Controller $transaction = Http::get(config('api.url') . '/api/transaction/id/'. $id)->json(); - $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - if(sizeof($transaction) != 0) $transaction = $transaction[0]; @@ -35,13 +33,15 @@ class ResitController extends Controller $customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json(); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/' . $gadai['kodcaw'])->json(); + $wakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getwakil/' . $auth_user['cawangan'] . '/code/' . $transaction['nowakil'])->json(); if($gadai['tagbaru'] == 1){ - return view('resit.resitansuran_ujrah',compact('transaction','gadai','customers_info')); + return view('resit.resitansuran_ujrah',compact('transaction','gadai','customers_info','cawangan_info','wakil')); }else{ - return view('resit.resitansuran',compact('transaction','gadai','customers_info')); + return view('resit.resitansuran',compact('transaction','gadai','customers_info','cawangan_info','wakil')); } } @@ -136,6 +136,8 @@ class ResitController extends Controller $transaction = Http::get(config('api.url') . '/api/transaction/'. $id)->json(); + $transaction_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/one/'. $id)->json(); + foreach($transaction as $trans) { $totaltransaction += $trans['duit_masuk']; @@ -152,6 +154,7 @@ class ResitController extends Controller $totalBayaranAnsuran = Http::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(); $surat_wakil = []; if(sizeof($wakil) != 0) { $wakil = $wakil[0]; @@ -163,10 +166,10 @@ class ResitController extends Controller $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); if($gadai['tagbaru'] == 1){ - return view('resit.resittebus_ujrah',compact('surat_wakil','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); + return view('resit.resittebus_ujrah',compact('transaction','transaction_tebus','totalrebate','khazanah_user','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); }else{ - return view('resit.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); + return view('resit.resittebus',compact('transaction','transaction_tebus','totalrebate','khazanah_user','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); } } diff --git a/resources/views/resit/resitansuran.blade.php b/resources/views/resit/resitansuran.blade.php index cea6591..05b7010 100644 --- a/resources/views/resit/resitansuran.blade.php +++ b/resources/views/resit/resitansuran.blade.php @@ -440,14 +440,13 @@ hr.new5 { -DiSemak - - Cagaran Di Keluarkan - - Cagaran Diterima - - Ar-Rahn
{{ Auth::user()->name }} - + DiSemak + + Cagaran Di Keluarkan + + Cagaran Diterima + + Ar-Rahn
{{ optional(Auth::user())->name ?? '' }} @@ -549,7 +548,7 @@ hr.new5 { Cagaran Diterima - Ar-Rahn
{{ Auth::user()->name }} + Ar-Rahn
{{ optional(Auth::user())->name ?? '' }} diff --git a/resources/views/resit/resitansuran_ujrah.blade.php b/resources/views/resit/resitansuran_ujrah.blade.php index 1fbf275..6994440 100644 --- a/resources/views/resit/resitansuran_ujrah.blade.php +++ b/resources/views/resit/resitansuran_ujrah.blade.php @@ -546,12 +546,11 @@ Teller - - + {{-- {{ $customers_info['nama'] }} {{ Auth::user()->name }} - + --}}
@@ -670,12 +669,11 @@ Teller - - + {{-- {{ $customers_info['nama'] }} {{ Auth::user()->name }} - + --}} diff --git a/resources/views/resit/resittebus.blade.php b/resources/views/resit/resittebus.blade.php index 9030924..aa53475 100644 --- a/resources/views/resit/resittebus.blade.php +++ b/resources/views/resit/resittebus.blade.php @@ -473,7 +473,7 @@ hr.new5 { - + @@ -575,7 +575,7 @@ hr.new5 { - + diff --git a/resources/views/resit/resittebus_ujrah.blade.php b/resources/views/resit/resittebus_ujrah.blade.php index 845c742..9b2a1bc 100644 --- a/resources/views/resit/resittebus_ujrah.blade.php +++ b/resources/views/resit/resittebus_ujrah.blade.php @@ -629,22 +629,22 @@ - + - + + {{ number_format($totalrebate['ujrah'], 2) }} @@ -683,17 +683,14 @@ - - + {{-- --}} + {{-- --}} - - - - - - - - + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} {{-- --}} + {{-- --}}
Cagaran Diterima Ar-Rahn
{{ Auth::user()->name }}
Ar-Rahn
{{ optional(Auth::user())->name ?? '' }}
Cagaran Diterima Ar-Rahn
{{ Auth::user()->name }}
Ar-Rahn
{{ optional(Auth::user())->name ?? '' }}
Keuntungan: RM {{ number_format($transaction_tebus['onepercent'], 2) }}: RM {{ number_format($penebusan['onepercent'], 2) }}
(-) Rebat Untung : RM - {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} + {{ number_format($totalrebate['onepercent'], 2) }}
Lain-Lain Caj: RM {{ number_format($transaction_tebus['ujrah'], 2) }} : RM {{ number_format($penebusan['ujrah'], 2) }}
(-) Rebat Lain-Lain Caj : RM - {{ number_format(($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }}
Khazanah
{{ Auth::user()->name }}
{{ Auth::user()->name }}{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} {{ $khazanah_user->name }}
{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} {{ $khazanah_user->name }}{{ $khazanah_user->name ?? '' }}

@@ -859,22 +856,22 @@ Keuntungan - : RM {{ number_format($transaction_tebus['onepercent'], 2) }} + : RM {{ number_format($penebusan['onepercent'], 2) }} (-) Rebat Untung : RM - {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} + {{ number_format($totalrebate['onepercent'], 2) }} Lain-Lain Caj - : RM {{ number_format($transaction_tebus['ujrah'], 2) }} + : RM {{ number_format($penebusan['ujrah'], 2) }} (-) Rebat Lain-Lain Caj : RM - {{ number_format($($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }} + {{ number_format($totalrebate['ujrah'], 2) }} @@ -914,16 +911,14 @@ Khazanah - + {{-- {{ Auth::user()->name }} {{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} - - {{ $khazanah_user->name }} - - - - + --}} + {{-- {{ $khazanah_user->name }} --}} + {{-- {{ $khazanah_user->name ?? '-' }} + --}}