From bca4a13ac73dd5c40911e079d21854b5407a734a Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Sat, 30 Dec 2023 14:29:36 +0800 Subject: [PATCH] fix hapus auto tawarruq and add 2 decimal places in customer info --- resources/views/customers/v2/info.blade.php | 47 ++++++++++++-------- resources/views/penebusan/v2/index.blade.php | 31 ++++++------- 2 files changed, 44 insertions(+), 34 deletions(-) diff --git a/resources/views/customers/v2/info.blade.php b/resources/views/customers/v2/info.blade.php index 11b97d8..ae2c249 100644 --- a/resources/views/customers/v2/info.blade.php +++ b/resources/views/customers/v2/info.blade.php @@ -852,7 +852,7 @@ 'RM '+formatter.format(gadai_detail['bakipjm']), (((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%', gadai_detail['tempoh'], - 'RM '+ upahsemasa, + 'RM '+ formatter.format(upahsemasa), '
' + taglel + '
', ]).draw(); }else{ @@ -895,7 +895,7 @@ 'RM '+formatter.format(gadai_detail['bakipjm']), (((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%', gadai_detail['tempoh'], - 'RM '+ upahsemasa['pendapatan'], + 'RM '+ formatter.format(upahsemasa['pendapatan']), '
' + taglel + '
', ]).draw(); } @@ -2217,23 +2217,32 @@ url: api_url + '/api/gadai/hapus/' + kodcaw + '/' + id, data: { 'kodlaluan' : teller }, success:function(data){ - $.ajax({ - method:'put', - url: api_url + '/api/komuditi/batal', - dataType:'json', - data:{ - norujukan: hapusid - }, - success:function(batalkomuditi){ - swalWithBootstrapButtons.fire( - 'Hapus!', - 'Maklumat gadaian telah dihapuskan.', - 'success' - ).then(function(){ - location.reload(); - }); - } - }) + + swalWithBootstrapButtons.fire( + 'Hapus!', + 'Maklumat gadaian telah dihapuskan.', + 'success' + ).then(function(){ + location.reload(); + }); + + // $.ajax({ + // method:'put', + // url: api_url + '/api/komuditi/batal', + // dataType:'json', + // data:{ + // norujukan: hapusid + // }, + // success:function(batalkomuditi){ + // swalWithBootstrapButtons.fire( + // 'Hapus!', + // 'Maklumat gadaian telah dihapuskan.', + // 'success' + // ).then(function(){ + // location.reload(); + // }); + // } + // }) },error: function(xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert(xhr.responseText); diff --git a/resources/views/penebusan/v2/index.blade.php b/resources/views/penebusan/v2/index.blade.php index 0dd8d00..204f0ad 100644 --- a/resources/views/penebusan/v2/index.blade.php +++ b/resources/views/penebusan/v2/index.blade.php @@ -170,7 +170,7 @@
- BAKI HARGA JUALAN(RM) + BAKI HARGA JUALAN (RM)
@@ -178,7 +178,7 @@
- BAKI PEMBIAYAAN(RM) + BAKI PEMBIAYAAN (RM)
@@ -189,7 +189,7 @@
- PEMBIAYAAN ASAL(RM) + PEMBIAYAAN ASAL (RM)
@@ -197,7 +197,7 @@
- BAYARAN PEMBIAYAAN(RM) + BAYARAN PEMBIAYAAN (RM)
@@ -283,7 +283,7 @@
- TELAH DIBAYAR(RM) + TELAH DIBAYAR (RM)
@@ -294,7 +294,7 @@
- PERLU DIBAYAR(RM) + PERLU DIBAYAR (RM)
@@ -302,7 +302,7 @@
- BAYARAN PELANGGAN(RM) + BAYARAN PELANGGAN (RM)
@@ -311,7 +311,7 @@
- DUIT PELANGGAN(RM) + DUIT PELANGGAN (RM)
@@ -328,7 +328,7 @@
- TAMBAH PEMBIAYAAN(RM) + TAMBAH PEMBIAYAAN (RM)
@@ -339,7 +339,7 @@
- PERLU DIBAYAR(RM) + PERLU DIBAYAR (RM)
@@ -358,7 +358,7 @@
- PEMBIAYAAN BARU(RM) + PEMBIAYAAN BARU (RM)
@@ -372,7 +372,7 @@
- PERLU DIBAYAR(RM) + PERLU DIBAYAR (RM)
@@ -385,7 +385,7 @@
- PEMBIAYAAN BARU(RM) + PEMBIAYAAN BARU (RM)
@php if($gadai['bakipjm'] != 0){ @@ -435,7 +435,7 @@
- BAYARAN DITERIMA(RM) + BAYARAN DITERIMA (RM)
@@ -2273,7 +2273,8 @@ var marginsemasa = (jenisAT == 'hargalama') ? pinjaman_baru/nm * 100 : pinjaman_baru/nmsemasa * 100; let texting = (jenisAT != 'hargalama') ? 'Bayaran harus melebihi keuntungan dan jumlah lebihan margin' : 'Bayaran harus melebihi keuntungan'; - if(parseFloat($('#perludibayarAT').val()) < parseFloat(total.toFixed(2))){ + + if(parseFloat($('#perludibayarAT').val().replace(/[^0-9.-]+/g,"")) < parseFloat(total.toFixed(2))){ Swal.fire({ icon: 'error', title: 'Ralat Bayaran!',