projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT#20687: Future package change [comment about bug fix]
[freeside.git]
/
FS
/
FS
/
bill_batch.pm
diff --git
a/FS/FS/bill_batch.pm
b/FS/FS/bill_batch.pm
index
1a46db0
..
fcafc4d
100644
(file)
--- a/
FS/FS/bill_batch.pm
+++ b/
FS/FS/bill_batch.pm
@@
-65,6
+65,9
@@
sub print_pdf {
qsearch('cust_bill_batch', { batchnum => $self->batchnum });
return "No invoices in batch ".$self->batchnum.'.' if !@invoices;
qsearch('cust_bill_batch', { batchnum => $self->batchnum });
return "No invoices in batch ".$self->batchnum.'.' if !@invoices;
+ my $conf = FS::Conf->new;
+ my $duplex = $conf->exists('invoice_print_pdf-duplex');
+
my $pdf_out;
my $num = 0;
foreach my $invoice (@invoices) {
my $pdf_out;
my $num = 0;
foreach my $invoice (@invoices) {
@@
-77,6
+80,13
@@
sub print_pdf {
else {
$pdf_out = CAM::PDF->new($part);
}
else {
$pdf_out = CAM::PDF->new($part);
}
+ if ( $duplex ) {
+ my $n = $pdf_out->numPages;
+ if ( $n % 2 == 1 ) {
+ # then insert a blank page so we end on an even number
+ $pdf_out->duplicatePage($n, 1);
+ }
+ }
if($job) {
# update progressbar
$num++;
if($job) {
# update progressbar
$num++;