Bug 4188 Allow acq basket group printing into PDF
authorFrédéric Demians <f.demians@tamil.fr>
Sun, 18 Apr 2010 09:53:34 +0000 (11:53 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Fri, 2 Jul 2010 12:49:42 +0000 (08:49 -0400)
Since new acquisition module workflow and specifications is not
documented, this fix is more an hypothesis than a patch.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
acqui/pdfformat/layout2pages.pm
acqui/pdfformat/layout3pages.pm

index 5614800..c7c1985 100755 (executable)
@@ -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
index 6809db1..2d82b8a 100755 (executable)
@@ -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