From: Bernd Bleßmann Date: Mon, 26 Oct 2015 15:52:34 +0000 (+0100) Subject: Auftrags-Controller: PriceSources: auch Rabatt-Quelle im Auswahl-Knopf anzeigen. X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c25fdc227a49e304313d4a89d97e1be70c910319;p=kivitendo-erp.git Auftrags-Controller: PriceSources: auch Rabatt-Quelle im Auswahl-Knopf anzeigen. --- diff --git a/templates/webpages/order/tabs/_price_sources_dialog.html b/templates/webpages/order/tabs/_price_sources_dialog.html index a9f92a0c5..a73073e40 100644 --- a/templates/webpages/order/tabs/_price_sources_dialog.html +++ b/templates/webpages/order/tabs/_price_sources_dialog.html @@ -58,7 +58,7 @@ [%- IF price_source.record_item.active_discount_source %] - [% L.button_tag('update_discount_source(\'' _ FORM.item_id _ '\', \'\')', LxERP.t8('Select')) %] + [% L.button_tag('update_discount_source(\'' _ FORM.item_id _ '\', \'\', \'' _ LxERP.t8('None (PriceSource Discount)') _ '\')', LxERP.t8('Select')) %] [%- ELSE %] [% 'Selected' | $T8 %] [%- END %] @@ -70,9 +70,9 @@ [%- FOREACH price IN price_source.available_discounts %] [%- IF price_source.record_item.active_discount_source != price.source %] - [% L.button_tag('update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.discount_as_percent _ '\')', LxERP.t8('Select')) %] + [% L.button_tag('update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ price.discount_as_percent _ '\')', LxERP.t8('Select')) %] [%- ELSIF price_source.record_item.discount * 1 != price.discount * 1 %] - [% L.button_tag('update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.discount_as_percent _ '\')', LxERP.t8('Update Discount')) %] + [% L.button_tag('update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ price.discount_as_percent _ '\')', LxERP.t8('Update Discount')) %] [%- ELSE %] [% 'Selected' | $T8 %] [% END %] diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index 08fd81d64..efcb59ed4 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -48,7 +48,9 @@ class="recalc") %] - [%- L.button_tag("price_chooser_item_row(this)", ITEM.active_price_source.source_description, name = "price_chooser_button") %] + [%- L.button_tag("price_chooser_item_row(this)", + ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description, + name = "price_chooser_button") %] [%- L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %] diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index ea37fafbe..e02c498ba 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -285,7 +285,7 @@ function update_price_source(item_id, source, descr, price_str) { var source_elt = $(row).find('[name="order.orderitems[].active_price_source"]'); var button_elt = $(row).find('[name="price_chooser_button"]'); - button_elt.val(descr); + button_elt.val(button_elt.val().replace(/.*\|/, descr + " |")); source_elt.val(source); var editable_div_elt = $(row).find('[name="editable_price"]'); @@ -315,10 +315,12 @@ function update_price_source(item_id, source, descr, price_str) { kivi.io.close_dialog(); } -function update_discount_source(item_id, source, discount_str) { +function update_discount_source(item_id, source, descr, discount_str) { var row = $('#item_' + item_id).parents("tbody").first(); var source_elt = $(row).find('[name="order.orderitems[].active_discount_source"]'); + var button_elt = $(row).find('[name="price_chooser_button"]'); + button_elt.val(button_elt.val().replace(/\|.*/, "| " + descr)); source_elt.val(source); var editable_div_elt = $(row).find('[name="editable_discount"]');