update waste and spoilage
This commit is contained in:
@@ -1109,6 +1109,16 @@ def self.get_payment_method_by_shift(shift_sale_range,shift,from,to,payment_type
|
||||
return all_total,sale_type
|
||||
end
|
||||
|
||||
def self.get_wastes_and_spoilages(from,to,status)
|
||||
if status == "spoile"
|
||||
type = "and sales.sale_status = 'spoile'"
|
||||
else
|
||||
type = "and sales.sale_status = 'waste'"
|
||||
end
|
||||
query = Sale.all.where("sales.receipt_date between ? and ? #{type}",from,to)
|
||||
.group("sales.receipt_no")
|
||||
end
|
||||
|
||||
# def self.get_separate_tax(from,to,payment_method=nil)
|
||||
|
||||
# query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
||||
|
||||
Reference in New Issue
Block a user