diff --git a/app/Http/Controllers/ResitController.php b/app/Http/Controllers/ResitController.php
index 75cbe3a..00a22d1 100644
--- a/app/Http/Controllers/ResitController.php
+++ b/app/Http/Controllers/ResitController.php
@@ -18,11 +18,13 @@ class ResitController extends Controller
public function resit($id)
{
-
+ $auth_user = Auth::user();
$totaltransaction = 0;
$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];
@@ -33,7 +35,14 @@ class ResitController extends Controller
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
- return view('resit.resitansuran',compact('transaction','gadai','customers_info'));
+ $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'));
+
+ }else{
+ return view('resit.resitansuran',compact('transaction','gadai','customers_info'));
+ }
}
public function resittebusseparuh($id)
@@ -151,10 +160,12 @@ class ResitController extends Controller
$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();
+ // $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first();
+ $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'] ?? 'dummy_cawangan')->select('name')->first() ?? (object) ['name' => 'Dummy User'];
+
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'));
+ return view('resit.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'));
diff --git a/resources/views/resit/resitansuran_ujrah.blade.php b/resources/views/resit/resitansuran_ujrah.blade.php
new file mode 100644
index 0000000..1fbf275
--- /dev/null
+++ b/resources/views/resit/resitansuran_ujrah.blade.php
@@ -0,0 +1,705 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A
+
+
+
+ | Nama |
+ : {{ $customers_info['nama'] }} |
+ |
+ |
+ |
+ No SAG |
+ : {{ $transaction['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($transaction['created_at']);
+ $date = $time->format('d/m/Y');
+ echo $date;
+ @endphp |
+
+
+ | |
+ |
+ |
+ Masa Bayaran |
+ @php
+ $masa_bayaran = strtotime($transaction['tarikh_bayaran']);
+ $masa = date('H:i:s', $masa_bayaran);
+ @endphp
+ : {{ $masa }} |
+
+
+
+
+
+
+
+
+ | Ansuran Pembiayaan |
+ : RM {{ number_format($transaction['bayaran_pembiayaan'], 2) }} |
+
+
+
+ | Keuntungan |
+ : RM {{ number_format($transaction['onepercent'], 2) }} |
+
+
+ | Lain-Lain Caj |
+ : RM {{ number_format($transaction['ujrah'], 2) }} |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ | Jumlah Bayaran |
+ @php
+ $jumlah_perlu_dibayar = $transaction['bayaran_pembiayaan'] + $transaction['bayaran_keuntungan'] + $transaction['ujrah'];
+ @endphp
+ : RM {{ number_format($transaction['duit_masuk'], 2) }} |
+
+
+ {{--
+
+ | Marhun: {{ $gadai['marhun'] }} |
+
+
--}}
+
+
+
+ | .................................................... |
+ |
+ .................................................... |
+
+
+
+ | Pelanggan |
+ |
+ Teller |
+
+
+
+ | {{ $customers_info['nama'] }} |
+ |
+ {{ Auth::user()->name }} |
+
+
+
+
+
+
+
+
+
A
+
+
+
+ | Nama |
+ : {{ $customers_info['nama'] }} |
+ |
+ |
+ |
+ No SAG |
+ : {{ $transaction['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($transaction['created_at']);
+ $date = $time->format('d/m/Y');
+ echo $date;
+ @endphp |
+
+
+
+ | |
+ |
+ |
+ Masa Bayaran |
+ @php
+ $masa_bayaran = strtotime($transaction['tarikh_bayaran']);
+ $masa = date('H:i:s', $masa_bayaran);
+ @endphp
+ : {{ $masa }} |
+
+
+
+
+
+
+
+
+ | Ansuran Pembiayaan |
+ : RM {{ number_format($transaction['bayaran_pembiayaan'], 2) }} |
+
+
+
+ | Keuntungan |
+ : RM {{ number_format($transaction['onepercent'], 2) }} |
+
+
+ | Lain-Lain Caj |
+ : RM {{ number_format($transaction['ujrah'], 2) }} |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ | Jumlah Bayaran |
+ @php
+ $jumlah_perlu_dibayar = $transaction['bayaran_pembiayaan'] + $transaction['bayaran_keuntungan'] + $transaction['ujrah'];
+ @endphp
+ : RM {{ number_format($transaction['duit_masuk'], 2) }} |
+
+
+ {{--
+
+ | Marhun: {{ $gadai['marhun'] }} |
+
+
--}}
+
+
+
+ | .................................................... |
+ |
+ .................................................... |
+
+
+
+ | Pelanggan |
+ |
+ Teller |
+
+
+
+ | {{ $customers_info['nama'] }} |
+ |
+ {{ Auth::user()->name }} |
+
+
+
+
+ | Duit Pelanggan |
+ : RM {{ number_format($transaction['duitpelanggan'], 2) }} |
+
+
+ | Jumlah Perlu Dibayar |
+ : RM {{ number_format($transaction['duit_masuk'], 2) }} |
+
+
+ | Baki |
+ : RM {{ number_format($transaction['bakipelanggan'], 2) }} |
+
+
+
+
+ | .................................................... |
+ |
+ .................................................... |
+ |
+ .................................................... |
+ |
+ .................................................... |
+
+
+