change credit payment query for dashboard and daily sales

This commit is contained in:
phyusin
2018-07-30 16:10:17 +06:30
parent cbb649c8d5
commit ca14b1e399
5 changed files with 39 additions and 30 deletions

View File

@@ -126,8 +126,11 @@ class HomeController < ApplicationController
if !employee_sales.nil?
employee_sales.each do |emp|
emp_data = []
emp_data.push([emp.e_name, emp.payment_amount])
@employee_sales.push({'name' => emp.payment_method, 'data' => emp_data})
if emp.payment_amount > 0
emp_data.push([emp.e_name, emp.payment_amount])
@employee_sales.push({'name' => emp.payment_method, 'data' => emp_data})
end
end
end
@inventories = StockJournal.inventory_balances(today,@from,@to,@from_time,@to_time).sum(:balance)