From abd2e003bff87138fffc242229cf6e7367064904 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 10 Aug 2015 17:20:45 +0200 Subject: [PATCH] =?utf8?q?Auftrags-Controller:=20Nach=20Hinzuf=C3=BCgen=20?= =?utf8?q?eines=20Artikels=20neue=20Ums=C3=A4tze=20und=20Steuern=20anzeige?= =?utf8?q?n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/Order.pm | 15 +++++++++++++++ templates/webpages/order/tabs/_tax_row.html | 9 +++++++++ templates/webpages/order/tabs/basic_data.html | 14 +++++++------- 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 templates/webpages/order/tabs/_tax_row.html diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 62ef86204..ba56e669e 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -171,6 +171,10 @@ sub action_set_item_values { ->val( '#' . $::form->{sellprice_dom_id}, $item->sellprice_as_number) ->val( '#' . $::form->{discount_dom_id}, $item->discount_as_percent) ->run('display_linetotal', $::form->{item_id}, $::form->format_amount(\%::myconfig, $item->{linetotal}, -2)) + ->html('#netamount_id', $::form->format_amount(\%::myconfig, $self->order->netamount, -2)) + ->html('#amount_id', $::form->format_amount(\%::myconfig, $self->order->amount, -2)) + ->remove('.tax_row') + ->insertBefore($self->build_tax_rows, '#amount_row_id') ->render($self); } @@ -250,6 +254,17 @@ sub build_shipto_select { ); } +sub build_tax_rows { + my ($self) = @_; + + my $rows_as_html; + foreach my $tax (@{ $self->{taxes} }) { + $rows_as_html .= $self->p->render('order/tabs/_tax_row', TAX => $tax); + } + return $rows_as_html; +} + + sub _make_order { my ($self) = @_; diff --git a/templates/webpages/order/tabs/_tax_row.html b/templates/webpages/order/tabs/_tax_row.html new file mode 100644 index 000000000..010da3fba --- /dev/null +++ b/templates/webpages/order/tabs/_tax_row.html @@ -0,0 +1,9 @@ +[%- USE T8 %] +[%- USE HTML %] +[%- USE LxERP %] +[%- USE L %] + + + [%- TAX.tax.taxdescription %] [% TAX.tax.rate_as_percent %]% + [%- LxERP.format_amount(TAX.amount, 2, 0) %] + diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 736520ade..fda5f10e8 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -147,18 +147,18 @@ [%- IF NOT taxincluded %] [%- 'Subtotal' | $T8 %] - [%- SELF.order.netamount_as_number %] + + [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %] + [%- END %] [%- FOREACH tax = SELF.taxes %] - - [%- tax.tax.description %] [% tax.tax.rate_as_percent %]% - [%- LxERP.format_amount(tax.amount, 2, 0) %] - + [%- PROCESS order/tabs/_tax_row.html TAX=tax %] [%- END %] - + [%- 'Total' | $T8 %] - [%- SELF.order.amount_as_number %] + + [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %] -- 2.20.1