change promotion with menu item and menu item instance

This commit is contained in:
phyusin
2017-11-27 09:23:10 +06:30
parent 87a27250b7
commit c170974224
4 changed files with 107 additions and 55 deletions

View File

@@ -48,16 +48,30 @@ class Origami::ShiftsController < BaseOrigamiController
unique_code = "CloseCashierPdf"
shop_details = Shop.find(1)
puts "shop details"
p shop_details
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
puts "shift obj"
p shift_obj
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
puts "sale taxes"
p @sale_taxes
#other payment details for mpu or visa like card
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
puts "other payment"
p @other_payment
# Calculate price_by_accounts
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
puts "total amount by account"
p @total_amount_by_account
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
puts "total_discount_by_account"
p @total_discount_by_account
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
puts "total_member_discount"
p @total_member_discount
# get printer info
print_settings = PrintSetting.find_by_unique_code(unique_code)