update other charge add to recipt bill and close pdf
This commit is contained in:
@@ -150,6 +150,19 @@ class SaleItem < ApplicationRecord
|
||||
return price,type
|
||||
end
|
||||
|
||||
# Get Prices for each accounts (eg: food, beverage)
|
||||
def self.calculate_other_charges(sale_items)
|
||||
total = 0
|
||||
# Check for actual sale items
|
||||
sale_items.each do |si|
|
||||
if si.product_code == "Other Charges" && si.item_instance_code == nil
|
||||
total = total + si.price
|
||||
end
|
||||
end
|
||||
|
||||
return total
|
||||
end
|
||||
|
||||
# def self.get_overall_discount(sale_id)
|
||||
# price = 0.0
|
||||
# item=SaleItem.where("product_code=?", sale_id)
|
||||
|
||||
Reference in New Issue
Block a user