From ff1317b17b3e6682c75f7d67037f790060065c4a Mon Sep 17 00:00:00 2001 From: Julius Date: Mon, 8 Jul 2013 21:02:43 +0200 Subject: [PATCH] Add hint to copy stock_article if price change desired in delivery process --- app/helpers/deliveries_helper.rb | 9 +++++++++ app/views/deliveries/_stock_article_form.html.haml | 2 +- config/locales/de.yml | 4 ++++ config/locales/en.yml | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/helpers/deliveries_helper.rb b/app/helpers/deliveries_helper.rb index 2ef5d14b..b23107cc 100644 --- a/app/helpers/deliveries_helper.rb +++ b/app/helpers/deliveries_helper.rb @@ -25,4 +25,13 @@ module DeliveriesHelper return output.html_safe end + def stock_article_price_hint(stock_article) + t('simple_form.hints.stock_article.edit_stock_article.price', + :stock_article_copy_link => link_to(t('.copy_stock_article'), + copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => stock_article.id), + :remote => true + ) + ) + end + end diff --git a/app/views/deliveries/_stock_article_form.html.haml b/app/views/deliveries/_stock_article_form.html.haml index d096f633..21c5b216 100644 --- a/app/views/deliveries/_stock_article_form.html.haml +++ b/app/views/deliveries/_stock_article_form.html.haml @@ -16,7 +16,7 @@ %span.add-on % = f.input :deposit - else - = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => t('stockit.form.price_hint') + = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article) = f.association :article_category .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} diff --git a/config/locales/de.yml b/config/locales/de.yml index c2e0b95a..0778536e 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -461,6 +461,8 @@ de: action_add_to_delivery: 'Liefern' action_edit: 'Bearbeiten' action_other_price: 'Kopieren' + stock_article_form: + copy_stock_article: 'Lagerartikel kopieren' stock_change_fields: remove_article: Artikel aus Lieferung entfernen suppliers_overview: Lieferantenübersicht @@ -1528,6 +1530,8 @@ de: supplier: copy_stock_article: name: Bitte ändern + edit_stock_article: + price: ! '' supplier: min_order_quantity: Die Mindestbestellmenge wird während der Bestellung angezeigt und soll motivieren task: diff --git a/config/locales/en.yml b/config/locales/en.yml index 078c1def..3892111b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -463,6 +463,8 @@ en: action_add_to_delivery: 'Add to delivery' action_edit: 'Edit' action_other_price: 'Copy' + stock_article_form: + copy_stock_article: 'Lagerartikel kopieren' stock_change_fields: remove_article: Remove article from delivery suppliers_overview: Supplier overview @@ -1530,6 +1532,8 @@ en: supplier: copy_stock_article: name: Please modify + edit_stock_article: + price: ! '' supplier: min_order_quantity: The minimum amount which has to be orderd will be shown during the order process and should motivate ordering task: