shop code filter for all reports and transactions

This commit is contained in:
Myat Zin Wai Maw
2019-11-26 12:06:52 +06:30
parent d1ab2c194d
commit 5dd4c6e7b6
26 changed files with 281 additions and 260 deletions

View File

@@ -11,9 +11,9 @@ class Reports::StockCheckController < BaseReportController
# end
from_date, to_date = get_date_range_from_params
@item_code = params[:item_code]
@inventory_definitions = InventoryDefinition.active.all
@inventory_definitions = InventoryDefinition.active.where("shop_code='#{@shop.shop_code}'")
@transaction = StockCheckItem.get_transaction(from_date, to_date, @item_code)
@transaction = StockCheckItem.where("shop_code='#{@shop.shop_code}'").get_transaction(from_date, to_date, @item_code)
@from = from_date
@to = to_date
# get printer info
@@ -27,7 +27,7 @@ class Reports::StockCheckController < BaseReportController
def show
from, to = get_date_range_from_params
@sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED)
@sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED).where("shift_sales.shop_code='#{@shop.shop_code}'")
date_arr = Array.new
@sale_data.each do |sale|