I see something strange there: * Create a basket with creating items on order * Create an order line with 3 items * Close basked * Receive shipment * Edit first item displayed, add barcode * Check checkbox and receive * Verify the order line has been split 2:1 * Receive again - notice all 3 items are showing. It should only be the remaining 2.
Note: ordernumber in aqorders.items was not updated correctly to the new ordernumber.
I don't recreate this on master. MariaDB [koha_kohadev]> select * from aqorders_items; +-------------+------------+---------------------+ | ordernumber | itemnumber | timestamp | +-------------+------------+---------------------+ | 2 | 973 | 2023-11-07 09:41:56 | | 1 | 974 | 2023-11-07 09:41:07 | | 1 | 975 | 2023-11-07 09:41:07 | +-------------+------------+---------------------+
I have tested it multiple times on master last night, with the same and a new order. I had tested bug 35244 and set up the preferences: * AcqItemSetSubfieldsWhenReceiptIsCancelled: 7=-1 * AcqItemSetSubfieldsWhenReceived: 7=1 Could this be the difference? Did you use the "Edit" link from the item table on the receive page?
I hope to have narrowed it down some more: * If you receive/mark an item for receive that you haven't edited, it works ok. * If you mark an item you have edited, it will fail to properly receive.
Created attachment 158587 [details] [review] Bug 35273: Fix item selection when receiving
The problem is coming around this code: 468 var _build_item = function(item, tr) { 469 var chb = $('<input type="checkbox" name="items_to_receive" value="'+item.item_id+'" />') 470 .prop('checked', item._checked) 471 .change(function() { 472 item._checked = $(this).prop('checked'); 473 }); 496 function PopupEditPage(biblionumber, itemnumber) { 509 success: function(item) { 510 var tr = $("#item_"+itemnumber); 511 item._checked = $(tr).find('input[type="checkbox"]').prop('checked'); 512 tr.html(''); 513 _build_item(item, tr); When the popup page is opened we lost the on change trigger (because we recreate the tr). This is ugly but the least intrusive I have found to not introduce regressions...
Created attachment 158767 [details] [review] Bug 35273: Fix item selection when receiving For partial receives with items created on order, the aqorders_items table was not correctly updated when only some of the ordered items were received. To test: 1) Create a basket with creating items on order 2) Create an order line with 3 items 3) Close basked 4) Receive shipment and create invoice 5) Receive your created order line 6) Edit first item displayed, add barcode 7) Check checkbox and receive 8) Verify the order line has been split 2:1 9) Receive again - notice all 3 items are showing. We should only see the remaining 2 10) Undo receive 11) Apply patch 12) Repeat steps 5)-9) 13) Verify that in step 9) only the remaining 2 items display now. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Seeing this crash passing by: Can't call method "edi_order" on an undefined value at /usr/share/koha/acqui/basket.pl line 381 Seems unrelated.
Just a keyboard thing: Hitting Enter on Add item does not work. Out of scope here.
Created attachment 158796 [details] [review] Bug 35273: Fix item selection when receiving For partial receives with items created on order, the aqorders_items table was not correctly updated when only some of the ordered items were received. To test: 1) Create a basket with creating items on order 2) Create an order line with 3 items 3) Close basked 4) Receive shipment and create invoice 5) Receive your created order line 6) Edit first item displayed, add barcode 7) Check checkbox and receive 8) Verify the order line has been split 2:1 9) Receive again - notice all 3 items are showing. We should only see the remaining 2 10) Undo receive 11) Apply patch 12) Repeat steps 5)-9) 13) Verify that in step 9) only the remaining 2 items display now. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passing QA but noting that this code is kind of unreadable. Need to study a day to see whats going on there..
Pushed to master for 23.11. Nice work everyone, thanks!
Pushed to 23.05.x for 23.05.06
*** Bug 35244 has been marked as a duplicate of this bug. ***
We have added this patch on our 23.05.04 It works as long as we choose English as language for the staff client, but not when we change to Swedish
(In reply to Klas Blomberg from comment #15) > We have added this patch on our 23.05.04 > > It works as long as we choose English as language for the staff client, but > not when we change to Swedish Hi Klas, did you update both the templates for en and Swedish? The patch only edits the English ones. Depending on how you installed and your customizations, you can koha-translate --update or make the changes in the second file manually.
Tanks - now it's working in both languages