diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php index 083e053..9876021 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/info.blade.php @@ -1083,17 +1083,17 @@ } }else if($("input[name='options']:checked").val() == 'sudah_tebus'){ - // let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text(); - // let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0); + let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text(); + let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0); - // if(+harini !== +tarikhgadai1){ - // Swal.fire({ - // icon: 'error', - // title: 'Amaran', - // text: 'Ubah Gadai Tidak Dibenarkan' - // }); - // return false; - // } + if(+harini !== +tarikhgadai1){ + Swal.fire({ + icon: 'error', + title: 'Amaran', + text: 'Ubah Gadai Tidak Dibenarkan' + }); + return false; + } } if(ubahid == null && $("input[name='options']:checked").val() == 'belum_tebus'){ @@ -1529,92 +1529,103 @@ } }); - //TIME INTERVAL - let timerInterval; + var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", { + cluster: 'ap1', + encrypted: true + }); - timerInterval = setInterval(function(){ - $.ajax({ - method:'get', - url: "{{ route('teller.getkelulusan') }}", - data: { - "norujukan" : id - }, - success:function(data){ - if(data != 0){ - clearInterval(timerInterval); - Swal.fire({ + var channel = pusher.subscribe('notice-ubahhapus'); + channel.bind('my-ubahhapus', function(data) { + + if(data.norujukan == id) + { + if(data.kelulusan == 'lulus') + { + + Swal.fire({ icon: 'success', title: 'Telah Disahkan' - }).then(function(){ + }).then(function(){ - let teller = "{{ Auth::user()->name }}"; + let teller = "{{ Auth::user()->name }}"; - if($("input[name='options']:checked").val() == 'belum_tebus'){ - $.ajax({ - method:'put', - url: api_url + '/api/gadai/hapus/' + kodcaw + '/' + hapusid, - 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(); - }); - } - }) - },error: function(xhr, status, error) { - var err = eval("(" + xhr.responseText + ")"); - alert(xhr.responseText); - } - }); - }else if($("input[name='options']:checked").val() == 'sudah_tebus'){ - $.ajax({ - method:'put', - url:api_url + '/api/tebus/hapus/' + kodcaw + '/' + hapusidsudah, - data: { 'kodlaluan' : teller }, - success:function(data){ - if(data != "Bukan-Tebus"){ + if($("input[name='options']:checked").val() == 'belum_tebus'){ + $.ajax({ + method:'put', + 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 () { + ).then(function(){ location.reload(); }); - }else{ - clearInterval(timerInterval); - swalWithBootstrapButtons.fire( - 'Amaran!', - 'Hapus Tebus Tidak Dibenarkan, Hanya untuk tebus sahaja!', - 'error' - ) } - },error: function(xhr, status, error) { - var err = eval("(" + xhr.responseText + ")"); - console.log(xhr.responseText); + }) + },error: function(xhr, status, error) { + var err = eval("(" + xhr.responseText + ")"); + alert(xhr.responseText); + } + }); + }else if($("input[name='options']:checked").val() == 'sudah_tebus'){ + $.ajax({ + method:'put', + url:api_url + '/api/tebus/hapus/' + kodcaw + '/' + id, + data: { 'kodlaluan' : teller }, + success:function(data){ + if(data != "Bukan-Tebus"){ + swalWithBootstrapButtons.fire( + 'Hapus!', + 'Maklumat gadaian telah dihapuskan.', + 'success' + ).then(function () { + location.reload(); + }); + }else{ + swalWithBootstrapButtons.fire( + 'Amaran!', + 'Hapus Tebus Tidak Dibenarkan, Hanya untuk tebus sahaja!', + 'error' + ) } - }); - } - return true; - }); - } - - },error: function(xhr, status, error) { - var err = eval("(" + xhr.responseText + ")"); - alert(xhr.responseText); + },error: function(xhr, status, error) { + var err = eval("(" + xhr.responseText + ")"); + console.log(xhr.responseText); + } + }); + } + return true; + }); } - }); - }, 3000); + else if(data.kelulusan == 'batal') + { + Swal.fire({ + icon: 'warning', + title: 'Telah Dibatalkan', + text: `Komen : ${data.komen}` + }).then(function(){ + // $("#terima_gadai").prop('disabled', false); + location.reload(); + return false; + }); + } + } + + + + }); + + }else if (result.dismiss === Swal.DismissReason.cancel) { swalWithBootstrapButtons.fire( 'Batal', diff --git a/resources/views/gadaian/edit.blade.php b/resources/views/gadaian/edit.blade.php index 84d2902..53c90eb 100644 --- a/resources/views/gadaian/edit.blade.php +++ b/resources/views/gadaian/edit.blade.php @@ -27,8 +27,8 @@
- - +
+ @@ -41,6 +41,13 @@ + + + + + + +
Bil RecnoAction
Jumlah
@@ -368,7 +375,7 @@ counter, marhun_detail['recno'], marhun_detail['marhun'], - 'RM ' + formatter.format(marhun_detail['n_marhun']), + formatter.format(marhun_detail['n_marhun']), marhun_detail['karat'], formatter.format(marhun_detail['berat']), marhun_detail['nota'], @@ -379,6 +386,8 @@ counter = counter + 1; }); }); + $('#totalberattable').text(formatter.format(total_berat)); + $('#totalnilaimarhuntable').text(formatter.format(jumlah_nilai_marhun)); $('#bilangan_marhun').val(formatter.format(counter-1)); $('#jumlah_nilai_marhun').val(formatter.format(jumlah_nilai_marhun)); if (count == 1){ @@ -466,6 +475,7 @@ $.ajax({ method:'GET', url: api_url + '/api/jemas', + async:false, success:function(data){ $.each(data,function(index,jemas){ $("#marhun_edit").append(new Option(jemas['descpt'], jemas['marhun'])); diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php index 8f2e6d1..19e27b9 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/index.blade.php @@ -49,7 +49,7 @@
- +
@@ -63,6 +63,13 @@ + + + + + + +
BilTindakan
Jumlah
@@ -367,6 +374,8 @@ counter = counter + 1; }); }); + $('#totalberattable').text(formatter.format(total_berat)); + $('#totalnilaimarhuntable').text(formatter.format(jumlah_nilai_marhun)); $('#bilangan_marhun').val(formatter.format(counter-1)); $('#jumlah_nilai_marhun').val(formatter.format(jumlah_nilai_marhun)); if(total_nilai_marhun > 0 && total_nilai_marhun < 401){ diff --git a/resources/views/khazanah/info.blade.php b/resources/views/khazanah/info.blade.php index 319c9e3..fa09976 100644 --- a/resources/views/khazanah/info.blade.php +++ b/resources/views/khazanah/info.blade.php @@ -712,7 +712,10 @@ allowOutsideClick: false, allowEscapeKey: false, allowEnterKey: false, - confirmButtonText: ' Baiklah', + showConfirmButton: false, + html: "
" + + '' + + '', icon: 'error', title: 'Surat Akuan Gadaian Hilang telah dikeluarkan!' }); diff --git a/resources/views/khazanah/tebus.blade.php b/resources/views/khazanah/tebus.blade.php index f9fe130..6724113 100644 --- a/resources/views/khazanah/tebus.blade.php +++ b/resources/views/khazanah/tebus.blade.php @@ -89,7 +89,7 @@ Bil No Rujukan - Penilai + Teller Transaksi Nilai Marhun @@ -106,7 +106,7 @@ {{$ls['norujukan']}} - {{ $ls['penilai'] }} + {{ $ls['teller'] }} {{ $ls['jenistebus'] }} {{ $ls['nilaimarhun'] }} diff --git a/resources/views/print/suratgadaianhilang.blade.php b/resources/views/print/suratgadaianhilang.blade.php index 3bba116..72f6fb8 100644 --- a/resources/views/print/suratgadaianhilang.blade.php +++ b/resources/views/print/suratgadaianhilang.blade.php @@ -33,10 +33,10 @@ $daerah = Http::get($api_url . '/api/daerah/' . $poskod['koddaerah'])->json(); @endphp -

Saya, {{ $customers[0]['nama'] }}, No. K/P : @php $satu = substr($gadai[0][0]['nokp'],0,6); $dua = substr($gadai[0][0]['nokp'],6,2);$ketiga = substr($gadai[0][0]['nokp'],8); echo $satu . '-' . $dua . '-' . $ketiga; @endphp yang beralamat di {{ strtoupper($customers[0]['alamat1']) . ', ' . $customers[0]['poskod'] . ', ' . strtoupper($daerah['namadaerah']) . ', ' . strtoupper($negeri['negeri']) }} dengan sesungguhnya dan sebenarnya mengaku bahawa: -

+

Saya, {{ $customers[0]['nama'] }}, No. K/P : @php $satu = substr($gadai[0][0]['nokp'],0,6); $dua = substr($gadai[0][0]['nokp'],6,2);$ketiga = substr($gadai[0][0]['nokp'],8); echo $satu . '-' . $dua . '-' . $ketiga; @endphp yang beralamat di {{ strtoupper($customers[0]['alamat1']) . ', ' . $customers[0]['poskod'] . ', ' . strtoupper($daerah['namadaerah']) . ', ' . strtoupper($negeri['negeri']) }} dengan sesungguhnya dan sebenarnya mengaku bahawa: -

    -
  1. Surat Gadaian Ar-Rahn Cawangan @php $namacawangan = substr($cawangan_detail['namacaw'],7); $rendoh = strtolower($namacawangan);echo ucwords($rendoh); @endphp kepunyaan saya telah hilang dalam simpanan @php if(strtoupper($polis[0]['komen1']) == 'SIMPANAN') { echo '.'; }else{ echo 'kerana ' . $polis[0]['komen1'] . '.'; } @endphp Saya telah sedaya upaya berusaha mencari surat tersebut tetapi gagal menemuinya. Saya juga mengaku bahawa tidak pernah menjual atau menggadai surat tersebut kepada mana-mana institusi kewangan.
  2. +
  3. Surat Gadaian Ar-Rahn Cawangan @php $namacawangan = substr($cawangan_detail['namacaw'],7); $rendoh = strtolower($namacawangan);echo ucwords($rendoh); @endphp kepunyaan saya telah hilang dalam simpanan @php if(strtoupper($polis[0]['komen1']) == 'SIMPANAN') { echo '.'; }else{ echo 'kerana ' . $polis[0]['komen1'] . '.'; } @endphp Saya telah sedaya upaya berusaha mencari surat tersebut tetapi gagal menemuinya. Saya juga mengaku bahawa tidak pernah menjual atau menggadai surat tersebut kepada mana-mana institusi kewangan.
  1. Butir-butir mengenai kehilangan surat gadaian tersebut adalah seperti berikut: -
  2. @@ -45,22 +45,22 @@ No. Rujukan : - {{ $polis[0]['norujukan'] }} + {{ $polis[0]['norujukan'] }} Berat : - {{ $gadai[0][0]['berat'] }} gm + {{ $gadai[0][0]['berat'] }} gm Pembiayaan : - RM {{ $gadai[0][0]['pinjaman'] }} + RM {{ $gadai[0][0]['pinjaman'] }} Tarikh Gadaian : - @php $time = new DateTime($gadai[0][0]['t_gadai']); $date = $time->format('d/m/Y'); echo $date; @endphp + @php $time = new DateTime($gadai[0][0]['t_gadai']); $date = $time->format('d/m/Y'); echo $date; @endphp

    dan saya membuat akuan ini dengan kepercayaan bahwa akuan ini adalah benar, dan menurut kuasa peruntukan Akta Akuan Berkanun 1960.

    @@ -77,7 +77,7 @@ - {{ $customers[0]['nama'] }} + {{ $customers[0]['nama'] }} ) ........................................................ @@ -88,12 +88,12 @@ @endphp - di {{ strtoupper($daerah['namadaerah']) }} + di {{ strtoupper($daerah['namadaerah']) }} ) - di dalam Negeri {{ $negeri['negeri'] }} + di dalam Negeri {{ $negeri['negeri'] }} )