1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

Merge branch 'dev' of git.sleede.com:projets/fab-manager into dev

This commit is contained in:
Nicolas Florentin 2023-11-08 10:49:27 +01:00
commit f15af0292b
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@
- Fix a bug: statistic_sub_type.label of plan was nil
- adds a migrations to fix all statistic_sub_types of plans having label = nil
- Fix a bug: unable to show wallet payment mean for avoir
## v6.3.0 2023 November 3

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