From 99cca406d513bc340a4dc2534ffef7368304d93f Mon Sep 17 00:00:00 2001 From: Peng DU Date: Thu, 3 Nov 2016 12:17:19 +0100 Subject: [PATCH] fix bug: event date period dant show correct in invoice --- CHANGELOG.md | 1 + app/models/reservation.rb | 6 +++++- .../notify_admin_member_create_reservation.html.erb | 8 +++++++- .../notify_member_create_reservation.html.erb | 8 +++++++- config/locales/rails.fr.yml | 4 ++-- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6253c1a3b..c15ed4cd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## next release +- Fix bug: Event date period dont show correct in invoice - Image max size is configutable, size by default is 2 megabytes - Allow add more picture for project step - Ability to use HTML in event's descriptions using a WYSIWYG editor diff --git a/app/models/reservation.rb b/app/models/reservation.rb index d17a2b98b..61f0713b6 100644 --- a/app/models/reservation.rb +++ b/app/models/reservation.rb @@ -107,7 +107,11 @@ class Reservation < ActiveRecord::Base amount += ticket.booked * ticket.event_price_category.amount end slots.each do |slot| - description = reservable.name + " #{I18n.l slot.start_at, format: :long} - #{I18n.l slot.end_at, format: :hour_minute}" + description = "#{reservable.name} " + (slot.start_at.to_date..slot.end_at.to_date).each do |d| + description += "\n" if slot.start_at.to_date != slot.end_at.to_date + description += "#{I18n.l d, format: :long} #{I18n.l slot.start_at, format: :hour_minute} - #{I18n.l slot.end_at, format: :hour_minute}" + end ii_amount = amount ii_amount = 0 if (slot.offered and on_site) unless on_site diff --git a/app/views/notifications_mailer/notify_admin_member_create_reservation.html.erb b/app/views/notifications_mailer/notify_admin_member_create_reservation.html.erb index f16bc570c..7e1a931f1 100644 --- a/app/views/notifications_mailer/notify_admin_member_create_reservation.html.erb +++ b/app/views/notifications_mailer/notify_admin_member_create_reservation.html.erb @@ -8,6 +8,12 @@

<%= t('.body.reserved_slots') %>

diff --git a/app/views/notifications_mailer/notify_member_create_reservation.html.erb b/app/views/notifications_mailer/notify_member_create_reservation.html.erb index 793fc5a37..ff507953e 100644 --- a/app/views/notifications_mailer/notify_member_create_reservation.html.erb +++ b/app/views/notifications_mailer/notify_member_create_reservation.html.erb @@ -5,6 +5,12 @@

<%= t('.body.your_reserved_slots') %>

diff --git a/config/locales/rails.fr.yml b/config/locales/rails.fr.yml index a2952b5f3..802a0e86a 100644 --- a/config/locales/rails.fr.yml +++ b/config/locales/rails.fr.yml @@ -33,7 +33,7 @@ fr: formats: default: "%d/%m/%Y" short: "%e %b" - long: "%e %B %Y" + long: "%A%e %B %Y" month_names: - - janvier @@ -204,4 +204,4 @@ fr: default: "%d %B %Y %Hh %Mmin %Ss" long: "%A %d %B %Y %Hh%M" short: "%d %b %Hh%M" - pm: pm \ No newline at end of file + pm: pm