1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-21 15:54:22 +01:00

(bug) unable to show wallet payment mean for avoir

This commit is contained in:
Du Peng 2023-11-07 09:34:02 +01:00
parent cba38056f0
commit 8fa9567eae
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
# Changelog Fab-manager # Changelog Fab-manager
- Fix a bug: unable to show wallet payment mean for avoir
## v6.3.0 2023 November 3 ## v6.3.0 2023 November 3
- Fix a bug: fix all failing tasks of rake task file chain.rake - Fix a bug: fix all failing tasks of rake task file chain.rake

View File

@ -160,7 +160,9 @@ class Invoice < PaymentDocument
# return a summary of the payment means used # return a summary of the payment means used
def payment_means def payment_means
res = [] res = []
res.push(means: :wallet, amount: wallet_amount) if paid_by_wallet? res.push(means: :wallet, amount: wallet_amount || total) if paid_by_wallet?
return res if is_a?(Avoir)
if paid_by_card? if paid_by_card?
res.push(means: :card, amount: amount_paid) res.push(means: :card, amount: amount_paid)
else else
@ -195,7 +197,7 @@ class Invoice < PaymentDocument
end end
def paid_by_wallet? def paid_by_wallet?
wallet_transaction && wallet_amount.positive? (wallet_transaction && wallet_amount.positive?) || payment_method == 'wallet'
end end
def render_resource def render_resource