update table box

This commit is contained in:
Aung Myo
2018-02-06 09:52:27 +06:30
parent 76a094972e
commit 85020d91bf
15 changed files with 173 additions and 79 deletions

View File

@@ -128,15 +128,16 @@
</div>
</div>
<script>
var cashier_type = "<%= @cashier_type %>";
// Bill Request
$(document).ready(function () {
$(".update").on('click', function () {
var sale_item_id = $(this).attr('data-id');
var qty = $('#' + sale_item_id + "_qty").val();
var price = $('#' + sale_item_id + "_price").val();
var qty = $('#' + sale_item_id + "_qty").val();
var price = $('#' + sale_item_id + "_price").val();
console.log(qty + "|" + price)
var ajax_url = "/origami/item_edit";
var ajax_url = "/origami/item_edit";
$.ajax({
type: "POST",
url: ajax_url,
@@ -196,7 +197,12 @@
$('#back').on('click', function () {
var table_id = '<%= @table_id %>'
window.location.href = '/origami/table/' + table_id;
var sale_id = "<%= @saleobj.sale_id %>"
if (cashier_type=="quick_service") {
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{
window.location.href = '/origami/table/' + table_id;
}
})
$('#cancel_all_void').on('click', function () {
@@ -221,7 +227,12 @@
url: ajax_url,
data: 'sale_id=' + sale_id,
success: function (result) {
window.location.href = '/origami/table/' + table_id;
if (cashier_type=="quick_service") {
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{
window.location.href = '/origami/table/' + table_id;
}
}
});
})