From fbc3a23215304e3cf0040ee726c6a53ff185d149 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 2 Jun 2009 07:35:04 +0000 Subject: [PATCH] Auch das Array "linetotal" liegt in TEMPLATE_ARRAYS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Wird für die Berechnung der Zwischensummenvariablen "sumcarriedforward" benutzt. Zusätzlich sollte die Variable "cumulatelinetotal" ebenfalls in TEMPLATE_ARRAYS liegen. Weiterer Teil des Fixes für Bug 1019. --- SL/Template.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SL/Template.pm b/SL/Template.pm index 3c34ce74f..4a59273a0 100644 --- a/SL/Template.pm +++ b/SL/Template.pm @@ -174,6 +174,9 @@ sub parse_foreach { my ($current_line, $corrent_row) = (0, 1); my $description_array = $self->_get_loop_variable("description", 1); my $longdescription_array = $self->_get_loop_variable("longdescription", 1); + my $linetotal_array = $self->_get_loop_variable("linetotal", 1); + + $form->{TEMPLATE_ARRAYS}->{cumulatelinetotal} = []; for (my $i = 0; $i < scalar(@{$ary}); $i++) { $form->{"__first__"} = $i == 1; @@ -219,12 +222,12 @@ sub parse_foreach { } $current_line += $lines; } - if ($i < scalar(@{$form->{"linetotal"}})) { - $sum += $form->parse_amount($self->{"myconfig"}, - $form->{"linetotal"}->[$i]); + + if ($i < scalar(@{$linetotal_array})) { + $sum += $form->parse_amount($self->{"myconfig"}, $linetotal_array->[$i]); } - $form->{"cumulatelinetotal"}[$i] = $form->format_amount($self->{"myconfig"}, $sum, 2); + $form->{TEMPLATE_ARRAYS}->{cumulatelinetotal}->[$i] = $form->format_amount($self->{"myconfig"}, $sum, 2); my $new_text = $self->parse_block($text, (@indices, $i)); return undef unless (defined($new_text)); -- 2.20.1