diff --git a/app/Http/Controllers/AccountStatementController.php b/app/Http/Controllers/AccountStatementController.php
new file mode 100644
index 0000000..a8a1685
--- /dev/null
+++ b/app/Http/Controllers/AccountStatementController.php
@@ -0,0 +1,66 @@
+json()[0][0];
+ $transaction = Http::get(config('api.url').'/portal/transaksipelanggan',['norujukan' => 'KB2240919-0004'])->json();
+ $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'. $gadaian['kodcaw'])->json()[0];
+ $customer = Http::get(config('api.url') . '/api/customers/' . $gadaian['nokp'])->json();
+ $poskod = Http::get(config('api.url') . '/api/poskod/' . $customer['poskod'])->json();
+
+ $accountHolder = [
+ 'name' => $customer['nama'],
+ 'address' => $customer['alamat1'] . '
' . $customer['alamat2'],
+ 'city_state_zip' => $customer['poskod'] . ', ' . $poskod['daerah']['namadaerah'] . ', ' . $poskod['negeri']['negeri'],
+ ];
+
+
+ $bankDetails = [
+ 'name' => 'PERMODALAN KELANTAN BERHAD',
+ 'address' => $cawangan['alamat1'] . '
' . $cawangan['alamat2'],
+ 'email' => 'firstcitizensbank@domain.com',
+ 'branch' => $cawangan['namacaw'],
+ ];
+
+
+ // Calculate total pages (e.g., 10 transactions per page + one row for header/footer on page 1)
+ // This is a rough estimate; the Blade file will handle the actual print pagination using CSS.
+
+ $transaction_count = count(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'A'));
+ $totalPages = ceil($transaction_count / 10);
+
+ $ansuranTransaction = array_values(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'A'));
+ $originLoan = $gadaian['pinjaman'];
+ $bakipinjaman = $originLoan;
+ $ansuranTransaction = array_map(function($trans) use(&$bakipinjaman) {
+ $bakipinjaman -= $trans['bayaran_pembiayaan'];
+ return array_merge($trans, ['bakipinjaman' => $bakipinjaman]);
+ }, $ansuranTransaction);
+
+ $tebusTransaction = array_values(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'T'))[0];
+
+
+
+ return view('accounts-statements', compact('tebusTransaction','ansuranTransaction','transaction_count','gadaian','transaction','accountHolder', 'bankDetails'));
+ }
+
+ /**
+ * Helper function to format currency.
+ * In a real app, this would be a Blade helper or filter.
+ * We'll format it directly in the view for simplicity in this example.
+ */
+}
\ No newline at end of file
diff --git a/resources/views/accounts-statements.blade.php b/resources/views/accounts-statements.blade.php
new file mode 100644
index 0000000..8c4907d
--- /dev/null
+++ b/resources/views/accounts-statements.blade.php
@@ -0,0 +1,373 @@
+
+
+
+
{!! $bankDetails['address'] !!}
+{{ $accountHolder['name'] }}
+{!! $accountHolder['address'] !!}
+{{ $accountHolder['city_state_zip'] }}
+{{ $bankDetails['branch'] }}
+Page 1 of 1
+| Tarikh | +Deskripsi | +Tempoh | +Bayaran | +Upah | +Pembiayaan | +Rebet | +Baki | +
|---|---|---|---|---|---|---|---|
| {{ date('d/m/Y', strtotime($transaction['created_at'])) }} | +{{ ($transaction['teller'] == 'Online') ? 'Bayaran Online' : 'Bayaran Kaunter' }} | ++ {{ $transaction['beza_tempoh'] }} + | ++ @if ($transaction['duit_masuk']) + {{ formatCurrency($transaction['duit_masuk']) }} + @else + - + @endif + | ++ @if ($transaction['bayaran_keuntungan']) + {{ formatCurrency($transaction['bayaran_keuntungan']) }} + @else + - + @endif + | ++ @if ($transaction['bayaran_pembiayaan']) + {{ formatCurrency($transaction['bayaran_pembiayaan']) }} + @else + - + @endif + | ++ {{ formatCurrency($transaction['bayaran_keuntungan'] - $transaction['keuntungan_rebet']) }} + | ++ {{ formatCurrency($transaction['bakipinjaman']) }} + | +
| Jumlah: | ++ {{ formatCurrency($totalBayaran) }} | ++ {{ formatCurrency($totalUpah) }} | ++ {{ formatCurrency($totalPembiayaan) }} | ++ {{ formatCurrency($totalRebet) }} | ++ | +||