disable no rebate if credit note
This commit is contained in:
@@ -323,7 +323,7 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
self.sale.sale_status = "completed"
|
||||
|
||||
if MembershipSetting.find_by_rebate(1) && is_foc == 0
|
||||
if MembershipSetting.find_by_rebate(1) && is_foc == 0 && is_credit == 0
|
||||
response = rebat(sObj)
|
||||
|
||||
#record an payment in sale-audit
|
||||
@@ -410,6 +410,7 @@ class SalePayment < ApplicationRecord
|
||||
# overall_dis = SaleItem.get_overall_discount(sObj.id)
|
||||
overall_dis = sObj.total_discount
|
||||
|
||||
if credit != 1
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
memberaction = MembershipAction.find_by_membership_type("get_member_campaign")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
@@ -438,6 +439,7 @@ class SalePayment < ApplicationRecord
|
||||
rescue SocketError
|
||||
response = { "status": false, "message": "Can't connect server"}
|
||||
end
|
||||
|
||||
redeem_amount = payparcost + overall_dis
|
||||
|
||||
total_percentage = 0
|
||||
@@ -478,6 +480,7 @@ class SalePayment < ApplicationRecord
|
||||
if credit == 1
|
||||
total_amount = 0
|
||||
end
|
||||
|
||||
if total_amount >= 0
|
||||
receipt_no = sObj.receipt_no
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
@@ -516,9 +519,9 @@ class SalePayment < ApplicationRecord
|
||||
Rails.logger.debug response.to_json
|
||||
return response
|
||||
end
|
||||
end
|
||||
else
|
||||
response = { "status": "no_member", "message": "Not membership"}
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user