Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into crm
This commit is contained in:
@@ -9,15 +9,17 @@ class Api::BillController < Api::ApiController
|
|||||||
#create Bill by Booking ID
|
#create Bill by Booking ID
|
||||||
if (params[:booking_id])
|
if (params[:booking_id])
|
||||||
booking = Booking.find(params[:booking_id])
|
booking = Booking.find(params[:booking_id])
|
||||||
if booking
|
|
||||||
if booking.sale_id.nil?
|
if booking
|
||||||
@sale = Sale.new
|
if booking.sale_id.nil?
|
||||||
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee)
|
@sale = Sale.new
|
||||||
else
|
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee)
|
||||||
@status = true
|
else
|
||||||
@sale_id = booking.sale_id
|
@status = true
|
||||||
|
@sale_id = booking.sale_id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
elsif (params[:order_id])
|
elsif (params[:order_id])
|
||||||
@sale = Sale.new
|
@sale = Sale.new
|
||||||
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee)
|
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee)
|
||||||
|
|||||||
@@ -6,11 +6,9 @@ class Api::BookingsController < Api::ApiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@booking = Booking.find(params[:id])
|
booking = Booking.find(params[:id])
|
||||||
|
if booking.dining_facility_id.to_i == params[:table_id].to_i
|
||||||
|
@booking = booking
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# private
|
|
||||||
# def Bookings_params
|
|
||||||
# params.permit(:id, :order_id)
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,11 +7,45 @@ class Api::OrdersController < Api::ApiController
|
|||||||
order = Order.find(params[:order_id])
|
order = Order.find(params[:order_id])
|
||||||
order.order_items
|
order.order_items
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_order
|
def get_order
|
||||||
order = Order.find(params[:order_id])
|
order = Order.find(params[:order_id])
|
||||||
order.order_items
|
order.order_items
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# API - This api will retrive current booking for android with table or room id
|
||||||
|
def view_orders
|
||||||
|
booking_id = params[:booking_id]
|
||||||
|
table_id = params[:table_id]
|
||||||
|
if Booking.exists?(booking_id)
|
||||||
|
booking = Booking.find(booking_id)
|
||||||
|
|
||||||
|
if booking
|
||||||
|
if booking.dining_facility_id.to_i == table_id.to_i
|
||||||
|
@booking = booking
|
||||||
|
else
|
||||||
|
table = DiningFacility.find(table_id)
|
||||||
|
booking = table.get_current_booking
|
||||||
|
if booking
|
||||||
|
if booking.dining_facility_id.to_i == table_id.to_i
|
||||||
|
@booking = booking
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts "only table"
|
||||||
|
table = DiningFacility.find(table_id)
|
||||||
|
booking = table.get_current_booking
|
||||||
|
puts booking
|
||||||
|
if booking
|
||||||
|
if booking.dining_facility_id.to_i == table_id.to_i
|
||||||
|
@booking = booking
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
# This API allow new order creation
|
# This API allow new order creation
|
||||||
# Input Params
|
# Input Params
|
||||||
@@ -38,18 +72,50 @@ class Api::OrdersController < Api::ApiController
|
|||||||
if !params["booking_id"].nil?
|
if !params["booking_id"].nil?
|
||||||
# check booking id is already completed.
|
# check booking id is already completed.
|
||||||
booking = Booking.find(params[:booking_id])
|
booking = Booking.find(params[:booking_id])
|
||||||
if !booking.sale_id.nil?
|
if booking
|
||||||
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "billed"
|
if booking.dining_facility_id.to_i == params[:table_id].to_i
|
||||||
@order.new_booking = true
|
if !booking.sale_id.nil?
|
||||||
|
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "billed"
|
||||||
|
@order.new_booking = true
|
||||||
|
else
|
||||||
|
@order.new_booking = false
|
||||||
|
@order.booking_id = params[:booking_id]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@order.new_booking = false
|
||||||
|
@order.booking_id = params[:booking_id]
|
||||||
|
puts "booking sale is null"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@order.new_booking = false
|
# booking.table id not equal current table
|
||||||
@order.booking_id = params[:booking_id]
|
table = DiningFacility.find(params[:table_id])
|
||||||
|
if table
|
||||||
|
booking = table.get_current_booking
|
||||||
|
if booking
|
||||||
|
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "billed"
|
||||||
|
@order.new_booking = true
|
||||||
|
else
|
||||||
|
@order.new_booking = false
|
||||||
|
@order.booking_id = booking.booking_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
end #booking exists
|
||||||
@order.new_booking = false
|
else
|
||||||
@order.booking_id = params[:booking_id]
|
#no booking id
|
||||||
puts "booking sale is null"
|
table = DiningFacility.find(params[:table_id])
|
||||||
end
|
if table
|
||||||
|
booking = table.get_current_booking
|
||||||
|
if booking
|
||||||
|
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "billed"
|
||||||
|
@order.new_booking = true
|
||||||
|
else
|
||||||
|
@order.new_booking = false
|
||||||
|
@order.booking_id = booking.booking_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@status, @booking = @order.generate
|
@status, @booking = @order.generate
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
def index
|
def index
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.complete_sale
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.all.order('date desc')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -12,13 +12,16 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
def show
|
def show
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.complete_sale
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.all.order('date desc')
|
||||||
@status_order = ""
|
@status_order = ""
|
||||||
|
@status_sale = ""
|
||||||
|
@sale_array = Array.new
|
||||||
@dining.bookings.each do |booking|
|
@dining.bookings.each do |booking|
|
||||||
if booking.sale_id.nil?
|
if booking.sale_id.nil?
|
||||||
@order_items = Array.new
|
@order_items = Array.new
|
||||||
booking.booking_orders.each do |booking_order|
|
booking.booking_orders.each do |booking_order|
|
||||||
|
|
||||||
order = Order.find(booking_order.order_id)
|
order = Order.find(booking_order.order_id)
|
||||||
@obj_order = order
|
@obj_order = order
|
||||||
@date = order.created_at
|
@date = order.created_at
|
||||||
@@ -30,6 +33,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
sale = Sale.find(booking.sale_id)
|
sale = Sale.find(booking.sale_id)
|
||||||
if sale.sale_status != "completed"
|
if sale.sale_status != "completed"
|
||||||
|
@sale_array.push(sale)
|
||||||
if @status_order == 'order'
|
if @status_order == 'order'
|
||||||
@status_order = 'sale'
|
@status_order = 'sale'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,13 +5,16 @@ class Origami::MovetableController < BaseOrigamiController
|
|||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.all
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.all.order('date desc')
|
||||||
|
@dining = DiningFacility.find(params[:dining_id])
|
||||||
|
|
||||||
@status_order = ""
|
@status_order = ""
|
||||||
@dining = DiningFacility.find(params[:dining_id])
|
@status_sale = ""
|
||||||
|
@sale_array = Array.new
|
||||||
@dining.bookings.each do |booking|
|
@dining.bookings.each do |booking|
|
||||||
if booking.sale_id.nil?
|
if booking.sale_id.nil?
|
||||||
@order_items = Array.new
|
@order_items = Array.new
|
||||||
booking.booking_orders.each do |booking_order|
|
booking.booking_orders.each do |booking_order|
|
||||||
|
|
||||||
order = Order.find(booking_order.order_id)
|
order = Order.find(booking_order.order_id)
|
||||||
@obj_order = order
|
@obj_order = order
|
||||||
@date = order.created_at
|
@date = order.created_at
|
||||||
@@ -23,6 +26,7 @@ class Origami::MovetableController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
sale = Sale.find(booking.sale_id)
|
sale = Sale.find(booking.sale_id)
|
||||||
if sale.sale_status != "completed"
|
if sale.sale_status != "completed"
|
||||||
|
@sale_array.push(sale)
|
||||||
if @status_order == 'order'
|
if @status_order == 'order'
|
||||||
@status_order = 'sale'
|
@status_order = 'sale'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,8 +3,13 @@ class Origami::OrdersController < BaseOrigamiController
|
|||||||
def show
|
def show
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.complete_sale
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.all.order('status desc')
|
||||||
@order = Order.find(params[:order_id])
|
@order = Order.find(params[:order_id])
|
||||||
|
sale_order = SaleOrder.find_by_order_id(@order.order_id)
|
||||||
|
if sale_order
|
||||||
|
sale = Sale.find(sale_order.sale_id)
|
||||||
|
@sale_status = sale.sale_status
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class Origami::RoomsController < BaseOrigamiController
|
|||||||
def show
|
def show
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.complete_sale
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.all.order('date desc')
|
||||||
@room = DiningFacility.find(params[:room_id])
|
@room = DiningFacility.find(params[:room_id])
|
||||||
@room.bookings.each do |booking|
|
@room.bookings.each do |booking|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class Origami::SalesController < BaseOrigamiController
|
|||||||
def show
|
def show
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.complete_sale
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.all.order('date desc')
|
||||||
@sale = Sale.find(params[:sale_id])
|
@sale = Sale.find(params[:sale_id])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -19,11 +19,10 @@ class DiningFacility < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_current_booking
|
def get_current_booking
|
||||||
puts "enter booking"
|
|
||||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
||||||
|
|
||||||
if booking.count > 0 then
|
if booking.count > 0 then
|
||||||
return booking[0].booking_id
|
return booking[0]
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Order < ApplicationRecord
|
|||||||
#primary key - need to be unique
|
#primary key - need to be unique
|
||||||
before_create :generate_custom_id
|
before_create :generate_custom_id
|
||||||
before_create :set_order_date
|
before_create :set_order_date
|
||||||
|
has_many :sale_orders
|
||||||
belongs_to :customer
|
belongs_to :customer
|
||||||
has_many :order_items, autosave: true , inverse_of: :order
|
has_many :order_items, autosave: true , inverse_of: :order
|
||||||
has_many :assigned_order_items
|
has_many :assigned_order_items
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
if (@booking)
|
if (@booking)
|
||||||
|
json.success true
|
||||||
json.id @booking.booking_id
|
json.id @booking.booking_id
|
||||||
json.status @booking.booking_status
|
json.status @booking.booking_status
|
||||||
if Sale.exists?(@booking.sale_id)
|
if Sale.exists?(@booking.sale_id)
|
||||||
@@ -43,5 +44,6 @@ if (@booking)
|
|||||||
json.sub_total @total_amount
|
json.sub_total @total_amount
|
||||||
json.commerical_tax @total_amount * 0.05
|
json.commerical_tax @total_amount * 0.05
|
||||||
json.total @total_amount + (@total_amount * 0.05)
|
json.total @total_amount + (@total_amount * 0.05)
|
||||||
|
else
|
||||||
|
json.success false
|
||||||
end
|
end
|
||||||
|
|||||||
49
app/views/api/orders/view_orders.json.jbuilder
Normal file
49
app/views/api/orders/view_orders.json.jbuilder
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
if (@booking)
|
||||||
|
json.success true
|
||||||
|
json.booking_id @booking.booking_id
|
||||||
|
json.status @booking.booking_status
|
||||||
|
if Sale.exists?(@booking.sale_id)
|
||||||
|
json.sale_status Sale.find(@booking.sale_id).sale_status
|
||||||
|
else
|
||||||
|
json.sale_status ""
|
||||||
|
end
|
||||||
|
json.checkin_at @booking.checkin_at.strftime("%d-%m-%Y")
|
||||||
|
json.checkin_by @booking.checkin_by
|
||||||
|
json.table_name @booking.dining_facility.name
|
||||||
|
|
||||||
|
if @booking.type == "TableBooking"
|
||||||
|
json.table_id @booking.dining_facility_id
|
||||||
|
else
|
||||||
|
json.room_id @booking.dining_facility_id
|
||||||
|
end
|
||||||
|
@total_amount = 0.00
|
||||||
|
@total_tax = 0.00
|
||||||
|
|
||||||
|
if @booking.booking_orders
|
||||||
|
order_items = []
|
||||||
|
@booking.booking_orders.each do |bo|
|
||||||
|
order = Order.find(bo.order_id)
|
||||||
|
#if (order.status == "new")
|
||||||
|
order_items = order_items + order.order_items
|
||||||
|
#end
|
||||||
|
end
|
||||||
|
|
||||||
|
json.order_items order_items do |item|
|
||||||
|
json.item_instance_code item.item_code
|
||||||
|
json.item_name item.item_name
|
||||||
|
json.price item.price
|
||||||
|
json.qty item.qty
|
||||||
|
json.options item.options
|
||||||
|
json.remark item.remark
|
||||||
|
json.item_status item.order_item_status
|
||||||
|
@total_amount = @total_amount + (item.price * item.qty)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
json.sub_total @total_amount
|
||||||
|
json.commerical_tax @total_amount * 0.05
|
||||||
|
json.total @total_amount + (@total_amount * 0.05)
|
||||||
|
else
|
||||||
|
json.success false
|
||||||
|
end
|
||||||
@@ -8,7 +8,7 @@ if @zones
|
|||||||
json.name table.name
|
json.name table.name
|
||||||
json.status table.status
|
json.status table.status
|
||||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
||||||
json.current_booking table.get_current_booking
|
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||||
end
|
end
|
||||||
|
|
||||||
json.rooms zone.rooms do |room|
|
json.rooms zone.rooms do |room|
|
||||||
@@ -16,7 +16,7 @@ if @zones
|
|||||||
json.name room.name
|
json.name room.name
|
||||||
json.status room.status
|
json.status room.status
|
||||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
||||||
json.current_booking room.get_current_booking
|
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -26,7 +26,7 @@ else #list all tables and rooms with out zones
|
|||||||
json.name table.name
|
json.name table.name
|
||||||
json.status table.status
|
json.status table.status
|
||||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
||||||
json.current_booking table.get_current_booking
|
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ else #list all tables and rooms with out zones
|
|||||||
json.name room.name
|
json.name room.name
|
||||||
json.status room.status
|
json.status room.status
|
||||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
||||||
json.current_booking room.get_current_booking
|
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="container-fluid" style="min-height:30px; padding-left:0px !important; padding-right:0px !important; background:#54A5AF; margin-bottom:5px">
|
<div class="container-fluid" style="min-height:30px; padding-left:0px !important; padding-right:0px !important; background:#54A5AF; margin-bottom:5px">
|
||||||
<div style="padding-top:5px;padding-bottom:5px;margin-left:15px; margin-right:15px;">
|
<div style="padding-top:5px;padding-bottom:5px;margin-left:15px; margin-right:15px;">
|
||||||
<div style="float:left;margin-top:3px;text-align:left;color:#ffffff">
|
<div style="float:left;margin-top:3px;text-align:left;color:#ffffff">
|
||||||
<strong>Cashier Station 1 - <%= Time.now.strftime('%a, %d %b %Y %H:%M:%S %p') %></strong>
|
<strong>Cashier Station 1 - <span id="clockbox"></span></strong>
|
||||||
</div>
|
</div>
|
||||||
<div style="float:right; margin-top:3px; text-align:right;width:200px;color:#ffffff">
|
<div style="float:right; margin-top:3px; text-align:right;width:200px;color:#ffffff">
|
||||||
<% if current_login_employee %>
|
<% if current_login_employee %>
|
||||||
@@ -10,3 +10,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
tday=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
|
||||||
|
tmonth=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
|
||||||
|
|
||||||
|
function GetClock(){
|
||||||
|
var d=new Date();
|
||||||
|
var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear();
|
||||||
|
var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap;
|
||||||
|
|
||||||
|
if(nhour==0){ap=" AM";nhour=12;}
|
||||||
|
else if(nhour<12){ap=" AM";}
|
||||||
|
else if(nhour==12){ap=" PM";}
|
||||||
|
else if(nhour>12){ap=" PM";nhour-=12;}
|
||||||
|
|
||||||
|
if(nmin<=9) nmin="0"+nmin;
|
||||||
|
if(nsec<=9) nsec="0"+nsec;
|
||||||
|
|
||||||
|
document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+"";
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload=function(){
|
||||||
|
GetClock();
|
||||||
|
setInterval(GetClock,1000);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div id="clockbox"></div>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
<!-- tabs - End -->
|
<!-- tabs - End -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-primary btn-block"> Refresh </button>
|
<button id="refreshbutton" type="button" class="btn btn-block" style="border-radius:5px;color:#fff;background-color:red;"> Refresh off </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Column One -->
|
<!-- Column One -->
|
||||||
@@ -117,4 +117,70 @@ $(document).ready(function(){
|
|||||||
window.location.href = '/origami/order/' + order_id;
|
window.location.href = '/origami/order/' + order_id;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
$(function() {
|
||||||
|
var timer;
|
||||||
|
|
||||||
|
function start() {
|
||||||
|
timer = setTimeout(function() { console.log("refresh");window.location.reload()}, 30000); //10000
|
||||||
|
};
|
||||||
|
|
||||||
|
function stop() {
|
||||||
|
clearTimeout(timer);
|
||||||
|
};
|
||||||
|
|
||||||
|
if(localStorage.getItem("refreshflag") != null){
|
||||||
|
if (localStorage.getItem("refreshflag") == 0) {
|
||||||
|
$('#refreshbutton').html("Refresh off");
|
||||||
|
$('#refreshbutton').css("background-color","red");
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#refreshbutton').html("Refresh on");
|
||||||
|
$('#refreshbutton').css("background-color","green");
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
localStorage.setItem("refreshflag", 0);
|
||||||
|
}
|
||||||
|
var url = location.href;
|
||||||
|
if (location.href.slice(-1) == "/"){
|
||||||
|
url = url.substring(0, url.length - 1);
|
||||||
|
}
|
||||||
|
var arr = url.split("/");
|
||||||
|
|
||||||
|
if(arr[arr.length-1] != "origami"){
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
$('#refreshbutton').bind("click", function(){
|
||||||
|
if(localStorage.getItem("refreshflag") == "0"){
|
||||||
|
localStorage.setItem("refreshflag", 1);
|
||||||
|
$(this).html("Refresh on");
|
||||||
|
$(this).css("background-color","green");
|
||||||
|
// $(this).html("Auto Refresh on<span class='glyphicon glyphicon-ok'></span>");
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
stop();
|
||||||
|
localStorage.setItem("refreshflag", 0);
|
||||||
|
$(this).html("Refresh off");
|
||||||
|
$(this).css("background-color","red");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function refreshing(){
|
||||||
|
if(localStorage.getItem("refreshflag") == "0"){
|
||||||
|
localStorage.setItem("refreshflag", 1);
|
||||||
|
$(this).html("Refresh on");
|
||||||
|
$(this).css("background-color","green");
|
||||||
|
// $(this).html("Auto Refresh on<span class='glyphicon glyphicon-ok'></span>");
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
stop();
|
||||||
|
localStorage.setItem("refreshflag", 0);
|
||||||
|
$(this).html("Refresh off");
|
||||||
|
$(this).css("background-color","red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||||
<div class="card" >
|
<div class="card" >
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<% if @status_order == 'order' %>
|
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong></div>
|
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong></div>
|
||||||
<% elsif @status_sale == 'sale' %>
|
<% elsif @status_sale == 'sale' %>
|
||||||
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
<p> Receipt No: <span id="receipt_no">
|
<p> Receipt No: <span id="receipt_no">
|
||||||
<% if @status_sale == 'sale' %>
|
<% if @status_sale == 'sale' %>
|
||||||
<%= @obj_sale.receipt_no rescue '' %>
|
<%= @sale_array[0].receipt_no rescue '' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span></p>
|
</span></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -126,6 +126,7 @@
|
|||||||
<table class="table table-striped" id="order-items-table">
|
<table class="table table-striped" id="order-items-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
<th class="item-name">Items</th>
|
<th class="item-name">Items</th>
|
||||||
<th class="item-attr">QTY</td>
|
<th class="item-attr">QTY</td>
|
||||||
<th class="item-attr">Price</td>
|
<th class="item-attr">Price</td>
|
||||||
@@ -133,14 +134,18 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<%
|
<%
|
||||||
|
count = 0
|
||||||
sub_total = 0
|
sub_total = 0
|
||||||
if @status_sale == "sale"
|
if @status_sale == "sale"
|
||||||
@obj_sale.sale_items.each do |sale_item|
|
puts @sale_array[0]
|
||||||
|
@sale_array[0].sale_items.each do |sale_item|
|
||||||
|
count += 1
|
||||||
sub_total = sub_total + sale_item.price
|
sub_total = sub_total + sale_item.price
|
||||||
%>
|
%>
|
||||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||||
<% unless sale_item.price <= 0 %>
|
<% unless sale_item.price <= 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><%= count %></td>
|
||||||
<td class='item-name'><%= sale_item.product_name %></td>
|
<td class='item-name'><%= sale_item.product_name %></td>
|
||||||
<td class='item-attr'><%= sale_item.qty %></td>
|
<td class='item-attr'><%= sale_item.qty %></td>
|
||||||
<td class='item-attr'><%= sale_item.price %></td>
|
<td class='item-attr'><%= sale_item.price %></td>
|
||||||
@@ -150,13 +155,18 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if @status_order == 'order'
|
if @status_order == 'order' && @status_sale != 'sale'
|
||||||
unless @order_items.nil?
|
unless @order_items.nil?
|
||||||
|
count = 0
|
||||||
@order_items.each do |order_item |
|
@order_items.each do |order_item |
|
||||||
|
puts @order_items.size
|
||||||
|
puts "view"
|
||||||
|
count += 1
|
||||||
sub_total = sub_total + order_item.price
|
sub_total = sub_total + order_item.price
|
||||||
|
|
||||||
unless order_item.price <= 0 %>
|
unless order_item.price <= 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><%= count %></td>
|
||||||
<td class='item-name'><%= order_item.item_name %></td>
|
<td class='item-name'><%= order_item.item_name %></td>
|
||||||
<td class='item-attr'><%= order_item.qty %></td>
|
<td class='item-attr'><%= order_item.qty %></td>
|
||||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||||
@@ -217,8 +227,24 @@
|
|||||||
</table>
|
</table>
|
||||||
<button class='btn btn-primary'> Add to existing invoice </button>
|
<button class='btn btn-primary'> Add to existing invoice </button>
|
||||||
<%
|
<%
|
||||||
|
else
|
||||||
|
@sale_array.each do |sale|
|
||||||
|
if @sale_array.size > 1
|
||||||
|
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||||
|
%>
|
||||||
|
Pending New Invoice
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||||
|
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<%
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
%>
|
%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -229,6 +255,7 @@
|
|||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||||
|
<% if @dining.bookings.length >= 1 %>
|
||||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||||
@@ -243,6 +270,7 @@
|
|||||||
<!-- Cashier Buttons -->
|
<!-- Cashier Buttons -->
|
||||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||||
<button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button>
|
<button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
case 'del' :
|
case 'del' :
|
||||||
var cash=$('#amount').text();
|
var cash=$('#amount').text();
|
||||||
$('#amount').text(cash.substr(0,cash.length-1));
|
$('#amount').text(cash.substr(0,cash.length-1));
|
||||||
|
break;
|
||||||
case 'nett':
|
case 'nett':
|
||||||
var remain_amount = $('#validamount').val();
|
var remain_amount = $('#validamount').val();
|
||||||
$('#amount').text(remain_amount);
|
$('#amount').text(remain_amount);
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
case 'del' :
|
case 'del' :
|
||||||
var cash=$('#amount').text();
|
var cash=$('#amount').text();
|
||||||
$('#amount').text(cash.substr(0,cash.length-1));
|
$('#amount').text(cash.substr(0,cash.length-1));
|
||||||
|
break;
|
||||||
case 'nett':
|
case 'nett':
|
||||||
var remain_amount = $('#validamount').val();
|
var remain_amount = $('#validamount').val();
|
||||||
$('#amount').text(remain_amount);
|
$('#amount').text(remain_amount);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
<p> Receipt No: <span id="receipt_no">
|
<p> Receipt No: <span id="receipt_no">
|
||||||
<% if @status_sale == 'sale' %>
|
<% if @status_sale == 'sale' %>
|
||||||
<%= @obj_sale.receipt_no rescue '' %>
|
<%= @sale_array[0].receipt_no rescue '' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span></p>
|
</span></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -99,6 +99,7 @@
|
|||||||
<table class="table table-striped" id="order-items-table">
|
<table class="table table-striped" id="order-items-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
<th class="item-name">Items</th>
|
<th class="item-name">Items</th>
|
||||||
<th class="item-attr">QTY</td>
|
<th class="item-attr">QTY</td>
|
||||||
<th class="item-attr">Price</td>
|
<th class="item-attr">Price</td>
|
||||||
@@ -106,14 +107,18 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<%
|
<%
|
||||||
|
count = 0
|
||||||
sub_total = 0
|
sub_total = 0
|
||||||
if @status_sale == "sale"
|
if @status_sale == "sale"
|
||||||
@obj_sale.sale_items.each do |sale_item|
|
puts @sale_array[0]
|
||||||
|
@sale_array[0].sale_items.each do |sale_item|
|
||||||
|
count += 1
|
||||||
sub_total = sub_total + sale_item.price
|
sub_total = sub_total + sale_item.price
|
||||||
%>
|
%>
|
||||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||||
<% unless sale_item.price <= 0 %>
|
<% unless sale_item.price <= 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><%= count %></td>
|
||||||
<td class='item-name'><%= sale_item.product_name %></td>
|
<td class='item-name'><%= sale_item.product_name %></td>
|
||||||
<td class='item-attr'><%= sale_item.qty %></td>
|
<td class='item-attr'><%= sale_item.qty %></td>
|
||||||
<td class='item-attr'><%= sale_item.price %></td>
|
<td class='item-attr'><%= sale_item.price %></td>
|
||||||
@@ -123,13 +128,18 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if @status_order == 'order'
|
if @status_order == 'order' && @status_sale != 'sale'
|
||||||
unless @order_items.nil?
|
unless @order_items.nil?
|
||||||
|
count = 0
|
||||||
@order_items.each do |order_item |
|
@order_items.each do |order_item |
|
||||||
|
puts @order_items.size
|
||||||
|
puts "view"
|
||||||
|
count += 1
|
||||||
sub_total = sub_total + order_item.price
|
sub_total = sub_total + order_item.price
|
||||||
|
|
||||||
unless order_item.price <= 0 %>
|
unless order_item.price <= 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><%= count %></td>
|
||||||
<td class='item-name'><%= order_item.item_name %></td>
|
<td class='item-name'><%= order_item.item_name %></td>
|
||||||
<td class='item-attr'><%= order_item.qty %></td>
|
<td class='item-attr'><%= order_item.qty %></td>
|
||||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||||
@@ -143,6 +153,47 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<%
|
||||||
|
if @status_sale == 'sale'
|
||||||
|
unless @order_items.nil?
|
||||||
|
%>
|
||||||
|
Pending New Order
|
||||||
|
<table class="table table-striped">
|
||||||
|
<%
|
||||||
|
@order_items.each do |order_item |
|
||||||
|
%>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<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'> Add to existing invoice </button>
|
||||||
|
<%
|
||||||
|
else
|
||||||
|
@sale_array.each do |sale|
|
||||||
|
if @sale_array.size > 1
|
||||||
|
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||||
|
%>
|
||||||
|
Pending New Invoice
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||||
|
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<%
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
%>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="pay purple" id="move_table">MOVE TABLE</div>
|
<div class="pay purple" id="move_table">MOVE TABLE</div>
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
case 'del' :
|
case 'del' :
|
||||||
var cash=$('#amount').text();
|
var cash=$('#amount').text();
|
||||||
$('#amount').text(cash.substr(0,cash.length-1));
|
$('#amount').text(cash.substr(0,cash.length-1));
|
||||||
|
break;
|
||||||
case 'nett':
|
case 'nett':
|
||||||
var remain_amount = $('#validamount').val();
|
var remain_amount = $('#validamount').val();
|
||||||
$('#amount').text(remain_amount);
|
$('#amount').text(remain_amount);
|
||||||
|
|||||||
@@ -81,7 +81,20 @@
|
|||||||
<% @orders.each do |order| %>
|
<% @orders.each do |order| %>
|
||||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= order.order_id %>
|
<%
|
||||||
|
order_status = ""
|
||||||
|
sale_order = SaleOrder.find_by_order_id(order)
|
||||||
|
if sale_order
|
||||||
|
sale = Sale.find(sale_order.sale_id)
|
||||||
|
order_status = sale.sale_status
|
||||||
|
if order_status == 'new'
|
||||||
|
order_status = order.status
|
||||||
|
end
|
||||||
|
else
|
||||||
|
order_status = order.status
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
<%= order.order_id %> | <%= order_status %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -137,10 +150,8 @@
|
|||||||
<td class='item-attr'><%= sale_item.price %></td>
|
<td class='item-attr'><%= sale_item.price %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
%>
|
%>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -165,6 +176,9 @@
|
|||||||
<!-- Column Three -->
|
<!-- Column Three -->
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||||
|
<% if @sale_status != 'completed' %>
|
||||||
|
<button type="button" class="btn btn-primary btn-block" id='move'>MOVE</button>
|
||||||
|
<% end %>
|
||||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -193,5 +207,8 @@ $('#pay').on('click',function() {
|
|||||||
});
|
});
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
window.location.href = '/origami/';
|
window.location.href = '/origami/';
|
||||||
|
})
|
||||||
|
$('#move').on('click',function(){
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -106,14 +106,14 @@
|
|||||||
<div class="col-md-4" id="others"><%= @other %></div>
|
<div class="col-md-4" id="others"><%= @other %></div>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row payment other-payment-color" id="card_payment" >
|
<div class="row payment other-payment-color" id="card_payment" style="line-height:30px;height: 30px;margin-bottom: 0px;" >
|
||||||
<div class="col-md-12">Other Payments</div>
|
<div class="col-md-12">Other Payments</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- mpu -->
|
<!-- mpu -->
|
||||||
<% if @other != 0.0 %>
|
<% if @other != 0.0 %>
|
||||||
<div class="row payment other-payment-color" >
|
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">MPU</div>
|
<div class="col-md-3">MPU</div>
|
||||||
<div class="col-md-4" id="others"><%= @other %></div>
|
<div class="col-md-4" id="others"><%= @other %></div>
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<!-- paypar -->
|
<!-- paypar -->
|
||||||
<% if @ppamount != 0.0 %>
|
<% if @ppamount != 0.0 %>
|
||||||
<div class="row">
|
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">Paypar</div>
|
<div class="col-md-3">Paypar</div>
|
||||||
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
|
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<!-- Visa -->
|
<!-- Visa -->
|
||||||
<% if @visacount != 0.0 %>
|
<% if @visacount != 0.0 %>
|
||||||
<div class="row">
|
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">Visa</div>
|
<div class="col-md-3">Visa</div>
|
||||||
<div class="col-md-4" id="visacount"><%= @visacount %></div>
|
<div class="col-md-4" id="visacount"><%= @visacount %></div>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<!-- JCB -->
|
<!-- JCB -->
|
||||||
<% if @jcbcount != 0.0 %>
|
<% if @jcbcount != 0.0 %>
|
||||||
<div class="row">
|
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">JCB</div>
|
<div class="col-md-3">JCB</div>
|
||||||
<div class="col-md-4" id="jcbcount"><%= @jcbcount %></div>
|
<div class="col-md-4" id="jcbcount"><%= @jcbcount %></div>
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<!-- Master -->
|
<!-- Master -->
|
||||||
<% if @mastercount != 0.0 %>
|
<% if @mastercount != 0.0 %>
|
||||||
<div class="row">
|
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">Master</div>
|
<div class="col-md-3">Master</div>
|
||||||
<div class="col-md-4" id="mastercount"><%= @mastercount %></div>
|
<div class="col-md-4" id="mastercount"><%= @mastercount %></div>
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
case 'del' :
|
case 'del' :
|
||||||
var cash=$('#used_amount').text();
|
var cash=$('#used_amount').text();
|
||||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||||
|
break;
|
||||||
case 'nett':
|
case 'nett':
|
||||||
alert($('#valid_amount').text())
|
alert($('#valid_amount').text())
|
||||||
$('#used_amount').text($('#valid_amount').text());
|
$('#used_amount').text($('#valid_amount').text());
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
case 'del' :
|
case 'del' :
|
||||||
var cash=$('#amount').text();
|
var cash=$('#amount').text();
|
||||||
$('#amount').text(cash.substr(0,cash.length-1));
|
$('#amount').text(cash.substr(0,cash.length-1));
|
||||||
|
break;
|
||||||
case 'nett':
|
case 'nett':
|
||||||
var remain_amount = $('#validamount').val();
|
var remain_amount = $('#validamount').val();
|
||||||
$('#amount').text(remain_amount);
|
$('#amount').text(remain_amount);
|
||||||
|
|||||||
@@ -44,10 +44,9 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
#Order Controller
|
#Order Controller
|
||||||
resources :orders, only: [:create, :show, :update] do
|
resources :orders, only: [:create, :show, :update] do
|
||||||
|
|
||||||
post "bill" => "bill#create"
|
post "bill" => "bill#create"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
get 'view_orders' => "orders#view_orders"
|
||||||
|
|
||||||
#Current active bookings
|
#Current active bookings
|
||||||
resources :bookings, only: [:index, :show, :create, :update]
|
resources :bookings, only: [:index, :show, :create, :update]
|
||||||
|
|||||||
Reference in New Issue
Block a user