From c59e395b749132080fefb81e5b12f8c0b6654665 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Wed, 23 Oct 2013 12:05:23 +0200 Subject: [PATCH] Bug 11122 - publisher code and publication year not fetched in acq orders In acquisition, several templates try to display publisher code and publication year : invoice.tt, parcel.tt, transferorder.tt. Thoses pages use C4::Acquisition methods GetPendingOrders or GetInvoiceDetails. The bug is that in the SQL query of those methods, biblioitems.publishercode and biblioitems.publicationyear. In uncertainprice.pl those datas are fetch using GetBiblioData. It whould be better to fetch them in GetPendingOrders and GetInvoiceDetails. This patch changes SQL queries to fetch wanted datas : aqorders.*,biblio.title,biblio.author,biblioitems.isbn,biblioitems.publishercode,biblioitems.publicationyear. GetInvoiceDetails also needs : biblio.seriestitle,biblioitems.volume. This patch also unifies the way biblio datas are displayed : [title] by [author] – [isbn] Publisher: [publishercode], [publicationyear] Test plan : - Choose a biblio record containing a data in : biblio.title, biblio.author, biblioitems.isbn, biblioitems.publishercode, biblioitems.publicationyear, biblio.seriestitle, biblioitems.volume. - Create an order using this biblio. - Look at this order in pages : parcel.pl, transferorder.pl, uncertainprice.pl => You see publisher code and publication year - Look at this order in page : invoice.pl => You see publisher code, publication year, series title and volume Signed-off-by: Katrin Fischer Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- C4/Acquisition.pm | 3 +++ acqui/uncertainprice.pl | 20 ++----------------- .../prog/en/modules/acqui/invoice.tt | 3 ++- .../prog/en/modules/acqui/parcel.tt | 10 ++++++++-- .../prog/en/modules/acqui/transferorder.tt | 5 ++++- .../prog/en/modules/acqui/uncertainprice.tt | 17 +++++++++++----- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 82b9e3b90f..4c2ead7281 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1706,6 +1706,8 @@ sub SearchOrders { biblio.*, biblioitems.isbn, biblioitems.biblioitemnumber, + biblioitems.publishercode, + biblioitems.publicationyear, aqbasket.authorisedby, aqbasket.booksellerid, aqbasket.closedate, @@ -2617,6 +2619,7 @@ sub GetInvoiceDetails { SELECT aqorders.*, biblio.*, biblio.copyrightdate, + biblioitems.isbn, biblioitems.publishercode, biblioitems.publicationyear, aqbasket.basketname, diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl index 34a6b2526e..54668c4f0e 100755 --- a/acqui/uncertainprice.pl +++ b/acqui/uncertainprice.pl @@ -79,24 +79,8 @@ my $pendingorders = SearchOrders({ basketno => $basketno, pending => 1, }); -my @orders; - -foreach my $order (@{$pendingorders}) { - if ( $order->{'uncertainprice'} ) { - my $bibdata = &GetBiblioData($order->{'biblionumber'}); - $order->{'bibisbn'} = $bibdata->{'isbn'}; - $order->{'bibpublishercode'} = $bibdata->{'publishercode'}; - $order->{'bibpublicationyear'} = $bibdata->{'publicationyear'}; - $order->{'bibtitle'} = $bibdata->{'title'}; - $order->{'bibauthor'} = $bibdata->{'author'}; - $order->{'surname'} = $order->{'surname'}; - $order->{'firstname'} = $order->{'firstname'}; - my $order_as_from_db=GetOrder($order->{ordernumber}); - $order->{'quantity'} = $order_as_from_db->{'quantity'}; - $order->{'listprice'} = $order_as_from_db->{'listprice'}; - push(@orders, $order); - } -} +my @orders = grep { $_->{'uncertainprice'} } @$pendingorders; + if ( $op eq 'validate' ) { $template->param( validate => 1); my $count = scalar(@orders); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index 9d156efde0..216b68d5b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -157,13 +157,14 @@ [% IF order.biblionumber %] - [% order.title %] + [% order.title |html %] [% IF ( order.author ) %]
by [% order.author %] [% END %] [% ELSE %] Deleted bibliographic record, can't find title [% END %] + [% IF ( order.isbn ) %] – [% order.isbn %][% END %] [% IF ( order.publishercode ) %]
[% order.publishercode %] [% IF order.publicationyear > 0 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 82bca90301..8374114cf1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -270,7 +270,10 @@ [% loop_order.title |html %] [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %] [% IF ( loop_order.isbn ) %] – [% loop_order.isbn %][% END %] - [% IF ( loop_order.publishercode ) %]
Publisher:[% loop_order.publishercode %][% END %] + [% IF ( loop_order.publishercode ) %] +
Publisher: [% loop_order.publishercode %] + [%- IF ( loop_order.publicationyear ) %], [% loop_order.publicationyear %][% END %] + [% END %] [% IF ( loop_order.suggestionid ) %]
Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %] @@ -417,7 +420,10 @@ [% order.title |html %] [% IF ( order.author ) %] / [% order.author %][% END %] [% IF ( order.isbn ) %] - [% order.isbn %][% END %] - [% IF ( order.publishercode ) %]
Publisher :[% order.publishercode %][% END %] + [% IF ( order.publishercode ) %] +
Publisher: [% order.publishercode %] + [%- IF ( order.publicationyear ) %], [% order.publicationyear %][% END %] + [% END %] [% IF ( order.suggestionid ) %]
Suggested by: [% order.surnamesuggestedby %][% IF ( order.firstnamesuggestedby ) %], [% order.firstnamesuggestedby %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt index d9d8bbc485..478801e052 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt @@ -103,7 +103,10 @@ [% ordersloo.title |html %] [% IF ( ordersloo.author ) %] by [% ordersloo.author %][% END %] [% IF ( ordersloo.isbn ) %] – [% ordersloo.isbn %][% END %] - [% IF ( ordersloo.publishercode ) %]
Publisher :[% ordersloo.publishercode %][% END %] + [% IF ( ordersloo.publishercode ) %] +
Publisher: [% ordersloo.publishercode %] + [%- IF ( ordersloo.publicationyear ) %], [% ordersloo.publicationyear %][% END %] + [% END %] Transfer diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt index b5491cff25..7eb822de28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt @@ -108,11 +108,18 @@ var MSG_INVALIDPRICE = _("ERROR: Price is not a valid number, please check the p [% uncertainpriceorder.basketname %] - [% uncertainpriceorder.bibtitle %] / [% uncertainpriceorder.bibauthor %]
[% uncertainpriceorder.bibpublishercode %], [% uncertainpriceorder.bibpublicationyear %]
[% uncertainpriceorder.bibisbn %]
- - edit - - + [% uncertainpriceorder.title |html %] + [% IF ( uncertainpriceorder.author ) %] by [% uncertainpriceorder.author %][% END %] + [% IF ( uncertainpriceorder.publishercode ) %] +
Publisher: [% uncertainpriceorder.publishercode %] + [%- IF ( uncertainpriceorder.publicationyear ) %], [% uncertainpriceorder.publicationyear %][% END %] + [% END %] + [% IF ( uncertainpriceorder.isbn ) %]
[% uncertainpriceorder.isbn %][% END %] +
+ + Edit + + [% uncertainpriceorder.firstname %] [% uncertainpriceorder.surname %] -- 2.39.5