fixed for reprint and query

This commit is contained in:
phyusin
2018-06-13 17:40:18 +06:30
parent 6952ce7359
commit 4a2d4b1007
6 changed files with 14 additions and 15 deletions

View File

@@ -18,16 +18,16 @@ class Origami::DashboardController < BaseOrigamiController
# .sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)')
# @inventories = StockJournal.inventory_balances(today).sum(:balance)
@total_sale = Sale.total_sale(today,current_user)
@total_count = Sale.total_count(today,current_user)
@total_card = Sale.total_card_sale(today,current_user)
@total_credit = Sale.credit_payment(today,current_user)
# @total_sale = Sale.total_sale(today,current_user)
# @total_count = Sale.total_count(today,current_user)
# @total_card = Sale.total_card_sale(today,current_user)
# @total_credit = Sale.credit_payment(today,current_user)
@sale_data = Array.new
@total_payment_methods = Sale.total_payment_methods(today,current_user)
if !@total_payment_methods.nil?
@total_payment_methods.each do |payment|
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb"
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay"
pay = Sale.payment_sale('card', today, current_user)
@sale_data.push({'card' => pay.payment_amount})
else