diff --git a/app/Services/PembiayaanService.php b/app/Services/PembiayaanService.php index 7e51e3f..b4ccc9c 100644 --- a/app/Services/PembiayaanService.php +++ b/app/Services/PembiayaanService.php @@ -112,13 +112,17 @@ class PembiayaanService return $formatted; } - public function getMarhunModalData($norujukan) + public function getMarhunModalData($norujukan,$tagsyarikat) { - $gadaianDetails = Http::arrahn()->get('/api/gadai/norujukan/' . $norujukan)->json()[0][0]; + $CallableHttp = $tagsyarikat == CompanyStatus::COM_PKB + ? Http::arrahn() + : Http::arrahn_koop(); + + $gadaianDetails = $CallableHttp->get('/api/gadai/norujukan/' . $norujukan)->json()[0][0]; - $attachCawanganName = function ($x) use ($gadaianDetails) { - $x['cawangan_name'] = Http::arrahn()->get('/api/cawangan/detail/' . $gadaianDetails['kodcaw'])->json()[0]['cawangan']; + $attachCawanganName = function ($x) use ($gadaianDetails,$CallableHttp) { + $x['cawangan_name'] = $CallableHttp->get('/api/cawangan/detail/' . $gadaianDetails['kodcaw'])->json()[0]['cawangan']; return $x; }; diff --git a/public/argon/js/main.js b/public/argon/js/main.js index 17f7d79..2b94b44 100644 --- a/public/argon/js/main.js +++ b/public/argon/js/main.js @@ -1,4 +1,6 @@ function loadingbtn(){ + const loader = document.getElementById('load-arrahn'); + loader.classList.remove('d-none'); $.notifyClose(); // $(this).unbind("click"); $('#background').css('display', 'block'); diff --git a/public/js/miscellaneous/cart.js b/public/js/miscellaneous/cart.js index ee6df57..85fd1a7 100644 --- a/public/js/miscellaneous/cart.js +++ b/public/js/miscellaneous/cart.js @@ -67,6 +67,8 @@ radios.forEach((radio) => { }); let deleteCarts = () => { + const loader = document.getElementById('load-arrahn'); + loader.classList.remove('d-none'); fetch('/deletecarts') .then(response => { if (!response.ok) { diff --git a/public/js/miscellaneous/navigation-trolley.js b/public/js/miscellaneous/navigation-trolley.js index 6d951eb..6dd10b4 100644 --- a/public/js/miscellaneous/navigation-trolley.js +++ b/public/js/miscellaneous/navigation-trolley.js @@ -56,6 +56,11 @@ function redirectTrolley() { redirectInput.value = 'trolley'; form.appendChild(redirectInput); document.body.appendChild(form); + + + const loader = document.getElementById('load-arrahn'); + loader.classList.remove('d-none'); + form.submit(); } diff --git a/resources/views/includes/bayaran/pembayaransag.blade.php b/resources/views/includes/bayaran/pembayaransag.blade.php index 046b600..fa5636b 100644 --- a/resources/views/includes/bayaran/pembayaransag.blade.php +++ b/resources/views/includes/bayaran/pembayaransag.blade.php @@ -41,6 +41,13 @@
+