update quick service for payment

This commit is contained in:
Aung Myo
2018-02-02 18:03:43 +06:30
parent 3f584edbd8
commit 1d9164aaf0
24 changed files with 85 additions and 46 deletions

View File

@@ -2,7 +2,6 @@
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="card">
@@ -303,6 +302,7 @@
</div>
<script>
var cashier_type = "<%= @cashier_type %>";
$(document).ready(function(){
/* start check first bill or not*/
var member_id = $('#membership_id').text();
@@ -337,7 +337,12 @@
$("#back").on('click', function() {
localStorage.removeItem('cash');
window.location.href = '/origami/table/'+ dining_id;
if (cashier_type=="cashier") {
window.location.href = '/origami/table/'+ dining_id;
}else{
window.location.href = '/origami/quick_service';
}
});
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
@@ -407,19 +412,20 @@
});
$( document ).ready(function() {
// Disable click event cash to prevent
$(".payment .cash-color").off('click');
$('#credit_payment').click(function() {
var sale_id = $('#sale_id').text();
window.location.href = '/origami/sale/'+ sale_id + "/payment/credit_payment"
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment/credit_payment"
return false;
});
$('#card_payment').click(function() {
localStorage.setItem("cash",$('#cash').text() );
var sale_id = $('#sale_id').text();
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment"
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment/others_payment"
return false;
});
@@ -492,7 +498,11 @@
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami';
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
}
});
}else{
$('#pay').text("Pay");
@@ -504,7 +514,11 @@
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami';
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
}
});
}
}
@@ -525,7 +539,11 @@
type: 'POST',
url: ajax_url,
success: function () {
window.location.href = '/origami/';
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
}
}
})
});
@@ -573,7 +591,11 @@
title: "Information!",
text: 'Thank You !',
}, function () {
window.location.href = '/origami';
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
}
});
}