From: Bernd Bleßmann Date: Mon, 11 Dec 2017 15:05:11 +0000 (+0100) Subject: Auftrags-Controller: Fehler bei Anzeige von EK und Marge in 2. Zeile behoben X-Git-Tag: release-3.5.4~499 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=78e36cfd9021212db652db06c18054644861c687;p=kivitendo-erp.git Auftrags-Controller: Fehler bei Anzeige von EK und Marge in 2. Zeile behoben Wenn das Order-Objekt noch nicht gespeichert ist, kann darauf nicht über $item->order zugegriffen werden. Darum muss an die 2. Zeile eine weitere Variable durchgereicht werden, um zu bestimmen, ob wir im Verkauf sind und EK und Margen angezeigt werden sollen. --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 04319e04a..0421e08f5 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -447,6 +447,7 @@ sub action_add_item { my $row_as_html = $self->p->render('order/tabs/_row', ITEM => $item, ID => $item_id, + TYPE => $self->type, ALL_PRICE_FACTORS => $self->all_price_factors ); @@ -472,6 +473,7 @@ sub action_add_item { my $row_as_html = $self->p->render('order/tabs/_row', ITEM => $item, ID => $item_id, + TYPE => $self->type, ALL_PRICE_FACTORS => $self->all_price_factors ); $self->js @@ -553,6 +555,7 @@ sub action_add_multi_items { my $row_as_html = $self->p->render('order/tabs/_row', ITEM => $item, ID => $item_id, + TYPE => $self->type, ALL_PRICE_FACTORS => $self->all_price_factors ); @@ -665,7 +668,7 @@ sub _js_load_second_row { $item->parse_custom_variable_values; } - my $row_as_html = $self->p->render('order/tabs/_second_row', ITEM => $item); + my $row_as_html = $self->p->render('order/tabs/_second_row', ITEM => $item, TYPE => $self->type); $self->js ->html('.row_entry:has(#item_' . $item_id . ') [name = "second_row"]', $row_as_html) diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index f000ba6fd..c057747fb 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -115,7 +115,7 @@ [%- IF MYCONFIG.show_form_details %]
- [%- PROCESS order/tabs/_second_row.html ITEM=ITEM %] + [%- PROCESS order/tabs/_second_row.html ITEM=ITEM TYPE=TYPE %]
[%- ELSE %]
diff --git a/templates/webpages/order/tabs/_second_row.html b/templates/webpages/order/tabs/_second_row.html index 1a09f0f69..d8d8a8644 100644 --- a/templates/webpages/order/tabs/_second_row.html +++ b/templates/webpages/order/tabs/_second_row.html @@ -14,7 +14,7 @@ [% L.date_tag("order.orderitems[].reqdate", ITEM.reqdate) %]  [%- 'Subtotal' | $T8 %]  [% L.yes_no_tag("order.orderitems[].subtotal", ITEM.subtotal) %]  - [%- IF ITEM.order.is_sales %] + [%- IF TYPE == "sales_order" %] [%- 'Ertrag' | $T8 %]  diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index ad41537f9..39b953101 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -180,7 +180,7 @@ [%- FOREACH item = SELF.order.items_sorted %] - [%- PROCESS order/tabs/_row.html ITEM=item ID=item.id ALL_PRICE_FACTORS=SELF.all_price_factors %] + [%- PROCESS order/tabs/_row.html ITEM=item ID=item.id TYPE=SELF.type ALL_PRICE_FACTORS=SELF.all_price_factors %] [%- END %]