Bug 39620

Summary: Price not populating from 020$c when creating a basket
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: AcquisitionsAssignee: Lucas Gass (lukeg) <lucas>
Status: Pushed to stable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: david, martin.renvoize, matt.blenkinsop, paul.derscheid
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
This patch fixes an error in Koha/MarcOrder.pm where price was not correctly defaulting to the 020$c if it exists.
Version(s) released in:
25.05.00,24.11.05
Circulation function:
Attachments: Bug 39620: Fallback to GetMarcPrice if nessesary
Bug 39620: Fallback to GetMarcPrice if nessesary
Bug 39620: Fallback to GetMarcPrice if nessesary

Description Lucas Gass (lukeg) 2025-04-12 14:57:09 UTC
To recreate:

1. Have a MRC file with price populated in the 020$c
2. Have nothing the MarcFieldsToOrder or  MarcItemFieldsToOrder sys prefs
3. Create a new basket and import from a new file 
4. The price is not imported. 


My understanding is that if the price is set in the 020$c it should be copied over.
Comment 1 Lucas Gass (lukeg) 2025-05-12 15:02:26 UTC
Created attachment 182298 [details] [review]
Bug 39620: Fallback to GetMarcPrice if nessesary

To test:
1. Have a MRC file with price populated in the 020$c
2. Have nothing the MarcFieldsToOrder or  MarcItemFieldsToOrder sys prefs
3. Create a new basket and import from a new file
4. The price is not imported.
5. APPLY PATCH and restart_all
6. Try again, this time the price should be populated correctly.
Comment 2 David Nind 2025-05-12 21:14:00 UTC
Created attachment 182313 [details] [review]
Bug 39620: Fallback to GetMarcPrice if nessesary

To test:
1. Have a MRC file with price populated in the 020$c
2. Have nothing the MarcFieldsToOrder or  MarcItemFieldsToOrder sys prefs
3. Create a new basket and import from a new file
4. The price is not imported.
5. APPLY PATCH and restart_all
6. Try again, this time the price should be populated correctly.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-05-12 21:20:57 UTC
Testing notes (using KTD):
1. Edit the BKS framework so that 020$c is visible in the editor.
2. Edit any record and add a value to 020$c, for example $5.00
3. Export the record as MARCXML.
4. Delete the items and record.
5. Continue with the test plan - note: I'm not that familiar with adding an order to a basket from a new file, I:
   - Selected "From a new file"
   - Accepted the default settings
   - You are on the "Job engueued page"
   - Click the "Add staged files to basket" action button
     (once the job is finished)
   - Continue with adding orders....
   - If you check the job page, you'll need to add to the basket again, but use "From a staged file"
Comment 4 Martin Renvoize (ashimema) 2025-05-13 06:41:23 UTC
Created attachment 182333 [details] [review]
Bug 39620: Fallback to GetMarcPrice if nessesary

To test:
1. Have a MRC file with price populated in the 020$c
2. Have nothing the MarcFieldsToOrder or  MarcItemFieldsToOrder sys prefs
3. Create a new basket and import from a new file
4. The price is not imported.
5. APPLY PATCH and restart_all
6. Try again, this time the price should be populated correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 5 Katrin Fischer 2025-05-15 06:36:09 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 6 Paul Derscheid 2025-05-26 07:25:34 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.05