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
## 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
- fix a bug: wrong currency unit for locale fr-CH

View File

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

View File

@ -24,16 +24,14 @@ class PayZen::Service < Payment::Service
rrule: rrule(payment_schedule),
order_id: order_id
}
if first_item.details['adjustment']&.zero? && first_item.details['other_items']&.zero?
initial_amount = first_item.amount
initial_amount -= payment_schedule.wallet_amount if payment_schedule.wallet_amount
if initial_amount.zero?
params[:effect_date] = (first_item.due_date + 1.month).iso8601
params[:rrule] = rrule(payment_schedule, -1)
else
params[:initial_amount] = payzen_amount(initial_amount)
params[:initial_amount_number] = 1
end
initial_amount = first_item.amount
initial_amount -= payment_schedule.wallet_amount if payment_schedule.wallet_amount
if initial_amount.zero?
params[:effect_date] = (first_item.due_date + 1.month).iso8601
params[:rrule] = rrule(payment_schedule, -1)
else
params[:initial_amount] = payzen_amount(initial_amount)
params[:initial_amount_number] = 1
end
pz_subscription = client.create_subscription(**params)
@ -141,7 +139,8 @@ class PayZen::Service < Payment::Service
transaction_date = Time.zone.parse(transaction['creationDate']).to_date
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
end

View File

@ -1,6 +1,6 @@
{
"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.",
"keywords": [
"fablab",