change dashboard ui
This commit is contained in:
@@ -954,7 +954,7 @@ end
|
||||
end
|
||||
|
||||
def self.summary_sale_receipt(today)
|
||||
query = Sale.select('count(sale_id) as total_receipt, sum(total_amount) as total_amount, sum(grand_total) as grand_total, sum(total_discount) as total_discount, sum(total_tax) as total_tax')
|
||||
query = Sale.select('count(sale_id) as total_receipt, (case when sum(total_amount) > 0 then sum(total_amount) else 0.0 end) as total_amount, (case when sum(grand_total) > 0 then sum(grand_total) else 0.0 end) as grand_total, (case when sum(total_discount) > 0 then sum(total_discount) else 0.0 end) as total_discount, (case when sum(total_tax) > 0 then sum(total_tax) else 0.0 end) as total_tax')
|
||||
.where('sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
|
||||
.first()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user