1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

Merge branch 'dev' for release 6.3.4

This commit is contained in:
Nicolas Florentin 2023-11-23 08:14:10 +01:00
commit b75751c778
4 changed files with 24 additions and 21 deletions

View File

@ -1,5 +1,10 @@
# Changelog Fab-manager # Changelog Fab-manager
## v6.3.4 2023 November 23
- fix a bug: wrong amount when pay a reservation with payment schedule
- fix regresion on PaymentScheduleItemWorker from v6.3.2
## v6.3.3 2023 November 14 ## v6.3.3 2023 November 14
- fix a bug: wrong currency unit for locale fr-CH - fix a bug: wrong currency unit for locale fr-CH

View File

@ -6,15 +6,14 @@ class PaymentScheduleItemWorker
include Sidekiq::Worker include Sidekiq::Worker
def perform(record_id = nil) def perform(record_id = nil)
p "WORKER CURRENCY_LOCALE=#{CURRENCY_LOCALE}" if record_id
# if record_id psi = PaymentScheduleItem.find(record_id)
# psi = PaymentScheduleItem.find(record_id) check_item(psi)
# check_item(psi) else
# else PaymentScheduleItem.where.not(state: 'paid').where('due_date < ?', Time.current).each do |item|
# PaymentScheduleItem.where.not(state: 'paid').where('due_date < ?', Time.current).each do |item| check_item(item)
# check_item(item) end
# end end
# end
end end
# @param psi [PaymentScheduleItem] # @param psi [PaymentScheduleItem]

View File

@ -24,7 +24,6 @@ class PayZen::Service < Payment::Service
rrule: rrule(payment_schedule), rrule: rrule(payment_schedule),
order_id: order_id order_id: order_id
} }
if first_item.details['adjustment']&.zero? && first_item.details['other_items']&.zero?
initial_amount = first_item.amount initial_amount = first_item.amount
initial_amount -= payment_schedule.wallet_amount if payment_schedule.wallet_amount initial_amount -= payment_schedule.wallet_amount if payment_schedule.wallet_amount
if initial_amount.zero? if initial_amount.zero?
@ -34,7 +33,6 @@ class PayZen::Service < Payment::Service
params[:initial_amount] = payzen_amount(initial_amount) params[:initial_amount] = payzen_amount(initial_amount)
params[:initial_amount_number] = 1 params[:initial_amount_number] = 1
end end
end
pz_subscription = client.create_subscription(**params) pz_subscription = client.create_subscription(**params)
# save payment token # save payment token
@ -141,7 +139,8 @@ class PayZen::Service < Payment::Service
transaction_date = Time.zone.parse(transaction['creationDate']).to_date transaction_date = Time.zone.parse(transaction['creationDate']).to_date
amount = payment_schedule_item.amount amount = payment_schedule_item.amount
if payment_schedule_item.details['adjustment']&.zero? && payment_schedule_item.payment_schedule.wallet_amount if payment_schedule_item == payment_schedule_item.payment_schedule.ordered_items.first &&
payment_schedule_item.payment_schedule.wallet_amount
amount -= payment_schedule_item.payment_schedule.wallet_amount amount -= payment_schedule_item.payment_schedule.wallet_amount
end end

View File

@ -1,6 +1,6 @@
{ {
"name": "fab-manager", "name": "fab-manager",
"version": "6.3.3", "version": "6.3.4",
"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.", "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": [ "keywords": [
"fablab", "fablab",