change query for credit sales
This commit is contained in:
@@ -980,10 +980,13 @@
|
||||
|
||||
if(parseInt(jQuery.inArray("Credit", type)) == -1){
|
||||
if (parseInt(jQuery.inArray("MPU", type)) != -1 || parseInt(jQuery.inArray("VISA", type)) != -1 || parseInt(jQuery.inArray("JCB", type)) != -1 || parseInt(jQuery.inArray("Master", type)) != -1 || parseInt(jQuery.inArray("UNIONPAY", type)) != -1 || parseInt(jQuery.inArray("Redeem", type)) != -1 || parseInt(jQuery.inArray("PAYMAL",type))!= -1) {
|
||||
if(!location.pathname.includes("credit_payment")){
|
||||
calculate_member_discount(sale_id,"Card",tax_type);
|
||||
|
||||
}
|
||||
}else{
|
||||
calculate_member_discount(sale_id,"Cash",tax_type);
|
||||
if(!location.pathname.includes("credit_payment")){
|
||||
calculate_member_discount(sale_id,"Cash",tax_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
||||
|
||||
@@ -803,7 +803,7 @@ var pdf_view = '<%=@pdf_view%>';
|
||||
var card = $('#card').text();
|
||||
|
||||
var tax_type = localStorage.getItem("tax_type") ? localStorage.getItem("tax_type") : 'all';
|
||||
if (credit <= 0) {
|
||||
if (credit <= 0 && (!location.pathname.includes("credit_payment"))) {
|
||||
calculate_member_discount(sale_id,tax_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -967,10 +967,13 @@ $(".choose_payment").on('click', function () {
|
||||
// type = $('.payment_method').val();
|
||||
if(parseInt(jQuery.inArray("Credit", type)) == -1){
|
||||
if (parseInt(jQuery.inArray("MPU", type)) != -1 || parseInt(jQuery.inArray("VISA", type)) != -1 || parseInt(jQuery.inArray("JCB", type)) != -1 || parseInt(jQuery.inArray("Master", type)) != -1 || parseInt(jQuery.inArray("UNIONPAY", type)) != -1 || parseInt(jQuery.inArray("Redeem", type)) != -1 || parseInt(jQuery.inArray("PAYMAL", type)) != -1) {
|
||||
calculate_member_discount(sale_id,"Card",tax_type);
|
||||
|
||||
if(!location.pathname.includes("credit_payment")){
|
||||
calculate_member_discount(sale_id,"Card",tax_type);
|
||||
}
|
||||
}else{
|
||||
calculate_member_discount(sale_id,"Cash",tax_type);
|
||||
if(!location.pathname.includes("credit_payment")){
|
||||
calculate_member_discount(sale_id,"Cash",tax_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
||||
|
||||
Reference in New Issue
Block a user