credit payment function
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-lg-1 col-sm-1">
|
||||
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/<%= @cashier_type %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
|
||||
<button type="button" class="btn bg-default btn-block" id="back"><i class="material-icons m-t--5">reply</i> Back </button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -148,7 +148,11 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+ "/payment/others_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+"/others_payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -183,8 +187,8 @@
|
||||
$('#amount').html("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
var cash=$('#amount').text() > 0 ? $('#amount').text() : 0;
|
||||
$('#amount').text((cash > 0 && cash.substr(0,cash.length-1) > 0) ? cash.substr(0,cash.length-1) : 0);
|
||||
break;
|
||||
case 'nett':
|
||||
var remain_amount = $('#validamount').val();
|
||||
@@ -225,8 +229,13 @@
|
||||
if(bank_integration == '1'){
|
||||
pay_withBank("SALE", "mpu", amount, sale_id, receipt_no,cashier_type);
|
||||
}else{
|
||||
if(location.pathname.includes("credit_payment")){
|
||||
var url = "<%= origami_credit_payment_mpu_path %>";
|
||||
}else{
|
||||
var url = "<%= origami_payment_mpu_path %>";
|
||||
}
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_mpu_path %>",
|
||||
url: url,
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
@@ -238,7 +247,11 @@
|
||||
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;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -252,6 +265,15 @@
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('#back').on('click',function(){
|
||||
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;
|
||||
// window.location.href = '/origami/sale/' + sale_id + "/cashier/payment";
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user