From d38c3fb62c23968732934261d68c35412e5bfa88 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Mon, 24 Nov 2025 09:59:28 +0800 Subject: [PATCH] changed resit align with the system --- app/Http/Controllers/ResitController.php | 21 +- .../views/resit/resittebus_ujrah.blade.php | 953 ++++++++++++++++++ 2 files changed, 970 insertions(+), 4 deletions(-) create mode 100644 resources/views/resit/resittebus_ujrah.blade.php diff --git a/app/Http/Controllers/ResitController.php b/app/Http/Controllers/ResitController.php index a792ba0..75cbe3a 100644 --- a/app/Http/Controllers/ResitController.php +++ b/app/Http/Controllers/ResitController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; @@ -114,7 +115,7 @@ class ResitController extends Controller public function resittebus($id) { - + $auth_user = Auth::user(); $gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $id)->json(); if(sizeof($gadai) != 0) @@ -142,10 +143,22 @@ class ResitController extends Controller $totalBayaranAnsuran = Http::get(config('api.url') . '/api/transaction/norujukan/total/ansuran',['norujukan'=>$id])->json(); - if(sizeof($wakil) != 0) - $wakil = $wakil[0]; + $surat_wakil = []; + if(sizeof($wakil) != 0) { + $wakil = $wakil[0]; + $surat_wakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getsuratwakil/' . $auth_user['cawangan'] . '/' . $id)->json(); + } - return view('resit.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); + $transaction_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/one/'. $id)->json(); + + $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); + + if($gadai['tagbaru'] == 1){ + return view('print.resittebus_ujrah',compact('surat_wakil','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); + + }else{ + return view('resit.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); + } } public function resitbelumtebus($id) diff --git a/resources/views/resit/resittebus_ujrah.blade.php b/resources/views/resit/resittebus_ujrah.blade.php new file mode 100644 index 0000000..31d2539 --- /dev/null +++ b/resources/views/resit/resittebus_ujrah.blade.php @@ -0,0 +1,953 @@ + + + + + + + + + + + + + + + +
+ +
+ KOPKB Logo + ARRAHN Logo +
+ + +
+ + {{ $cawangan_info["details_caw"] }} + +
+ + +
+ UNTUK KEGUNAAN PELANGGAN +
+
+ +
+ +
+
T
+ + + @if (sizeof($wakil) != 0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + + + + + + + + + + + + + + + + + @else + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + + + + + + + + + + @endif +
Nama Wakil:{{ $wakil['nama'] }} No SAG: {{ $gadai['norujukan'] }}
No K/P Wakil:{{ $wakil['nokp'] }} Tarikh Bayar: @php + $time = new DateTime($penebusan['t_tebus']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
No Telefon:{{ $wakil['telefon'] }} Masa Bayaran : {{ $masa }}
Alamat :{{ $wakil['alamat1'] }} Tempoh Simpan: {{ $gadai['tempoh'] }}
No Wakil:{{ sizeof($surat_wakil) == 0 ? '-' : $surat_wakil['no_surat'] }}
Nama: {{ $customers_info['nama'] }} No SAG: {{ $gadai['norujukan'] }}
No K/P : @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp Tarikh Bayar: @php + $time = new DateTime($penebusan['t_tebus']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
Masa Bayaran: {{ $masa }}
Tempoh Simpan: {{ $gadai['tempoh'] }}
+
+ + +
+ @if (sizeof($wakil) != 0) + + + + + + + + + + + + + + +
Maklumat Pelanggan
Nama:{{ $customers_info['nama'] }}
No K/P: + @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp +
+ @endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Baki Pembiayaan: RM {{ number_format($gadai['bakipjm'], 2) }}
Keuntungan: RM {{ number_format($transaction_tebus['onepercent'], 2) }}
(-) Rebat Untung: RM + {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} +
Lain-Lain Caj: RM {{ number_format($transaction_tebus['ujrah'], 2) }}
(-) Rebat Lain-Lain Caj: RM + {{ number_format(($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }}
Jumlah Bayaran: RM + {{ number_format($transaction_tebus['duit_masuk'], 2) }}
+
+ + + + +
Marhun: {{ $gadai['marhun'] }}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
.................................................... .................................................... ....................................................
Teller{{ sizeof($wakil) != 0 ? 'Wakil' : 'Pelanggan' }}Khazanah
{{ Auth::user()->name }}{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} {{ $khazanah_user->name }}
+
+ + + +
+
+ User Image + User Image +
+
+ + {{ $cawangan_info["details_caw"] }} (arOS V2) + +
+
+ UNTUK KEGUNAAN PEJABAT +
+
+
+
+
T
+ + + @if (sizeof($wakil) != 0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + + + + + + + + + + + + + + + + + @else + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + + + + + + + + + + @endif +
Nama Wakil:{{ $wakil['nama'] }} No SAG: {{ $gadai['norujukan'] }}
No K/P Wakil:{{ $wakil['nokp'] }} Tarikh Bayar: @php + $time = new DateTime($penebusan['t_tebus']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
No Telefon:{{ $wakil['telefon'] }} Masa Bayaran : {{ $masa }}
Alamat :{{ $wakil['alamat1'] }} Tempoh Simpan: {{ $gadai['tempoh'] }}
No Wakil:{{ sizeof($surat_wakil) == 0 ? '-' : $surat_wakil['no_surat'] }}
Nama: {{ $customers_info['nama'] }} No SAG: {{ $gadai['norujukan'] }}
No K/P : @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp Tarikh Bayar: @php + $time = new DateTime($penebusan['t_tebus']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
Masa Bayaran: {{ $masa }}
Tempoh Simpan: {{ $gadai['tempoh'] }}
+
+ + +
+ @if (sizeof($wakil) != 0) + + + + + + + + + + + + + + +
Maklumat Pelanggan
Nama:{{ $customers_info['nama'] }}
No K/P: + @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp +
+ @endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Baki Pembiayaan: RM {{ number_format($gadai['bakipjm'], 2) }}
Keuntungan: RM {{ number_format($transaction_tebus['onepercent'], 2) }}
(-) Rebat Untung: RM + {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} +
Lain-Lain Caj: RM {{ number_format($transaction_tebus['ujrah'], 2) }}
(-) Rebat Lain-Lain Caj: RM + {{ number_format($($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }}
Jumlah Bayaran: RM + {{ number_format($transaction_tebus['duit_masuk'], 2) }}
+
+ + + + + +
Marhun: {{ $gadai['marhun'] }}
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
.................................................... .................................................... ....................................................
Teller{{ sizeof($wakil) != 0 ? 'Wakil' : 'Pelanggan' }}Khazanah
{{ $transaction_tebus['teller'] }}{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }}{{ $khazanah_user->name }}
+ + + + + + + + + + + + + +
Duit Pelanggan: RM {{ number_format($transaction_tebus['duitpelanggan'], 2) }}
Jumlah Perlu Dibayar: RM {{ number_format($transaction_tebus['duit_masuk'], 2) }}
Baki: RM {{ number_format($transaction_tebus['bakipelanggan'], 2) }}
+ + + + + + + + + + +
.................................................... .................................................... .................................................... ....................................................
+