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

[bug] exports for events reservation always have seats=1 (fixes #54)

This commit is contained in:
Sylvain 2016-11-09 15:01:41 +01:00
parent a80df7f993
commit da71ba783c
5 changed files with 10 additions and 2 deletions

View File

@ -2,8 +2,10 @@
## next release
- Fix a bug: number of reserved seats for an event is always of 1 in the excel export of reservations
- Fix a bug: conflict between similar translations around "reservations"
- Fix a bug: later occurrences of recurrent events does not have the initially configured theme and age range
- [TODO DEPLOY] delete the `exports/users/reservations` folder to prevent the usage of old invalid exports
## v2.4.2 2016 November 8

View File

@ -5,7 +5,11 @@ class API::ExportsController < API::ApiController
def download
authorize @export
send_file File.join(Rails.root, @export.file), :type => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :disposition => 'attachment'
if FileTest.exist?(@export.file)
send_file File.join(Rails.root, @export.file), :type => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :disposition => 'attachment'
else
render text: I18n.t('errors.messages.export_not_found'), status: :not_found
end
end
def status

View File

@ -21,7 +21,7 @@ wb.add_worksheet(name: t('export_reservations.reservations')) do |sheet|
resrv.created_at.to_date,
resrv.reservable_type,
(resrv.reservable.nil? ? '' : resrv.reservable.name),
resrv.slots.count,
(resrv.reservable_type == 'Event') ? resrv.total_booked_seats: resrv.slots.count,
(resrv.stp_invoice_id.nil?)? t('export_reservations.local_payment') : t('export_reservations.online_payment')
]
styles = [nil, nil, nil, date, nil, nil, nil, nil]

View File

@ -31,6 +31,7 @@ en:
wrong_size: "is the wrong size (should be %{file_size})"
size_too_small: "is too small (should be at least %{file_size})"
size_too_big: "is too big (should be at most %{file_size})"
export_not_found: "Requested export was not found. It was probably deleted, please generate a new export."
activemodel:
errors:

View File

@ -31,6 +31,7 @@ fr:
wrong_size: "ne fait pas la taille du fichier (doit comporter %{file_size})"
size_too_small: "est trop petite (au moins %{file_size})"
size_too_big: "est trop grande (pas plus de %{file_size})"
export_not_found: "L'export demandé n'a pas été trouvé. Il a probablement été supprimé, veuillez lancer la génération d'un nouvel export."
activemodel:
errors: