From b3db307176b793d34d216da3bed70fad8699767b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Thu, 24 Nov 2005 16:45:56 +0000 Subject: [PATCH] Merge von 596 aus unstable: Mehr Markup: Wenn in einer Rechnungszeile "" auftaucht, so wird es aus dem Text entfernt, und bei LaTeX-Ausgabe wird nach der Z eile ein Seitenumbruch erzwungen. --- SL/Form.pm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 9253f419d..a313787cc 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -596,7 +596,7 @@ sub parse_template { # Some variables used for page breaks my ($chars_per_line, $lines_on_first_page, $lines_on_second_page) = (0, 0, 0); - my ($current_page, $current_line) = (1, 1); + my ($current_page, $current_line, $current_row) = (1, 1, 0); my $pagebreak = ""; my $sum = 0; @@ -700,8 +700,9 @@ sub parse_template { $lpp = $lines_on_second_page; } - # Yes we need a manual page break - if (($current_line + $lines) > $lpp) { + # Yes we need a manual page break -- or the user has forced one + if ((($current_line + $lines) > $lpp) || + ($self->{"_forced_pagebreaks"} && grep(/^${current_row}$/, @{$self->{"_forced_pagebreaks"}}))) { my $pb = $pagebreak; # replace the special variables <%sumcarriedforward%> @@ -722,6 +723,7 @@ sub parse_template { $current_line = 1; } $current_line += $lines; + $current_row++; } $sum += $self->parse_amount($myconfig, $self->{"linetotal"}[$i]); @@ -987,6 +989,18 @@ sub format_string { %unique_fields = map({ $_ => 1 } @fields); @fields = keys(%unique_fields); + + foreach my $field (@fields) { + next unless ($self->{$field} =~ /\/); + $self->{$field} =~ s/\//g; + if ($field =~ /.*_(\d+)$/) { + if ($self->{"_forced_pagebreaks"}) { + $self->{"_forced_pagebreaks"} = []; + } + push(@{ $self->{"_forced_pagebreaks"} }, "$1"); + } + } + my $format = $self->{format}; if ($self->{format} =~ /(postscript|pdf)/) { $format = 'tex'; -- 2.20.1