1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

Merge branch 'hotfix' for release 4.2.4

This commit is contained in:
Sylvain 2019-10-30 15:59:07 +01:00
commit 93f8c4452f
3 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,10 @@
# Changelog Fab Manager
## v4.2.4 2019 October 30
- Fix a bug: in some cases, the invoices were not generated after deploying v4.2.0+. This can occurs if VAT was changed/enabled during the application life (#156)
- [TODO DEPLOY] `rake fablab:maintenance:regenerate_invoices[2019,10]` only if you had download issues with your last invoices
## v4.2.3 2019 October 22
- Ability to set the default view in project gallery: openLab or local

View File

@ -32,9 +32,10 @@ class VatHistoryService
chronology.push(start: v.created_at, end: end_date, enabled: v.value == 'true')
end_date = v.created_at
end
chronology.push(start: DateTime.new(0), end: end_date, enabled: false)
date_rates = []
Setting.find_by(name: 'invoice_VAT-rate').history_values.order(created_at: 'ASC').each do |rate|
range = chronology.select { |p| rate.created_at.between?(p[:start], p[:end]) }.first
range = chronology.select { |p| rate.created_at.to_i.between?(p[:start].to_i, p[:end].to_i) }.first
date = range[:enabled] ? rate.created_at : range[:end]
date_rates.push(date: date, rate: rate.value.to_i)
end

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "4.2.3",
"version": "4.2.4",
"description": "FabManager 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",