Bugzilla – Attachment 95782 Details for
Bug 10758
Show bibliographic information of deleted records in acquisition baskets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10758: WIP
Bug-10758-WIP.patch (text/plain), 9.09 KB, created by
Jonathan Druart
on 2019-11-25 12:01:11 UTC
(
hide
)
Description:
Bug 10758: WIP
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-25 12:01:11 UTC
Size:
9.09 KB
patch
obsolete
>From 76653e8d1c729764f76c6dc366c55a6eebe4bcb0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 25 Nov 2019 12:58:24 +0100 >Subject: [PATCH] Bug 10758: WIP > >Started working on this but then realised we do not have >Koha::Old::Biblios classes. It is getting complicated and will put a >spoke in bug 20271's wheel >--- > acqui/parcel.pl | 35 ++++++++++++------ > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 42 ++++++++++++---------- > 2 files changed, 47 insertions(+), 30 deletions(-) > >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 9c16c9ccfe..4782454e84 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -69,6 +69,7 @@ use Koha::Acquisition::Baskets; > use Koha::Acquisition::Bookseller; > use Koha::Acquisition::Orders; > use Koha::Biblios; >+use Koha::Old::Biblios; > use Koha::DateUtils; > use Koha::Biblios; > >@@ -140,14 +141,22 @@ for my $order ( @orders ) { > > my %line = %{ $order }; > $line{invoice} = $invoice->{invoicenumber}; >- my @itemnumbers = $order_object->items->get_column('itemnumber'); >+ > my $biblio = Koha::Biblios->find( $line{biblionumber} ); >- $line{total_holds} = $biblio ? $biblio->holds->count : 0; >- $line{item_holds} = $biblio ? $biblio->current_holds->search( >- { >- itemnumber => { -in => \@itemnumbers }, >- } >- )->count : 0; >+ if ( $biblio ) { >+ my @itemnumbers = $order_object->items->get_column('itemnumber'); >+ $line{total_holds} = $biblio->holds->count; >+ $line{item_holds} = $biblio->current_holds->search( >+ { >+ itemnumber => { -in => \@itemnumbers }, >+ } >+ )->count; >+ } else { >+ $biblio = Koha::Old::Biblios->find( $line{biblionumber} ); >+ $line{total_holds} = 0; >+ $line{item_holds} = 0; >+ } >+ $line{biblio} = $biblio; > $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} ); > > $line{tax_value} = $line{tax_value_on_receiving}; >@@ -244,11 +253,15 @@ unless( defined $invoice->{closedate} ) { > my $countbiblio = CountBiblioInOrders($biblionumber); > my $ordernumber = $line{'ordernumber'}; > my $order_object = Koha::Acquisition::Orders->find($ordernumber); >- my $cnt_subscriptions = $biblio ? $biblio->subscriptions->count: 0; >- my $itemcount = $biblio ? $biblio->items->count : 0; >- my $holds_count = $biblio ? $biblio->holds->count : 0; > my @itemnumbers = $order_object->items->get_column('itemnumber'); >- my $itemholds = $biblio ? $biblio->holds->search({ itemnumber => { -in => \@itemnumbers } })->count : 0; >+ my ( $cnt_subscriptions, $itemcount, $holds_count, $itemholds ) = (0) x 4; >+ if ( $biblio ) { >+ $cnt_subscriptions = $biblio->subscriptions->count; >+ $itemcount = $biblio->items->count; >+ $holds_count = $biblio->holds->count; >+ $itemholds = $biblio->holds->search({ itemnumber => { -in => \@itemnumbers } })->count; >+ } >+ $order->{biblio} = $biblio; > > my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); > $line{suggestionid} = $suggestion->{suggestionid}; >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 414844397c..bb894b1f95 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -140,13 +140,13 @@ > </td> > <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber | uri %]&booksellerid=[% loop_order.booksellerid | uri %]">[% loop_order.ordernumber | html %]</a></td> > <td class="summaryfilterclass"> >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber | uri %]">[% loop_order.title | html %]</a> >- [% IF ( loop_order.author ) %] by [% loop_order.author | html %][% END %] >- [% IF ( loop_order.isbn ) %] – [% loop_order.isbn | html %][% END %] >- [% IF ( loop_order.publishercode ) %] >- <br />Publisher: [% loop_order.publishercode | html %] >- [%- IF ( loop_order.publicationyear > 0) -%], [% loop_order.publicationyear | html %] >- [%- ELSIF ( loop_order.copyrightdate > 0) -%] [% loop_order.copyrightdate | html %] >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblio.biblionumber | uri %]">[% loop_order.biblio.title | html %]</a> >+ [% IF ( loop_order.biblio.author ) %] by [% loop_order.biblio.author | html %][% END %] >+ [% IF ( loop_order.biblio.biblioitem ) %] – [% loop_order.biblio.biblioitem.isbn | html %][% END %] >+ [% IF ( loop_order.biblio.biblioitem.publishercode ) %] >+ <br />Publisher: [% loop_order.biblio.biblioitem.publishercode | html %] >+ [%- IF ( loop_order.biblio.biblioitem.publicationyear > 0) -%], [% loop_order.biblio.biblioitem.publicationyear | html %] >+ [%- ELSIF ( loop_order.biblio.copyrightdate > 0) -%] [% loop_order.biblio.copyrightdate | html %] > [% END %] > [% END %] > [% IF ( loop_order.suggestionid ) %] >@@ -167,8 +167,10 @@ > </td> > <td> > <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br> >- <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber | uri %]" class="previewData">MARC</a><br> >- <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber | uri %]" class="previewData">Card</a> >+ [% IF loop_order.biblionumber %] >+ <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber | uri %]" class="previewData">MARC</a><br> >+ <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber | uri %]" class="previewData">Card</a> >+ [% END %] > </td> > <td>[% loop_order.replacementprice | $Price %]</td> > <td>[% loop_order.quantity | html %]</td> >@@ -303,13 +305,13 @@ > 0 > [% END %] > </td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a> >- [% IF ( order.author ) %] / [% order.author | html %][% END %] >- [% IF ( order.isbn ) %] - [% order.isbn | html %][% END %] >- [% IF ( order.publishercode ) %] >- <br />Publisher: [% order.publishercode | html %] >- [%- IF ( order.publicationyear > 0) -%], [% order.publicationyear | html %] >- [%- ELSIF ( order.copyrightdate > 0) -%] [% order.copyrightdate | html %] >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblio.biblionumber | uri %]">[% order.biblio.title | html %]</a> >+ [% IF ( order.biblio.author ) %] / [% order.biblio.author | html %][% END %] >+ [% IF ( order.biblio.biblioitem.isbn ) %] - [% order.biblio.biblioitem.isbn | html %][% END %] >+ [% IF ( order.biblio.biblioitem.publishercode ) %] >+ <br />Publisher: [% order.biblio.biblioitem.publishercode | html %] >+ [%- IF ( order.biblio.biblioitem.publicationyear > 0) -%], [% order.biblio.biblioitem.publicationyear | html %] >+ [%- ELSIF ( order.biblio.copyrightdate > 0) -%] [% order.biblio.copyrightdate | html %] > [% END %] > [% END %] > [% IF ( order.suggestionid ) %] >@@ -330,9 +332,11 @@ > [% END %] > </td> > <td> >- <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br> >- <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber | uri %]" class="previewData">MARC</a><br> >- <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber | uri %]" class="previewData">Card</a> >+ <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br> >+ [% IF order.biblionumber %] >+ <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber | uri %]" class="previewData">MARC</a><br> >+ <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber | uri %]" class="previewData">Card</a> >+ [% END %] > </td> > <td>[% order.replacementprice | $Price %]</td> > <td>[% order.quantityreceived | html %]</td> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10758
:
21296
|
22106
|
26830
|
26832
|
27273
|
27312
|
27313
|
27314
|
27315
|
28514
|
28515
|
29667
|
30551
|
30552
|
30623
|
95782
|
162016
|
162034
|
165229