credit payment function

This commit is contained in:
phyusin
2018-07-10 18:12:25 +06:30
parent d0118d2cfc
commit bf0f76ebc7
29 changed files with 879 additions and 462 deletions

View File

@@ -228,8 +228,8 @@ $(document).on('turbolinks:load', function() {
});
$(document).on("click", ".credit_detail",function(){
var sale_payment_id = $(this).attr("data-id");
window.location.href = "/origami/cashier/credit_sales/"+sale_payment_id;
var sale_id = $(this).attr("data-id");
window.location.href = "/origami/cashier/credit_sales/"+sale_id;
});
});
@@ -391,7 +391,11 @@ function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amo
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/"+payment_type;
var url_param = "payment";
if(location.pathname.includes("credit_payment")){
url_param = "credit_payment";
}
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/"+url_param+"/others_payment/"+payment_type;
});
}
}
@@ -415,7 +419,11 @@ function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amoun
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment";
var url_param = "payment";
if(location.pathname.includes("credit_payment")){
url_param = "credit_payment";
}
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/"+url_param;
});
}
}
@@ -435,8 +443,12 @@ function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amoun
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/"+payment_type;
});
var url_param = "payment";
if(location.pathname.includes("credit_payment")){
url_param = "credit_payment";
}
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/"+url_param+"/others_payment/"+payment_type;
});
}
}
//end CB ECR integration
@@ -555,7 +567,7 @@ function getCreditSales(filter, customer){
var receipt_date = sale_date.getFullYear() +'-'+ (sale_date.getMonth() > 10 ? sale_date.getMonth() : '0' + sale_date.getMonth()) +'-'+ (sale_date.getDate() > 10 ? sale_date.getDate() : '0' + sale_date.getDate());
$('.tbd_credit_lists').append(html_credit_items.formatUnicorn({
'key':i,
'sale_payment_id':credit_sales[i].sale_payment_id,
'sale_id':credit_sales[i].sale_id,
'receipt_date':receipt_date +" "+timeFormat(sale_date),
'receipt_no':credit_sales[i].receipt_no,
'cashier_name':credit_sales[i].cashier_name,