Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 86525d9559 | |||
| c37abbfb65 | |||
| 6e1ce76c50 | |||
| a127b9d8ce | |||
| be96576f3d |
@@ -718,14 +718,14 @@
|
||||
var kodcaw = "{{ $cawangan_info['kodcaw'] }}";
|
||||
var tagarrahnbid = "{{ $cawangan_info['tagarrahnbid'] }}";
|
||||
var min_komoditi = "{{ $min_komoditi }}";
|
||||
$('#daftar_gadai').on('click',function(){
|
||||
$('#daftar_gadai').on('click', function() {
|
||||
$("#daftar_gadai").prop('disabled', true);
|
||||
var noic = $('#noic').val();
|
||||
var iclama = "{{ $customer_info['kplama'] }}";
|
||||
var icbaru = "{{ $customer_info['kpbaru'] }}";
|
||||
var outstanding_semasa = "{{ $outstanding_semasa }}";
|
||||
event.preventDefault();
|
||||
if(outstanding_semasa >= 300000){
|
||||
if (outstanding_semasa >= 300000) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Had Pembiayaan',
|
||||
@@ -733,55 +733,46 @@
|
||||
});
|
||||
$("#daftar_gadai").prop('disabled', false);
|
||||
event.preventDefault();
|
||||
if (outstanding_semasa >= 300000) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Had Pembiayaan',
|
||||
text: 'Outstanding Pembiayaan Pelanggan Telah Melebihi Had'
|
||||
});
|
||||
$("#daftar_gadai").prop('disabled', false);
|
||||
event.preventDefault();
|
||||
return false;
|
||||
} else {
|
||||
$.ajax({
|
||||
method: 'get',
|
||||
url: api_url + '/api/komuditi/check',
|
||||
success: function(data) {
|
||||
var check_komuditi = Object.keys(data).length;
|
||||
if (check_komuditi == 0) {
|
||||
return false;
|
||||
} else {
|
||||
$.ajax({
|
||||
method: 'get',
|
||||
url: api_url + '/api/komuditi/check',
|
||||
success: function(data) {
|
||||
var check_komuditi = Object.keys(data).length;
|
||||
if (check_komuditi == 0) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Unit Komoditi Berbaki Minima',
|
||||
text: 'Sila Hubungi Operasi Untuk Membuat Pembelian Komoditi'
|
||||
});
|
||||
$("#daftar_gadai").prop('disabled', false);
|
||||
event.preventDefault();
|
||||
return false;
|
||||
} else {
|
||||
if (Number(data['unit_komuditi']) <= min_komoditi) {
|
||||
$("#daftar_gadai").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Unit Komoditi Berbaki Minima',
|
||||
text: 'Sila Hubungi Operasi Untuk Membuat Pembelian Komoditi'
|
||||
});
|
||||
$("#daftar_gadai").prop('disabled', false);
|
||||
event.preventDefault();
|
||||
return false;
|
||||
} else {
|
||||
if (Number(data['unit_komuditi']) <= min_komoditi) {
|
||||
$("#daftar_gadai").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Unit Komoditi Berbaki Minima',
|
||||
text: 'Sila Hubungi Operasi Untuk Membuat Pembelian Komoditi'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
if (icbaru.length > 0) {
|
||||
window.location.href =
|
||||
"{{ route('gadaian', ['noic' => $customer_info['kpbaru']]) }}";
|
||||
} else {
|
||||
if (icbaru.length > 0) {
|
||||
window.location.href =
|
||||
"{{ route('gadaian', ['noic' => $customer_info['kpbaru']]) }}";
|
||||
} else {
|
||||
window.location.href =
|
||||
"{{ route('gadaian', ['noic' => $customer_info['kplama']]) }}";
|
||||
}
|
||||
window.location.href =
|
||||
"{{ route('gadaian', ['noic' => $customer_info['kplama']]) }}";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
|
||||
// here is the new selected tab id
|
||||
|
||||
Reference in New Issue
Block a user