Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Nweni
2017-06-20 19:00:02 +06:30
28 changed files with 330 additions and 170 deletions

View File

@@ -256,7 +256,9 @@ class SalePayment < ApplicationRecord
end
def rebat(sObj)
food_prices, beverage_prices = SaleItem.calculate_food_beverage(sObj.sale_items)
rebate_prices = SaleItem.calculate_food_beverage(sObj.sale_items)
puts "rebate_prices"
puts rebate_prices
generic_customer_id = sObj.customer.membership_id
if generic_customer_id != nil || generic_customer_id != "" || generic_customer_id != 0
paypar = sObj.sale_payments
@@ -266,12 +268,10 @@ class SalePayment < ApplicationRecord
payparcost = payparcost + pp.payment_amount
end
end
overall_dis = SaleItem.get_overall_discount(sObj.id)
total_amount = food_prices - payparcost + overall_dis
puts "total_amount"
puts food_prices
puts payparcost
puts total_amount
# overall_dis = SaleItem.get_overall_discount(sObj.id)
overall_dis = sObj.total_discount
total_amount = rebate_prices - payparcost + overall_dis
if total_amount > 0
receipt_no = sObj.receipt_no
membership = MembershipSetting.find_by_membership_type("paypar_url")