Revision f1b1481e
Von Moritz Bunkus vor etwa 19 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
632 | 632 |
# Some variables used for page breaks |
633 | 633 |
my ($chars_per_line, $lines_on_first_page, $lines_on_second_page) = |
634 | 634 |
(0, 0, 0); |
635 |
my ($current_page, $current_line) = (1, 1);
|
|
635 |
my ($current_page, $current_line, $current_row) = (1, 1, 0);
|
|
636 | 636 |
my $pagebreak = ""; |
637 | 637 |
my $sum = 0; |
638 | 638 |
|
... | ... | |
736 | 736 |
$lpp = $lines_on_second_page; |
737 | 737 |
} |
738 | 738 |
|
739 |
# Yes we need a manual page break |
|
740 |
if (($current_line + $lines) > $lpp) { |
|
739 |
# Yes we need a manual page break -- or the user has forced one |
|
740 |
if ((($current_line + $lines) > $lpp) || |
|
741 |
($self->{"_forced_pagebreaks"} && grep(/^${current_row}$/, @{$self->{"_forced_pagebreaks"}}))) { |
|
741 | 742 |
my $pb = $pagebreak; |
742 | 743 |
|
743 | 744 |
# replace the special variables <%sumcarriedforward%> |
... | ... | |
758 | 759 |
$current_line = 1; |
759 | 760 |
} |
760 | 761 |
$current_line += $lines; |
762 |
$current_row++; |
|
761 | 763 |
} |
762 | 764 |
$sum += $self->parse_amount($myconfig, $self->{"linetotal"}[$i]); |
763 | 765 |
|
... | ... | |
1023 | 1025 |
|
1024 | 1026 |
%unique_fields = map({ $_ => 1 } @fields); |
1025 | 1027 |
@fields = keys(%unique_fields); |
1028 |
|
|
1029 |
foreach my $field (@fields) { |
|
1030 |
next unless ($self->{$field} =~ /\<pagebreak\>/); |
|
1031 |
$self->{$field} =~ s/\<pagebreak\>//g; |
|
1032 |
if ($field =~ /.*_(\d+)$/) { |
|
1033 |
if ($self->{"_forced_pagebreaks"}) { |
|
1034 |
$self->{"_forced_pagebreaks"} = []; |
|
1035 |
} |
|
1036 |
push(@{ $self->{"_forced_pagebreaks"} }, "$1"); |
|
1037 |
} |
|
1038 |
} |
|
1039 |
|
|
1026 | 1040 |
my $format = $self->{format}; |
1027 | 1041 |
if ($self->{format} =~ /(postscript|pdf)/) { |
1028 | 1042 |
$format = 'tex'; |
Auch abrufbar als: Unified diff
Mehr Markup: Wenn in einer Rechnungszeile "<pagebreak>" auftaucht, so wird es aus dem Text entfernt, und bei LaTeX-Ausgabe wird nach der Zeile ein Seitenumbruch erzwungen.