shop code
This commit is contained in:
@@ -6,7 +6,7 @@ class Origami::GiftVoucherController < BaseOrigamiController
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = 0
|
||||
@gift_vouchercount = 0
|
||||
@shop = Shop.first
|
||||
# @shop = Shop.first
|
||||
@rounding_adj = 0
|
||||
@can_gift_voucher = 0
|
||||
@member_discount = 0
|
||||
@@ -15,16 +15,16 @@ class Origami::GiftVoucherController < BaseOrigamiController
|
||||
@receipt_no = nil
|
||||
if !sale_data.nil?
|
||||
total = sale_data.grand_total
|
||||
|
||||
|
||||
others = 0
|
||||
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "gift_voucher"
|
||||
@gift_vouchercount = @gift_vouchercount + sale_payment.payment_amount
|
||||
@@ -48,13 +48,13 @@ class Origami::GiftVoucherController < BaseOrigamiController
|
||||
ref_no = params[:reference_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
shop_details = Shop.first
|
||||
|
||||
# shop_details = Shop.first
|
||||
|
||||
# rounding adjustment
|
||||
# if shop_details.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)
|
||||
# saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||
# end
|
||||
|
||||
# saleObj = Sale.find(sale_id)
|
||||
@@ -64,8 +64,8 @@ class Origami::GiftVoucherController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user