total other amount added to SaleItemsPdf
This commit is contained in:
@@ -156,7 +156,14 @@ class ShiftSale < ApplicationRecord
|
||||
.joins("JOIN customers as c ON c.customer_id = sales.customer_id")
|
||||
.where('shift_sale_id =? and sales.sale_status = "completed" and c.customer_type = "Takeaway" and c.membership_id is null',shift.id)
|
||||
.first()
|
||||
end
|
||||
end
|
||||
|
||||
# def self.get_total_other_charges_for_sale_item_report(from, to)
|
||||
# query = SaleItem.select("sum(sale_items.qty * sale_items.unit_price) as total_other_charges_amount")
|
||||
# .joins("JOIN sales as s ON s.sale_id = sale_items.sale_id")
|
||||
# .joins("JOIN shift_sales ss ON ss.id = s.shift_sale_id")
|
||||
# .where('s.sale_status = "completed" and sale_items.product_code = "Other Charges" and sale_items.item_instance_code is null and s.receipt_date between ? and ?',from, to)
|
||||
# end
|
||||
|
||||
def self.get_total_other_charges(shift)
|
||||
query = SaleItem.select("sum(sale_items.qty * sale_items.unit_price) as total_other_charges_amount")
|
||||
|
||||
Reference in New Issue
Block a user