fix origami dashboard
This commit is contained in:
@@ -1583,6 +1583,8 @@ end
|
||||
|
||||
if !from.nil? && !to.nil?
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1606,6 +1608,8 @@ end
|
||||
|
||||
if !from.nil? && !to.nil?
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1637,6 +1641,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1654,6 +1660,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1675,6 +1683,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.merge(Sale.receipt_date_between(from, to))
|
||||
else
|
||||
query = query.merge(Sale.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day))
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1692,6 +1702,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1711,6 +1723,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1738,6 +1752,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1784,6 +1800,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1802,6 +1820,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1866,6 +1886,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1884,6 +1906,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1902,6 +1926,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -1921,6 +1947,8 @@ end
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor')
|
||||
@@ -2073,6 +2101,8 @@ def self.employee_sale(shift=nil,from=nil,to=nil,from_time=nil,to_time=nil)
|
||||
.paid.completed
|
||||
if !from.nil? && !to.nil?
|
||||
query = query.receipt_date_between(from, to)
|
||||
else
|
||||
query = query.receipt_date_between(Time.now.beginning_of_day, Time.now.end_of_day)
|
||||
end
|
||||
|
||||
if !shift.nil?
|
||||
|
||||
Reference in New Issue
Block a user