https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41900 --- Comment #12 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 212632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212632&action=edit Bug 41900: Fill source of acquisition for items created when ordering Items created through acquisitions only got items.booksellerid (952$e, source of acquisition) when they were received. Items created while ordering - from a staged file, or with AcqCreateItem set to 'ordering' - had no vendor until receipt. This patch sets the vendor where the item data is entered: - The item forms on the 'Add orders from a staged file' and new order pages are prefilled with the vendor id in Source of acquisition. Staff can see it and change it before saving. - Items created from MarcItemFieldsToOrder, which have no item form, get the vendor when they are created. - Items copied by duplicating an order get the vendor of the new basket if they have no source of acquisition. PrepareItemrecordDisplay already takes default values for some fields (callnumber, branchcode, location, ccode); this adds booksellerid. The receiving item form is not prefilled, as receiving already sets the vendor on all received items. Test plan: 1. Set AcqCreateItem to 'ordering' 2. Set MarcItemFieldsToOrder, for example: homebranch: 970$a holdingbranch: 970$a itype: 970$i price: 970$p quantity: 970$b budget_code: 970$f 3. Stage a file of records containing matching 970 fields 4. Create a basket for a vendor and add orders from the staged file 5. View the items for the new records: Source of acquisition is empty 6. Stage another file without 970 fields, add orders from it and look at the 'Item information' tab: Source of acquisition is empty 7. Add an order to the basket from a new empty record, look at the item form: Source of acquisition is empty 8. Apply patch, restart_all 9. Repeat 3-4: Source of acquisition is now the vendor id on the items 10. Repeat 6 and 7: Source of acquisition is prefilled with the vendor id 11. Save the orders, confirm the items have the vendor id 12. Change the prefilled value before saving another order, confirm your value is kept 13. Duplicate an order into a basket of another vendor (Basket -> Add to basket -> From existing orders (copy)); confirm items without a Source of acquisition get the new vendor 14. Receive an order, confirm Source of acquisition is the vendor id 15. prove t/db_dependent/Items.t t/db_dependent/Koha/MarcOrder.t \ t/db_dependent/Koha/Acquisition/Order.t t/db_dependent/Koha/EDI.t \ xt/find-acquisition-item-links.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.