route changes
This commit is contained in:
@@ -255,14 +255,14 @@ function setCommPorts(comPortLists) {
|
||||
}
|
||||
|
||||
/** pay with CB bank **/
|
||||
function pay_withBank(cmd_type, payment_type, bnk_bill_amount,sale_id,receipt_no) {
|
||||
function pay_withBank(cmd_type, payment_type, bnk_bill_amount,sale_id,receipt_no,cashier_type) {
|
||||
$("#loading_wrapper").show();
|
||||
var com_port = $("#com_port_name").val();
|
||||
reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port);
|
||||
reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port,cashier_type);
|
||||
}
|
||||
|
||||
//add req data to card_sale_trans table
|
||||
function reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port) {
|
||||
function reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, receipt_no, com_port,cashier_type) {
|
||||
var jobj = {"cmd_type" : cmd_type, "payment_type" : "CARD", "amt" : bnk_bill_amount, "sale_id" : sale_id, "inv_no" : receipt_no, "com_port" : com_port};
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -272,14 +272,14 @@ function reqCardSaleTrans(cmd_type, payment_type, bnk_bill_amount, sale_id, rece
|
||||
success: function(data) {
|
||||
if (data.status == "success"){
|
||||
card_sale_trans_id = data.card_sale_trans_id;
|
||||
resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port);
|
||||
resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port,cashier_type);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//add res data to card_sale_trans table
|
||||
function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port) {
|
||||
function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amount, sale_id, receipt_no,com_port,cashier_type) {
|
||||
|
||||
var resMsg = "";
|
||||
var card_payment_type="";
|
||||
@@ -306,7 +306,7 @@ function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amo
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.status == "success"){
|
||||
resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port);
|
||||
resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port,cashier_type);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -317,7 +317,7 @@ function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amo
|
||||
}
|
||||
|
||||
|
||||
function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port) {
|
||||
function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port,cashier_type) {
|
||||
$("#loading_wrapper").hide();
|
||||
var jobj = $.parseJSON(resMsg);
|
||||
if(jobj.STATUS == "Approved"){
|
||||
@@ -334,7 +334,7 @@ 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 + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ 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 + "/payment/others_payment/"+payment_type;
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/"+payment_type;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user