remove conflict data

This commit is contained in:
phyusin
2018-03-05 16:24:45 +06:30
111 changed files with 3612 additions and 1386 deletions

View File

@@ -77,11 +77,19 @@ $(document).on('turbolinks:load', function() {
});
}
}
var table_type = '';
if (data[field]["table_type"]!=null) {
table_type = data[field]["table_type"] +'-'+data[field]["zone"]
}else{
table_type = "No Table"
}
row ='<div class="card queue_station animated " data-order-no="'+data[field]["order_id"]+'">'
+'<div class="card-block">'
+'<div class="row">'
+'<span class="col-md-4 order-zone-type font-13">'+data[field]["table_type"]+'-'+ data[field]["zone"] +'</span>'
+'<span class="col-md-4 order-zone-type font-13">'+table_type +'</span>'
+'<span class="order-zone hidden font-14">'+ data[field]["zone"] +'</span>'
+'<span class="col-md-8"><small class="float-right font-13">'+data[field]["order_id"]+'</small></span>'
+'</div>'
@@ -145,9 +153,22 @@ $(document).on('turbolinks:load', function() {
url: '/oqs/' + orderNo,
data: { 'status' : order_status },
success: function(res){
for (i = 0; i < res.length; i++) {
var data = JSON.stringify(res[i]);
// console.log(res);
for (i = 0; i < res["items"].length; i++) {
var data = JSON.stringify(res["items"][i]);
var parse_data = JSON.parse(data);
var assigned_order_items = [];
var assigned_order_item_id = '';
if(res["assigned_order_items"]!= undefined && res["assigned_order_items"]!=''){
assigned_order_items = JSON.parse(JSON.stringify(res["assigned_order_items"]));
$.each(assigned_order_items,function(key,value){
if(value[parse_data.order_items_id] != undefined){
assigned_order_item_id = value[parse_data.order_items_id];
}
});
}
// console.log(assigned_order_item_id);
var set_menu_items = parse_data.set_menu_items;
var set_instance_items = "";
if(set_menu_items!=null){
@@ -159,10 +180,18 @@ $(document).on('turbolinks:load', function() {
}
if (oqs_id > 0){
var order_item_row = "<tr id='edit_"+assigned_item_id+"' class='order-item-edit'>" +
"<td class='order-items' style='width:80%; text-align:left'>" + parse_data.item_name + set_instance_items + "</td>" +
"<td class='order-qty' style='width:20%; text-align:right'>" + parse_data.qty + "</td>" +
"</tr>";
if(assigned_order_item_id != ''){
var order_item_row = "<tr id='edit_"+assigned_order_item_id+"' class='order-item-edit'>" +
"<td class='order-items' style='width:80%; text-align:left'>" + parse_data.item_name + set_instance_items + "</td>" +
"<td class='order-qty' style='width:20%; text-align:right'>" + parse_data.qty + "</td>" +
"</tr>";
}else{
var order_item_row = "<tr>" +
"<td class='order-items' style='width:80%; text-align:left'>" + parse_data.item_name + set_instance_items + "</td>" +
"<td class='order-qty' style='width:20%; text-align:right'>" + parse_data.qty + "</td>" +
"</tr>";
}
}else{
var order_item_row = "<tr>" +
"<td class='order-items' style='width:80%; text-align:left'>" + parse_data.item_name + set_instance_items + "</td>" +
@@ -185,7 +214,7 @@ $(document).on('turbolinks:load', function() {
$(document).on('click', '.order-item-edit', function(event){
var _self = $(this); // To know in ajax return
var assigned_item_id=$(this).attr('id').substr(5);
window.location.href = '/oqs/'+ assigned_item_id + "/edit"
window.location.href = '/oqs/'+ assigned_item_id + "/edit/oqs";
});
// complete for queue item

View File

@@ -1,7 +1,7 @@
$(function() {
type = $('#type').val();
modify_order = $('#modify_order').val();
var role = $('#role').val();
type = window.location.href.indexOf("quick_service");
modify_order = window.location.href.indexOf("modify_order");
//click menu sidebar menu category
$(".product").on("click", function(){
var url = $(this).attr('data-ref');
@@ -76,8 +76,8 @@ $(function() {
}
//end show list function
//click menu sidebar menu category
// $(".menu_category").on("click", function(){
$(document).on('click', '.menu_category', function(event){
event.preventDefault();
var menu_id = $(this).attr("data-id");
var url = "get_menu_category/"+menu_id;
show_menu_item_list(url);
@@ -88,13 +88,16 @@ $(function() {
function show_menu_item_list(url_item){
var menu_list = $('.menu_items_list');
menu_list.empty();
if (modify_order=="true" && type =="true") {
url_item = '../../../addorders/'+url_item;
}if(modify_order=="false" && type =="true"){
url_item = 'addorders/'+url_item
}else{
url_item = url_item;
type = window.location.href.indexOf("quick_service");
modify_order = window.location.href.indexOf("modify_order");
if (type != -1 && modify_order != -1) {
url_item = '../../../addorders/'+url_item;
}if(modify_order == -1 && type != -1){
url_item = 'addorders/'+url_item;
}
if (type ==-1 && modify_order == -1){
url_item = url_item
}
//Start Ajax
@@ -756,10 +759,10 @@ $(function() {
e.preventDefault();
$("#oqs_loading_wrapper").show();
type = $('#type').val();
if (type == 'true') {
type = 'cashier'
type = window.location.href.indexOf("quick_service");
if (type != -1) {
type = 'quick_service'
var table_type = $('#table_type').text();
var table_id = $('#table_id').val();
var customer_id = $('#customer_id').val();
@@ -773,42 +776,45 @@ $(function() {
var booking_id = $('#booking_id').text();
var ajax_url = '../addorders/create';
}
if (!booking_id.length > 0) {
var order_items = JSON.stringify(get_order_item_rows());
if (booking_id.length > 0) {
var params = {'order_source': type, 'order_type': "dine_in",
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
'table_id': table_id,
'order_items': order_items };
}
var order_items = JSON.stringify(get_order_item_rows());
var params = {'order_source': type, 'order_type': "dine_in",
'order_items': order_items,'create_type' : "create_only" };
}else{
var params = {'order_source': type, 'order_type': "dine_in",
'customer_id': customer_id, 'guest_info': "",
'table_id': table_id,
'order_items': order_items };
if (table_id.length>0) {
$.ajax({
type: "POST",
url: ajax_url,
data: params,
dataType: "json",
success:function(result){
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
}
});
}else{
$(this).removeAttr('disabled', '');
$("#oqs_loading_wrapper").hide();
swal("Opps","Please Select Table or Room","warning");
'order_items': order_items,'create_type' : "create_only" };
}
// if (table_id.length>0 || role == 'waiter') {
$.ajax({
type: "POST",
url: ajax_url,
data: params,
dataType: "json",
success:function(result){
if (type == "quick_service") {
window.location.href = "/origami/quick_service"
}else{
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
}
}
});
// }else{
// $(this).removeAttr('disabled', '');
// $("#oqs_loading_wrapper").hide();
// swal("Opps","Please Select Table or Room","warning");
// }
});
@@ -817,9 +823,10 @@ $(function() {
$(this).attr('disabled', 'disabled');
e.preventDefault();
type = "quick_service"
modify_order = window.location.href.indexOf("modify_order");
$("#oqs_loading_wrapper").show();
console.log(modify_order)
if (modify_order == "true") {
if (modify_order !=-1) {
console.log($('#sale_id').text())
var ajax_url = '../../../quick_service/update_modify_order';
var table_type = $('#table_type').text();
@@ -835,21 +842,20 @@ $(function() {
var booking_id = $('#booking_id').text();
var sale_id = ""
}
if (!booking_id.length > 0) {
var order_items = JSON.stringify(get_order_item_rows());
if (booking_id.length > 0) {
var params = {'order_source': type, 'order_type': "dine_in",
'customer_id': customer_id, 'guest_info': "",'booking_id':booking_id,
'table_id': table_id,
'order_items': order_items };
}
var order_items = JSON.stringify(get_order_item_rows());
var params = {'order_source': type, 'order_type': "dine_in",
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
}else{
var params = {'order_source': type, 'order_type': "dine_in",
'customer_id': customer_id, 'guest_info': "",
'table_id': table_id,
'order_items': order_items,'sale_id': sale_id };
console.log(params)
'order_items': order_items,'sale_id': sale_id,'create_type': "create_pay" };
}
$.ajax({
type: "POST",
url: ajax_url,
@@ -858,7 +864,11 @@ $(function() {
success:function(result){
console.log(result)
if (result.status) {
if (result.data == null){
window.location.href = '/origami/quick_service/pending_order/' + $('#sale_id').text();
}else{
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment"
}
}
}
});
@@ -975,7 +985,7 @@ $(function() {
$("#back").on("click", function(){
var table_id = $('#table_id').text();
var table_type = $('#table_type').text();
type = $('#type').val();
type = window.location.href.indexOf("quick_service");
if (type == 'true') {
var table_type = $('#table_id').find("option:selected").data('type');
var table_id = $('#table_id').val();
@@ -1089,7 +1099,8 @@ $(function() {
//click menu sidebar menu category
$(".sub_click").on("click", function(){
$(document).on('click', '.sub_click', function(event){
event.preventDefault();
var menu_id = $(this).attr("data-id");
var url = "get_menu_sub_category/"+menu_id;
sub_category = $(this).find('.sub_category_list');
@@ -1100,11 +1111,12 @@ $(function() {
//show menu item list when click menu category
function show_sub_category_list(url,sub_category){
if (modify_order == "true" && type =="true") {
if (type != -1 && modify_order != -1) {
var url = "../../../addorders/"+url;
}if(modify_order=="false" && type =="true"){
}if(modify_order== -1 && type != -1){
var url = 'addorders/'+url;
}else{
}
if (type ==-1 && modify_order == -1){
var url = url;
}

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@@ -175,7 +175,7 @@ section.content{
text-align: center;
}
.add_icon{
.menu_item_box{
cursor: pointer;
}

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the reports/ProductSale controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/