Bug 23352 - Define serial's collection in the subscription
Summary: Define serial's collection in the subscription
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Alex Buckley
QA Contact: Testopia
URL:
Keywords:
: 9273 (view as bug list)
Depends on: 5343
Blocks: 23450
  Show dependency treegraph
 
Reported: 2019-07-21 22:05 UTC by Alex Buckley
Modified: 2022-05-11 01:18 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:
22.05.00


Attachments
Bug 23352: Database and DBIx changes (4.05 KB, patch)
2019-07-21 22:44 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Template and perl script changes to save subscription defaults (11.24 KB, patch)
2019-07-22 04:01 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Display Acquisition unitprice and replacementprice by default in serials/serials-edit.pl (1.67 KB, patch)
2019-08-01 00:30 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl (25.09 KB, patch)
2019-08-05 04:40 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl (29.45 KB, patch)
2019-08-05 09:03 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl (30.19 KB, patch)
2019-08-12 10:27 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl (30.09 KB, patch)
2019-08-13 01:04 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Changes to unit tests (6.15 KB, patch)
2019-08-13 01:55 UTC, Alex Buckley
Details | Diff | Splinter Review
Error trace - save subscription (12.47 KB, text/plain)
2019-11-21 15:14 UTC, Martha Fuerst
Details
Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl (30.20 KB, patch)
2020-03-26 21:35 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 23352: Changes to unit tests (6.17 KB, patch)
2020-03-26 21:35 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fix 952$g and location auto-population (5.85 KB, patch)
2020-03-26 22:48 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 23352: Database changes (1.94 KB, patch)
2022-01-07 00:07 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Updated schema file (1.46 KB, patch)
2022-01-07 00:07 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Set default collection code when creating subscription (13.78 KB, patch)
2022-01-07 00:08 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Set default collection code when creating subscription (13.76 KB, patch)
2022-01-09 01:01 UTC, Samu Heiskanen
Details | Diff | Splinter Review
Bug 23352: Database changes (1.99 KB, patch)
2022-01-09 02:11 UTC, Samu Heiskanen
Details | Diff | Splinter Review
Bug 23352: Updated schema file (1.52 KB, patch)
2022-01-09 02:12 UTC, Samu Heiskanen
Details | Diff | Splinter Review
Bug 23352: Set default collection code when creating subscription (13.76 KB, patch)
2022-01-09 02:13 UTC, Samu Heiskanen
Details | Diff | Splinter Review
Bug 23352: Set default collection code when creating subscription (13.84 KB, patch)
2022-03-07 04:54 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fixes for QA review (5.19 KB, patch)
2022-03-07 04:54 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Database changes (2.05 KB, patch)
2022-03-07 14:21 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 23352: Updated schema file (1.59 KB, patch)
2022-03-07 14:21 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 23352: Set default collection code when creating subscription (13.84 KB, patch)
2022-03-07 14:21 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fixes for QA review (5.23 KB, patch)
2022-03-07 14:21 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fix QA test failure (1.19 KB, patch)
2022-04-04 04:25 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23352: Database changes (2.10 KB, patch)
2022-04-22 14:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23352: Updated schema file (1.64 KB, patch)
2022-04-22 14:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23352: Set default collection code when creating subscription (13.89 KB, patch)
2022-04-22 14:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fixes for QA review (5.28 KB, patch)
2022-04-22 14:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fix QA test failure (1.24 KB, patch)
2022-04-22 14:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23352: Database changes (2.16 KB, patch)
2022-04-25 13:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23352: Updated schema file (1.69 KB, patch)
2022-04-25 13:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23352: Set default collection code when creating subscription (13.94 KB, patch)
2022-04-25 13:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fixes for QA review (5.33 KB, patch)
2022-04-25 13:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23352: (follow-up) Fix QA test failure (1.30 KB, patch)
2022-04-25 13:46 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2019-07-21 22:05:50 UTC
To speed up the process of receiving serial issues libraries should be able to set default serial issue values for the subscription when they create the subscription. 

Currently, it is possible for librarians to set default values for 952 MARC fields in the bibliographic frameworks but that would set blanket default values for all subscriptions. 

As different subscriptions are likely to have different 952 MARC field values it would be useful for libraries to set default values which are only applied to the serial issue items created for a specific subscription.

The default values they should be able to set when creating the subscription (in serials/subscription-add.pl) are:

* Collection code
* Subscription full cost

Then when a serial issue is received from the two above values the following 952 subfields will be pre-populated:

* 952$8 Collection Code - Pulled in from default set in serials/subscription-add.pl
* 952$b Current location - Set to the currently logged in library branch
* 952$d Date acquired - This will be pre-populated upon page load rather than when you click on the text input field as is the current behaviour
* 952$h Serial Enumeration/ chronology - This will be pre-populated from the subscription numbering pattern
* 952$v Cost, replacement price - This will be pre-populated from the calculation of the subscription full cost/number of issues

This would only leave the librarian to input 952$p (barcode) and 952$a (permanent location), speeding up the cataloguing process of receiving serials.
Comment 1 Alex Buckley 2019-07-21 22:44:11 UTC Comment hidden (obsolete)
Comment 2 Alex Buckley 2019-07-22 04:01:49 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2019-07-22 05:20:35 UTC
 
> * 952$8 Collection Code - Pulled in from default set in
> serials/subscription-add.pl
> * 952$b Current location - Set to the currently logged in library branch
> * 952$d Date acquired - This will be pre-populated upon page load rather
> than when you click on the text input field as is the current behaviour
> * 952$h Serial Enumeration/ chronology - This will be pre-populated from the
> subscription numbering pattern
> * 952$v Cost, replacement price - This will be pre-populated from the
> calculation of the subscription full cost/number of issues
> 
> This would only leave the librarian to input 952$p (barcode) and 952$a
> (permanent location), speeding up the cataloguing process of receiving
> serials.

Hi Alex, the item form sets $a and $b to the currently logged in users branch, so it might make sense to have this behave consistently. Also if there is a branch set in the subscription, I think libraries might want to use that instead of the user's? Haven't tested, but thought it was the case already. But pretty sure $h should already work the way you describe here.
Comment 4 Alex Buckley 2019-07-24 19:28:53 UTC
Hi Katrin, 
Good point I hadn't thought of that I shall test that :)
Comment 5 Alex Buckley 2019-08-01 00:30:38 UTC Comment hidden (obsolete)
Comment 6 Alex Buckley 2019-08-01 00:53:44 UTC
Hi Katrin, 

You're quite right currently 952$h already behaves as I had described.
Comment 7 Alex Buckley 2019-08-05 04:40:05 UTC Comment hidden (obsolete)
Comment 8 Alex Buckley 2019-08-05 09:03:39 UTC Comment hidden (obsolete)
Comment 9 Alex Buckley 2019-08-05 09:27:15 UTC
Hi Katrin, 

The above patch addresses your points as follows:

1. Already existing behaviour - 952h is set to the next appropriate serial numbering pattern value as you supposed

When a branch is set in the subscription that is set as the 952a (Home branch) and 952b (holding branch) instead of the branch that the user is logged in on - this is existing behaviour in Koha

What this patch does is:

1. Adds a 'Serial Issue Collection' input in the serials/subscription-add.pl where librarians can set a collection code to be set as default for all serial issues 952$8 Collection Code

2. Populating the item creation form with order cost data (set in the Acquisition module and stored in the aqorders table) 

* Automatic display of the aqorder.price in the 952g Item price

* Automatic display of the aqorder.replacementprice in the 952v Replacement price

3. Added two new sysprefs:

* DefaultToCreatingSerialIssuesOnReceival - Disabled by default. When enabled it sets 'Create an item record on receiving this serial' 

* PopulateNewItemDateAccessionedOnPageLoad - Disabled by default. When enabled it fills the 952d Date Acquired field on page load rather than the librarian having to click in the field. 

What this means is when an order exists and the PopulateNewItemDateAccessionedOnPageLoad syspref is enabled then the following fields are filled by default when receiving an order (as long as the 'Create an item record on receiving this serial' is enabled):

952$8 Collection Code 
952a Home branch
952b Holding branch
952d Date Acquired
952$h Serial Enumeration
952$g Price
952v Replacement price

So all that needs adding is barcode, this will make for a faster serial cataloguing process. 

Thanks very much,
Alex
Comment 10 Alex Buckley 2019-08-05 09:32:06 UTC
*** Bug 9273 has been marked as a duplicate of this bug. ***
Comment 11 Alex Buckley 2019-08-12 10:27:23 UTC Comment hidden (obsolete)
Comment 12 Alex Buckley 2019-08-13 00:33:35 UTC
Hi all,

I see in comments #6 and #7 in bug 13735 (which also changes the C4::Items->PrepareItemrecordDisplay()  function) that it was decided that unit tests were not required for changes to this function which has no unit test coverage to date. 

Would I be correct in assuming that also applies to the changes I have made to the PrepareItemrecordDisplay()?

Cheers,
Alex
Comment 13 Alex Buckley 2019-08-13 01:04:03 UTC Comment hidden (obsolete)
Comment 14 Alex Buckley 2019-08-13 01:04:23 UTC
Rebased against master
Comment 15 Alex Buckley 2019-08-13 01:55:26 UTC Comment hidden (obsolete)
Comment 16 Alex Buckley 2019-08-13 01:58:11 UTC
I've now added changes to t/db_dependent/Serials.t to test changes I made to C4::Serials->NewSubscription() and C4::Serials->ModSubscription() functions. 

Please see my note in comment #12 about unit tests for C4::Items->PrepareItemrecordDisplay() changes made in my first commit.
Comment 17 Martha Fuerst 2019-11-21 15:14:16 UTC
Created attachment 95662 [details]
Error trace - save subscription

Could not save a new subscription to get through the test plan. Clicking "Save Subscription" results in an Error Trace.

Attaching error trace in .txt file.
Comment 18 Aleisha Amohia 2020-03-26 21:35:39 UTC Comment hidden (obsolete)
Comment 19 Aleisha Amohia 2020-03-26 21:35:43 UTC Comment hidden (obsolete)
Comment 20 Aleisha Amohia 2020-03-26 22:48:29 UTC Comment hidden (obsolete)
Comment 21 David Nind 2021-04-11 03:11:14 UTC
Patch no longer applies 8-(..

Applying: Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl
Using index info to reconstruct a base tree...
M	C4/Items.pm
M	C4/Serials.pm
M	Koha/Schema/Result/Subscription.pm
M	installer/data/mysql/kohastructure.sql
A	installer/data/mysql/sysprefs.sql
M	koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
M	koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref
M	koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
M	koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
M	serials/subscription-add.pl
Falling back to patching base and 3-way merge...
Auto-merging serials/subscription-add.pl
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
Auto-merging installer/data/mysql/mandatory/sysprefs.sql
CONFLICT (content): Merge conflict in installer/data/mysql/mandatory/sysprefs.sql
Auto-merging installer/data/mysql/kohastructure.sql
CONFLICT (content): Merge conflict in installer/data/mysql/kohastructure.sql
Auto-merging Koha/Schema/Result/Subscription.pm
CONFLICT (content): Merge conflict in Koha/Schema/Result/Subscription.pm
Auto-merging C4/Serials.pm
Auto-merging C4/Items.pm
CONFLICT (content): Merge conflict in C4/Items.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl
...
Comment 22 Alex Buckley 2022-01-07 00:06:33 UTC
Hi all, 

I think the best step forward for this is to split the functionality on this bug report into separate smaller reports.

That being the case I'm changing this one to only cover defining serial's collection codes in the subscription. 

Thanks,
Alex
Comment 23 Alex Buckley 2022-01-07 00:07:37 UTC Comment hidden (obsolete)
Comment 24 Alex Buckley 2022-01-07 00:07:55 UTC Comment hidden (obsolete)
Comment 25 Alex Buckley 2022-01-07 00:08:14 UTC Comment hidden (obsolete)
Comment 26 Alex Buckley 2022-01-07 00:08:36 UTC
Ready for testing
Comment 27 Samu Heiskanen 2022-01-09 01:01:36 UTC Comment hidden (obsolete)
Comment 28 Samu Heiskanen 2022-01-09 02:11:07 UTC Comment hidden (obsolete)
Comment 29 Samu Heiskanen 2022-01-09 02:12:41 UTC Comment hidden (obsolete)
Comment 30 Samu Heiskanen 2022-01-09 02:13:54 UTC Comment hidden (obsolete)
Comment 31 Katrin Fischer 2022-02-13 13:32:26 UTC
Hi Alex,

can you please make a couple fixes?

1) QA test tools
 FAIL	installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl
   FAIL	  file permissions
		File must have the exec flag
   FAIL	  valid
		Useless use of anonymous hash ({}) in void context 

2) Handling of default on existing items

I am in doubt about these lines:

+                    if ( $itemrecord and $defaultvalues and not $itemrecord->subfield($tag,$subfield->{subfield}) ) {
+                        # if the item record exists, only use default value if the item has no ccode
+                        $defaultvalue = $defaultvalues->{ccode};

I believe that would affect what happens if an item is edited from the serials module?

If the item has been created without a collection, we should not 'force' it later. The rule is that if it was emptied out intentionally it should remain empty.

3) Terminology

<label for="ccode">Collection code:</label>
[% IF ( ccode ) %]<li><span class="label">Collection code:</span> [% ccode | html %]</li>[% END %]

As we always display the descriptions and not the codes, we have updated the GUI to always say "Collection".
Comment 32 Alex Buckley 2022-03-07 02:14:06 UTC
(In reply to Katrin Fischer from comment #31)

Hi Katrin,

My apologies for my delay in responding. I've been away for the last 3 weeks, but back now!

Thank you for your response I'll make those changes, and let you know if I have any questions.

Thanks,
Alex
Comment 33 Alex Buckley 2022-03-07 04:54:04 UTC Comment hidden (obsolete)
Comment 34 Alex Buckley 2022-03-07 04:54:25 UTC Comment hidden (obsolete)
Comment 35 Alex Buckley 2022-03-07 05:00:16 UTC
(In reply to Katrin Fischer from comment #31)

Hi Katrin, 

I have attached the third patch (rebased against master) and a followup patch which should hopefully fix the three points you noted in comment #31

Good catch re. point 3! I have corrected that. I noticed there are no unit tests for C4::Items->PrepareItemrecordDisplay() so I could not confirm it via a unit test and have added test steps into the fourth patch.

Could you please take a look? 

Many thanks,
Alex
Comment 36 Andrew Fuerste-Henry 2022-03-07 14:21:14 UTC
Created attachment 131435 [details] [review]
Bug 23352: Database changes

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 37 Andrew Fuerste-Henry 2022-03-07 14:21:19 UTC
Created attachment 131437 [details] [review]
Bug 23352: Updated schema file

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 38 Andrew Fuerste-Henry 2022-03-07 14:21:23 UTC
Created attachment 131438 [details] [review]
Bug 23352: Set default collection code when creating subscription

The default collection code set in the subscription will be applied if
item records are created when receiving the serial.

Test plan:
1. Apply 3 patches
2. Run updatedatabase.pl and restart services
3. Create a subscription:
- Tick the 'Create an item record when receiving this serial' radio
button
- Select values in the Location, Collection code and Item type dropdowns
- Save the subscription
4. Confirm the Location, and Collection code default values
you choose in #3 are displaying in the 'Information' tab of page that's
loaded
5. Receive the serial:
- Click 'Receive'
- Change the status dropdown from 'Expected' to 'Arrived'
- Confirm the 'Collection Code', 'Shelving location' and 'Koha item
type' dropdowns are pre-filled with the values you defined in #3
6. Run unit test t/db_dependent/Serials.t

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 39 Andrew Fuerste-Henry 2022-03-07 14:21:28 UTC
Created attachment 131439 [details] [review]
Bug 23352: (follow-up) Fixes for QA review

Test plan:
1. Confirm that
installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl
has the exec flag

2. Create a subscription. Notice the 'Collection' dropdown defaults to
the 'None' option - same as Location

3. Save the subscription without changing the 'None' collection

4. Receive the serial and confirm the 'Collection' field is empty

5. Create a second subscription. Change the 'Collection' dropdown to
'Fiction', then save the subscription

6. Receive the serial and confirm the 'Collection' dropdown is set to
'Fiction'

7. Confirm that the 'Collection code' terminology in the template is replaced with
'Collection'

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 40 Katrin Fischer 2022-04-02 23:11:28 UTC
Hi Alex,

could you take a look at the failure in QA test tools please?

1) QA tools
 FAIL	installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl
   FAIL	  valid
		Useless use of anonymous hash ({}) in void context 

... and nothing else. Tests pass and testing looked good. Hope above is an easy fix!
Comment 41 Alex Buckley 2022-04-04 04:25:56 UTC
Created attachment 132920 [details] [review]
Bug 23352: (follow-up) Fix QA test failure

Sponsored-by: Catalyst IT
Comment 42 Alex Buckley 2022-04-04 04:33:58 UTC
(In reply to Katrin Fischer from comment #40)
> Hi Alex,
> 
> could you take a look at the failure in QA test tools please?
> 
> 1) QA tools
>  FAIL
> installer/data/mysql/atomicupdate/bug_23352-
> add_ccode_column_to_subscriptions_table.pl
>    FAIL	  valid
> 		Useless use of anonymous hash ({}) in void context 
> 
> ... and nothing else. Tests pass and testing looked good. Hope above is an
> easy fix!

Hi Katrin, 

Thanks for doing QA on this patchset!

I've attached a follow-up patch that, I hope, has fixed that QA test tool failure. Could you please take a look?

Many thanks,
Alex
Comment 43 Alex Buckley 2022-04-12 02:27:59 UTC
This patchset still applies cleanly to master and is ready for testing if someone is available :)
Comment 44 Owen Leonard 2022-04-22 14:03:09 UTC
Created attachment 133679 [details] [review]
Bug 23352: Database changes

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 45 Owen Leonard 2022-04-22 14:03:14 UTC
Created attachment 133680 [details] [review]
Bug 23352: Updated schema file

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 46 Owen Leonard 2022-04-22 14:03:18 UTC
Created attachment 133681 [details] [review]
Bug 23352: Set default collection code when creating subscription

The default collection code set in the subscription will be applied if
item records are created when receiving the serial.

Test plan:
1. Apply 3 patches
2. Run updatedatabase.pl and restart services
3. Create a subscription:
- Tick the 'Create an item record when receiving this serial' radio
button
- Select values in the Location, Collection code and Item type dropdowns
- Save the subscription
4. Confirm the Location, and Collection code default values
you choose in #3 are displaying in the 'Information' tab of page that's
loaded
5. Receive the serial:
- Click 'Receive'
- Change the status dropdown from 'Expected' to 'Arrived'
- Confirm the 'Collection Code', 'Shelving location' and 'Koha item
type' dropdowns are pre-filled with the values you defined in #3
6. Run unit test t/db_dependent/Serials.t

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 47 Owen Leonard 2022-04-22 14:03:22 UTC
Created attachment 133682 [details] [review]
Bug 23352: (follow-up) Fixes for QA review

Test plan:
1. Confirm that
installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl
has the exec flag

2. Create a subscription. Notice the 'Collection' dropdown defaults to
the 'None' option - same as Location

3. Save the subscription without changing the 'None' collection

4. Receive the serial and confirm the 'Collection' field is empty

5. Create a second subscription. Change the 'Collection' dropdown to
'Fiction', then save the subscription

6. Receive the serial and confirm the 'Collection' dropdown is set to
'Fiction'

7. Confirm that the 'Collection code' terminology in the template is replaced with
'Collection'

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 48 Owen Leonard 2022-04-22 14:03:27 UTC
Created attachment 133683 [details] [review]
Bug 23352: (follow-up) Fix QA test failure

Sponsored-by: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 49 Katrin Fischer 2022-04-25 13:46:24 UTC
Created attachment 133786 [details] [review]
Bug 23352: Database changes

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 50 Katrin Fischer 2022-04-25 13:46:29 UTC
Created attachment 133787 [details] [review]
Bug 23352: Updated schema file

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 51 Katrin Fischer 2022-04-25 13:46:35 UTC
Created attachment 133788 [details] [review]
Bug 23352: Set default collection code when creating subscription

The default collection code set in the subscription will be applied if
item records are created when receiving the serial.

Test plan:
1. Apply 3 patches
2. Run updatedatabase.pl and restart services
3. Create a subscription:
- Tick the 'Create an item record when receiving this serial' radio
button
- Select values in the Location, Collection code and Item type dropdowns
- Save the subscription
4. Confirm the Location, and Collection code default values
you choose in #3 are displaying in the 'Information' tab of page that's
loaded
5. Receive the serial:
- Click 'Receive'
- Change the status dropdown from 'Expected' to 'Arrived'
- Confirm the 'Collection Code', 'Shelving location' and 'Koha item
type' dropdowns are pre-filled with the values you defined in #3
6. Run unit test t/db_dependent/Serials.t

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 52 Katrin Fischer 2022-04-25 13:46:41 UTC
Created attachment 133789 [details] [review]
Bug 23352: (follow-up) Fixes for QA review

Test plan:
1. Confirm that
installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl
has the exec flag

2. Create a subscription. Notice the 'Collection' dropdown defaults to
the 'None' option - same as Location

3. Save the subscription without changing the 'None' collection

4. Receive the serial and confirm the 'Collection' field is empty

5. Create a second subscription. Change the 'Collection' dropdown to
'Fiction', then save the subscription

6. Receive the serial and confirm the 'Collection' dropdown is set to
'Fiction'

7. Confirm that the 'Collection code' terminology in the template is replaced with
'Collection'

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 53 Katrin Fischer 2022-04-25 13:46:47 UTC
Created attachment 133790 [details] [review]
Bug 23352: (follow-up) Fix QA test failure

Sponsored-by: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 54 Fridolin Somers 2022-05-11 01:18:38 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄