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
This seems to resolved in main by Bug 35026.
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