menu alt name

This commit is contained in:
Nweni
2017-07-02 14:38:18 +06:30
16 changed files with 205 additions and 63 deletions

View File

@@ -306,16 +306,22 @@ class SalePayment < ApplicationRecord
if generic_customer_id != nil || generic_customer_id != "" || generic_customer_id != 0
paypar = sObj.sale_payments
payparcost = 0
credit = 0
paypar.each do |pp|
if pp.payment_method == "paypar"
payparcost = payparcost + pp.payment_amount
elsif pp.payment_method == "creditnote"
credit = 1
end
end
# overall_dis = SaleItem.get_overall_discount(sObj.id)
overall_dis = sObj.total_discount
total_amount = rebate_prices - payparcost - overall_dis
if total_amount > 0
if credit == 1
total_amount = 0
end
if total_amount >= 0
receipt_no = sObj.receipt_no
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("rebate")