Description
Alex Buckley
2019-07-21 22:05:50 UTC
Created attachment 91678 [details] [review] Bug 23352: Database and DBIx changes This patch contains the following changes: * Atomicupdate (this change is idempotent using the column_exists subroutine) * kohastructure.sql changes adding the new column 'ccode' to subscription table. * Change to Koha/Schema/Result/Subscription.pm to reflect the change to subscription table Test plan: 1. Enter mysql terminal: sudo koha-mysql <instancename> 2. Run the query: describe subscription; 3. Notice there is no 'ccode' column after the 'mana_id' column 3. Exit mysql terminal and apply patch 4. Navigate to the installer/data/mysql directory 5. Enter koha-shell: sudo koha-shell <instancename> 6. Run: ./updatedatabase.pl 7. Notice atomicupdate runs without errors 8. Exit koha-shell and re-enter mysql terminal and confirm the 'ccode' column is in the subscription table now after mana_id column 9. Exit mysql terminal and view the installer/data/mysql/kohastructure.sql file and notice 'ccode' is added to subscription table under mana_id column 10. Exit the file and view the Koha/Schema/Result/Subscription.pm file. Notice it has been updated on 22 July 2019 and it now contains 'ccode' Sponsored-By: Brimbank Library, Australia Created attachment 91679 [details] [review] Bug 23352: Template and perl script changes to save subscription defaults This patch adds the front-end code to save a CCODE in the serials/subscription-add.pl Then when receiving the serial the CCODE (952$8) is pre-populated with the CCODE set when creating the subscription. Test plan: To come in next commit Sponsored-By: Brimbank Library, Australia
> * 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.
Hi Katrin, Good point I hadn't thought of that I shall test that :) Created attachment 91901 [details] [review] Bug 23352: Display Acquisition unitprice and replacementprice by default in serials/serials-edit.pl Sponsored-By: Brimbank Library, Australia Hi Katrin, You're quite right currently 952$h already behaves as I had described. Created attachment 91985 [details] [review] Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl This patch contains: * Database and DBIx changes * Setting 952g (items.price) and 952v (items.replacementprice) from Acquisitions module order unitprice and replacment cost respectively * Default setting of the 952d (items.dateaccessioned) on page load * New input in serials/subscription-add.pl for librarian to select default collection code for serial issues. * New syspref: DefaultToCreatingSerialIssuesOnReceival - disabled by default. When enabled it sets the 'Create an item record when receiving this serial' to be ticked. Test plan: 1. Enter mysql terminal: sudo koha-mysql <instancename> 2. Run the query: describe subscription; 3. Notice there is no 'ccode' column after the 'mana_id' column 4. In the staff client go to Serials > New subscription 5. Notice the 'Do not create an item record when receiving this serial' radiobutton is ticked by default. Click the 'Create an item record when receiving this serial' radiobutton 6. Fill out all the required serial fields, set the library branch to a branch different to the library branch you are currently logged in as and click 'Save subscription' 7. Now go to the Acquisitions module. Add a new basket to a vendor Add to the basket and select 'From a subscription' Search for the subscription you created in steps 5-6 Set a quantity, vendor price of 2 and replacement cost of 3 Save the order 8. Go back to Serials and recieve an item for the subscription and notice that the item creation form that is loaded when you change the status from 'Expected' to 'Arrived' does not set defaults for: 952$8 - Collection code 952$d - Date accessioned - You must click in the input box to load a default value for this 952$g - Cost 952$v - Replacement price Also note the 952$a and 952$b are set the library you set in the subscription and not the branch you are currently logged in as 9. Exit mysql terminal and apply patch 10. Navigate to the installer/data/mysql directory 11. Enter koha-shell: sudo koha-shell <instancename> 12. Run: ./updatedatabase.pl 13. Notice 2 atomicupdates run without errors 14. Exit koha-shell and re-enter mysql terminal and confirm the 'ccode' column is in the subscription table now after mana_id column Exit the MySQL terminal. 15. In the Koha staff client > Administration > Global System Preferences and notice there is a new syspref in the 'Serials' system preferences named 'DefaultToCreatingSerialIssuesOnReceival' Notice it is disabled by default. 16. Repeat steps 4-8. Notice there is now a new input in the subscription-add.pl page 2: 'Serial issue Collection' which populates with the contents of the ccode authorised value Notice upon receiving the item the following fields do have a default value now: 952$8 - Collection code 952$d - Date accessioned - Default value in this field on page load 952$g - Cost 952$v - Replacement price 17. Go back to Administration > Global System Preferences and set the 'DefaultToCreatingSerialIssuesOnReceival' syspref to 'enabled' 18. Go back to Serials > New subscription and observe the 'Create an item record when receiving this serial' radiobutton is now checked by default 19. Sign off :) Sponsored-By: Brimbank Library, Australia Created attachment 91986 [details] [review] Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl This patch contains: * Database and DBIx changes * Setting 952g (items.price) and 952v (items.replacementprice) from Acquisitions module order unitprice and replacment cost respectively * Default setting of the 952d (items.dateaccessioned) on page load * New input in serials/subscription-add.pl for librarian to select default collection code for serial issues. * 2 new sysprefs: - DefaultToCreatingSerialIssuesOnReceival - Disabled by default. When enabled it sets the 'Create an item record when receiving this serial' to be ticked. - PopulateNewItemDateAccessionedOnPageLoad - Disabled by default. When enabled it populates the 952$d Date Acquired field in the item addition page without the cataloguer having to click in the field. Test plan: 1. Enter mysql terminal: sudo koha-mysql <instancename> 2. Run the query: describe subscription; 3. Notice there is no 'ccode' column after the 'mana_id' column 4. In the staff client go to Serials > New subscription 5. Notice the 'Do not create an item record when receiving this serial' radiobutton is ticked by default. Click the 'Create an item record when receiving this serial' radiobutton 6. Fill out all the required serial fields, set the library branch to a branch different to the library branch you are currently logged in as and click 'Save subscription' 7. Now go to the Acquisitions module. Add a new basket to a vendor Add to the basket and select 'From a subscription' Search for the subscription you created in steps 5-6 Set a quantity, vendor price of 2 and replacement cost of 3 Save the order 8. Go back to Serials and recieve an item for the subscription and notice that the item creation form that is loaded when you change the status from 'Expected' to 'Arrived' does not set defaults for: 952$8 - Collection code 952$d - Date accessioned - You must click in the input box to load a default value for this 952$g - Cost 952$v - Replacement price Also note the 952$a and 952$b are set the library you set in the subscription and not the branch you are currently logged in as 9. Exit mysql terminal and apply patch 10. Navigate to the installer/data/mysql directory 11. Enter koha-shell: sudo koha-shell <instancename> 12. Run: ./updatedatabase.pl 13. Notice 2 atomicupdates run without errors 14. Exit koha-shell and re-enter mysql terminal and confirm the 'ccode' column is in the subscription table now after mana_id column Exit the MySQL terminal. 15. In the Koha staff client > Administration > Global System Preferences and notice there is a new syspref in the 'Serials' system preferences named 'DefaultToCreatingSerialIssuesOnReceival' and there is a new syspref in the 'Cataloging' system preferences named - PopulateNewItemDateAccessionedOnPageLoad Notice both are disabled by default. 16. Repeat steps 4-8. Notice there is now a new input in the subscription-add.pl page 2: 'Serial issue Collection' which populates with the contents of the ccode authorised value Notice upon receiving the item the following fields do have a default value now: 952$8 - Collection code 952$g - Cost 952$v - Replacement price 17. Go back to Administration > Global System Preferences and set the 'DefaultToCreatingSerialIssuesOnReceival' and 'PopulateNewItemDateAccessionedOnPageLoad' syspref to 'Enabled' 18. Go back to Serials > New subscription and observe the 'Create an item record when receiving this serial' radiobutton is now checked by default 19. After creating the subscription repeat step 7 and now receive the serial and notice that the 952d Date Acquired is set automatically to todays date in the format: YYYY-MM-DD (i.e. you don't have to click in the field). 20. Try clicking in the 952d and notice no second date is appended 21. Sign off :) Sponsored-By: Brimbank Library, Australia 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 *** Bug 9273 has been marked as a duplicate of this bug. *** Created attachment 92149 [details] [review] Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl This patch contains: * Database and DBIx changes * Setting 952g (items.price) and 952v (items.replacementprice) from Acquisitions module order unitprice and replacment cost respectively * Default setting of the 952d (items.dateaccessioned) on page load * New input in serials/subscription-add.pl for librarian to select default collection code for serial issues. * 2 new sysprefs: - DefaultToCreatingSerialIssuesOnReceival - Disabled by default. When enabled it sets the 'Create an item record when receiving this serial' to be ticked. - PopulateNewItemDateAccessionedOnPageLoad - Disabled by default. When enabled it populates the 952$d Date Acquired field in the item addition page without the cataloguer having to click in the field. Test plan: 1. Enter mysql terminal: sudo koha-mysql <instancename> 2. Run the query: describe subscription; 3. Notice there is no 'ccode' column after the 'mana_id' column 4. In the staff client go to Serials > New subscription 5. Notice the 'Do not create an item record when receiving this serial' radiobutton is ticked by default. Click the 'Create an item record when receiving this serial' radiobutton 6. Fill out all the required serial fields, set the library branch to a branch different to the library branch you are currently logged in as and click 'Save subscription' 7. Now go to the Acquisitions module. Add a new basket to a vendor Add to the basket and select 'From a subscription' Search for the subscription you created in steps 5-6 Set a quantity, vendor price of 2 and replacement cost of 3 Save the order 8. Go back to Serials and recieve an item for the subscription and notice that the item creation form that is loaded when you change the status from 'Expected' to 'Arrived' does not set defaults for: 952$8 - Collection code 952$d - Date accessioned - You must click in the input box to load a default value for this 952$g - Cost 952$v - Replacement price Also note the 952$a and 952$b are set the library you set in the subscription and not the branch you are currently logged in as 9. Exit mysql terminal and apply patch 10. Navigate to the installer/data/mysql directory 11. Enter koha-shell: sudo koha-shell <instancename> 12. Run: ./updatedatabase.pl 13. Notice 2 atomicupdates run without errors 14. Exit koha-shell and re-enter mysql terminal and confirm the 'ccode' column is in the subscription table now after mana_id column Exit the MySQL terminal. 15. In the Koha staff client > Administration > Global System Preferences and notice there is a new syspref in the 'Serials' system preferences named 'DefaultToCreatingSerialIssuesOnReceival' and there is a new syspref in the 'Cataloging' system preferences named - PopulateNewItemDateAccessionedOnPageLoad Notice both are disabled by default. 16. Repeat steps 4-8. Notice there is now a new input in the subscription-add.pl page 2: 'Serial issue Collection' which populates with the contents of the ccode authorised value Notice upon receiving the item the following fields do have a default value now: 952$8 - Collection code 952$g - Cost 952$v - Replacement price 17. Go back to Administration > Global System Preferences and set the 'DefaultToCreatingSerialIssuesOnReceival' and 'PopulateNewItemDateAccessionedOnPageLoad' syspref to 'Enabled' 18. Go back to Serials > New subscription and observe the 'Create an item record when receiving this serial' radiobutton is now checked by default 19. After creating the subscription repeat step 7 and now receive the serial and notice that the 952d Date Acquired is set automatically to todays date in the format: YYYY-MM-DD (i.e. you don't have to click in the field). 20. Try clicking in the 952d and notice no second date is appended 21. Sign off :) Sponsored-By: Brimbank Library, Australia 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 Created attachment 92165 [details] [review] Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl This patch contains: * Database and DBIx changes * Setting 952g (items.price) and 952v (items.replacementprice) from Acquisitions module order unitprice and replacment cost respectively * Default setting of the 952d (items.dateaccessioned) on page load * New input in serials/subscription-add.pl for librarian to select default collection code for serial issues. * 2 new sysprefs: - DefaultToCreatingSerialIssuesOnReceival - Disabled by default. When enabled it sets the 'Create an item record when receiving this serial' to be ticked. - PopulateNewItemDateAccessionedOnPageLoad - Disabled by default. When enabled it populates the 952$d Date Acquired field in the item addition page without the cataloguer having to click in the field. Test plan: 1. Enter mysql terminal: sudo koha-mysql <instancename> 2. Run the query: describe subscription; 3. Notice there is no 'ccode' column after the 'mana_id' column 4. In the staff client go to Serials > New subscription 5. Notice the 'Do not create an item record when receiving this serial' radiobutton is ticked by default. Click the 'Create an item record when receiving this serial' radiobutton 6. Fill out all the required serial fields, set the library branch to a branch different to the library branch you are currently logged in as and click 'Save subscription' 7. Now go to the Acquisitions module. Add a new basket to a vendor Add to the basket and select 'From a subscription' Search for the subscription you created in steps 5-6 Set a quantity, vendor price of 2 and replacement cost of 3 Save the order 8. Go back to Serials and recieve an item for the subscription and notice that the item creation form that is loaded when you change the status from 'Expected' to 'Arrived' does not set defaults for: 952$8 - Collection code 952$d - Date accessioned - You must click in the input box to load a default value for this 952$g - Cost 952$v - Replacement price Also note the 952$a and 952$b are set the library you set in the subscription and not the branch you are currently logged in as 9. Exit mysql terminal and apply patch 10. Navigate to the installer/data/mysql directory 11. Enter koha-shell: sudo koha-shell <instancename> 12. Run: ./updatedatabase.pl 13. Notice 2 atomicupdates run without errors 14. Exit koha-shell and re-enter mysql terminal and confirm the 'ccode' column is in the subscription table now after mana_id column Exit the MySQL terminal. 15. In the Koha staff client > Administration > Global System Preferences and notice there is a new syspref in the 'Serials' system preferences named 'DefaultToCreatingSerialIssuesOnReceival' and there is a new syspref in the 'Cataloging' system preferences named - PopulateNewItemDateAccessionedOnPageLoad Notice both are disabled by default. 16. Repeat steps 4-8. Notice there is now a new input in the subscription-add.pl page 2: 'Serial issue Collection' which populates with the contents of the ccode authorised value Notice upon receiving the item the following fields do have a default value now: 952$8 - Collection code 952$g - Cost 952$v - Replacement price 17. Go back to Administration > Global System Preferences and set the 'DefaultToCreatingSerialIssuesOnReceival' and 'PopulateNewItemDateAccessionedOnPageLoad' syspref to 'Enabled' 18. Go back to Serials > New subscription and observe the 'Create an item record when receiving this serial' radiobutton is now checked by default 19. After creating the subscription repeat step 7 and now receive the serial and notice that the 952d Date Acquired is set automatically to todays date in the format: YYYY-MM-DD (i.e. you don't have to click in the field). 20. Try clicking in the 952d and notice no second date is appended 21. Sign off :) Sponsored-By: Brimbank Library, Australia Rebased against master Created attachment 92166 [details] [review] Bug 23352: Changes to unit tests Changes to t/db_dependent/Serials.t unit tests to capture and test the changes to NewSubscription() and ModSubscription() in C4/Serials.pm Test plan: 1. Follow test plan in first commit 2. From Koha home directory enter Koha shell and run: prove t/db_dependent/Serials.t Sponsored-By: Brimbank Library, Australia 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. 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.
Created attachment 101913 [details] [review] Bug 23352: Default setting of item price, replacement price, ccode, dateaccesioned in serials-edit.pl This patch contains: * Database and DBIx changes * Setting 952g (items.price) and 952v (items.replacementprice) from Acquisitions module order unitprice and replacment cost respectively * Default setting of the 952d (items.dateaccessioned) on page load * New input in serials/subscription-add.pl for librarian to select default collection code for serial issues. * 2 new sysprefs: - DefaultToCreatingSerialIssuesOnReceival - Disabled by default. When enabled it sets the 'Create an item record when receiving this serial' to be ticked. - PopulateNewItemDateAccessionedOnPageLoad - Disabled by default. When enabled it populates the 952$d Date Acquired field in the item addition page without the cataloguer having to click in the field. Test plan: 1. Enter mysql terminal: sudo koha-mysql <instancename> 2. Run the query: describe subscription; 3. Notice there is no 'ccode' column after the 'mana_id' column 4. In the staff client go to Serials > New subscription 5. Notice the 'Do not create an item record when receiving this serial' radiobutton is ticked by default. Click the 'Create an item record when receiving this serial' radiobutton 6. Fill out all the required serial fields, set the library branch to a branch different to the library branch you are currently logged in as and click 'Save subscription' 7. Now go to the Acquisitions module. Add a new basket to a vendor Add to the basket and select 'From a subscription' Search for the subscription you created in steps 5-6 Set a quantity, vendor price of 2 and replacement cost of 3 Save the order 8. Go back to Serials and recieve an item for the subscription and notice that the item creation form that is loaded when you change the status from 'Expected' to 'Arrived' does not set defaults for: 952$8 - Collection code 952$d - Date accessioned - You must click in the input box to load a default value for this 952$g - Cost 952$v - Replacement price Also note the 952$a and 952$b are set the library you set in the subscription and not the branch you are currently logged in as 9. Exit mysql terminal and apply patch 10. Navigate to the installer/data/mysql directory 11. Enter koha-shell: sudo koha-shell <instancename> 12. Run: ./updatedatabase.pl 13. Notice 2 atomicupdates run without errors 14. Exit koha-shell and re-enter mysql terminal and confirm the 'ccode' column is in the subscription table now after mana_id column Exit the MySQL terminal. 15. In the Koha staff client > Administration > Global System Preferences and notice there is a new syspref in the 'Serials' system preferences named 'DefaultToCreatingSerialIssuesOnReceival' and there is a new syspref in the 'Cataloging' system preferences named - PopulateNewItemDateAccessionedOnPageLoad Notice both are disabled by default. 16. Repeat steps 4-8. Notice there is now a new input in the subscription-add.pl page 2: 'Serial issue Collection' which populates with the contents of the ccode authorised value Notice upon receiving the item the following fields do have a default value now: 952$8 - Collection code 952$g - Cost 952$v - Replacement price 17. Go back to Administration > Global System Preferences and set the 'DefaultToCreatingSerialIssuesOnReceival' and 'PopulateNewItemDateAccessionedOnPageLoad' syspref to 'Enabled' 18. Go back to Serials > New subscription and observe the 'Create an item record when receiving this serial' radiobutton is now checked by default 19. After creating the subscription repeat step 7 and now receive the serial and notice that the 952d Date Acquired is set automatically to todays date in the format: YYYY-MM-DD (i.e. you don't have to click in the field). 20. Try clicking in the 952d and notice no second date is appended 21. Sign off :) Sponsored-By: Brimbank Library, Australia Created attachment 101914 [details] [review] Bug 23352: Changes to unit tests Changes to t/db_dependent/Serials.t unit tests to capture and test the changes to NewSubscription() and ModSubscription() in C4/Serials.pm Test plan: 1. Follow test plan in first commit 2. From Koha home directory enter Koha shell and run: prove t/db_dependent/Serials.t Sponsored-By: Brimbank Library, Australia Created attachment 101916 [details] [review] Bug 23352: (follow-up) Fix 952$g and location auto-population Previously the cost (952$g) used unit price from the acquisition order, but this is not automatically calculated and is sometimes zero. We should use the individual item's budgeted cost instead. This patch ensures the permanent location (952$a) and current location (952$b) are set to the current logged in branch, not the subscription branch Also fixing a typo and amending syspref description to be more user-friendly. Sponsored-by: Brimbank Library, Australia 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 ... 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 Created attachment 129123 [details] [review] Bug 23352: Database changes Sponsored-By: Brimbank Library, Australia Created attachment 129124 [details] [review] Bug 23352: Updated schema file Sponsored-By: Brimbank Library, Australia Created attachment 129125 [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 Ready for testing Created attachment 129225 [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> Created attachment 129226 [details] [review] Bug 23352: Database changes Sponsored-By: Brimbank Library, Australia Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi> Created attachment 129227 [details] [review] Bug 23352: Updated schema file Sponsored-By: Brimbank Library, Australia Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi> Created attachment 129228 [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> 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". (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 Created attachment 131426 [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> Created attachment 131427 [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 (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 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> 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> 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> 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> 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! Created attachment 132920 [details] [review] Bug 23352: (follow-up) Fix QA test failure Sponsored-by: Catalyst IT (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 This patchset still applies cleanly to master and is ready for testing if someone is available :) 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> Pushed to master for 22.05, thanks to everybody involved [U+1F984] Created attachment 163965 [details] [review] Bug 23352: [22.05] (follow-up) change number of tests |