replace @shop and shop_details with current_shop

This commit is contained in:
Zin Moe
2020-01-13 17:34:48 +06:30
parent f99defc459
commit a3edbb07fd
48 changed files with 72 additions and 72 deletions

View File

@@ -26,7 +26,7 @@ class Api::CallWaitersController < ActionController::API
unique_code = "CallWaiterPdf"
print_settings = PrintSetting.find_by_unique_code(unique_code)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_call_waiter(print_settings,@table,@time,@shop)
printer.print_call_waiter(print_settings,@table,@time,current_shop)
end

View File

@@ -70,7 +70,7 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
order_reservation_id, flag = OrderReservation.addOrderReservationInfo(order_reservation)
if !order_reservation_id.nil? && flag
shop = @shop
shop = current_shop
if !shop.nil?
shop_code = shop.shop_code
order_audio = DisplayImage.find_by_shop_id_and_name(shop.id, "order_audio")

View File

@@ -47,7 +47,7 @@ class Api::OrdersController < Api::ApiController
# end
#
return @shop.to_json
return current_shop.to_json
end

View File

@@ -10,7 +10,7 @@ class Api::Payment::CallbackController < Api::ApiController
if trade_status == "PAY_SUCCESS"
merch_order_id = params[:Request][:merch_order_id]
status, filename, sale_receipt_no, printer_name = Payment.pay(getCloudDomain, cash, sale_id, member_info, type, tax_type, path, latest_order_no, shop_detail, current_user, 'kbzpay', merch_order_id)
status, filename, sale_receipt_no, printer_name = Payment.pay(getCloudDomain, cash, sale_id, member_info, type, tax_type, path, latest_order_no, current_shop, current_user, 'kbzpay', merch_order_id)
render json: JSON.generate({:status => status, :message => "Can't Rebate coz of Sever Error ", :filename => filename, :receipt_no => sale_receipt_no, :printer_name => printer_name})
end
end

View File

@@ -15,7 +15,7 @@ class Api::Payment::MobilepaymentController < Api::ApiController
saleObj = Sale.find(sale_id)
sale_items = SaleItem.get_all_sale_items(sale_id)
shop_detail = @shop
shop_detail = current_shop
# rounding adjustment
if !path.include? ("credit_payment")

View File

@@ -154,7 +154,7 @@ class Api::PaymentsController < Api::ApiController
other_amount = SaleItem.calculate_other_charges(sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,sale,params[:card_no], item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, 'Foodcourt',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,sale,params[:card_no], item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, 'Foodcourt',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
render json: JSON.generate({:status => true, :balance_amount => card_balance_amount,:receipt_no => sale.receipt_no,:order_no => latest_order_no, :message => "Payment successful."})
else

View File

@@ -2,7 +2,7 @@ class Api::SoundEffectController < Api::ApiController
#sound effect / alarm api for doemal side calling
def sound_effect
shop = @shop
shop = current_shop
if !shop.nil?
shop_code = shop.shop_code
order_audio = DisplayImage.find_by_shop_id_and_name(shop.id, "order_audio")

View File

@@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail,:order_reservation, :bank_integration
helper_method :current_shop,:order_reservation, :bank_integration
# lookup domain for db from provision
# before_action :set_locale
# helper_method :current_company,:current_login_employee,:current_user

View File

@@ -2,7 +2,7 @@ module LoginVerification
extend ActiveSupport::Concern
included do
before_action :authenticate_session_token
helper_method :current_company, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration, :shop_detail
helper_method :current_company, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration, :current_shop
end
#this is base api base controller to need to inherit.
@@ -30,9 +30,9 @@ module LoginVerification
end
#Shop Name in Navbor
def shop_detail
@shop ||= current_shop
end
# def shop_detail
# @shop ||= current_shop
# end
#check order reservation used
def order_reservation

View File

@@ -76,7 +76,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
def completed
customer =Customer.find_by_customer_id(params[:customer_id])
phone_number =customer.contact_no
if Order.send_message(phone_number,params[:order_id],@shop.name)
if Order.send_message(phone_number,params[:order_id],current_shop.name)
booking =Booking.find(params[:booking_id])
booking.booking_status ='completed'
booking.save!

View File

@@ -20,7 +20,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
#shop_detail = Shop.first
# rounding adjustment
if !path.include? ("credit_payment")
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
rounding_adj = new_total - saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj) if rounding_adj > 0
@@ -154,7 +154,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
other_amount = SaleItem.calculate_other_charges(sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,saleObj,account_no, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, 'Foodcourt',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,saleObj,account_no, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, 'Foodcourt',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
#end
end
@@ -223,7 +223,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
@pdf_view = @lookup_pdf.value
end
amount = SalePayment.get_kbz_pay_amount(sale_id, current_user,@shop)
amount = SalePayment.get_kbz_pay_amount(sale_id, current_user,current_shop)
@kbz_pay_amount += amount.to_f
#for changable on/off
@@ -270,7 +270,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
#end rounding adjustment
# rounding adjustment
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
a = saleObj.grand_total % 25 # Modulus
b = saleObj.grand_total / 25 # Division
#not calculate rounding if modulus is 0 and division is even
@@ -472,7 +472,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
printer = Printer::ReceiptPrinter.new(print_settings)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
result = {
:status => true,
@@ -571,7 +571,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "FOC",nil,nil,other_amount,nil,nil,nil,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "FOC",nil,nil,other_amount,nil,nil,nil,nil)
result = {
:status => true,
:filepath => filename,
@@ -606,7 +606,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
saleObj = Sale.find(params[:sale_id])
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
a = saleObj.grand_total % 25 # Modulus
b = saleObj.grand_total / 25 # Division
#not calculate rounding if modulus is 0 and division is even

View File

@@ -9,7 +9,7 @@ class Foodcourt::PayparPaymentsController < BaseFoodcourtController
saleObj = Sale.find(sale_id)
# rounding adjustment
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
rounding_adj = new_total-saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)

View File

@@ -88,7 +88,7 @@ class Foodcourt::ShiftsController < BaseFoodcourtController
end
end
end
shop_details = shop_detail
shop_details = current_shop
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
sale_items = ''

View File

@@ -132,7 +132,7 @@ class Foodcourt::VoidController < BaseFoodcourtController
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
other_amount = SaleItem.calculate_other_charges(sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "VOID",current_balance,nil,other_amount,nil,nil,nil,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "VOID",current_balance,nil,other_amount,nil,nil,nil,nil)
result = {
:filepath => filename,
:printer_model => print_settings.brand_name,

View File

@@ -118,7 +118,7 @@ class Foodcourt::WasteSpoileController < BaseFoodcourtController
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
other_amount = SaleItem.calculate_other_charges(sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, remark,current_balance,nil,other_amount,nil,nil,nil,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, remark,current_balance,nil,other_amount,nil,nil,nil,nil)
result = {
:filepath => filename,
:printer_model => print_settings.brand_name,

View File

@@ -90,8 +90,8 @@ class Inventory::InventoryDefinitionsController < BaseInventoryController
format.json { head :no_content }
end
StockJournal.delete_stock_journal(inventory.item_code,@shop)
StockCheckItem.delete_stock_check_item(inventory.item_code,@shop)
StockJournal.delete_stock_journal(inventory.item_code,current_shop)
StockCheckItem.delete_stock_check_item(inventory.item_code,current_shop)
if !inventory.nil?
inventory.destroy
flash[:message] = 'Inventory was successfully destroyed.'

View File

@@ -19,7 +19,7 @@ class Inventory::StockChecksController < BaseInventoryController
item_list = JSON.parse(params[:stock_item])
reason = params[:reason]
check = StockCheck.new
@check = check.create(current_user, reason, item_list,@shop)
@check = check.create(current_user, reason, item_list,current_shop)
end
def show
@@ -33,7 +33,7 @@ class Inventory::StockChecksController < BaseInventoryController
check = params[:data]
stockCheck = StockCheck.find_by_id(check)
stockCheck.stock_check_items.each do |item|
StockJournal.from_stock_check(item,@shop)
StockJournal.from_stock_check(item,current_shop)
end
end
@@ -49,7 +49,7 @@ class Inventory::StockChecksController < BaseInventoryController
print_settings = PrintSetting.find_by_unique_code(unique_code)
if !print_settings.nil?
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_stock_check_result(print_settings, stockcheck, stockcheck_items, checker.name, @shop)
printer.print_stock_check_result(print_settings, stockcheck, stockcheck_items, checker.name, current_shop)
end
end

View File

@@ -23,7 +23,7 @@ class Origami::AlipayController < BaseOrigamiController
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -8,7 +8,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
total = sale_data.grand_total
@creditcount = 0
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -6,7 +6,7 @@ class Origami::DingaController < BaseOrigamiController
@membership_rebate_balance=0
@sale_data = Sale.find_by_sale_id(@sale_id)
@receipt_no = @sale_data.receipt_no
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(@sale_data.grand_total)
else
new_total = @sale_data.grand_total

View File

@@ -17,7 +17,7 @@ class Origami::GiftVoucherController < BaseOrigamiController
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -33,7 +33,7 @@ class Origami::HomeController < BaseOrigamiController
@status_sale = ""
@sale_array = Array.new
@shop = shop_detail
@shop = current_shop
@membership = MembershipSetting::MembershipSetting
@payment_methods = PaymentMethodSetting.all
@dining_booking = @dining.current_bookings

View File

@@ -24,7 +24,7 @@ class Origami::JcbController < BaseOrigamiController
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -11,7 +11,7 @@ class Origami::JunctionPayController < BaseOrigamiController
@cashier_id = current_user.emp_id
@payment_method_setting_nav = PaymentMethodSetting.all
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -23,7 +23,7 @@ class Origami::MasterController < BaseOrigamiController
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -22,7 +22,7 @@ class Origami::MpuController < BaseOrigamiController
others = 0
if @shop.is_rounding_adj && (!path.include? ("credit_payment"))
if current_shop.is_rounding_adj && (!path.include? ("credit_payment"))
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -6,7 +6,7 @@ class Origami::PaymalController < BaseOrigamiController
@membership_rebate_balance=0
sale_data = Sale.find_by_sale_id(@sale_id)
@receipt_no = sale_data.receipt_no
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -65,7 +65,7 @@ class Origami::PaymentsController < BaseOrigamiController
end
end
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, status, qr, cashier_terminal, sale_items, sale_data, customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, nil, @shop, "Frt", current_balance, nil, other_amount, nil, nil, nil)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, status, qr, cashier_terminal, sale_items, sale_data, customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, nil, current_shop, "Frt", current_balance, nil, other_amount, nil, nil, nil)
result = {
:filepath => filename,
@@ -202,7 +202,7 @@ class Origami::PaymentsController < BaseOrigamiController
other_amount = SaleItem.calculate_other_charges(sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal, sale_items, saleObj, customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, rebate_amount, @shop, "Paid", current_balance, card_data, other_amount, latest_order_no, card_balance_amount, nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal, sale_items, saleObj, customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, rebate_amount, current_shop, "Paid", current_balance, card_data, other_amount, latest_order_no, card_balance_amount, nil)
#end
end
@@ -275,7 +275,7 @@ class Origami::PaymentsController < BaseOrigamiController
@pdf_view = @lookup_pdf.value
end
amount = SalePayment.get_kbz_pay_amount(sale_id, current_user,@shop)
amount = SalePayment.get_kbz_pay_amount(sale_id, current_user, current_shop)
@kbz_pay_amount += amount.to_f
#for changable on/off
@@ -322,7 +322,7 @@ class Origami::PaymentsController < BaseOrigamiController
#end rounding adjustment
# rounding adjustment
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
a = saleObj.grand_total % 25 # Modulus
b = saleObj.grand_total / 25 # Division
#not calculate rounding if modulus is 0 and division is even
@@ -524,7 +524,7 @@ class Origami::PaymentsController < BaseOrigamiController
printer = Printer::ReceiptPrinter.new(print_settings)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount, current_shop, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
result = {
:status => true,
@@ -622,7 +622,7 @@ class Origami::PaymentsController < BaseOrigamiController
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "FOC",nil,nil,other_amount,nil,nil,nil,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "FOC",nil,nil,other_amount,nil,nil,nil,nil)
result = {
:status => true,
:filepath => filename,
@@ -657,7 +657,7 @@ class Origami::PaymentsController < BaseOrigamiController
saleObj = Sale.find(params[:sale_id])
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
a = saleObj.grand_total % 25 # Modulus
b = saleObj.grand_total / 25 # Division
#not calculate rounding if modulus is 0 and division is even

View File

@@ -8,7 +8,7 @@ class Origami::PayparPaymentsController < BaseOrigamiController
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
# rounding adjustment
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
rounding_adj = new_total-saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)

View File

@@ -5,7 +5,7 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
@cashier_type = params[:type]
@membership_rebate_balance=0
sale_data = Sale.find_by_sale_id(@sale_id)
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -126,7 +126,7 @@ class Origami::ShiftsController < BaseOrigamiController
if find_close_cashier_print[0][1].to_i > 0
printer.print_close_cashier(print_settings,cashier_terminal,@shift, @sale_items, @total_other_charges_info, @shop,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments)
printer.print_close_cashier(print_settings,cashier_terminal,current_shop, @sale_items, @total_other_charges_info, current_shop,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments)
end
end
end

View File

@@ -9,7 +9,7 @@ class Origami::TableInvoicesController < BaseOrigamiController
else
sale = Sale.find(booking.sale_id)
# rounding adjustment
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
a = sale.grand_total % 25 # Modulus
b = sale.grand_total / 25 # Division
#not calculate rounding if modulus is 0 and division is even

View File

@@ -21,7 +21,7 @@ class Origami::UnionpayController < BaseOrigamiController
total = sale_data.grand_total
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -21,7 +21,7 @@ class Origami::VisaController < BaseOrigamiController
total = sale_data.grand_total
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -143,7 +143,7 @@ class Origami::VoidController < BaseOrigamiController
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
other_amount = SaleItem.calculate_other_charges(sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "VOID",current_balance,nil,other_amount,nil,nil,nil,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "VOID",current_balance,nil,other_amount,nil,nil,nil,nil)
result = {
:filepath => filename,
:printer_model => print_settings.brand_name,

View File

@@ -7,7 +7,7 @@ class Origami::VoucherController < BaseOrigamiController
total = sale_data.grand_total
@vouchercount = 0
others = 0
if @shop.is_rounding_adj
if current_shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total

View File

@@ -117,7 +117,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
other_amount = SaleItem.calculate_other_charges(sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, remark,current_balance,nil,other_amount,nil,nil,nil,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, remark,current_balance,nil,other_amount,nil,nil,nil,nil)
result = {
:filepath => filename,
:printer_model => print_settings.brand_name,

View File

@@ -118,7 +118,7 @@ class Reports::HourlySaleitemController < BaseReportController
shift_name = employee.nil? ? sh_name : "#{sh_name} (#{employee.name})"
end
shop_details = shop_detail
shop_details = current_shop
account_type = params[:account_type]
@type = params[:period_type]
period_name = get_period_name(params[:period])

View File

@@ -119,7 +119,7 @@ class Reports::HourlySaleitemController < BaseReportController
shift_name = employee.nil? ? sh_name : "#{sh_name} (#{employee.name})"
end
shop_details = shop_detail
shop_details = current_shop
account_type = params[:account_type]
@type = params[:period_type]
period_name = get_period_name(params[:period])

View File

@@ -215,7 +215,7 @@ authorize_resource :class => false
printer = Printer::ReceiptPrinter.new(print_settings)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
result = {
:status => true,

View File

@@ -129,11 +129,11 @@ class Reports::SaleitemController < BaseReportController
if print_settings.nil?
if !print_settings_star.nil?
printer = Printer::CashierStationPrinter.new(print_settings_star)
printer.print_sale_items_report(print_settings_star, @shop, period_name, @type, account_type, from, to, shift_name, @sale_data, @total_other_charges)
printer.print_sale_items_report(print_settings_star, current_shop, period_name, @type, account_type, from, to, shift_name, @sale_data, @total_other_charges)
end
else
printer = Printer::CashierStationPrinter.new(print_settings)
printer.print_sale_items_report(print_settings, @shop, period_name, @type, account_type, from, to, shift_name, @sale_data, @total_other_charges)
printer.print_sale_items_report(print_settings, current_shop, period_name, @type, account_type, from, to, shift_name, @sale_data, @total_other_charges)
end
respond_to do |format|

View File

@@ -75,7 +75,7 @@ class Reports::ShiftsaleController < BaseReportController
end
shop_details = shop_detail
shop_details = current_shop
cashier_terminal = @shift.cashier_terminal
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
@total_waste = Sale.get_total_waste(shift_id).sum(:grand_total)
@@ -97,7 +97,7 @@ class Reports::ShiftsaleController < BaseReportController
printer = Printer::CashierStationPrinter.new(print_settings)
# printer.print_close_cashier(print_settings,cashier_terminal,@shift, nil, shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments)
printer.print_close_cashier(print_settings,cashier_terminal,@shift, @sale_items, @total_other_charges_info, @shop,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments)
printer.print_close_cashier(print_settings,cashier_terminal,@shift, @sale_items, @total_other_charges_info, current_shops,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments)
respond_to do |format|
format.html { redirect_to '/en/reports/shiftsale/', notice: 'Printing Completed.'}

View File

@@ -157,7 +157,7 @@ class Settings::MenusController < ApplicationController
def import
if params[:file]
status = Menu.import(params[:file], current_user.name,@shop)
status = Menu.import(params[:file], current_user.name,current_shop)
redirect_to settings_menus_path, notice: status
end
end

View File

@@ -32,7 +32,7 @@ class Settings::ShopsController < ApplicationController
if @settings_shop.save
if params[:display_images].present?
params[:display_images]['image'].each do |a|
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => a)
@display_image = @settings_shop.display_images.create!(:shop_id => current_shop.id, :image => a)
end
end
format.html { redirect_to settings_shops_url, notice: 'Shop was successfully created.' }
@@ -60,16 +60,16 @@ class Settings::ShopsController < ApplicationController
File.delete(delete_path)
end
end
save_path = Rails.root.join("public/#{@shop.shop_code}_#{a.original_filename}")
save_path = Rails.root.join("public/#{current_shop.shop_code}_#{a.original_filename}")
File.open(save_path, 'wb') do |f|
f.write a.read
end
audio_name = "#{@shop.shop_code}_#{a.original_filename}"
audio_name = "#{current_shop.shop_code}_#{a.original_filename}"
@settings_shop.display_images.where(:name => "order_audio").destroy_all
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :name => "order_audio", :image => audio_name)
@display_image = @settings_shop.display_images.create!(:shop_id => current_shop.id, :name => "order_audio", :image => audio_name)
else
@aa = Base64.encode64(a.read)
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => "data:image/jpeg;base64,"+@aa)
@display_image = @settings_shop.display_images.create!(:shop_id => current_shop.id, :image => "data:image/jpeg;base64,"+@aa)
end
end
end

View File

@@ -350,7 +350,7 @@ class Transactions::SalesController < ApplicationController
customer= Customer.find(sale.customer_id)
#shop detail
shop_details = @shop
shop_details = current_shop
# get member information
rebate = MembershipSetting.find_by_rebate(1)
if customer.membership_id != nil && rebate

View File

@@ -37,7 +37,7 @@
</div>
<!-- Start Shop Info -->
<div class="navbar-right m-auto">
<span class="navbar-brand navbar-brand-txt"><%= shop_detail.name %></span>
<span class="navbar-brand navbar-brand-txt"><%= current_shop.name %></span>
</div>
<!-- End Shop Info -->
<% if current_login_employee.role !='foodcourt_cashier' %>

View File

@@ -9,7 +9,7 @@
</div>
<!-- Start Shop Info -->
<div class="navbar-right m-auto">
<span class="navbar-brand navbar-brand-txt"><%= shop_detail.name %></span>
<span class="navbar-brand navbar-brand-txt"><%= current_shop.name %></span>
</div>
<!-- End Shop Info -->

View File

@@ -82,7 +82,7 @@
<div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
<div class="current-shop-name">
<span><%= shop_detail.name %></span>
<span><%= current_shop.name %></span>
</div>
</div>
</div>