diff --git a/app/pdfs/pdf/invoice.rb b/app/pdfs/pdf/invoice.rb index ab9b8b20e..6c9dc5eb6 100644 --- a/app/pdfs/pdf/invoice.rb +++ b/app/pdfs/pdf/invoice.rb @@ -37,10 +37,12 @@ module PDF if Setting.find_by({name: 'invoice_code-active'}).value == 'true' text I18n.t('invoices.code', CODE:Setting.find_by({name: 'invoice_code-value'}).value), :leading => 3 end - if invoice.is_a?(Avoir) - text I18n.t('invoices.order_number', NUMBER:invoice.invoice.order_number), :leading => 3 - else - text I18n.t('invoices.order_number', NUMBER:invoice.order_number), :leading => 3 + if invoice.invoiced_type != WalletTransaction.name + if invoice.is_a?(Avoir) + text I18n.t('invoices.order_number', NUMBER:invoice.invoice.order_number), :leading => 3 + else + text I18n.t('invoices.order_number', NUMBER:invoice.order_number), :leading => 3 + end end if invoice.is_a?(Avoir) text I18n.t('invoices.refund_invoice_issued_on_DATE', DATE:I18n.l(invoice.avoir_date.to_date)) @@ -68,7 +70,11 @@ module PDF # object move_down 25 if invoice.is_a?(Avoir) - object = I18n.t('invoices.cancellation_of_invoice_REF', REF: invoice.invoice.reference) + if invoice.invoiced_type == WalletTransaction.name + object = I18n.t('invoices.wallet_credit') + else + object = I18n.t('invoices.cancellation_of_invoice_REF', REF: invoice.invoice.reference) + end else case invoice.invoiced_type when 'Reservation' diff --git a/config/locales/en.yml b/config/locales/en.yml index f30febc5e..7b0f5be86 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -68,6 +68,7 @@ en: order_number: "Order #: %{NUMBER}" invoice_issued_on_DATE: "Invoice issued on %{DATE}" refund_invoice_issued_on_DATE: "Refund invoice issued on %{DATE}" + wallet_credit: "Wallet credit" cancellation_of_invoice_REF: "Cancellation of invoice %{REF}" reservation_of_USER_on_DATE_at_TIME: "Reservation of %{USER} on %{DATE} at %{TIME}" cancellation: "Cancellation" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 68bb7179c..fde68aac2 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -68,6 +68,7 @@ fr: order_number: "N° Commande : %{NUMBER}" invoice_issued_on_DATE: "Facture éditée le %{DATE}" refund_invoice_issued_on_DATE: "Avoir édité le %{DATE}" + wallet_credit: "Crédit du porte-monnaie" cancellation_of_invoice_REF: "Annulation de la facture %{REF}" reservation_of_USER_on_DATE_at_TIME: "Réservation de %{USER} le %{DATE} à %{TIME}" cancellation: "Annulation"