| Summary: | MarcFieldsToOrder price is overriding MarcItemFieldsToOrderPrice | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
| Component: | Acquisitions | Assignee: | Lucas Gass (lukeg) <lucas> |
| Status: | RESOLVED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | bwsdonna, fridolin.somers, kebliss, lucas, martin.renvoize, matt.blenkinsop |
| Version: | 24.05 | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
24.05.04
|
|
| Circulation function: | |||
| Bug Depends on: | 33171 | ||
| Bug Blocks: | |||
| Attachments: |
Marc file for testing
Bug 37551: Only delete price when there is already an itemprice Bug 37551: (24.05.x) Only delete price when there is already an itemprice Bug 37551: (24.05.x) Only delete price when there is already an itemprice |
||
Created attachment 170735 [details]
Marc file for testing
To recreate: 1. Have a mrc file with some different prices. In my case I am using the mrc file attached here with different price values in the 975$p and 975$a 2. Set the MarcFieldsToOrder to "price: 975$p" and MarcItemFieldsToOrder to "price: 975$a" 3. In Acquisitions create a new basket > add to basket > from a new file 4. The value from MarcFieldsToOrder (975$p) is always set as the price when it should be the value from MarcItemFieldsToOrder (975$a) Created attachment 170736 [details] [review] Bug 37551: Only delete price when there is already an itemprice To test: 1. Have a mrc file with some different prices. In my case I am using the mrc file attached here with different price values in the 975$p and 975$a 2. Set the MarcFieldsToOrder to "price: 975$p" and MarcItemFieldsToOrder to "price: 975$a" 3. In Acquisitions create a new basket > add to basket > from a new file 4. The value from MarcFieldsToOrder (975$p) is always set as the price when it should be the value from MarcItemFieldsToOrder (975$a) 5. APPLY PATCH, restart_all 6. Try steps 1 - 3 again, this time item price should be correctly handled. Created attachment 170737 [details] [review] Bug 37551: (24.05.x) Only delete price when there is already an itemprice To test: 1. Have a mrc file with some different prices. In my case I am using the mrc file attached here with different price values in the 975$p and 975$a 2. Set the MarcFieldsToOrder to "price: 975$p" and MarcItemFieldsToOrder to "price: 975$a" 3. In Acquisitions create a new basket > add to basket > from a new file 4. The value from MarcFieldsToOrder (975$p) is always set as the price when it should be the value from MarcItemFieldsToOrder (975$a) 5. APPLY PATCH, restart_all 6. Try steps 1 - 3 again, this time item price should be correctly handled. While Bug 35026 I don't think we'll want to backport all of that to 24.05? So I made a patch for 24.05.x Tested, works as expected. Signing off. Created attachment 171627 [details] [review] Bug 37551: (24.05.x) Only delete price when there is already an itemprice To test: 1. Have a mrc file with some different prices. In my case I am using the mrc file attached here with different price values in the 975$p and 975$a 2. Set the MarcFieldsToOrder to "price: 975$p" and MarcItemFieldsToOrder to "price: 975$a" 3. In Acquisitions create a new basket > add to basket > from a new file 4. The value from MarcFieldsToOrder (975$p) is always set as the price when it should be the value from MarcItemFieldsToOrder (975$a) 5. APPLY PATCH, restart_all 6. Try steps 1 - 3 again, this time item price should be correctly handled. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Backported to 24.05.x for upcoming 24.05.04 Depends on Bug 33171 not in 23.11.x Bug fix, doesn't need to be documented. |
In the code: # Price is handled as "itemprice" in the UI form to distinguish from MarcFieldsToOrder $iteminfos->{itemprice} = delete $iteminfos->{price} if $iteminfos->{price}; and later $iteminfos->{price} ||= $price; # Fallback to order price if no item price was defined Well, this means we will always fallback, because we deleted it. itemprice is the variable name when processing the form, but for populating we use 'price' I touched all of these lines, so I am blamed, but seems a clear mistake