hourly sale group

This commit is contained in:
Yan
2017-10-27 11:42:08 +06:30
parent 62ce53c978
commit 8f5d24a2e3

View File

@@ -856,7 +856,9 @@ end
end
def self.hourly_sales(today)
query= Sale.select("grand_total").where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
query= Sale.select("grand_total")
.where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
.group("date_format(receipt_date, '%I %p')")
end
def self.employee_sales(today)