finished sale summary quick view

This commit is contained in:
Aung Myo
2017-08-10 11:59:15 +06:30
parent 13359cecba
commit 80d13ce1f9
8 changed files with 227 additions and 10 deletions

View File

@@ -2,10 +2,11 @@ class Origami::HomeController < BaseOrigamiController
before_action :set_dining, only: [:show]
def index
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
@orders = Order.all.order('date desc')
@shop = Shop.find_by_id(1)
# @shift = ShiftSale.current_open_shift(current_user.id)
end

View File

@@ -35,8 +35,6 @@ class Origami::ShiftsController < BaseOrigamiController
@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)
#t 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')
@@ -60,6 +58,21 @@ class Origami::ShiftsController < BaseOrigamiController
def sale_summary
@shift = ShiftSale.current_open_shift(current_user.id)
# @shift = ShiftSale.find_by_id(shift_id)
if @shift
#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)
#t 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')
end
end