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

@@ -5,15 +5,15 @@ class Transactions::SurveysController < ApplicationController
to = params[:to]
if filter.nil? && from.nil? && to.nil?
@surveys = Survey.all
@surveys = Survey.where("shop_code='#{@shop.shop_code}'")
else
@surveys = Survey.search(filter,from,to)
end
@surveys = Survey.search(filter,from,to).where("shop_code='#{@shop.shop_code}'")
end
@filter = filter
@from = from
@to = to
respond_to do |format|
format.html # index.html.erb
format.xls