From 49514aed04bd052055823c4034bc97791788ffcf Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Sat, 19 Apr 2014 20:21:59 +0200 Subject: [PATCH] Bug 12110 : Display the order vendor note in basket and basketgroup CSV and PDF Content-Type: text/plain; charset="utf-8" This bug adds the "vendor note" for each order in the PDF for basketgroups. The note is display only if it exists, just under the bibliographic information. I added a separation line "--------" between bibliographic information and the note, so that it could be visible at 1st glance It also replaces the internal note with the vendor in the CSV for basket and basketgroup It is more logical and useful for libraries to export the note made for vendor, as those files are destined to be sent to the vendor. Test plan : - fill a basket with some orders, some with internal notes, some with vendor notes - export the basket in CSV : only the vendor notes should be present - put the basket in a basketgroup - export the basketgroup in CSV : only the vendor notes should be present - Select "English-2 pages" template for basketgroups in Sysprefs - export the basket in PDF : the vendor notes should be present under the bibliographic information - Select "English-3 pages" template for basketgroups in Sysprefs - export the basket in PDF : the vendor notes should be present under the bibliographic information --- C4/Acquisition.pm | 4 ++-- acqui/basketgroup.pl | 2 +- acqui/pdfformat/layout2pages.pm | 2 +- acqui/pdfformat/layout3pages.pm | 2 +- .../prog/en/includes/csv_headers/acqui/basket.tt | 2 +- .../en/includes/csv_headers/acqui/basketgroup.tt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index c565db6..177c640 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -310,7 +310,7 @@ sub GetBasketAsCSV { publicationyear => $bd->{'publicationyear'}, publishercode => $bd->{'publishercode'}, collectiontitle => $bd->{'collectiontitle'}, - notes => $order->{'order_internalnote'}, + notes => $order->{'order_vendornote'}, quantity => $order->{'quantity'}, rrp => $order->{'rrp'}, deliveryplace => C4::Branch::GetBranchName( $basket->{'deliveryplace'} ), @@ -381,7 +381,7 @@ sub GetBasketGroupAsCSV { rrp => $order->{rrp}, discount => $bookseller->{discount}, ecost => $order->{ecost}, - notes => $order->{order_internalnote}, + notes => $order->{order_vendornote}, entrydate => $order->{entrydate}, booksellername => $bookseller->{name}, bookselleraddress => $bookseller->{address1}, diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index b2d8b94..29e90f1 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -214,7 +214,7 @@ sub printbasketgrouppdf{ itemtype => ( $ord->{itemtype} and $bib->{itemtype} ? $itemtypes->{$bib->{itemtype}}->{description} : undef ), en => ( $en ? $en : 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 discount quantity rrpgsti rrpgste gstgsti gstgste ecostgsti ecostgste gstvalue totalgste totalgsti order_vendornote / ) { $ba_order->{$key} = $ord->{$key}; } diff --git a/acqui/pdfformat/layout2pages.pm b/acqui/pdfformat/layout2pages.pm index 335dc0a..f3664b8 100644 --- a/acqui/pdfformat/layout2pages.pm +++ b/acqui/pdfformat/layout2pages.pm @@ -93,7 +93,7 @@ sub printorders { $arrbasket = undef; 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} : ""), + $line->{title} . " / " . $line->{author} . ( $line->{isbn} ? " ISBN : " . $line->{isbn} : '' ) . ( $line->{en} ? " EN : " . $line->{en} : '' ) . ", " . $line->{itemtype} . ( $line->{publishercode} ? ' published by '. $line->{publishercode} : "").( $line->{order_vendornote} ? "\n----------------\nNotes for vendor : " . $line->{order_vendornote} : '' ) , $line->{quantity}, $num->format_price($line->{rrpgsti}), $num->format_price($line->{discount}).'%', diff --git a/acqui/pdfformat/layout3pages.pm b/acqui/pdfformat/layout3pages.pm index b9d10aa..c39296a 100644 --- a/acqui/pdfformat/layout3pages.pm +++ b/acqui/pdfformat/layout3pages.pm @@ -111,7 +111,7 @@ sub printorders { foreach my $line (@{$orders->{$basket->{basketno}}}) { $arrbasket = undef; push( @$arrbasket, - $line->{title} . " / " . $line->{author} . ( $line->{isbn} ? " ISBN : " . $line->{isbn} : '' ) . ( $line->{en} ? " EN : " . $line->{en} : '' ) . ", " . $line->{itemtype} . ( $line->{publishercode} ? ' published by '. $line->{publishercode} : ""), + $line->{title} . " / " . $line->{author} . ( $line->{isbn} ? " ISBN : " . $line->{isbn} : '' ) . ( $line->{en} ? " EN : " . $line->{en} : '' ) . ", " . $line->{itemtype} . ( $line->{publishercode} ? ' published by '. $line->{publishercode} : "").( $line->{order_vendornote} ? "\n----------------\nNotes for vendor : " . $line->{order_vendornote} : '' ) , $line->{quantity}, $num->format_price($line->{rrpgste}), $num->format_price($line->{rrpgsti}), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basket.tt index fdb5781..a2086f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basket.tt @@ -1 +1 @@ -Contract name,Order number,Entry date,ISBN,Author,Title,Publication year,Publisher,Collection title,Internal note,Quantity,RRP,Delivery place,Billing place +Contract name,Order number,Entry date,ISBN,Author,Title,Publication year,Publisher,Collection title,Note for vendor,Quantity,RRP,Delivery place,Billing place diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basketgroup.tt index fd99445..de07b35 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basketgroup.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/basketgroup.tt @@ -1 +1 @@ -Account number,Basket name,Order number,Author,Title,Publisher,Publication year,Collection title,ISBN,Quantity,RRP,Discount,Estimated cost,Internal note,Entry date,Bookseller name,Bookseller physical address,Bookseller postal address,Contract number,Contract name,Basket group delivery place,Basket group billing place,Basket delivery place,Basket billing place +Account number,Basket name,Order number,Author,Title,Publisher,Publication year,Collection title,ISBN,Quantity,RRP,Discount,Estimated cost,Note for vendor,Entry date,Bookseller name,Bookseller physical address,Bookseller postal address,Contract number,Contract name,Basket group delivery place,Basket group billing place,Basket delivery place,Basket billing place -- 1.7.9.5