From 0eea24a8a19b0be56b77d983c4265c98620393fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sun, 18 Apr 2010 11:53:34 +0200 Subject: [PATCH] Bug 4188 Allow acq basket group printing into PDF Since new acquisition module workflow and specifications is not documented, this fix is more an hypothesis than a patch. Signed-off-by: Galen Charlton --- acqui/pdfformat/layout2pages.pm | 8 +++++--- acqui/pdfformat/layout3pages.pm | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/acqui/pdfformat/layout2pages.pm b/acqui/pdfformat/layout2pages.pm index 561480067e..c7c19853df 100755 --- a/acqui/pdfformat/layout2pages.pm +++ b/acqui/pdfformat/layout2pages.pm @@ -236,9 +236,11 @@ sub printfooters { sub printpdf { my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_; # open the default PDF that will be used for base (1st page already filled) - my $template = C4::Context->preference("OrderPdfTemplate"); - $template = decode_base64($template); - my $pdf = PDF::API2->openScalar($template); + use FindBin qw( $Bin ); + open(my $fh, "$Bin/pdfformat/layout2pages.pdf") or die "$@"; + my @pdf = <$fh>; + close($fh); + my $pdf = PDF::API2->openScalar(join('', @pdf)); $pdf->pageLabel( 0, { -style => 'roman', } ); # start with roman numbering diff --git a/acqui/pdfformat/layout3pages.pm b/acqui/pdfformat/layout3pages.pm index 6809db1cdb..2d82b8ad3b 100755 --- a/acqui/pdfformat/layout3pages.pm +++ b/acqui/pdfformat/layout3pages.pm @@ -373,9 +373,11 @@ sub printfooters { sub printpdf { my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_; # open the default PDF that will be used for base (1st page already filled) - my $template = C4::Context->preference("OrderPdfTemplate"); - $template = decode_base64($template); - my $pdf = PDF::API2->openScalar($template); + use FindBin qw( $Bin ); + open(my $fh, "$Bin/pdfformat/layout3pages.pdf") or die "$@"; + my @pdf = <$fh>; + close($fh); + my $pdf = PDF::API2->openScalar(join('', @pdf)); $pdf->pageLabel( 0, { -style => 'roman', } ); # start with roman numbering -- 2.39.5