[Koha-patches] [PATCH 2/2] Bug 4188 Allow acq basket group printing into PDF
Frédéric Demians
f.demians at tamil.fr
Sun Apr 18 11:53:34 CEST 2010
Since new acquisition module workflow and specifications is not
documented, this fix is more an hypothesis than a patch.
---
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 5614800..c7c1985 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 6809db1..2d82b8a 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
--
1.6.4.3
More information about the Koha-patches
mailing list