When I try to receive 0 items ("Quantity received: 0") for a order in the page /cgi-bin/koha/acqui/orderreceive.pl?ordernumber=1&invoiceid=1 I get the following error when clicking save: Invalid value passed, dateaccessioned=07/30/2020 expected type is date at /usr/share/perl5/Exception/Class/Base.pm line 88 The $datereceived variable is not being processed properly.
I think you should not be able to receive 0 - to my knowledge that just didn't save before. The error seems new - are you creating/updating items on receive?
You are right Katrin, the issue happens only with the AcqCreateItem set to "Create an item when placing an order." To reproduce this bug be sure to first set this syspref to the aformentioned value and then after that create a new order basket and go receive the item there. (the syspref gets only applied to newly create baskets.)
I think the error has been highlighted by Bug 23463: Replace ModItem with Koha::Item->store
What's the expected behaviour? A JS check to make sure the form is only submitted when the quantity > 0?
I actually filed a bug for that, because I forgot to fill in quantity received a lot: Bug 21811 - Add warning when order receive form is saved without entering 'quantity received' I think a Javascript check or simply marking the field required (as in has to be greater 1 for saving)?
*** This bug has been marked as a duplicate of bug 21811 ***
Jonathan, if this is duplicate of bug 21811 then it seems like the code that uses $datereceived variable in orderreceive.pl is unused and should be removed.
(In reply to Joonas Kylmälä from comment #7) > Jonathan, if this is duplicate of bug 21811 then it seems like the code that > uses $datereceived variable in orderreceive.pl is unused and should be > removed. It's passed to the template: 250 datereceived => $datereceived,
(In reply to Jonathan Druart from comment #8) > (In reply to Joonas Kylmälä from comment #7) > > Jonathan, if this is duplicate of bug 21811 then it seems like the code that > > uses $datereceived variable in orderreceive.pl is unused and should be > > removed. > > It's passed to the template: > 250 datereceived => $datereceived, Sorry, I confused the file to acqui/finishreceive.pl, on line 175 there is a while loop where the variable is used and not necessarily modified to fit the DB format: > while ( my $item = $items->next ) { > ...
Yes, you are right. I let a comment on bug 21811.