Merge branch 'foodcourt' of gitlab.com:code2lab/SXRestaurant into foodcourt
This commit is contained in:
@@ -73,10 +73,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3" >
|
||||
<button type="button" class="btn btn-lg btn-block btn-default waves-effect m-t-5" id='back'>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 item-wrapper" >
|
||||
<button type="button" class="btn btn-lg btn-block btn-default waves-effect m-t-5" id='back' style="width: 75%;">
|
||||
<i class="material-icons">reply</i>Back
|
||||
</button>
|
||||
<button type="button" class="btn btn-xs btn-danger waves-effect" id='clear_all' style="width: 23%; padding: 10px; margin-top: 5px;">Clear</button>
|
||||
|
||||
<div class="card-block">
|
||||
<div class="card-text" id="order-detail-slimscroll" data-height="140">
|
||||
@@ -87,7 +88,7 @@
|
||||
<th class="item-name">Items</th>
|
||||
<!-- <th class="item-qty">Min Qty</th>
|
||||
<th class="item-attr">Max Qty</th> -->
|
||||
<!-- <th></th> -->
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-13" >
|
||||
@@ -162,6 +163,7 @@
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#add_out_of_stock").attr("disabled","disabled");
|
||||
var menus = JSON.parse(localStorage.getItem("menus"));
|
||||
if (menus != null) {
|
||||
menu_cache_append(menus);
|
||||
@@ -470,19 +472,6 @@
|
||||
item_instance_name = item_data.attr('data-name');
|
||||
item_instance_code = item_data.attr('data-instance-code');
|
||||
|
||||
// $('#item_code').val(item_data.attr('data-item-code'));
|
||||
// $('#item_name').val(item_data.attr('data-name'));
|
||||
// $('#instance_code').val(item_data.attr('data-instance-code'));
|
||||
|
||||
// $('.attributes-list').empty();
|
||||
|
||||
// data = $(this).children().children('.menu_item_box');
|
||||
// data = $(this).parent().siblings('.add_icon');
|
||||
|
||||
// attributes = $(data).data('id');
|
||||
// selected_item = $(data).data('item');
|
||||
// instances = $(data).data('instance');
|
||||
|
||||
instance_attributes = []
|
||||
for(var field in instances) {
|
||||
value = instances[field].values;
|
||||
@@ -498,7 +487,6 @@
|
||||
$(item_row).each(function(i){
|
||||
item_name = $(item_row[i]).attr('data-item-name');
|
||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||
r_option = $(item_row[i]).attr('data-opt');
|
||||
|
||||
if (item_name == item_data.attr('data-name') && instance_code == item_data.attr('data-instance-code')) {
|
||||
|
||||
@@ -514,39 +502,37 @@
|
||||
+'<td class="">'+rowCount+'</td>'
|
||||
+'<td class="hidden" id="item_instance_code">' + item_instance_code +'</td>'
|
||||
+'<td class="">' + item_instance_name +'</td>'
|
||||
+"<td class='delete_item'> <i class='material-icons' style='cursor: pointer;'>delete</i> </td>"
|
||||
+'</tr>';
|
||||
$(".summary-items tbody").append(row);
|
||||
$(disable_item).css({"pointer-events": "none", "opacity": "0.4"});
|
||||
|
||||
|
||||
|
||||
if ($('.summary-items tbody tr').length > 0) {
|
||||
$('#add_out_of_stock').removeAttr("disabled", false);
|
||||
}else{
|
||||
$('#add_out_of_stock').attr("disabled", true);
|
||||
}
|
||||
// for(var field in attributes) {
|
||||
// value = attributes[field]["values"];
|
||||
// type = attributes[field]["type"]
|
||||
// row = "";
|
||||
//
|
||||
// $(value).each(function(i){
|
||||
// disabled = ""
|
||||
// status ="";
|
||||
// if(parseInt(jQuery.inArray(value[i], selected_item)) !== -1){
|
||||
// status = "selected-attribute";
|
||||
// }
|
||||
// if(parseInt(jQuery.inArray(value[i], instance_attributes)) == -1){
|
||||
// disabled = "disabled";
|
||||
// }
|
||||
// row +="<button type='button' id='selected-attribute' data-instances='"+JSON.stringify(instances)+"' data-type='"
|
||||
// +type+"' data-value='"+value[i]+"' class='btn btn- waves-effect attribute_btn "
|
||||
// + status +" "+ type +" '"+ disabled +" >"
|
||||
// +value[i]
|
||||
// +"</button>";
|
||||
// });
|
||||
// $(".attributes-list").append(row);
|
||||
// }
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete_item', function(event){
|
||||
item = $(this).parent('.item_box');
|
||||
item_name = item.attr('data-item-name');
|
||||
tmp = item.children().clone();
|
||||
item.remove();
|
||||
tmp.appendTo(item.parent());
|
||||
enable_item = $("div:contains("+item_name+")");
|
||||
$(enable_item).css({"pointer-events": "", "opacity": ""});
|
||||
});
|
||||
|
||||
$(document).on('click', '#clear_all', function(event){
|
||||
item_row = $(".summary-items tbody tr");
|
||||
$(item_row).each(function(i){
|
||||
item_name = $(item_row[i]).attr('data-item-name');
|
||||
enable_item = $("div:contains("+item_name+")");
|
||||
$(enable_item).css({"pointer-events": "", "opacity": ""});
|
||||
});
|
||||
$(".summary-items tbody").empty();
|
||||
$("#add_out_of_stock").attr("disabled","disabled");
|
||||
});
|
||||
|
||||
$('#add_out_of_stock').on('click', function () {
|
||||
@@ -564,11 +550,20 @@
|
||||
dataType: "json",
|
||||
success:function(result){
|
||||
if (result.status) {
|
||||
swal("Success",result.message,"success");
|
||||
setTimeout(function() {
|
||||
swal({
|
||||
title: "Success",
|
||||
text: result.message,
|
||||
type: "success"
|
||||
}, function() {
|
||||
window.location = "/settings/out_of_stock";
|
||||
});
|
||||
}, 1000);
|
||||
}else{
|
||||
swal("Opps",result.message,"warning");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function get_order_item_rows(){
|
||||
@@ -706,7 +701,7 @@
|
||||
window.location.href = '/inventory/stock_checks';
|
||||
});
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
// $('.remove_row').on('click', function(){
|
||||
// window.location.href = '/inventory';
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-6" style="padding-right: 15px;">
|
||||
<button type="button" class="delete btn btn-danger btn-sm float-right waves-effect" style='margin-left:5px;' data-ref="<%= settings_reset_all_path %>" data-method="delete">
|
||||
<button type="button" id="reset_all" class="delete btn btn-danger btn-sm float-right waves-effect" style='margin-left:5px;' data-ref="<%= settings_reset_all_path %>" data-method="delete">
|
||||
<%= t("views.btn.reset_all") %>
|
||||
</button>
|
||||
<button id='new_out_of_stock' class='btn btn-primary float-right waves-effect' style='margin-left:5px;'><%= (t :new_out_of_stock) +" " %> <%= t("views.right_panel.detail.item") %></button>
|
||||
|
||||
Reference in New Issue
Block a user