route changes

This commit is contained in:
San Wai Lwin
2018-03-13 14:51:07 +06:30
parent 694feb9c06
commit 9228168ebc
49 changed files with 1906 additions and 707 deletions

View File

@@ -201,49 +201,48 @@
console.log(amount);
console.log($("#validamount").attr("value"));
$("#reference_no_Err").html("");
if(reference_no.length > 0){
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text();
// var member_discount = $('#member_discount').text();
// if (member_id && member_discount) {
// $.ajax({
// type: "POST",
// url: "/origami/" + sale_id + "/member_discount",
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
// success:function(result){
// }
// });
// }
//end member discount
var bank_integration = "<%= @bank_integration %>";
if(bank_integration == '1'){
$("#reference_no").val("");
pay_withBank("SALE", "visa", amount, sale_id, receipt_no);
}
else{
$.ajax({type: "POST",
url: "<%= origami_payment_visa_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text();
// var member_discount = $('#member_discount').text();
// if (member_id && member_discount) {
// $.ajax({
// type: "POST",
// url: "/origami/" + sale_id + "/member_discount",
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
// success:function(result){
// }
// });
// }
//end member discount
var bank_integration = "<%= @bank_integration %>";
if(bank_integration == '1'){
pay_withBank("SALE", "visa", amount, sale_id, receipt_no,cashier_type);
}
else{
$.ajax({type: "POST",
url: "<%= origami_payment_visa_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}
});
}
}else{
}
});
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
@@ -253,5 +252,5 @@
}else{
$("#reference_no_Err").html("can't be blank");
}
})
});
</script>