DONE: use constant for min and max pinjaman
This commit is contained in:
@@ -412,6 +412,8 @@
|
||||
<script>
|
||||
var api_url = "{{ api_url_for_browser() }}";
|
||||
var kodcaw_ujrah = "<?php echo $cawangan_info['kodcaw'] ?>";
|
||||
const MIN_PINJAMAN = {{ \App\Http\Controllers\GadaianController::MIN_PINJAMAN }};
|
||||
const MAX_PINJAMAN = {{ \App\Http\Controllers\GadaianController::MAX_PINJAMAN }};
|
||||
$('form input').keydown(function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
@@ -1302,8 +1304,7 @@
|
||||
|
||||
function toggleCaraTerima(pinjaman) {
|
||||
var pembiayaanOnlineEnabled = $('#pembiayaan_online_enabled').val() === '1';
|
||||
// MIN PINJAMAN = 1.00
|
||||
if (pembiayaanOnlineEnabled && pinjaman >= 1 && pinjaman <= 50000) {
|
||||
if (pembiayaanOnlineEnabled && pinjaman >= MIN_PINJAMAN && pinjaman <= MAX_PINJAMAN) {
|
||||
$('#cara_terima_section').show();
|
||||
toggleBankOnlineSection();
|
||||
} else {
|
||||
@@ -1416,7 +1417,7 @@
|
||||
|
||||
async function checkDisbursementFloat(pinjaman) {
|
||||
var cara = $('input[name="cara_terima"]:checked').val() || 'TUNAI';
|
||||
if (!(pinjaman >= 5000 && pinjaman <= 50000)) {
|
||||
if (!(pinjaman >= MIN_PINJAMAN && pinjaman <= MAX_PINJAMAN)) {
|
||||
cara = 'TUNAI';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user