diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php index 817244a..63d8f50 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/info.blade.php @@ -863,11 +863,101 @@ function cetaktuntutbaki(e) { let norujukan = $(e).data('norujukan'); - let urlroute = '{{ route("resit.tuntutbaki", ":id") }}'; - urlroute = urlroute.replace(':id', norujukan); - window.open(urlroute, '_blank'); + const swalWithBootstrapButtons = Swal.mixin({ + customClass: { + confirmButton: 'btn btn-success ml-1', + cancelButton: 'btn btn-danger' + }, + buttonsStyling: false + }); + swalWithBootstrapButtons.fire({ + title: 'Dapatkan Pengesahan PC/PPC', + text: "Kelulusan Ulang Cetak Tuntut Baki Lelong", + icon: 'info', + showCancelButton: true, + confirmButtonText: 'Hantar', + cancelButtonText: 'Batal', + reverseButtons: true + }).then((result) => { + if(result.isConfirmed) { + Swal.fire({ + title: 'Tunggu Pengesahan Daripada PC/PPC.', + icon: 'info', + width: 600, + padding: '3em', + background: '#fffff', + showCancelButton: false, + showConfirmButton: false, + allowOutsideClick: false, + allowEscapeKey: false, + allowEnterKey: false + }) + + let mohon = "Ulang Cetak Tuntut Baki"; + + $.ajax({ + method:'post', + url: '{{ route("teller.createkelulusan") }}', + data: { + "_token": "{{ csrf_token() }}", + "norujukan" : norujukan, + "mohon" : mohon + }, + success:function(data){ + },error: function(xhr, status, error) { + var err = eval("(" + xhr.responseText + ")"); + alert(xhr.responseText); + } + }); + + let teller = "{{ Auth::user()->name }}"; + + var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", { + cluster: 'ap1', + encrypted: true + }); + + var channel = pusher.subscribe('notice-ubahhapus'); + channel.bind('my-ubahhapus', function(data) { + + if(data.norujukan == norujukan && data.teller == teller) + { + if(data.kelulusan == 'lulus') + { + Swal.fire({ + icon: 'success', + title: 'Telah Disahkan' + }).then(function(){ + let urlroute = '{{ route("resit.tuntutbaki", ":id") }}'; + urlroute = urlroute.replace(':id', norujukan); + window.open(urlroute, '_blank'); + }); + + } + else if(data.kelulusan == 'batal') + { + Swal.fire({ + icon: 'warning', + title: 'Telah Dibatalkan', + text: `Komen : ${data.komen}` + }).then(function(){ + location.reload(); + return false; + }); + } + } + }); + }else if (result.dismiss === Swal.DismissReason.cancel){ + swalWithBootstrapButtons.fire( + 'Batal', + 'Tidak Berjaya Mendapatkan Pengesahan Khazanah', + 'error' + ) + } + + }); return; } @@ -905,7 +995,7 @@ }); swalWithBootstrapButtons.fire({ - title: 'Dapatkan Pengesahan Khazanah', + title: 'Dapatkan Pengesahan PC/PPC', text: "Kelulusan Tuntut Baki Lelong", icon: 'info', showCancelButton: true, @@ -915,7 +1005,7 @@ }).then((result) => { if(result.isConfirmed) { Swal.fire({ - title: 'Tunggu Pengesahan Daripada Khazanah.', + title: 'Tunggu Pengesahan Daripada PC/PPC.', icon: 'info', width: 600, padding: '3em', @@ -995,7 +1085,7 @@ Swal.fire({ icon: 'error', title: 'Amaran', - text: 'Lelongan telah dibayar!' + text: 'Lelongan telah Dituntut!' }); } @@ -1285,7 +1375,7 @@ allowOutsideClick: false, allowEscapeKey: false, allowEnterKey: false, - confirmButtonText: ' Baik Boss!', + confirmButtonText: ' OK!!', icon: 'success', title: 'Berjaya Mendaftar Wakil Pelanggan!' }).then(function(){ diff --git a/resources/views/gadaian/edit.blade.php b/resources/views/gadaian/edit.blade.php index d110758..5e5dd51 100644 --- a/resources/views/gadaian/edit.blade.php +++ b/resources/views/gadaian/edit.blade.php @@ -795,7 +795,7 @@ var pembiyaan_max_pelulus = $('#pembiyaan_max_pelulus').val(); var pembiyaan_max_pelulus = Number(pembiyaan_max_pelulus.replace(/[^0-9.-]+/g,"")); var min_pinjaman = nilai_marhun_total * 0.10; - var max_pinjaman = nilai_marhun_total * 0.80; + var max_pinjaman = pembiyaan_max_pelulus; let teller = "{{ Auth::user()->name }}"; let bakiakhir = 0; @@ -857,7 +857,7 @@ return false; } else{ - if(pinjaman >=10000){ + if(pinjaman >=10000 && pinjaman <= Number(pembiyaan_max_pelulus)){ const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', @@ -975,7 +975,7 @@ event.preventDefault(); return false; - }else if(pinjaman > Number(pembiayaan_max_teller)+10){ + }else if(pinjaman > Number(pembiayaan_max_teller)){ const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', @@ -1091,7 +1091,7 @@ event.preventDefault(); return false; } - else if(pinjaman < 10000){ + else if(pinjaman < 10000 && pinjaman <= Number(pembiayaan_max_teller)){ Swal.fire({ icon: 'success', title: 'Berjaya!', diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php index ed2d5a4..073d246 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/index.blade.php @@ -690,7 +690,7 @@ var pembiyaan_max_pelulus = $('#pembiyaan_max_pelulus').val(); var pembiyaan_max_pelulus = Number(pembiyaan_max_pelulus.replace(/[^0-9.-]+/g,"")); var min_pinjaman = nilai_marhun_total * 0.10; - var max_pinjaman = nilai_marhun_total * 0.80; + var max_pinjaman = pembiyaan_max_pelulus; var outstanding_semasa = Number("{{ $outstanding_semasa }}"); let teller = "{{ Auth::user()->name }}"; @@ -796,7 +796,7 @@ return false; } else{ - if(pinjaman >= 10000){ + if(pinjaman >= 10000 && pinjaman <= Number(pembiyaan_max_pelulus)){ const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', @@ -1039,7 +1039,7 @@ event.preventDefault(); return false; } - else if( pinjaman < 10000){ + else if( pinjaman < 10000 && pinjaman <= Number(pembiayaan_max_teller)){ Swal.fire({ icon: 'success', title: 'Berjaya!', diff --git a/resources/views/homepage/khazanah/home.blade.php b/resources/views/homepage/khazanah/home.blade.php index ed4f42c..b56e6e6 100644 --- a/resources/views/homepage/khazanah/home.blade.php +++ b/resources/views/homepage/khazanah/home.blade.php @@ -233,9 +233,6 @@ class="btn btn-info btn-lg btn-block mb-3">Kelulusan {{--