1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +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
- Fix a bug: unable to show wallet payment mean for avoir
## v6.3.0 2023 November 3
- 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
def payment_means
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?
res.push(means: :card, amount: amount_paid)
else
@ -195,7 +197,7 @@ class Invoice < PaymentDocument
end
def paid_by_wallet?
wallet_transaction && wallet_amount.positive?
(wallet_transaction && wallet_amount.positive?) || payment_method == 'wallet'
end
def render_resource