dashboard hourly sale and license code clean

This commit is contained in:
Yan
2017-12-12 17:41:35 +06:30
parent e55948a7b2
commit bbf30ed26f
3 changed files with 10 additions and 27 deletions

View File

@@ -979,7 +979,8 @@ 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)
.group("date_format(receipt_date, '%I %p')")
.group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')")
.order('receipt_date')
end
def self.employee_sales(today)