Edit in Reference No in CB

This commit is contained in:
San Wai Lwin
2018-04-26 17:23:01 +06:30
parent d0ad95c8d6
commit 8e7fd2d747
7 changed files with 23 additions and 46 deletions

View File

@@ -361,6 +361,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,cashier_type) { 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(); $("#loading_wrapper").hide();
var jobj = $.parseJSON(resMsg); var jobj = $.parseJSON(resMsg);
$("#reference_no").val(jobj.REFNUM);
if(jobj.STATUS == "Approved"){ if(jobj.STATUS == "Approved"){
$.ajax({type: "POST", $.ajax({type: "POST",
url: "/origami/payment/"+payment_type, url: "/origami/payment/"+payment_type,

View File

@@ -204,8 +204,7 @@
var bank_integration = "<%= @bank_integration %>"; var bank_integration = "<%= @bank_integration %>";
var cashier_type = "<%= @cashier_type %>"; var cashier_type = "<%= @cashier_type %>";
$("#reference_no_Err").html(""); $("#reference_no_Err").html("");
if(reference_no.length > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click"); $(this).off("click");
//start member discount 5% by pay card //start member discount 5% by pay card
// var sub_total = $('#sub-total').text(); // var sub_total = $('#sub-total').text();
@@ -244,15 +243,12 @@
}); });
} }
}else{ }else{
if (amount>0) { if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" ); swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{ }else{
swal ( "Oops" , "Enter Amount!" , "error" ); swal ( "Oops" , "Enter Amount!" , "error" );
} }
}
}else{
$("#reference_no_Err").html("can't be blank");
} }
}) })
</script> </script>

View File

@@ -200,8 +200,7 @@ $('#jcb_pay').on('click',function(){
var receipt_no = "<%= @receipt_no %>"; var receipt_no = "<%= @receipt_no %>";
var bank_integration = "<%= @bank_integration %>"; var bank_integration = "<%= @bank_integration %>";
$("#reference_no_Err").html(""); $("#reference_no_Err").html("");
if(reference_no.length > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click"); $(this).off("click");
//start member discount 5% by pay card //start member discount 5% by pay card
// var sub_total = $('#sub-total').text(); // var sub_total = $('#sub-total').text();
@@ -247,8 +246,5 @@ $('#jcb_pay').on('click',function(){
swal ( "Oops" , "Enter Amount!" , "error" ); swal ( "Oops" , "Enter Amount!" , "error" );
} }
} }
}else{
$("#reference_no_Err").html("can't be blank");
}
}) })
</script> </script>

View File

@@ -198,7 +198,6 @@
var receipt_no = "<%= @receipt_no %>"; var receipt_no = "<%= @receipt_no %>";
var bank_integration = "<%= @bank_integration %>"; var bank_integration = "<%= @bank_integration %>";
$("#reference_no_Err").html(""); $("#reference_no_Err").html("");
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click"); $(this).off("click");
@@ -245,8 +244,5 @@
swal ( "Oops" , "Enter Amount!" , "error" ); swal ( "Oops" , "Enter Amount!" , "error" );
} }
} }
}else{
$("#reference_no_Err").html("can't be blank");
}
}) })
</script> </script>

View File

@@ -204,9 +204,8 @@
var bank_integration = "<%= @bank_integration %>"; var bank_integration = "<%= @bank_integration %>";
var cashier_type = "<%= @cashier_type %>"; var cashier_type = "<%= @cashier_type %>";
$("#reference_no_Err").html(""); $("#reference_no_Err").html("");
if(reference_no.length > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ $(this).off("click");
$(this).off("click");
//start member discount 5% by pay card //start member discount 5% by pay card
// var sub_total = $('#sub-total').text(); // var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text(); // var member_id = $('#membership_id').text();
@@ -244,15 +243,12 @@
}); });
} }
}else{ }else{
if (amount>0) { if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" ); swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{ }else{
swal ( "Oops" , "Enter Amount!" , "error" ); swal ( "Oops" , "Enter Amount!" , "error" );
} }
}
}else{
$("#reference_no_Err").html("can't be blank");
} }
}) })
</script> </script>

View File

@@ -202,7 +202,6 @@
var receipt_no = "<%= @receipt_no %>"; var receipt_no = "<%= @receipt_no %>";
$("#reference_no_Err").html(""); $("#reference_no_Err").html("");
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click"); $(this).off("click");
//start member discount 5% by pay card //start member discount 5% by pay card
@@ -250,8 +249,5 @@
swal ( "Oops" , "Enter Amount!" , "error" ); swal ( "Oops" , "Enter Amount!" , "error" );
} }
} }
}else{
$("#reference_no_Err").html("can't be blank");
}
}) })
</script> </script>

View File

@@ -202,8 +202,7 @@
console.log(amount); console.log(amount);
console.log($("#validamount").attr("value")); console.log($("#validamount").attr("value"));
$("#reference_no_Err").html(""); $("#reference_no_Err").html("");
if(reference_no.length > 0){ if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click"); $(this).off("click");
//start member discount 5% by pay card //start member discount 5% by pay card
// var sub_total = $('#sub-total').text(); // var sub_total = $('#sub-total').text();
@@ -244,14 +243,11 @@
}); });
} }
}else{ }else{
if (amount>0) { if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" ); swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{ }else{
swal ( "Oops" , "Enter Amount!" , "error" ); swal ( "Oops" , "Enter Amount!" , "error" );
}
} }
}else{
$("#reference_no_Err").html("can't be blank");
} }
}); });
</script> </script>