diff --git a/resources/views/customers/v2/info.blade.php b/resources/views/customers/v2/info.blade.php index 190735c2..2cdd6f79 100644 --- a/resources/views/customers/v2/info.blade.php +++ b/resources/views/customers/v2/info.blade.php @@ -718,8 +718,29 @@ var tagarrahnbid = "{{ $cawangan_info['tagarrahnbid'] }}"; var min_komoditi = "{{ $min_komoditi }}"; console.log('test api_arrahnbid: ', api_arrahnbid); - $('#daftar_gadai').on('click', function() { + $('#daftar_gadai').on('click', async function(event) { + event.preventDefault(); + if ($(this).prop('disabled')) { + return; + } $("#daftar_gadai").prop('disabled', true); + + var bakiLelong = Number(@json((float) $bakilelong)); + if (bakiLelong > 0) { + var confirmation = await Swal.fire({ + icon: 'warning', + title: 'Baki Lelong', + text: 'Pelanggan mempunyai baki lelong, teruskan gadai?', + showCancelButton: true, + confirmButtonText: 'Teruskan', + cancelButtonText: 'Batal', + focusCancel: true + }); + if (!(confirmation.isConfirmed || confirmation.value === true)) { + $("#daftar_gadai").prop('disabled', false); + return; + } + } var noic = $('#noic').val(); var iclama = "{{ $customer_info['kplama'] }}"; var icbaru = "{{ $customer_info['kpbaru'] }}"; diff --git a/resources/views/khazanah/v2/info.blade.php b/resources/views/khazanah/v2/info.blade.php index d57458a5..cf1c3616 100644 --- a/resources/views/khazanah/v2/info.blade.php +++ b/resources/views/khazanah/v2/info.blade.php @@ -665,7 +665,15 @@ var taglel = ''; if(gadai_detail['taglel'] == 1){ if(tagarrahnbid == 1){ - taglel = gadai_detail['t_lelong']; + $.ajax({ + method: "GET", + async: false, + url: api_arrahnbid + 'portalApi', + data: { norujukan: gadai_detail['norujukan'] }, + success: function(data) { + taglel = (data && data.lelong && data.lelong.t_lelong) || ''; + } + }); } else { $.ajax({ method:"GET", @@ -722,9 +730,15 @@ var taglel = ''; if(gadai_detail['taglel'] == 1){ if(tagarrahnbid == 1){ - if(gadai_detail['t_lelong'] != null) { - taglel = gadai_detail['t_lelong']; - } + $.ajax({ + method: "GET", + async: false, + url: api_arrahnbid + 'portalApi', + data: { norujukan: gadai_detail['norujukan'] }, + success: function(data) { + taglel = (data && data.lelong && data.lelong.t_lelong) || ''; + } + }); } else { $.ajax({ method:"GET",