heck rounding adjustment error

This commit is contained in:
phyusin
2018-01-28 16:12:59 +06:30
parent d4e2d5be25
commit aa129ad469
9 changed files with 66 additions and 53 deletions

View File

@@ -28,7 +28,6 @@ class Origami::PaymentsController < BaseOrigamiController
shop_details = Shop::ShopDetail
# customer= Customer.where('customer_id=' +.customer_id)
customer = Customer.find(sale_data.customer_id)
# rounding adjustment
if shop_details.is_rounding_adj
a = sale_data.grand_total % 25 # Modulus
@@ -42,7 +41,6 @@ class Origami::PaymentsController < BaseOrigamiController
end
end
#end rounding adjustment
# get member information
rebate = MembershipSetting.find_by_rebate(1)
if customer.membership_id != nil && rebate
@@ -74,7 +72,6 @@ class Origami::PaymentsController < BaseOrigamiController
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
shop_details = Shop::ShopDetail
# rounding adjustment
if shop_details.is_rounding_adj
a = saleObj.grand_total % 25 # Modulus
@@ -167,12 +164,7 @@ class Origami::PaymentsController < BaseOrigamiController
@table_no = ''
@shop = Shop::ShopDetail
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 = @sale_data.rounding_adjustment
#get customer amount
@customer = Customer.find(@sale_data.customer_id)