Bug 32171

Summary: Order prices not populated when adding to a basket from a staged file
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: AcquisitionsAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: major    
Priority: P5 - low CC: andrewfh, lucas
Version: MainKeywords: rel_22_05_candidate
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on: 29955, 32166    
Bug Blocks:    
Attachments: Bug 32171: Store after populating order
Bug 32171: Store after populating order
Bug 32171: Store after populating order
Bug 32171: Store after populating order

Description Nick Clemens (kidclamp) 2022-11-10 20:22:05 UTC
From bug 29955 - in '3rd add order' we remembered to store the order after populating, when adding from a basket we didn't
Comment 1 Nick Clemens (kidclamp) 2022-11-10 20:25:04 UTC
Created attachment 143707 [details] [review]
Bug 32171: Store after populating order

This updates the call to store after populating the order

I put this on it's own bug just for sake of dependency, in case it is needed
seperate from 32166 for backports

To test:
1 - Apply and test with bug 32166
Comment 2 Andrew Fuerste-Henry 2022-11-14 21:55:27 UTC
Looks like you forgot to declare your oder:
Could not compile /kohadevbox/koha/acqui/addorderiso2709.pl: Global symbol "$oder" requires explicit package name (did you forget to declare "my $oder"?) at /kohadevbox/koha/acqui/addorderiso2709.pl line 297.
BEGIN not safe after errors--compilation aborted at /kohadevbox/koha/acqui/addorderiso2709.pl line 754.
Comment 3 Nick Clemens (kidclamp) 2022-11-15 12:58:39 UTC
Created attachment 143901 [details] [review]
Bug 32171: Store after populating order

This updates the call to store after populating the order

I put this on it's own bug just for sake of dependency, in case it is needed
seperate from 32166 for backports

To test:
1 - Apply and test with bug 32166
Comment 4 ByWater Sandboxes 2022-11-15 16:36:45 UTC
Created attachment 143919 [details] [review]
Bug 32171: Store after populating order

This updates the call to store after populating the order

I put this on it's own bug just for sake of dependency, in case it is needed
seperate from 32166 for backports

To test:
1 - Apply and test with bug 32166

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Comment 5 Andrew Fuerste-Henry 2022-11-15 16:40:47 UTC
coopted the test plan from 32166:
To test:
 -1: apply patch
 0 - Set system preferences:

MarcFieldsToOrder:
price: 949$g
quantity: 949$k
budget_code: 949$l
discount: 949$m
sort1: 949$n
sort2: 949$q

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

 1 - Stage attached sample file, Format:MARCXML, Record matching:Koha biblio 999$c
 2 - Add to a basket from the staged file
 3 - Select 1st record to basket and save
 4 - Record is added with the fields above as expected AND THE PRICE FIELDS ARE POPULATED
 5- repeat with the other records if you feel like it
Comment 6 Katrin Fischer 2022-11-16 13:37:14 UTC
Created attachment 143954 [details] [review]
Bug 32171: Store after populating order

This updates the call to store after populating the order

I put this on it's own bug just for sake of dependency, in case it is needed
seperate from 32166 for backports

To test:
1 - Apply and test with bug 32166

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2022-11-16 13:37:34 UTC
Thx for the help with the test plan, Andrew!
Comment 8 Tomás Cohen Arazi 2022-11-16 18:56:42 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!