sub total fixed in origami shows
This commit is contained in:
@@ -27,7 +27,7 @@ class Order < ApplicationRecord
|
|||||||
if self.new_booking
|
if self.new_booking
|
||||||
|
|
||||||
booking = Booking.create({:dining_facility_id => self.table_id,:type => "TableBooking",
|
booking = Booking.create({:dining_facility_id => self.table_id,:type => "TableBooking",
|
||||||
:checkin_at => Time.now.utc, :checkin_by => self.employee_name,
|
:checkin_at => Time.now.utc.getlocal, :checkin_by => self.employee_name,
|
||||||
:booking_status => "assign" })
|
:booking_status => "assign" })
|
||||||
table = DiningFacility.find(self.table_id)
|
table = DiningFacility.find(self.table_id)
|
||||||
table.status = "occupied"
|
table.status = "occupied"
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
# end
|
# end
|
||||||
|
|
||||||
# Auto Printing
|
# Auto Printing
|
||||||
|
# ToDo per item per printer
|
||||||
if oqs.auto_print && is_auto_printed == false
|
if oqs.auto_print && is_auto_printed == false
|
||||||
print_slip(oqs, order, order_items)
|
print_slip(oqs, order, order_items)
|
||||||
is_auto_printed = true
|
is_auto_printed = true
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class Sale < ApplicationRecord
|
|||||||
order.save
|
order.save
|
||||||
|
|
||||||
booking.sale_id = self.id
|
booking.sale_id = self.id
|
||||||
booking.checkout_at = Time.now.utc
|
booking.checkout_at = Time.now.utc.getlocal
|
||||||
booking.checkout_by = requested_by.name
|
booking.checkout_by = requested_by.name
|
||||||
booking.save
|
booking.save
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ class Sale < ApplicationRecord
|
|||||||
def generate_invoice_by_items (items, requested_by)
|
def generate_invoice_by_items (items, requested_by)
|
||||||
taxable = true
|
taxable = true
|
||||||
self.requested_by = requested_by
|
self.requested_by = requested_by
|
||||||
self.requested_at = DateTime.now.utc
|
self.requested_at = DateTime.now.utc.getlocal
|
||||||
|
|
||||||
items.each do |item|
|
items.each do |item|
|
||||||
add_item(item)
|
add_item(item)
|
||||||
@@ -185,7 +185,7 @@ class Sale < ApplicationRecord
|
|||||||
sales_items.each do |item|
|
sales_items.each do |item|
|
||||||
#compute each item and added to total
|
#compute each item and added to total
|
||||||
subtotal_price = subtotal_price + item.price
|
subtotal_price = subtotal_price + item.price
|
||||||
total_taxable = total_taxable + item.taxable_price
|
total_taxable = total_taxable + (item.taxable_price * item.qty)
|
||||||
end
|
end
|
||||||
|
|
||||||
apply_tax (total_taxable)
|
apply_tax (total_taxable)
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
count = 0
|
count = 0
|
||||||
@order_items.each do |order_item |
|
@order_items.each do |order_item |
|
||||||
count += 1
|
count += 1
|
||||||
sub_total = sub_total + order_item.price
|
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||||
|
|
||||||
unless order_item.price == 0 %>
|
unless order_item.price == 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -165,7 +165,7 @@
|
|||||||
if @status == 'order'
|
if @status == 'order'
|
||||||
unless @order_items.nil?
|
unless @order_items.nil?
|
||||||
@order_items.each do |order_item |
|
@order_items.each do |order_item |
|
||||||
sub_total = sub_total + order_item.price
|
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||||
|
|
||||||
unless order_item.price == 0 %>
|
unless order_item.price == 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user