change receipt no report ui and add sale taxes for dining charges
This commit is contained in:
@@ -51,7 +51,7 @@ class Sale < ApplicationRecord
|
||||
if !charges.nil?
|
||||
block_count, diningprice = DiningCharge.amount_calculate(charges, booking.checkin_at, booking.checkout_at)
|
||||
dining_time = booking.checkin_at.strftime('%H:%M %p').to_s + " - " + booking.checkout_at.strftime('%H:%M %p').to_s
|
||||
create_saleitem_diningcharges(charges, block_count, diningprice, booking.dining_facility.name, dining_time)
|
||||
create_saleitem_diningcharges(charges, block_count, diningprice, booking.dining_facility.name, dining_time, order_source)
|
||||
end
|
||||
|
||||
return status, sale_id
|
||||
@@ -131,6 +131,7 @@ class Sale < ApplicationRecord
|
||||
if order_source.nil?
|
||||
order_source = order.source
|
||||
end
|
||||
puts "compute source"
|
||||
compute(order_source)
|
||||
|
||||
#Update the order items that is billed
|
||||
@@ -275,7 +276,7 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def create_saleitem_diningcharges(chargeObj, block_count, diningprice, dining_name, dining_time)
|
||||
def create_saleitem_diningcharges(chargeObj, block_count, diningprice, dining_name, dining_time, order_source = nil)
|
||||
sale_item = SaleItem.new
|
||||
sale_item.product_code = chargeObj.item_code
|
||||
sale_item.product_name = dining_name.to_s + " ( " + dining_time.to_s + " )"
|
||||
@@ -291,7 +292,7 @@ class Sale < ApplicationRecord
|
||||
|
||||
# Re-calc
|
||||
sale = Sale.find(self.id)
|
||||
self.compute_by_sale_items(self.id, sale.sale_items, self.total_discount)
|
||||
self.compute_by_sale_items(self.id, sale.sale_items, self.total_discount, nil, order_source)
|
||||
end
|
||||
|
||||
def update_item (item)
|
||||
@@ -506,6 +507,7 @@ class Sale < ApplicationRecord
|
||||
if order_source.to_s == "emenu"
|
||||
order_source = "cashier"
|
||||
end
|
||||
|
||||
#Create new tax records
|
||||
tax_profiles.each do |tax|
|
||||
# customer.tax_profiles.each do |cus_tax|
|
||||
|
||||
Reference in New Issue
Block a user