Bug 34717

Summary: Incorrect method call in addorderiso2709.pl
Product: Koha Reporter: Matt Blenkinsop <matt.blenkinsop>
Component: AcquisitionsAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 34717: Fix budget selection
Test file with mapped fields
Bug 34717: Fix budget selection

Description Matt Blenkinsop 2023-09-05 13:47:51 UTC
There is an incorrect method usage in the script where GetBudgetByCode is used instead of GetBudget.
Comment 1 Matt Blenkinsop 2023-09-05 14:08:10 UTC
Created attachment 155217 [details] [review]
Bug 34717: Fix budget selection

This patch replaces GetBudgetByCode with GetBudget to allow budget population to happen correctly

Test plan:

Needs to be tested using the file attached as it includes the field mappings
Needs to be tested in KTD as the mappings match a budget created in the KTD sample data (sandboxes run on KTD so are suitable for this)

1) In system preferences, search for MarcFieldsToOrder
2) Paste the following into the syspref:
price: 975$p
quantity: 975$q
budget_code: 975$h
3) Save the syspref
4) In Acquistions, choose a vendor and go into a basket
5) Click Add to basket
6) Select From a new file
7) Use the file attached to this bug
8) Click Upload file
9) At the bottom, click Stage for import
10) When the import is complete, click Add staged files to basket
11) Tick the box next to the record name
12) Observe that under fund, you are being asked to select a fund
13) Apply patch
14) restart_all
15) Refresh the page
16) Observe that the budget has now defaulted to Fund 1_2 as per the mappings in the marc file
Comment 2 Matt Blenkinsop 2023-09-05 14:26:18 UTC
Created attachment 155219 [details]
Test file with mapped fields
Comment 3 Matt Blenkinsop 2023-09-05 14:28:34 UTC
Created attachment 155220 [details] [review]
Bug 34717: Fix budget selection

This patch replaces GetBudgetByCode with GetBudget to allow budget population to happen correctly

Test plan:

Needs to be tested using the file attached as it includes the field mappings
Needs to be tested in KTD as the mappings match a budget created in the KTD sample data (sandboxes run on KTD so are suitable for this)

1) In system preferences, search for MarcFieldsToOrder
2) Paste the following into the syspref:
price: 975$p
quantity: 975$q
budget_code: 975$h
3) Save the syspref
4) In Acquistions, choose a vendor and go into a basket
5) Click Add to basket
6) Select From a new file
7) Use the file attached to this bug
8) Click Upload file
9) At the bottom, click Stage for import
10) When the import is complete, click Add staged files to basket
11) Tick the box next to the record name
12) Observe that under fund, you are being asked to select a fund and the budget being mapped in the file has not been populated as it should be
13) Apply patch
14) restart_all
15) Refresh the page
16) Observe that the budget has now correctly defaulted to Fund 1_2 as per the mappings in the marc file