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

Merge branch 'dev' for release 5.4.19

This commit is contained in:
Du Peng 2022-09-13 14:08:17 +02:00
commit ae9f7dcc40
3 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,8 @@
# Changelog Fab-manager
## v5.4.19 2022 September 13
- Fix a bug: comput the wallet amount that can't apply coupon
## v5.4.18 2022 September 12
- Script to download translations from Crowdin

View File

@ -75,17 +75,16 @@ class WalletService
##
# Compute the amount decreased from the user's wallet, if applicable
# @param payment {Invoice|PaymentSchedule}
# @param payment {Invoice|PaymentSchedule|Order}
# @param user {User} the customer
# @param coupon {Coupon|String} Coupon object or code
##
def self.wallet_amount_debit(payment, user, coupon = nil)
def self.wallet_amount_debit(payment, user)
total = if payment.is_a? PaymentSchedule
payment.payment_schedule_items.first.amount
else
payment.total
end
total = CouponService.new.apply(total, coupon, user.id) if coupon
total = CouponService.new.apply(total, payment.coupon, user.id) if payment.coupon
wallet_amount = (user.wallet.amount * 100).to_i

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "5.4.18",
"version": "5.4.19",
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
"keywords": [
"fablab",