update sale item report

This commit is contained in:
Aung Myo
2018-04-04 14:09:35 +06:30
parent 17562f6fcf
commit 8c9b0f756d
4 changed files with 25 additions and 11 deletions

View File

@@ -806,6 +806,15 @@ def self.get_by_shift_sale(from,to,status)
return query = query.where("shift_sales.shift_started_at >= ?" + " AND shift_sales.shift_closed_at <= ?", from,to)
end
def self.get_by_shift_sale_by_item(from,to,status)
query = ShiftSale.select("shift_sales.id ,shift_started_at AS opening_date,
shift_closed_at As closing_date," +
" grand_total AS grand_total, cash_sales AS cash," +
"total_taxes AS total_tax,total_discounts As total_discount")
.order("shift_sales.id DESC")
return query = query.where("shift_sales.shift_started_at >= ?" , from)
end
def self.get_item_query(type)
if type == "revenue" || type.nil?