update origami for room
This commit is contained in:
@@ -115,7 +115,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 100
|
||||
:timeout => 10
|
||||
)
|
||||
|
||||
rescue HTTParty::Error
|
||||
@@ -209,8 +209,6 @@ end
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
puts "hhhhhhhhh"
|
||||
puts response.to_json
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
|
||||
@@ -55,6 +55,10 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
shop_details = Shop.find(1)
|
||||
# get member information
|
||||
member_info = Customer.get_member_account(customer)
|
||||
puts "transaction"
|
||||
puts rebate_amount.to_json
|
||||
puts "member_info"
|
||||
puts member_info.to_json
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
@@ -6,6 +6,7 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
@room = DiningFacility.find(params[:room_id])
|
||||
@sale_array = Array.new
|
||||
@room.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
@@ -23,12 +24,16 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
|
||||
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
|
||||
puts "hhhhhhhhhh"
|
||||
puts @status
|
||||
puts @obj.to_json
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -69,16 +69,23 @@
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<% if room.get_booking.nil? %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span>
|
||||
<% else %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> new</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if room.get_booking.nil? %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span>
|
||||
<div style="font-size:12px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms blue text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
@@ -114,7 +121,7 @@
|
||||
<div class="card-header">
|
||||
<% if @status == 'order' %>
|
||||
<div id="save_order_id" data-order="<%= @obj.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %></div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<% elsif @status == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %></div>
|
||||
<% end %>
|
||||
|
||||
@@ -218,7 +225,7 @@
|
||||
</div>
|
||||
<br>
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
if @status == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Pending New Order
|
||||
@@ -272,10 +279,10 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<% if @room.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<% if @status == 'order' && @status != 'sale' %>
|
||||
<!-- <button type="button" class="btn btn-primary btn-block" >Add Order</button> -->
|
||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
||||
@@ -332,7 +339,7 @@ $(document).ready(function(){
|
||||
// })
|
||||
|
||||
$('.invoicedetails').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var dining_id = "<%= @room.id %>";
|
||||
var sale_id = this.id;
|
||||
window.location.href = '/origami/table/'+ dining_id + "/table_invoice/"+sale_id;
|
||||
})
|
||||
@@ -431,7 +438,7 @@ $("#first_bill").on('click', function(){
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
|
||||
alert(url)
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/origami/sale/'+ sale_id + "/rounding_adj",
|
||||
@@ -466,8 +473,8 @@ $('#back').on('click',function(){
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = "<%= @obj.sale_id rescue "" %>"
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -549,8 +556,8 @@ $('#add_invoice').on('click',function(){
|
||||
}
|
||||
|
||||
$('#edit').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = "<%= @obj.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user