change some fun: for dashboard

This commit is contained in:
phyusin
2018-06-15 18:19:53 +06:30
parent c33ae58b07
commit 86b83125e6
3 changed files with 51 additions and 150 deletions

View File

@@ -119,10 +119,8 @@ class HomeController < ApplicationController
.sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)')
@inventories = StockJournal.inventory_balances(today,@from,@to,@from_time,@to_time).sum(:balance)
@total_sale = Sale.total_sale(today,current_user,@from,@to,@from_time,@to_time)
@total_count = Sale.total_count(today,current_user,@from,@to,@from_time,@to_time)
@total_card = Sale.total_card_sale(today,current_user,@from,@to,@from_time,@to_time)
@total_credit = Sale.credit_payment(today,current_user,@from,@to,@from_time,@to_time)
@total_trans = Sale.total_trans(today,current_user,@from,@to,@from_time,@to_time)
@total_payment_trans = Sale.total_payment_trans(today,current_user,@from,@to,@from_time,@to_time)
@sale_data = Array.new
@total_payment_methods = Sale.total_payment_methods(today,current_user,@from,@to,@from_time,@to_time)