Bug 12110: Display the order vendor note in basket and basketgroup CSV and PDF
[koha.git] / acqui / pdfformat / layout2pages.pm
index 66e2ba0..0beae0f 100644 (file)
@@ -88,12 +88,32 @@ sub printorders {
     }
     push(@$abaskets, $arrbasket);
 
+    my $titleinfo;
     for my $basket (@$baskets){
         for my $line (@{$orders->{$basket->{basketno}}}) {
             $arrbasket = undef;
+            $titleinfo = "";
+            if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) {
+                $titleinfo =  $line->{title} . " / " . $line->{author} .
+                    ( $line->{isbn} ? " ISBN: " . $line->{isbn} : '' ) .
+                    ( $line->{en} ? " EN: " . $line->{en} : '' ) .
+                    ( $line->{itemtype} ? ", " . $line->{itemtype} : '' ) .
+                    ( $line->{edition} ? ", " . $line->{edition} : '' ) .
+                    ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') .
+                    ( $line->{publicationyear} ? ', '. $line->{publicationyear} : '');
+            }
+            else { # MARC21, NORMARC
+                $titleinfo =  $line->{title} . " " . $line->{author} .
+                    ( $line->{isbn} ? " ISBN: " . $line->{isbn} : '' ) .
+                    ( $line->{en} ? " EN: " . $line->{en} : '' ) .
+                    ( $line->{itemtype} ? " " . $line->{itemtype} : '' ) .
+                    ( $line->{edition} ? ", " . $line->{edition} : '' ) .
+                    ( $line->{publishercode} ? ' published by '. $line->{publishercode} : '') .
+                    ( $line->{copyrightdate} ? ' '. $line->{copyrightdate} : '');
+            }
             push( @$arrbasket,
                 $basket->{basketno},
-                $line->{title} . " / " . $line->{author} . ( $line->{isbn} ? " ISBN : " . $line->{isbn} : '' ) . ( $line->{en} ? " EN : " . $line->{en} : '' ) . ", " . $line->{itemtype} . ( $line->{publishercode} ? ' published by '. $line->{publishercode} : ""),
+                $titleinfo. ($line->{order_vendornote} ? "\n----------------\nNotes for vendor : " . $line->{order_vendornote} : '' ),
                 $line->{quantity},
                 $num->format_price($line->{rrpgsti}),
                 $num->format_price($line->{discount}).'%',
@@ -208,6 +228,8 @@ sub printhead {
     $text->text($bookseller->{address2});
     $text->translate(100/mm, ($height-200)/mm);
     $text->text($bookseller->{address3});
+    $text->translate(100/mm, ($height-205)/mm);
+    $text->text($bookseller->{accountnumber});
     
     # print delivery infos
     $text->font( $pdf->corefont("Times-Bold", -encoding => "utf8"), 4/mm );