Bug 39518 - Add the option to define the basket name in a MARC file when adding to a basket
Summary: Add the option to define the basket name in a MARC file when adding to a basket
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Matt Blenkinsop
QA Contact: Thomas Klausner
URL:
Keywords:
Depends on: 34355
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-02 07:12 UTC by Matt Blenkinsop
Modified: 2025-04-03 13:58 UTC (History)
2 users (show)

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


Attachments
Bug 39518: Add a new column basket_name_field (2.33 KB, patch)
2025-04-02 08:01 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Add DBIC file (1.60 KB, patch)
2025-04-02 08:01 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Add new field to the UI (2.47 KB, patch)
2025-04-02 08:01 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Update object methods and unit tests (5.85 KB, patch)
2025-04-02 08:01 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Add a new column basket_name_field (2.40 KB, patch)
2025-04-02 09:21 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Add a new column basket_name_field (2.40 KB, patch)
2025-04-02 09:53 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Add DBIC file (1.60 KB, patch)
2025-04-02 09:53 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Add new field to the UI (2.47 KB, patch)
2025-04-02 09:53 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39518: Update object methods and unit tests (8.71 KB, patch)
2025-04-02 09:53 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Test file (13.54 KB, text/plain)
2025-04-02 09:56 UTC, Matt Blenkinsop
Details
Bug 39518: Add a new column basket_name_field (2.40 KB, patch)
2025-04-02 10:19 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Add DBIC file (1.60 KB, patch)
2025-04-02 10:19 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Add new field to the UI (2.47 KB, patch)
2025-04-02 10:19 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Update object methods and unit tests (8.78 KB, patch)
2025-04-02 10:19 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: (follow-up) Add clarifying text to basket name field (1.57 KB, patch)
2025-04-02 10:19 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Add a new column basket_name_field (2.46 KB, patch)
2025-04-02 11:25 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Add DBIC file (1.65 KB, patch)
2025-04-02 11:25 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Add new field to the UI (2.52 KB, patch)
2025-04-02 11:25 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Update object methods and unit tests (8.78 KB, patch)
2025-04-02 11:25 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: (follow-up) Add clarifying text to basket name field (1.57 KB, patch)
2025-04-02 11:25 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39518: Add a new column basket_name_field (2.50 KB, patch)
2025-04-03 13:58 UTC, Thomas Klausner
Details | Diff | Splinter Review
Bug 39518: Add DBIC file (1.70 KB, patch)
2025-04-03 13:58 UTC, Thomas Klausner
Details | Diff | Splinter Review
Bug 39518: Add new field to the UI (2.56 KB, patch)
2025-04-03 13:58 UTC, Thomas Klausner
Details | Diff | Splinter Review
Bug 39518: Update object methods and unit tests (8.83 KB, patch)
2025-04-03 13:58 UTC, Thomas Klausner
Details | Diff | Splinter Review
Bug 39518: (follow-up) Add clarifying text to basket name field (1.62 KB, patch)
2025-04-03 13:58 UTC, Thomas Klausner
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2025-04-02 07:12:19 UTC
Some users have requested the ability to allow the basket name to be defined in a field by the vendor in the MARC files they provide. It would be useful if the field could be defined on a MARC order account and then read during import to define the basket name.
Comment 1 Matt Blenkinsop 2025-04-02 08:01:38 UTC
Created attachment 180248 [details] [review]
Bug 39518: Add a new column basket_name_field
Comment 2 Matt Blenkinsop 2025-04-02 08:01:40 UTC
Created attachment 180249 [details] [review]
Bug 39518: Add DBIC file
Comment 3 Matt Blenkinsop 2025-04-02 08:01:43 UTC
Created attachment 180250 [details] [review]
Bug 39518: Add new field to the UI
Comment 4 Matt Blenkinsop 2025-04-02 08:01:45 UTC
Created attachment 180251 [details] [review]
Bug 39518: Update object methods and unit tests
Comment 5 Matt Blenkinsop 2025-04-02 09:21:56 UTC
Created attachment 180271 [details] [review]
Bug 39518: Add a new column basket_name_field
Comment 6 Matt Blenkinsop 2025-04-02 09:53:15 UTC
Created attachment 180277 [details] [review]
Bug 39518: Add a new column basket_name_field
Comment 7 Matt Blenkinsop 2025-04-02 09:53:17 UTC
Created attachment 180278 [details] [review]
Bug 39518: Add DBIC file
Comment 8 Matt Blenkinsop 2025-04-02 09:53:20 UTC
Created attachment 180279 [details] [review]
Bug 39518: Add new field to the UI
Comment 9 Matt Blenkinsop 2025-04-02 09:53:22 UTC
Created attachment 180280 [details] [review]
Bug 39518: Update object methods and unit tests

Test plan:
Test plan:

This test plan involves running a cronjob, not sure how easy this is in the sandboxes

1) In system preferences, click Search and then select the Acquisitions option from the left hand menu
2) Enable MarcOrderingAutomation
3) Paste the following into MarcFieldsToOrder
price: 975$p
quantity: 975$q
budget_code: 975$h
4) Paste the following into MarcItemFieldsToOrder
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l
Now save the sysprefs
5) In the administration homepage, under Acquisition parameters there should now be a link called "MARC order accounts"
6) Click on this and click the New account button
7) Choose a vendor and a budget
8) Enter a description and make sure you don't set a value in the 'Basket name field' input
9) Enter the following in download directory - "/var/lib/koha/kohadev/tmp/koha_kohadev_upload"
10) Select any record matching settings you want (not important for the test plan, this uses the same code as the marc file staging that already exists in Koha)
11) Check Yes under Check for embedded item record data
12) Click submit
13) We now need to upload a MARC file into the directory that we put in the account. The easiest way to do this is through the marc staging tool
14) Navigate to Cataloging > Stage MARC records for import
15) Upload the file attached to this bug using the Choose file button
16) Click Upload file.
17) Leave the page without completing the new form that appears, we don't want to stage this file. The file we uploaded is now in the directory ready for the cronjob to process as if it had been transferred via SFTP.
18) In the CLI run, perl misc/cronjobs/marc_ordering_process.pl -v -c
19) The logging should show that the file has been processed for that account
20) Navigate to Acquisitions
21) Search for the Vendor that you put in the MARC ordering account
22) There should now be a basket titled: 'This is a basket'
23) In the ordering account, set the 'Basket name field' to be 975$a
24) Repeat steps 14 -22, the basket should now be called "This is a basket" which has been pulled from the file
Comment 10 Matt Blenkinsop 2025-04-02 09:56:37 UTC
Created attachment 180281 [details]
Test file
Comment 11 Nick Clemens (kidclamp) 2025-04-02 10:19:47 UTC
Created attachment 180286 [details] [review]
Bug 39518: Add a new column basket_name_field
Comment 12 Nick Clemens (kidclamp) 2025-04-02 10:19:50 UTC
Created attachment 180287 [details] [review]
Bug 39518: Add DBIC file
Comment 13 Nick Clemens (kidclamp) 2025-04-02 10:19:52 UTC
Created attachment 180288 [details] [review]
Bug 39518: Add new field to the UI
Comment 14 Nick Clemens (kidclamp) 2025-04-02 10:19:55 UTC
Created attachment 180289 [details] [review]
Bug 39518: Update object methods and unit tests

Test plan:
Test plan:

This test plan involves running a cronjob, not sure how easy this is in the sandboxes

1) In system preferences, click Search and then select the Acquisitions option from the left hand menu
2) Enable MarcOrderingAutomation
3) Paste the following into MarcFieldsToOrder
price: 975$p
quantity: 975$q
budget_code: 975$h
4) Paste the following into MarcItemFieldsToOrder
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l
Now save the sysprefs
5) In the administration homepage, under Acquisition parameters there should now be a link called "MARC order accounts"
6) Click on this and click the New account button
7) Choose a vendor and a budget
8) Enter a description and make sure you don't set a value in the 'Basket name field' input
9) Enter the following in download directory - "/var/lib/koha/kohadev/tmp/koha_kohadev_upload"
10) Select any record matching settings you want (not important for the test plan, this uses the same code as the marc file staging that already exists in Koha)
11) Check Yes under Check for embedded item record data
12) Click submit
13) We now need to upload a MARC file into the directory that we put in the account. The easiest way to do this is through the marc staging tool
14) Navigate to Cataloging > Stage MARC records for import
15) Upload the file attached to this bug using the Choose file button
16) Click Upload file.
17) Leave the page without completing the new form that appears, we don't want to stage this file. The file we uploaded is now in the directory ready for the cronjob to process as if it had been transferred via SFTP.
18) In the CLI run, perl misc/cronjobs/marc_ordering_process.pl -v -c
19) The logging should show that the file has been processed for that account
20) Navigate to Acquisitions
21) Search for the Vendor that you put in the MARC ordering account
22) There should now be a basket titled: '{random_hash}_orderstest.marcxml'
23) In the ordering account, set the 'Basket name field' to be 975$a
24) Repeat steps 14 -22, the basket should now be called "This is the basket name" which has been pulled from the file

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Nick Clemens (kidclamp) 2025-04-02 10:19:57 UTC
Created attachment 180290 [details] [review]
Bug 39518: (follow-up) Add clarifying text to basket name field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Nick Clemens (kidclamp) 2025-04-02 11:25:31 UTC
Created attachment 180293 [details] [review]
Bug 39518: Add a new column basket_name_field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Nick Clemens (kidclamp) 2025-04-02 11:25:33 UTC
Created attachment 180294 [details] [review]
Bug 39518: Add DBIC file

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 18 Nick Clemens (kidclamp) 2025-04-02 11:25:35 UTC
Created attachment 180295 [details] [review]
Bug 39518: Add new field to the UI

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 19 Nick Clemens (kidclamp) 2025-04-02 11:25:38 UTC
Created attachment 180296 [details] [review]
Bug 39518: Update object methods and unit tests

Test plan:
Test plan:

This test plan involves running a cronjob, not sure how easy this is in the sandboxes

1) In system preferences, click Search and then select the Acquisitions option from the left hand menu
2) Enable MarcOrderingAutomation
3) Paste the following into MarcFieldsToOrder
price: 975$p
quantity: 975$q
budget_code: 975$h
4) Paste the following into MarcItemFieldsToOrder
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l
Now save the sysprefs
5) In the administration homepage, under Acquisition parameters there should now be a link called "MARC order accounts"
6) Click on this and click the New account button
7) Choose a vendor and a budget
8) Enter a description and make sure you don't set a value in the 'Basket name field' input
9) Enter the following in download directory - "/var/lib/koha/kohadev/tmp/koha_kohadev_upload"
10) Select any record matching settings you want (not important for the test plan, this uses the same code as the marc file staging that already exists in Koha)
11) Check Yes under Check for embedded item record data
12) Click submit
13) We now need to upload a MARC file into the directory that we put in the account. The easiest way to do this is through the marc staging tool
14) Navigate to Cataloging > Stage MARC records for import
15) Upload the file attached to this bug using the Choose file button
16) Click Upload file.
17) Leave the page without completing the new form that appears, we don't want to stage this file. The file we uploaded is now in the directory ready for the cronjob to process as if it had been transferred via SFTP.
18) In the CLI run, perl misc/cronjobs/marc_ordering_process.pl -v -c
19) The logging should show that the file has been processed for that account
20) Navigate to Acquisitions
21) Search for the Vendor that you put in the MARC ordering account
22) There should now be a basket titled: '{random_hash}_orderstest.marcxml'
23) In the ordering account, set the 'Basket name field' to be 975$a
24) Repeat steps 14 -22, the basket should now be called "This is the basket name" which has been pulled from the file

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 20 Nick Clemens (kidclamp) 2025-04-02 11:25:40 UTC
Created attachment 180297 [details] [review]
Bug 39518: (follow-up) Add clarifying text to basket name field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 21 Thomas Klausner 2025-04-03 13:57:15 UTC
Works as advertised in test plan!
Comment 22 Thomas Klausner 2025-04-03 13:58:38 UTC
Created attachment 180553 [details] [review]
Bug 39518: Add a new column basket_name_field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Comment 23 Thomas Klausner 2025-04-03 13:58:41 UTC
Created attachment 180554 [details] [review]
Bug 39518: Add DBIC file

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Comment 24 Thomas Klausner 2025-04-03 13:58:44 UTC
Created attachment 180555 [details] [review]
Bug 39518: Add new field to the UI

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Comment 25 Thomas Klausner 2025-04-03 13:58:46 UTC
Created attachment 180556 [details] [review]
Bug 39518: Update object methods and unit tests

Test plan:
Test plan:

This test plan involves running a cronjob, not sure how easy this is in the sandboxes

1) In system preferences, click Search and then select the Acquisitions option from the left hand menu
2) Enable MarcOrderingAutomation
3) Paste the following into MarcFieldsToOrder
price: 975$p
quantity: 975$q
budget_code: 975$h
4) Paste the following into MarcItemFieldsToOrder
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l
Now save the sysprefs
5) In the administration homepage, under Acquisition parameters there should now be a link called "MARC order accounts"
6) Click on this and click the New account button
7) Choose a vendor and a budget
8) Enter a description and make sure you don't set a value in the 'Basket name field' input
9) Enter the following in download directory - "/var/lib/koha/kohadev/tmp/koha_kohadev_upload"
10) Select any record matching settings you want (not important for the test plan, this uses the same code as the marc file staging that already exists in Koha)
11) Check Yes under Check for embedded item record data
12) Click submit
13) We now need to upload a MARC file into the directory that we put in the account. The easiest way to do this is through the marc staging tool
14) Navigate to Cataloging > Stage MARC records for import
15) Upload the file attached to this bug using the Choose file button
16) Click Upload file.
17) Leave the page without completing the new form that appears, we don't want to stage this file. The file we uploaded is now in the directory ready for the cronjob to process as if it had been transferred via SFTP.
18) In the CLI run, perl misc/cronjobs/marc_ordering_process.pl -v -c
19) The logging should show that the file has been processed for that account
20) Navigate to Acquisitions
21) Search for the Vendor that you put in the MARC ordering account
22) There should now be a basket titled: '{random_hash}_orderstest.marcxml'
23) In the ordering account, set the 'Basket name field' to be 975$a
24) Repeat steps 14 -22, the basket should now be called "This is the basket name" which has been pulled from the file

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Comment 26 Thomas Klausner 2025-04-03 13:58:49 UTC
Created attachment 180557 [details] [review]
Bug 39518: (follow-up) Add clarifying text to basket name field

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>