update close receipt for member discount

This commit is contained in:
Aung Myo
2017-08-11 15:39:08 +06:30
parent 2c7a641d47
commit 79ca1428b9
7 changed files with 74 additions and 24 deletions

View File

@@ -7,6 +7,7 @@ class Origami::HomeController < BaseOrigamiController
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
@shop = Shop.find_by_id(1)
# @shift = ShiftSale.current_open_shift(current_user.id)
end
@@ -39,7 +40,6 @@ class Origami::HomeController < BaseOrigamiController
else
sale = Sale.find(booking.sale_id)
if sale.sale_status != "completed" && sale.sale_status != 'void'
puts "enter"
@sale_array.push(sale)
if @status_order == 'order'
@status_order = 'sale'

View File

@@ -39,13 +39,13 @@ class Origami::ShiftsController < BaseOrigamiController
# 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)
print_settings = PrintSetting.find_by_unique_code(unique_code)
printer = Printer::CashierStationPrinter.new(print_settings)
printer.print_close_cashier(print_settings,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account)
printer.print_close_cashier(print_settings,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
end
@@ -72,6 +72,8 @@ class Origami::ShiftsController < BaseOrigamiController
# 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)
end
end