Merge branch 'adminbsb_material_ui'

This commit is contained in:
Aung Myo
2018-01-16 11:01:34 +06:30
7 changed files with 59 additions and 46 deletions

View File

@@ -1,4 +1,5 @@
class Origami::HomeController < BaseOrigamiController
authorize_resource :class => false
before_action :set_dining, only: [:show]
def index

View File

@@ -21,8 +21,6 @@ class Origami::PaymentsController < BaseOrigamiController
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
Rails.logger.debug ENV["SERVER_MODE"]
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# Print for First Bill to Customer
unique_code = "ReceiptBillPdf"

View File

@@ -54,27 +54,26 @@ class Origami::ShiftsController < BaseOrigamiController
card_sett_trans.save()
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
unique_code = "CloseCashierPdf"
shop_details = Shop.find(1)
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
#other payment details for mpu or visa like card
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
# unique_code = "CloseCashierPdf"
# shop_details = Shop.find(1)
# #get tax
# shift_obj = ShiftSale.where('id =?',@shift.id)
# @sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
# #other payment details for mpu or visa like card
# @other_payment = ShiftSale.get_by_shift_other_payment(@shift)
# Calculate price_by_accounts
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
# get printer info
print_settings = PrintSetting.find_by_unique_code(unique_code)
# # Calculate price_by_accounts
# @total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
# @total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
# @total_member_discount = ShiftSale.get_total_member_discount(@shift)
# # get printer info
# print_settings = PrintSetting.find_by_unique_code(unique_code)
printer = Printer::CashierStationPrinter.new(print_settings)
# printer = Printer::CashierStationPrinter.new(print_settings)
# printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
end
end
Employee.logout(session[:session_token])
session[:session_token] = nil