From 7fa848ca048c788c3cb308aa14a523cf9526ab91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dudzik?= Date: Mon, 8 Jul 2024 17:23:45 +0200 Subject: [PATCH] Bug 37265: Consideration of UniqueItemFields setting when receiving items in an order When using the Koha acquisition module to receive items (basket receiving an order), Koha does not consideration of UniqueItemFields setting. The problem is that you can accidentally attach 3 items to an order with the same values. Test plan: 1. Set preference UniqueItemFields: Public note (itemnotes) 2. Go to the acquisition module. 3. Create a basket with the option for 'Create items when:' set to receiving an order. 4. Add an order to the basket, for example: From a new (empty) record with the Quantity set to 3 or more. 5. Close the basket. 6. Receive the order. 7. Add a public note: TEST, and receive the first item (Add item). 8. You will see that the next item has the same public note. 9. Apply this patch and repeat step 7 - the public note is not used for the next note. Sponsored-by: kohawbibliotece.pl Signed-off-by: David Nind Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize (cherry picked from commit 1b923e946ae9384945967b4f89ea595570f84a90) Signed-off-by: Lucas Gass (cherry picked from commit bb130a573b09e4560c9334ac9128a232c5cb4f5f) Signed-off-by: Fridolin Somers --- acqui/orderreceive.pl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index d8192292f2..7b9963c61a 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -169,15 +169,16 @@ my @gst_values = map { }, split( '\|', C4::Context->preference("TaxRates") ); $template->param( - freight => $freight, - name => $bookseller->name, - active_currency => $active_currency, - currencies => $currencies->search({ rate => { '!=' => 1 } }), - invoiceincgst => $bookseller->invoiceincgst, - invoiceid => $invoice->{invoiceid}, - invoice => $invoice->{invoicenumber}, - gst_values => \@gst_values, - vendor => $bookseller, + freight => $freight, + name => $bookseller->name, + active_currency => $active_currency, + currencies => $currencies->search( { rate => { '!=' => 1 } } ), + invoiceincgst => $bookseller->invoiceincgst, + invoiceid => $invoice->{invoiceid}, + invoice => $invoice->{invoicenumber}, + gst_values => \@gst_values, + vendor => $bookseller, + UniqueItemFields => C4::Context->preference('UniqueItemFields'), ); my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;