DONE: add komoditi page for khazanah, update certs to include all three certs into one file

This commit is contained in:
2026-10-22 13:02:33 +08:00
parent f804e4211e
commit 4c1ebd751b
5 changed files with 190 additions and 8 deletions
+16 -7
View File
@@ -56,6 +56,19 @@ class KomuditiController extends Controller
return redirect()->route('komuditi');
}
/**
* Khazanah branch list of BSAS commodity orders.
*/
public function khazanahBsas()
{
$auth_user = Auth::user();
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])
->get(config('api.url') . '/api/cawangan/' . $auth_user['cawangan'])
->json();
return view('homepage.khazanah.bsas_komoditi', compact('cawangan_info'));
}
/**
* Dummy BSAS eCert layout preview (bid, OTC, STB, then one commodity schedule).
*/
@@ -193,9 +206,8 @@ class KomuditiController extends Controller
[$time, $date] = $this->splitBsasDateTime((string) ($ecert['PURCHASETIMEDATE'] ?? ''));
return $this->certificatePage(
'Certificate of Bid',
'Certificate of Purchase',
'This is to certify that the following bid transaction has been executed<br>through the Bursa Suq Al-Sila\' in accordance with the<br>Rules of Bursa Suq Al-Sila\'.',
'Generated for Ar-Rahn / Koperasi Permodalan Kelantan Berhad · BSAS Bid Certificate',
$ecert,
$orderMeta,
array_merge([
@@ -212,9 +224,8 @@ class KomuditiController extends Controller
[$time, $date] = $this->splitBsasDateTime((string) ($ecert['REPORTINGTIMEDATE'] ?? ''));
$page = $this->certificatePage(
'Certificate of Purchase',
'Certificate of Murabahah',
'This is to certify that the following transaction has been executed<br>through the Bursa Suq Al-Sila\' in accordance with the<br>Rules of Bursa Suq Al-Sila\'.',
'Generated for Ar-Rahn / Koperasi Permodalan Kelantan Berhad · BSAS OTC Certificate',
$ecert,
$orderMeta,
array_merge([
@@ -240,7 +251,6 @@ class KomuditiController extends Controller
return $this->certificatePage(
'Certificate of Sale',
'This is to certify that the following sale transaction has been executed<br>through the Bursa Suq Al-Sila\' in accordance with the<br>Rules of Bursa Suq Al-Sila\'.',
'Generated for Ar-Rahn / Koperasi Permodalan Kelantan Berhad · BSAS STB Certificate',
$ecert,
$orderMeta,
array_merge([
@@ -251,12 +261,11 @@ class KomuditiController extends Controller
);
}
protected function certificatePage(string $title, string $statement, string $footerNote, array $ecert, array $orderMeta, array $rows): array
protected function certificatePage(string $title, string $statement, array $ecert, array $orderMeta, array $rows): array
{
return [
'title' => $title,
'statement' => $statement,
'footer_note' => $footerNote,
'ecert_no' => $ecert['ECERTNO'] ?? ($orderMeta['e_cert_no'] ?? '-'),
'currency' => $ecert['CURRENCY'] ?? 'MYR',
'rows' => $rows,