update dashboard total sale and count
This commit is contained in:
@@ -867,6 +867,15 @@ end
|
||||
.order('e.name ASC')
|
||||
end
|
||||
|
||||
def self.total_sale(today)
|
||||
total = Sale.where('sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today).sum("grand_total")
|
||||
|
||||
end
|
||||
|
||||
def self.total_count(today)
|
||||
total = Sale.where('sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today).count
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def generate_custom_id
|
||||
|
||||
Reference in New Issue
Block a user