[Koha-patches] [PATCH] BZ6075: problem in pdf and columns alignment

paul.poulain at biblibre.com paul.poulain at biblibre.com
Tue Apr 5 22:43:06 CEST 2011


From: Paul Poulain <paul.poulain at biblibre.com>

When some fields are empty, the table is wrongly set : the empty columns are
not set, thus the column don't contains what they are supposed to contain
---
 acqui/basketgroup.pl |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl
index 457b616..a92d730 100755
--- a/acqui/basketgroup.pl
+++ b/acqui/basketgroup.pl
@@ -211,19 +211,18 @@ sub printbasketgrouppdf{
                 } else {
                     push(@ba_order, undef);
                 }
-                if ($ord->{itemtype}){
-                    push(@ba_order, $itemtypes->{$bib->{itemtype}}->{description}) if $bib->{itemtype};
+                if ($ord->{itemtype} and $bib->{itemtype}){
+                    push(@ba_order, $itemtypes->{$bib->{itemtype}}->{description});
                 } else {
                     push(@ba_order, undef);
                 }
 #             } else {
 #                 push(@ba_order, undef, undef);
                 for my $key (qw/author title publishercode quantity listprice ecost/) {
-                    push(@ba_order, $ord->{$key});                                                  #Order lines
+                    push(@ba_order, ($ord->{$key} || undef ));                                                  #Order lines
                 }
-                push(@ba_order, $bookseller->{discount});
+                push(@ba_order, $bookseller->{discount} || undef );
                 push(@ba_order, $bookseller->{gstrate}*100 // C4::Context->preference("gist") // 0);
-                push(@ba_orders, \@ba_order);
                 # Editor Number
                 my $en;
                 if (C4::Context->preference("marcflavour") eq 'UNIMARC') {
@@ -236,6 +235,7 @@ sub printbasketgrouppdf{
                 } else {
                     push(@ba_order, undef);
                 }
+                push( @ba_orders, \@ba_order );
             }
         }
         $orders{$basket->{basketno}}=\@ba_orders;
-- 
1.7.1



More information about the Koha-patches mailing list