diff --git a/app/Http/Controllers/GadaianController.php b/app/Http/Controllers/GadaianController.php
index 01164f8..3f96867 100644
--- a/app/Http/Controllers/GadaianController.php
+++ b/app/Http/Controllers/GadaianController.php
@@ -515,6 +515,8 @@ class GadaianController extends Controller
$transaction = Http::withOptions(['verify' => config('app.api_verify')])->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'];
@@ -543,8 +545,11 @@ class GadaianController extends Controller
if(sizeof($wakil) != 0)
$wakil = $wakil[0];
- // return view('print.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran'));
- return view('print.resittebus_ujrah',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran'));
+ if($gadai['tagbaru'] == 1) {
+ return view('print.resittebus_ujrah',compact('transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran'));
+ } else {
+ return view('print.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran'));
+ }
}
public function resitbelumtebus($id)
diff --git a/resources/views/print/resittebus_ujrah.blade.php b/resources/views/print/resittebus_ujrah.blade.php
index e338cd4..d8e756a 100644
--- a/resources/views/print/resittebus_ujrah.blade.php
+++ b/resources/views/print/resittebus_ujrah.blade.php
@@ -492,33 +492,36 @@
|
|
Masa Bayaran |
- : --:--:-- |
+ @php
+ $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']);
+ $masa = date('H:i:s', $masa_bayaran);
+ @endphp
+ : {{ $masa }} |
T
-
| Baki Pembiayaan |
- : RM {{ number_format($gadai['hargajualan'], 2) }} |
+ : RM {{ number_format($penebusan['bakipjm'], 2) }} |
- | Untung |
- : RM {{ number_format($totalBayaranAnsuran, 2) }} |
+ Keuntungan |
+ : RM {{ number_format($penebusan['onepercent'], 2) }} |
| (-) Rebat Untung |
- : RM {{ number_format($gadai['bakihargajualan'], 2) }} |
+ : RM {{ number_format($transaction_tebus['onepercent_rebet'], 2) }} |
| Ujrah |
- : RM {{ number_format($penebusan['rebate'], 2) }} |
+ : RM {{ number_format($penebusan['ujrah'], 2) }} |
| (-) Rebat Ujrah |
- : RM {{ number_format($gadai['bakihargajualan'] - $penebusan['rebate'], 2) }} |
+ : RM {{ number_format($transaction_tebus['ujrah_rebet'], 2) }} |
|
@@ -530,8 +533,11 @@
|
+ @php
+ $jumlah_perlu_dibayar = $penebusan['bakipjm'] + $penebusan['onepercent'] - $transaction_tebus['onepercent_rebet'] + $penebusan['ujrah'] - $transaction_tebus['ujrah_rebet'];
+ @endphp
| Jumlah Perlu Dibayar |
- : RM XX.XX |
+ : RM {{ number_format($jumlah_perlu_dibayar, 2) }} |
@@ -637,7 +643,11 @@
|
|
Masa Bayaran |
- : --:--:-- |
+ @php
+ $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']);
+ $masa = date('H:i:s', $masa_bayaran);
+ @endphp
+ : {{ $masa }} |
@@ -647,23 +657,23 @@
| Baki Pembiayaan |
- : RM {{ number_format($gadai['hargajualan'], 2) }} |
+ : RM {{ number_format($penebusan['bakipjm'], 2) }} |
- | Untung |
- : RM {{ number_format($totalBayaranAnsuran, 2) }} |
+ Keuntungan |
+ : RM {{ number_format($penebusan['onepercent'], 2) }} |
| (-) Rebat Untung |
- : RM {{ number_format($gadai['bakihargajualan'], 2) }} |
+ : RM {{ number_format($transaction_tebus['onepercent_rebet'], 2) }} |
| Ujrah |
- : RM {{ number_format($penebusan['rebate'], 2) }} |
+ : RM {{ number_format($penebusan['ujrah'], 2) }} |
| (-) Rebat Ujrah |
- : RM {{ number_format($gadai['bakihargajualan'] - $penebusan['rebate'], 2) }} |
+ : RM {{ number_format($transaction_tebus['ujrah_rebet'], 2) }} |
|
@@ -675,8 +685,11 @@
|
+ @php
+ $jumlah_perlu_dibayar = $penebusan['bakipjm'] + $penebusan['onepercent'] - $transaction_tebus['onepercent_rebet'] + $penebusan['ujrah'] - $transaction_tebus['ujrah_rebet'];
+ @endphp
| Jumlah Perlu Dibayar |
- : RM XX.XX |
+ : RM {{ number_format($jumlah_perlu_dibayar, 2) }} |