update rome check all fun
This commit is contained in:
@@ -35,5 +35,20 @@ class Origami::MoveroomController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def moving
|
||||
change_to = params[:change_to] #new
|
||||
change_from = params[:change_from] #original
|
||||
bookings = Booking.where('dining_facility_id=?',change_from)
|
||||
|
||||
booking_array = Array.new
|
||||
bookings.each do | booking |
|
||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
booking_array.push(booking)
|
||||
end
|
||||
end
|
||||
|
||||
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,36 +1,77 @@
|
||||
class Origami::RoomsController < BaseOrigamiController
|
||||
|
||||
def index
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("sale_status != 'new'")
|
||||
@orders = Order.all.order('date desc')
|
||||
# @shift = ShiftSale.current_open_shift(current_user.id)
|
||||
end
|
||||
|
||||
def show
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("sale_status != 'new'")
|
||||
@orders = Order.all.order('date desc')
|
||||
@room = DiningFacility.find(params[:room_id])
|
||||
|
||||
@status = ""
|
||||
@sale_array = Array.new
|
||||
@room.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
|
||||
@room.bookings.active.each do |booking|
|
||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
@order_items = Array.new
|
||||
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
@obj = order
|
||||
@customer = order.customer
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
if (order.status == "new")
|
||||
@obj = order
|
||||
@customer = order.customer
|
||||
@date = order.created_at
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
@status = 'order'
|
||||
else
|
||||
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
@sale_array.push(sale)
|
||||
if sale.sale_status != "completed" && sale.sale_status != 'void'
|
||||
@sale_array.push(sale)
|
||||
if @status == 'order'
|
||||
@status = 'sale'
|
||||
end
|
||||
@date = sale.created_at
|
||||
@status = 'sale'
|
||||
@obj = sale
|
||||
@customer = sale.customer
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# @room.bookings.each do |booking|
|
||||
# if booking.sale_id.nil?
|
||||
# @order_items = Array.new
|
||||
|
||||
# booking.booking_orders.each do |booking_order|
|
||||
# order = Order.find(booking_order.order_id)
|
||||
# @obj = order
|
||||
# @customer = order.customer
|
||||
# order.order_items.each do |item|
|
||||
# @order_items.push(item)
|
||||
# end
|
||||
# end
|
||||
# @status = 'order'
|
||||
# else
|
||||
|
||||
# sale = Sale.find(booking.sale_id)
|
||||
# if sale.sale_status != "completed"
|
||||
# @sale_array.push(sale)
|
||||
# @status = 'sale'
|
||||
# @obj = sale
|
||||
# @customer = sale.customer
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<%if @obj != nil && @status_sale == 'sale' && @obj.discount_type == 'member_discount'%>
|
||||
<%if @obj != nil && @status == 'sale' && @obj.discount_type == 'member_discount'%>
|
||||
<td class="charges-name"><strong>Member Discount:</strong></td>
|
||||
<%else%>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
@@ -232,52 +232,52 @@
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
<%
|
||||
if @status == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
count += 1
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td><%= count %>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
end
|
||||
<%
|
||||
if @status == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
count += 1
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice </button>
|
||||
<% end %>
|
||||
<% if @sale_array.size > 1 %>
|
||||
<br><br>
|
||||
Pending Payment
|
||||
<% end %>
|
||||
<% @sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
%>
|
||||
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary invoicedetails' id="<%= sale.sale_id %>">Show Detail </button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<tr>
|
||||
<td><%= count %>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice </button>
|
||||
<% end %>
|
||||
<% if @sale_array.size > 1 %>
|
||||
<br><br>
|
||||
Pending Payment
|
||||
<% end %>
|
||||
<% @sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
%>
|
||||
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary invoicedetails' id="<%= sale.sale_id %>">Show Detail </button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user