Bug 27817

Summary: Enhance display of title information throughout acquisitions
Product: Koha Reporter: Barbara Johnson <barbara.johnson>
Component: AcquisitionsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aholt, ajohnson, kelly, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20532
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31433
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31434
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This adds remainder of title/subtitle, medium, part name, and part number to several pages in the acquisitions module.
Version(s) released in:
22.11.00
Circulation function:
Attachments: Bug 27817: Use biblio-title include in some acquisitions pages
Bug 27817: Use biblio-title include in some acquisitions pages
acq_basket
acq_ordered
wimpy kid
Bug 27817: Use biblio-title include in some acquisitions pages
Bug 27817: Use biblio-title include in some acquisitions pages
Bug 27817: Use biblio-title include in some acquisitions pages
Bug 27817: Use biblio-title include in some acquisitions pages

Description Barbara Johnson 2021-02-26 22:22:07 UTC
There are multiple places in Acquisitions where only the 245a field from the title displays.  It would be helpful to add additional subfields for subtitle (245b), part number (245n) and part name (245p)  Being able to view the entire title would make receiving easier, more accurate and more efficient.  The pages that would benefit from showing this info are as follows:

ordered.pl
invoice.pl
basket.pl
parcel.pl
orderreceive.pl
Comment 1 Owen Leonard 2021-03-29 15:17:34 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2021-04-17 13:05:47 UTC
*** Bug 20532 has been marked as a duplicate of this bug. ***
Comment 3 Barbara Johnson 2021-06-15 21:12:18 UTC
I tested in a sandbox.  For Acquisitions -> Vendor -> Basket I'm getting a "Template process failed" error.  For all other pages I'm not seeing the additional info from the 245$b, 245$h, 245$n or 245$p subfields.
Comment 4 Owen Leonard 2021-10-15 11:26:49 UTC
Thanks for testing, Barbara. Please feel free to mark something "Failed QA" if anything doesn't work. It's not a setting which is reserved for the QA team. Because this was still "needs signoff" I didn't realize there was a problem with it!
Comment 5 Owen Leonard 2021-10-15 12:09:26 UTC
Created attachment 126323 [details] [review]
Bug 27817: Use biblio-title include in some acquisitions pages

This patch adds the use of the biblio-title include in acquisitions
templates which get the right data from their corresponding scripts.

To test, apply the patch and test these Acquisitions pages to confirm
that titles with 245$b, 245$h, etc, show all the correct information.

- Acquisitions -> Vendor -> Basket
- Acquisitions -> Vendor -> Uncertain prices
- Acquisitions -> Invoices -> Invoice
- Acquisitions -> Invoices -> Invoice -> View an invoice which has an
  already-received bibliographic record.
  - Go to receipt page -> Already received.
    -- The "Pending orders" table is unmodified because I wasn't sure
       how to use the biblio-title include in an AJAX DataTable.
Comment 6 Owen Leonard 2021-10-15 12:15:42 UTC
I couldn't (In reply to Barbara Johnson from comment #3)
> I tested in a sandbox.  For Acquisitions -> Vendor -> Basket I'm getting a
> "Template process failed" error.

I couldn't reproduce this error, but the patch needed to be rebased so a new version is attached.
Comment 7 Barbara Johnson 2022-02-18 21:55:49 UTC
Here's what I have found so far in my testing:

On basket.pl the title and subtitle display correctly in the 245|a and 245|b. 
 However, it is also incorrectly including series data from the 490|a and 490|v. See the attachment acq_basket.png.  The info highlighted in yellow is coming from the 490 tag.

On ordered.pl only data from the 245|a is displaying.  See the attachment acq_ordered.png.  Each title that has been highlighted has a subtitle in the 245|b but it is not displaying. 

On orderreceive.pl, parcel.pl and invoice.pl the 245|a and 245|b display correctly.

Actually parcel.pl is the the place the extra info from the 245|b would be most useful.  I attached a screenshot (which_wimpy_kid_is_it.png) showing the display a staff person sees when receiving.  In the example all four books are different wimpy kid titles, but without the subtitle displayed it's not readily apparent which is the correct book to receive.  Staff then has to start looking at the ISBNS which is more time consuming.
Comment 8 Barbara Johnson 2022-02-18 21:56:58 UTC
Created attachment 130899 [details]
acq_basket
Comment 9 Barbara Johnson 2022-02-18 21:57:17 UTC
Created attachment 130900 [details]
acq_ordered
Comment 10 Barbara Johnson 2022-02-18 21:57:46 UTC
Created attachment 130901 [details]
wimpy kid
Comment 11 Katrin Fischer 2022-02-19 19:18:31 UTC
Owen, could you have a look at Barbara's comments please?
Comment 12 Owen Leonard 2022-08-19 18:42:34 UTC
(In reply to Barbara Johnson from comment #7)

> On basket.pl ... is also incorrectly including series data from the 490|a and
> 490|v.

basket.pl and invoice.pl have code to deliberately add the series information to the title variable:

    if ( $line{'title'} ) {
        my $volume      = $order->{'volume'};
        my $seriestitle = $order->{'seriestitle'};
        $line{'title'} .= " / $seriestitle" if $seriestitle;
        $line{'title'} .= " / $volume"      if $volume;
    }


parcel.pl appears to be showing 245$b correctly for me in the "Already received" table, which is the only place this patch changes anything. The display of title information in the "Pending orders" table is not affected.
Comment 13 Owen Leonard 2022-08-19 18:42:59 UTC
Created attachment 139517 [details] [review]
Bug 27817: Use biblio-title include in some acquisitions pages

This patch adds the use of the biblio-title include in acquisitions
templates which get the right data from their corresponding scripts.

To test, apply the patch and test these Acquisitions pages to confirm
that titles with 245$b, 245$h, etc, show all the correct information.

- Acquisitions -> Vendor -> Basket
- Acquisitions -> Vendor -> Uncertain prices
- Acquisitions -> Invoices -> Invoice
- Acquisitions -> Invoices -> Invoice -> View an invoice which has an
  already-received bibliographic record.
  - Go to receipt page -> Already received.
    -- The "Pending orders" table is unmodified because I wasn't sure
       how to use the biblio-title include in an AJAX DataTable.
Comment 14 Katrin Fischer 2022-08-21 22:16:59 UTC
(In reply to Owen Leonard from comment #12)
> (In reply to Barbara Johnson from comment #7)
> 
> > On basket.pl ... is also incorrectly including series data from the 490|a and
> > 490|v.
> 
> basket.pl and invoice.pl have code to deliberately add the series
> information to the title variable:
> 
>     if ( $line{'title'} ) {
>         my $volume      = $order->{'volume'};
>         my $seriestitle = $order->{'seriestitle'};
>         $line{'title'} .= " / $seriestitle" if $seriestitle;
>         $line{'title'} .= " / $volume"      if $volume;
>     }
> 
> 
> parcel.pl appears to be showing 245$b correctly for me in the "Already
> received" table, which is the only place this patch changes anything. The
> display of title information in the "Pending orders" table is not affected.

Maybe we could move the series information display to a separate bug. I can see that the code doesn't affect it - neither adding nor removing.
Comment 15 Katrin Fischer 2022-08-21 22:34:53 UTC
Created attachment 139564 [details] [review]
Bug 27817: Use biblio-title include in some acquisitions pages

This patch adds the use of the biblio-title include in acquisitions
templates which get the right data from their corresponding scripts.

To test, apply the patch and test these Acquisitions pages to confirm
that titles with 245$b, 245$h, etc, show all the correct information.

- Acquisitions -> Vendor -> Basket
- Acquisitions -> Vendor -> Uncertain prices
- Acquisitions -> Invoices -> Invoice
- Acquisitions -> Invoices -> Invoice -> View an invoice which has an
  already-received bibliographic record.
  - Go to receipt page -> Already received.
    -- The "Pending orders" table is unmodified because I wasn't sure
       how to use the biblio-title include in an AJAX DataTable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Katrin Fischer 2022-08-21 22:36:39 UTC
I filed bug 31433 (order from existing) and bug 31434 (order receive) to complete the work here. This is already a huge improvement and important to libraries dealing with a lot of multi-part records and series that can only be differentiated by part number or part name.

@Barbara: if you wanted to give this another try we could count my sign-off towards QA.
Comment 17 Barbara Johnson 2022-08-22 21:15:00 UTC
In my latest test, I can confirm that I am able to view the 245abhnp on basket.pl, orderreceive.pl and invoice.pl.

Only the 245a info is displayed on parcel.pl and I believe bug 31434 is supposed to address that.

Also, only the 245a is displayed on ordered.pl - it would be helpful to see the additional info here as well.
Comment 18 Katrin Fischer 2022-08-23 08:19:47 UTC
Thx Barbara. Do you want to sign-off with the sandboxes? Otherwise I can try to add your sign-off line later.

(In reply to Barbara Johnson from comment #17)
> In my latest test, I can confirm that I am able to view the 245abhnp on
> basket.pl, orderreceive.pl and invoice.pl.
> 
> Only the 245a info is displayed on parcel.pl and I believe bug 31434 is
> supposed to address that.

It does show, but only after you received something for the received oders, in the second table below the first. Bug 31434 is for the 'unreceiveds' table.

> Also, only the 245a is displayed on ordered.pl - it would be helpful to see
> the additional info here as well.

Could you file that as a separate one? We'd probably want it for the spent too.
Comment 19 ByWater Sandboxes 2022-08-23 13:47:58 UTC
Created attachment 139679 [details] [review]
Bug 27817: Use biblio-title include in some acquisitions pages

This patch adds the use of the biblio-title include in acquisitions
templates which get the right data from their corresponding scripts.

To test, apply the patch and test these Acquisitions pages to confirm
that titles with 245$b, 245$h, etc, show all the correct information.

- Acquisitions -> Vendor -> Basket
- Acquisitions -> Vendor -> Uncertain prices
- Acquisitions -> Invoices -> Invoice
- Acquisitions -> Invoices -> Invoice -> View an invoice which has an
  already-received bibliographic record.
  - Go to receipt page -> Already received.
    -- The "Pending orders" table is unmodified because I wasn't sure
       how to use the biblio-title include in an AJAX DataTable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 20 Barbara Johnson 2022-08-23 16:18:14 UTC
I've signed off on this bug - this functionality will be so helpful.

Also, I filed bug 31443 (for viewing titles from ordered.pl) and bug 31444 (for viewing titles on spent.pl) to complete the work already done here.
Comment 21 Kyle M Hall (khall) 2022-09-16 18:48:50 UTC
Created attachment 140734 [details] [review]
Bug 27817: Use biblio-title include in some acquisitions pages

This patch adds the use of the biblio-title include in acquisitions
templates which get the right data from their corresponding scripts.

To test, apply the patch and test these Acquisitions pages to confirm
that titles with 245$b, 245$h, etc, show all the correct information.

- Acquisitions -> Vendor -> Basket
- Acquisitions -> Vendor -> Uncertain prices
- Acquisitions -> Invoices -> Invoice
- Acquisitions -> Invoices -> Invoice -> View an invoice which has an
  already-received bibliographic record.
  - Go to receipt page -> Already received.
    -- The "Pending orders" table is unmodified because I wasn't sure
       how to use the biblio-title include in an AJAX DataTable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 22 Tomás Cohen Arazi (tcohen) 2022-09-19 18:17:43 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 23 Ashley Johnson 2022-09-22 21:33:07 UTC
Excellent!
Comment 24 Lucas Gass (lukeg) 2022-10-31 22:15:23 UTC
Enhancement will not be backported to 22.05.x series