Bug 35994 - New acquisition status method to see if biblio record is still in acquisition
Summary: New acquisition status method to see if biblio record is still in acquisition
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Marcel de Rooy
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 36068 36018
Blocks:
  Show dependency treegraph
 
Reported: 2024-02-05 14:09 UTC by Marcel de Rooy
Modified: 2024-11-09 12:37 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:


Attachments
Bug 35994: Add $biblio->acq_status (4.10 KB, patch)
2024-02-22 14:31 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35994: Show acq_status on catalogue/detail (2.31 KB, patch)
2024-02-22 14:31 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35994: Add $biblio->acq_status (4.10 KB, patch)
2024-04-19 07:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35994: Show acq_status on catalogue/detail (2.29 KB, patch)
2024-04-19 07:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35994: Add $biblio->acq_status (4.13 KB, patch)
2024-04-19 18:18 UTC, Emily Lamancusa (emlam)
Details | Diff | Splinter Review
Bug 35994: Show acq_status on catalogue/detail (2.32 KB, patch)
2024-04-19 18:18 UTC, Emily Lamancusa (emlam)
Details | Diff | Splinter Review
Bug 35994: (QA follow-up) Fix Biblio.t (1.32 KB, patch)
2024-05-10 08:41 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35994: Add $biblio->acq_status (4.20 KB, patch)
2024-05-10 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35994: Show acq_status on catalogue/detail (2.38 KB, patch)
2024-05-10 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35994: (QA follow-up) Fix Biblio.t (1.34 KB, patch)
2024-05-10 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2024-02-05 14:09:57 UTC
See also bug 35993. Checking for 005 would not be a good way to approach this question.
Comment 1 Marcel de Rooy 2024-02-05 14:11:43 UTC
Note that acquisition of older books may take a long time. In the meantime we may have changed from creating items at ordering, receiving or cataloging. So we cannot just trust checking items.notforloan.
Comment 2 Marcel de Rooy 2024-02-06 14:47:05 UTC
Bug 24430 added biblio->active_orders but they include the lines which are completely received. These are actually 'not-cancelled' orders.
Comment 3 Marcel de Rooy 2024-02-21 13:29:36 UTC
(In reply to Marcel de Rooy from comment #2)
> Bug 24430 added biblio->active_orders but they include the lines which are
> completely received. These are actually 'not-cancelled' orders.

No this is about current orders. And has been addressed now on 36018.
Comment 4 Marcel de Rooy 2024-02-22 14:31:06 UTC
Created attachment 162334 [details] [review]
Bug 35994: Add $biblio->acq_status

This allows you to see quickly if a biblio has linked orders or not.
And if they are all cancelled, or some still in processing, or some
are complete (and the rest cancelled).

Test plan:
Run t/db_dependent/Koha/Biblio.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2024-02-22 14:31:08 UTC
Created attachment 162335 [details] [review]
Bug 35994: Show acq_status on catalogue/detail

Test plan:
Based on the described criteria, check a few biblio records.
Look at Acquisitions tab on the intranet detail page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2024-04-17 13:44:50 UTC
Issue seems to be resolved on 36018. So back to NSO here. Please try again!
Comment 7 Emily Lamancusa (emlam) 2024-04-17 17:11:46 UTC
This is a nice addition! I can confirm the "unlinked" and "cancelled" statuses work as intended, as well as the "processing" status when nothing has been received yet. I ran into bug 36628 when trying to set up the cases for "acquired", and the "processing" status when some but not all items have been received, though. :(
Comment 8 Emily Lamancusa (emlam) 2024-04-18 17:05:52 UTC
Ohhh, the error is coming from the dependency, not master - see https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36018#c24
Comment 9 Marcel de Rooy 2024-04-19 07:40:27 UTC
Created attachment 165154 [details] [review]
Bug 35994: Add $biblio->acq_status

This allows you to see quickly if a biblio has linked orders or not.
And if they are all cancelled, or some still in processing, or some
are complete (and the rest cancelled).

Test plan:
Run t/db_dependent/Koha/Biblio.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2024-04-19 07:40:29 UTC
Created attachment 165155 [details] [review]
Bug 35994: Show acq_status on catalogue/detail

Test plan:
Based on the described criteria, check a few biblio records.
Look at Acquisitions tab on the intranet detail page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2024-04-19 07:42:44 UTC
(In reply to Emily Lamancusa from comment #8)
> Ohhh, the error is coming from the dependency, not master - see
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36018#c24

Fixed
Comment 12 Emily Lamancusa (emlam) 2024-04-19 18:18:50 UTC
Created attachment 165224 [details] [review]
Bug 35994: Add $biblio->acq_status

This allows you to see quickly if a biblio has linked orders or not.
And if they are all cancelled, or some still in processing, or some
are complete (and the rest cancelled).

Test plan:
Run t/db_dependent/Koha/Biblio.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 13 Emily Lamancusa (emlam) 2024-04-19 18:18:53 UTC
Created attachment 165225 [details] [review]
Bug 35994: Show acq_status on catalogue/detail

Test plan:
Based on the described criteria, check a few biblio records.
Look at Acquisitions tab on the intranet detail page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 14 Martin Renvoize (ashimema) 2024-05-10 08:27:29 UTC
We're failing a test here I'm afraid.. hopefully it's not to terrible though.

Running tests (1)
        * Proving /kohadevbox/koha/t/db_dependent/Koha/Biblio.t KO!

    #   Failed test 'Cancelled for only cancelled lines'
    #   at /kohadevbox/koha/t/db_dependent/Koha/Biblio.t line 1003.
    #          got: 'acquired'
    #     expected: 'cancelled'
     # Looks like you failed 1 test of 9.
 
#   Failed test '->orders, ->uncancelled_orders and ->acq_status tests'
#   at /kohadevbox/koha/t/db_dependent/Koha/Biblio.t line 1006.
 # Looks like you failed 1 test of 37.
 /kohadevbox/koha/t/db_dependent/Koha/Biblio.t .. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/37 subtests
Comment 15 Marcel de Rooy 2024-05-10 08:41:02 UTC
Created attachment 166510 [details] [review]
Bug 35994: (QA follow-up) Fix Biblio.t

A follow-up changed orders->cancel a bit. This test assumed to
cancel completed lines here. So we are doing it now with a
direct update to have the original result.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 16 Martin Renvoize (ashimema) 2024-05-10 08:52:14 UTC Comment hidden (obsolete)
Comment 17 Martin Renvoize (ashimema) 2024-05-10 12:28:18 UTC
Created attachment 166537 [details] [review]
Bug 35994: Add $biblio->acq_status

This allows you to see quickly if a biblio has linked orders or not.
And if they are all cancelled, or some still in processing, or some
are complete (and the rest cancelled).

Test plan:
Run t/db_dependent/Koha/Biblio.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Martin Renvoize (ashimema) 2024-05-10 12:28:20 UTC
Created attachment 166538 [details] [review]
Bug 35994: Show acq_status on catalogue/detail

Test plan:
Based on the described criteria, check a few biblio records.
Look at Acquisitions tab on the intranet detail page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 19 Martin Renvoize (ashimema) 2024-05-10 12:28:23 UTC
Created attachment 166539 [details] [review]
Bug 35994: (QA follow-up) Fix Biblio.t

A follow-up changed orders->cancel a bit. This test assumed to
cancel completed lines here. So we are doing it now with a
direct update to have the original result.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 20 Martin Renvoize (ashimema) 2024-05-10 12:28:57 UTC
Thanks for the quick follow-up.

All looking good now, working as expected, no regressions found.

Passing QA
Comment 21 Katrin Fischer 2024-05-10 14:22:26 UTC
I am no sure about displaying the status for records with no orders. I have tweaked the HTML a little in hope to make it easier to translate, but also added a class that might help with customizations.
Comment 22 Katrin Fischer 2024-05-10 14:23:58 UTC
TT variable name "myvar"?
Comment 23 Katrin Fischer 2024-05-10 14:47:01 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 24 Marcel de Rooy 2024-05-13 07:22:13 UTC
(In reply to Katrin Fischer from comment #22)
> TT variable name "myvar"?

Yeah that wasnt the best name..
Comment 25 Katrin Fischer 2024-05-13 16:58:35 UTC
Hi Marcel, we have a failure here that might or might not be related to this work, could you have a look please?
t_db_dependent_api_v1_acquisitions_orders_t
Comment 26 Marcel de Rooy 2024-05-14 11:05:18 UTC
(In reply to Katrin Fischer from comment #25)
> Hi Marcel, we have a failure here that might or might not be related to this
> work, could you have a look please?
> t_db_dependent_api_v1_acquisitions_orders_t

Jonathan posted a fix on the dependency (36018)
Comment 27 Fridolin Somers 2024-05-29 09:05:36 UTC
Not backported to 23.11.x
Comment 28 Caroline Cyr La Rose 2024-09-10 20:13:41 UTC
This seems like a backend architecture change, it doesn't affect the manual.