Bug 12110: Display the order vendor note in basket and basketgroup CSV and PDF
[koha-ffzg.git] / acqui / basketgroup.pl
index 6b2529d..cdb392d 100755 (executable)
@@ -126,7 +126,8 @@ sub printbasketgrouppdf{
     my ($basketgroupid) = @_;
     
     my $pdfformat = C4::Context->preference("OrderPdfFormat");
-    if ($pdfformat eq 'pdfformat::layout3pages' || $pdfformat eq 'pdfformat::layout2pages' || $pdfformat eq 'pdfformat::layout3pagesfr'){
+    if ($pdfformat eq 'pdfformat::layout3pages' || $pdfformat eq 'pdfformat::layout2pages' || $pdfformat eq 'pdfformat::layout3pagesfr'
+        || $pdfformat eq 'pdfformat::layout2pagesde'){
        eval {
         eval "require $pdfformat";
            import $pdfformat;
@@ -199,12 +200,15 @@ sub printbasketgrouppdf{
 
             # Editor Number
             my $en;
+            my $edition;
             my $marcrecord=eval{MARC::Record::new_from_xml( $ord->{marcxml},'UTF-8' )};
             if ($marcrecord){
                 if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) {
                     $en = $marcrecord->subfield( '345', "b" );
+                    $edition = $marcrecord->subfield( '205', 'a' );
                 } elsif ( C4::Context->preference("marcflavour") eq 'MARC21' ) {
                     $en = $marcrecord->subfield( '037', "a" );
+                    $edition = $marcrecord->subfield( '250', 'a' );
                 }
             }
 
@@ -212,8 +216,9 @@ sub printbasketgrouppdf{
                 isbn => ($ord->{isbn} ? $ord->{isbn} : undef),
                 itemtype => ( $ord->{itemtype} and $bib->{itemtype} ? $itemtypes->{$bib->{itemtype}}->{description} : undef ),
                 en => ( $en ? $en : undef ),
+                edition => ( $edition ? $edition : undef ),
             };
-            for my $key ( qw/ gstrate author title itemtype publishercode discount quantity rrpgsti rrpgste gstgsti gstgste ecostgsti ecostgste gstvalue totalgste totalgsti / ) {
+            for my $key ( qw/ gstrate author title itemtype publishercode copyrightdate publicationyear discount quantity rrpgsti rrpgste gstgsti gstgste ecostgsti ecostgste gstvalue totalgste totalgsti order_vendornote / ) {
                 $ba_order->{$key} = $ord->{$key};
             }