From 2c49285740a33f4d635e8095f281d45c20bd5baf Mon Sep 17 00:00:00 2001 From: Peng DU Date: Tue, 12 Jul 2016 11:39:18 +0200 Subject: [PATCH] avoir by wallet --- app/assets/javascripts/controllers/admin/invoices.coffee.erb | 1 + app/models/avoir.rb | 2 +- app/pdfs/pdf/invoice.rb | 2 ++ config/locales/app.admin.en.yml | 1 + config/locales/app.admin.fr.yml | 1 + config/locales/en.yml | 1 + config/locales/fr.yml | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/controllers/admin/invoices.coffee.erb b/app/assets/javascripts/controllers/admin/invoices.coffee.erb index daa410c94..1a1230cb0 100644 --- a/app/assets/javascripts/controllers/admin/invoices.coffee.erb +++ b/app/assets/javascripts/controllers/admin/invoices.coffee.erb @@ -494,6 +494,7 @@ Application.Controllers.controller 'AvoirModalController', ["$scope", "$uibModal {name: _t('by_cash'), value: 'cash'} {name: _t('by_cheque'), value: 'cheque'} {name: _t('by_transfer'), value: 'transfer'} + {name: _t('by_wallet'), value: 'wallet'} ] ## If a subscription was took with the current invoice, should it be canceled or not diff --git a/app/models/avoir.rb b/app/models/avoir.rb index a24564718..212c0627e 100644 --- a/app/models/avoir.rb +++ b/app/models/avoir.rb @@ -2,7 +2,7 @@ class Avoir < Invoice belongs_to :invoice after_create :expire_subscription, if: :subscription_to_expire - validates :avoir_mode, :inclusion => {:in => %w(stripe cheque transfer none cash)} + validates :avoir_mode, :inclusion => {:in => %w(stripe cheque transfer none cash wallet)} attr_accessor :invoice_items_ids diff --git a/app/pdfs/pdf/invoice.rb b/app/pdfs/pdf/invoice.rb index d9ce100f5..9c36f18df 100644 --- a/app/pdfs/pdf/invoice.rb +++ b/app/pdfs/pdf/invoice.rb @@ -196,6 +196,8 @@ module PDF payment_verbose += I18n.t('invoices.by_transfer') when 'cash' payment_verbose += I18n.t('invoices.by_cash') + when 'wallet' + payment_verbose += I18n.t('invoices.by_wallet') when 'none' payment_verbose = I18n.t('invoices.no_refund') else diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 9d70c3e59..d20f9ecdf 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -246,6 +246,7 @@ en: by_cash: "By cash" by_cheque: "By cheque" by_transfer: "By transfer" + by_wallet: "By wallet" you_must_select_at_least_one_element_to_create_a_refund: "You must select at least one element, to create a refund." unable_to_create_the_refund: "Unable to create the refund" invoice_reference_successfully_saved: "Invoice reference successfully saved." diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index 87e4e04e9..8a8eb9c67 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -246,6 +246,7 @@ fr: by_cash: "En espèces" by_cheque: "Par chèque" by_transfer: "Par virement" + by_wallet: "Par porte-monnaie" you_must_select_at_least_one_element_to_create_a_refund: "Vous devez sélectionner au moins un élément sur lequel créer un avoir." unable_to_create_the_refund: "Impossible de créer l'avoir" invoice_reference_successfully_saved: "La référence facture a bien été enregistrée." diff --git a/config/locales/en.yml b/config/locales/en.yml index 0e50e0059..c1096022d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -97,6 +97,7 @@ en: by_transfer: "by transfer" by_cash: "by cash" no_refund: "No refund" + by_wallet: "by wallet" settlement_by_debit_card: "Settlement by debit card" settlement_done_at_the_reception: "Settlement done at the reception" on_DATE_at_TIME: "on %{DATE} at %{TIME}," diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 607c419fd..d053581bc 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -96,6 +96,7 @@ fr: by_cheque: "par chèque" by_transfer: "par virement" by_cash: "en espèces" + by_wallet: "par porte-monnaie" no_refund: "Pas de remboursement" settlement_by_debit_card: "Règlement effectué par carte bancaire" settlement_done_at_the_reception: "Règlement effectué à l'accueil"