change hardcoded payment methods

This commit is contained in:
NyanLinHtut
2020-06-08 10:13:55 +06:30
parent 51932b8a86
commit 98ca01533e
16 changed files with 302 additions and 646 deletions

View File

@@ -600,9 +600,9 @@ $(document).ready(function(){
}
// if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
other_payment = payment_methods.find(x => payment_type.indexOf(x) >= 0)
// console.log(payment_type)
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
console.log(payment_type)
// console.log(parseInt(jQuery.inArray("MPU", payment_type)))
if (member_id && member_discount) {
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
@@ -611,7 +611,7 @@ $(document).ready(function(){
$("#credit_payment").show();
}
if(other_payment){
if(payment_type && payment_methods.some(x => payment_type.indexOf(x) >= 0)){
$("#card_payment").show();
} else{
$("#card_payment").hide();
@@ -680,9 +680,8 @@ $(document).ready(function(){
$('#pay').click(function() {
sub_total = $('#sub-total').text();
member = $('#membership_id').text();
// console.log(member)
if (other_payment && !other_payments.some(x => x[0] == other_payment && x[1] > 0 ) && sub_total != 0.0 && member) {
swal("Oops","Please Pay with " + other_payment + " Payment","warning");
if (payment_type && !other_payments.some(x => payment_type.indexOf(x[0]) >= 0 && x[1] > 0 ) && sub_total != 0.0 && member) {
swal("Oops","Please Pay with " + payment_methods.find(x => payment_type.indexOf(x) >= 0) + " Payment","warning");
} else {
$( "#loading_wrapper").show();
if($('#balance').text() > 0){