update addorder move + and box
This commit is contained in:
@@ -164,29 +164,33 @@ $(function() {
|
||||
}else{
|
||||
image_path = "/image/logo.png";
|
||||
}
|
||||
if (menu_item_box == "set_item_box") {
|
||||
add_icon = "set_item_box"
|
||||
}else{
|
||||
add_icon = "add_icon"
|
||||
}
|
||||
|
||||
row = '<div class="card custom-card testimonial-card animated fadeInRight" style="">'
|
||||
+'<div class="custom-card-head card-head row" style="line-height:14px;margin:0px;">'
|
||||
+'<div class="col-md-9">'+ menu_items[field].name +'</div>'
|
||||
+"<div class='col-md-3 add_icon' data-item-code='"
|
||||
+ menu_items[field].code +"' data-name='"
|
||||
+ menu_items[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
||||
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ options +"' data-image='"+image_path+"'>"
|
||||
+"<i class='fa "+fa_plus+" '>"
|
||||
+add+ '</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+"<div class='"+menu_item_box+"' data-item-code='"
|
||||
+"<div class='col-md-3 "+menu_item_box+"' data-item-code='"
|
||||
+ menu_items[field].code +"' data-instance = '"
|
||||
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
||||
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
||||
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"'>"
|
||||
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' >"
|
||||
+"<i class='fa "+fa_plus+" '>"
|
||||
+add+ '</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+"<div class='"+add_icon+"' data-item-code='"
|
||||
+ menu_items[field].code +"' data-name='"
|
||||
+ menu_items[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
||||
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ options +"' data-image='"+image_path+"' >"
|
||||
|
||||
+"<div class='card-block custom-card-block'>"
|
||||
+"<img id='logo' height='125px' src='"+image_path+"'>"
|
||||
@@ -434,7 +438,8 @@ $(function() {
|
||||
|
||||
change_qty_plus_minus("count","plus","minus");
|
||||
|
||||
data = $(this).parent().children().children('.add_icon');
|
||||
// data = $(this).parent().children().children('.add_icon');
|
||||
data = $(this).parent().siblings('.add_icon');
|
||||
|
||||
$('#total_price').text(data.attr('data-price'));
|
||||
attributes = $(this).data('id');
|
||||
|
||||
@@ -1226,9 +1226,10 @@ end
|
||||
end
|
||||
|
||||
def self.add_to_existing_pending_invoice(dining,sale_id,booking)
|
||||
table = DiningFacility.find(dining)
|
||||
|
||||
existing_booking = Booking.find_by_sale_id(sale_id)
|
||||
if dining.to_i > 0
|
||||
table = DiningFacility.find(dining)
|
||||
table.bookings.each do |booking|
|
||||
# if !booking.checkout_at.nil?
|
||||
# existing_booking.update_attributes(checkout_at: checkout_at)
|
||||
|
||||
@@ -65,15 +65,28 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-lg-3 col-sm-3 m-t-10">
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
Back
|
||||
</button>
|
||||
<% if type %>
|
||||
<button type="button" class="btn btn-block btn-primary waves-effect" id='pending_order'>
|
||||
Pending Order
|
||||
</button>
|
||||
<% end%>
|
||||
|
||||
<% if type && modify_order%>
|
||||
<button type="button" class="btn btn-lg btn-default waves-effect col-md-4" id='back'>
|
||||
<!-- <i class="material-icons">reply</i> -->
|
||||
Back
|
||||
</button>
|
||||
<button type="button" class="btn btn-lg btn-primary waves-effect col-md-7" id='pending_order'>Pending Order
|
||||
</button>
|
||||
<%elsif !modify_order && type%>
|
||||
<button type="button" class="btn btn-lg btn-default waves-effect col-md-2" id='back' style=" padding: .5rem 0.15rem !important;">
|
||||
<!-- <i class="material-icons">reply</i> -->
|
||||
Back
|
||||
</button>
|
||||
<button type="button" class="btn btn-lg btn-primary waves-effect col-md-6" id='pending_order' style=" padding: .5rem 0.15rem !important;">Pending Order
|
||||
</button>
|
||||
<a class="btn btn-lg bg-blue waves-effect select_table col-md-3" data-toggle="modal" data-target="#TableModal" style=" padding: .5rem 0.15rem !important;">Select</a>
|
||||
<input type="hidden" name="table_id" value="" id="table_id">
|
||||
<%else%>
|
||||
<button type="button" class="btn btn-lg btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>Back
|
||||
</button>
|
||||
<%end%>
|
||||
<br>
|
||||
<div class="card-header" style="padding: 0.5rem 0.25rem">
|
||||
<% if type %>
|
||||
@@ -81,19 +94,23 @@
|
||||
<div class="col-md-6 col-lg-6 col-sm-12">
|
||||
<strong id="order-title" class="font-14">ORDER DETAILS </strong>
|
||||
</div>
|
||||
|
||||
<% if modify_order %>
|
||||
<div class="col-md-6 col-lg-6 col-sm-6">Table : <%=@table.name%></div>
|
||||
<p class="hidden" id="table_id"><%=@table_id%></p>
|
||||
<p class="hidden" id="table_type"><%=@table.type%></p>
|
||||
<% if @table.nil? %>
|
||||
<div class="col-md-6 col-lg-6 col-sm-6">Table : </div>
|
||||
<p class="hidden" id="table_id"><%=@table_id%></p>
|
||||
<p class="hidden" id="table_type"></p>
|
||||
<% else%>
|
||||
<div class="col-md-6 col-lg-6 col-sm-6">Table : <%=@table.name%></div>
|
||||
<p class="hidden" id="table_id"><%=@table_id%></p>
|
||||
<p class="hidden" id="table_type"><%=@table.type%></p>
|
||||
<% end%>
|
||||
|
||||
<p class="hidden" id="booking_id"><%=@booking_id%></p>
|
||||
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
|
||||
<p class="hidden" id="sale_id"><%=@sale_id%></p>
|
||||
<% else%>
|
||||
<div class="col-md-2 col-lg-2 col-sm-6">Table</div>
|
||||
<div class="col-md-4 col-lg-4 col-sm-6 m-t--5">
|
||||
<a class="btn btn-block bg-blue waves-effect select_table" data-toggle="modal" data-target="#TableModal">Select</a>
|
||||
<input type="hidden" name="table_id" value="" id="table_id">
|
||||
</div>
|
||||
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
@@ -123,23 +140,28 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer custom-card-footer">
|
||||
<div class="card-footer custom-card-footer" style="padding: 0.35rem 0.15rem !important;">
|
||||
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<!-- <table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="sub_total">0.00</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<% if type %>
|
||||
</table> -->
|
||||
<% if type && modify_order%>
|
||||
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
|
||||
|
||||
<button type="button" class="btn btn-primary btn-block create" id="create_pay_order" disabled="disabled"><%if modify_order%>Update Order & Pay<%else%>Create Order & Pay<%end%></button>
|
||||
<% end %>
|
||||
<% if !modify_order %>
|
||||
<button type="button" class="btn btn-primary btn-block create m-t-5" id="create_order" disabled="disabled">Create Order</button>
|
||||
<% end %>
|
||||
<button type="button" class="btn btn-primary btn-lg create col-md-10" id="create_pay_order" disabled="disabled">Update Order & Pay</button>
|
||||
<%elsif !modify_order && type%>
|
||||
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
|
||||
|
||||
<button type="button" class="btn btn-primary btn-lg create col-md-6" id="create_pay_order" disabled="disabled">Create & Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-lg create col-md-5" id="create_order" disabled="disabled">Create Order</button>
|
||||
<%else%>
|
||||
<button type="button" class="btn btn-primary btn-lg create col-md-10" id="create_order" disabled="disabled">Create Order</button>
|
||||
<%end%>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user