Merge branch 'r-1902001-01' into foodcourt
This commit is contained in:
@@ -54,6 +54,7 @@ class Origami::VoidController < BaseOrigamiController
|
||||
rebate_amount = nil
|
||||
current_balance = nil
|
||||
|
||||
# For Cashier by Zone
|
||||
if sale.booking.dining_facility_id.to_i > 0
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
@@ -4,6 +4,7 @@ authorize_resource :class => false
|
||||
@filter_for_credit = [['All',''],['Paid','paid'],['Unpaid','unpaid']]
|
||||
@sources = [["All",''], ["Cashier","cashier"],["Quick Service","quick_service"],["Online Order","doemal_order"]]
|
||||
from, to = get_date_range_from_params
|
||||
customer_filter = params[:customer]
|
||||
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
@@ -13,14 +14,13 @@ authorize_resource :class => false
|
||||
if to.blank?
|
||||
@shift = ShiftSale.where("shift_started_at = ? and shift_closed_at is NULL",shift_sale.shift_started_at)
|
||||
else
|
||||
|
||||
@shift = ShiftSale.where("shift_started_at = ? and shift_closed_at = ?",shift_sale.shift_started_at, shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
|
||||
@filter = params[:filter_check]
|
||||
@order_source = params[:order_source]
|
||||
@sale_data = Sale.get_by_shift_sale_credit_payment(@shift_sale_range,@shift,from,to,@filter,@order_source)
|
||||
@sale_data = Sale.get_by_shift_sale_credit_payment(@shift_sale_range,@shift,from,to,@filter,customer_filter,@order_source)
|
||||
|
||||
@from = from
|
||||
@to = to
|
||||
|
||||
@@ -3,59 +3,60 @@ authorize_resource :class => false
|
||||
def index
|
||||
@payments = [["All Payment",''], ["Cash Payment","cash"], ["Credit Payment","creditnote"], ["FOC Payment","foc"]]
|
||||
@payment_method = PaymentMethodSetting.all
|
||||
from, to = get_date_range_from_params
|
||||
from, to = get_date_range_from_params
|
||||
customer_filter = params[:customer]
|
||||
|
||||
@shift_sale_range = ''
|
||||
|
||||
@shift = ''
|
||||
if params[:shift_name].to_i != 0
|
||||
@shift = ''
|
||||
if params[:shift_name].to_i != 0
|
||||
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
@shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
@shift = ShiftSale.where("shift_started_at = ? and shift_closed_at is NULL",@shift_sale.shift_started_at)
|
||||
else
|
||||
if @shift_sale.shift_closed_at.blank?
|
||||
@shift = ShiftSale.where("shift_started_at = ? and shift_closed_at is NULL",@shift_sale.shift_started_at)
|
||||
else
|
||||
@shift = ShiftSale.where("shift_started_at = ? and shift_closed_at = ?",@shift_sale.shift_started_at, @shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
@shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',@shift_sale.shift_started_at)
|
||||
else
|
||||
if @shift_sale.shift_closed_at.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',@shift_sale.shift_started_at)
|
||||
else
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',@shift_sale.shift_started_at, @shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@lookup = Lookup.find_by_lookup_type('reprint_receipt')
|
||||
if @lookup.nil?
|
||||
@lookup = Lookup.create_reprint_receipt_lookup
|
||||
end
|
||||
@lookup = Lookup.find_by_lookup_type('reprint_receipt')
|
||||
if @lookup.nil?
|
||||
@lookup = Lookup.create_reprint_receipt_lookup
|
||||
end
|
||||
|
||||
payment_type = params[:payment_type]
|
||||
@sale_data = Sale.get_shift_sales_by_receipt_no(@shift_sale_range,@shift,from,to,payment_type)
|
||||
@sale_taxes = Sale.get_separate_tax(@shift_sale_range,@shift,from,to,payment_type)
|
||||
@tax_profiles = TaxProfile.group('name').order('order_by asc') #.limit(2)
|
||||
payment_type = params[:payment_type]
|
||||
@sale_data = Sale.get_shift_sales_by_receipt_no(@shift_sale_range, @shift, from, to, payment_type, customer_filter)
|
||||
@sale_taxes = Sale.get_separate_tax(@shift_sale_range, @shift, from, to, payment_type)
|
||||
@tax_profiles = TaxProfile.group('name').order('order_by asc') #.limit(2)
|
||||
|
||||
@from = from
|
||||
@to = to
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
if @shift.present?
|
||||
@shift.each do |sh|
|
||||
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_data = sh
|
||||
end
|
||||
end
|
||||
@from = from
|
||||
@to = to
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
if @shift.present?
|
||||
@shift.each do |sh|
|
||||
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_data = sh
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls
|
||||
end
|
||||
format.html
|
||||
format.xls
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
@sale_data = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
@sale_data = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
date_arr = Array.new
|
||||
@sale_data.each do |sale|
|
||||
@@ -68,11 +69,11 @@ authorize_resource :class => false
|
||||
date_arr.push(str)
|
||||
end
|
||||
|
||||
out = {:status => 'ok', :message => date_arr}
|
||||
out = {:status => 'ok', :message => date_arr}
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: out }
|
||||
end
|
||||
respond_to do |format|
|
||||
format.json { render json: out }
|
||||
end
|
||||
end
|
||||
|
||||
def sync_data
|
||||
|
||||
@@ -6,6 +6,11 @@ class Reports::ReceiptNoDetailController < BaseReportController
|
||||
@payment_methods += PaymentMethodSetting.pluck(:payment_method).map { |payment_method| [payment_method.parameterize == 'paymal' ? 'Card' : payment_method, payment_method.parameterize] }
|
||||
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
customer_filter = params[:customer]
|
||||
|
||||
@shift_sale_range = ''
|
||||
|
||||
@shift = ''
|
||||
if params[:shift_name].to_i != 0
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
@@ -23,7 +28,7 @@ class Reports::ReceiptNoDetailController < BaseReportController
|
||||
end
|
||||
|
||||
payment_type = params[:payment_type]
|
||||
@sale_data = Sale.get_shift_sales_by_receipt_no_detail(@shift_sale_range,@shift,from,to,payment_type)
|
||||
@sale_data = Sale.get_shift_sales_by_receipt_no_detail(@shift_sale_range, @shift, from, to, payment_type, customer_filter)
|
||||
|
||||
@from = from
|
||||
@to = to
|
||||
|
||||
Reference in New Issue
Block a user