In orderreceive.pl, argument 'booksellerid' passed to the template is always empty (= because we don't have booksellerid field in order records); subsequently, finishreceive.pl script is also not getting this parameter (and it relies on it to do some possibly important work). This has the following consequences: 1) link to vendor in the breadcrumbs on the receiving page is not working 2) this code block (introduced by Bug 5335 - More granular VAT) if ( $bookseller->{listincgst} ) { if ( not $bookseller->{invoiceincgst} ) { $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} ); $order->{ecost} = $order->{ecost} * ( 1 + $order->{gstrate} ); $order->{unitprice} = $order->{unitprice} * ( 1 + $order->{gstrate} ); } } else { if ( $bookseller->{invoiceincgst} ) { $order->{rrp} = $order->{rrp} / ( 1 + $order->{gstrate} ); $order->{ecost} = $order->{ecost} / ( 1 + $order->{gstrate} ); $order->{unitprice} = $order->{unitprice} / ( 1 + $order->{gstrate} ); } } } in finishreceive.pl never runs 3) in the received item records, booksellerid (952 $e) field is not updated with the correct value by ModItem(), it always becomes '' after receiving. Regarding 2), I'm not quite sure it is neceserilly the bad thing ;). But it (partially) explains to me why tax calculations in Koha are occasionally working seemingly weird (at least for some less usual invoiceincgst & listincgst settings in vendor record).
Created attachment 25834 [details] [review] Bug 11755: SearchOrders does not return booksellerid The SearchOrders routine should return the booksellerid. Booksellerid was returned before bug 10723. Quick test plan: Go on orderreceive.pl and verify that the vendor link is correct.
(In reply to Jonathan Druart from comment #1) > Created attachment 25834 [details] [review] [review] > Bug 11755: SearchOrders does not return booksellerid > > The SearchOrders routine should return the booksellerid. > > Booksellerid was returned before bug 10723. > Patch does resolve all the issues mentioned; I'm a little worried about an impact it will have on issue 2), though.. Situation regarding tax recalculation code in finishreceive.pl seems to be somehow like that: - in 3.10 & 3.12 branches, this code block was, and still is working like intended, - it got broken in 3.14 and up (since bug 10723) resulting in price values in all newly received orders being inconsistently saved in the database (at least for those cases where listincgst xor invoiceincgst != 1) ? As a side effect, some bug reports currently sitting in the queue which regard various problems with tax calculations in Koha will probably need to be retested / reevaluated. Still, IMO pushing this patch first (and ASAP) will be a huge change in the right direction. I wonder if there may be some way to retroactively correct wrongly calculated price values which may already got stored in aqorders table, for those people using 3.14 right now in production environment?
Created attachment 25885 [details] [review] Bug 11755: SearchOrders does not return booksellerid The SearchOrders routine should return the booksellerid. Booksellerid was returned before bug 10723. Quick test plan: Go on orderreceive.pl and verify that the vendor link is correct.
Created attachment 25894 [details] [review] [Signed-off] Bug 11755: SearchOrders does not return booksellerid The SearchOrders routine should return the booksellerid. Booksellerid was returned before bug 10723. Quick test plan: Go on orderreceive.pl and verify that the vendor link is correct. Followed test plan. Vendor link is now correct. Signed-off-by: Marc Véron <veron@veron.ch>
Jonathan - tests failed. There are a lot of new additions to the Acquisitions.t Besides that - the patch does do what it advertize - so once tests past :)
Created attachment 26078 [details] [review] Bug 11755: SearchOrders does not return booksellerid The SearchOrders routine should return the booksellerid. Booksellerid was returned before bug 10723. Quick test plan: Go on orderreceive.pl and verify that the vendor link is correct. Followed test plan. Vendor link is now correct. Signed-off-by: Marc Véron <veron@veron.ch>
Last patch rebased.
Created attachment 26121 [details] [review] Bug 11755: SearchOrders does not return booksellerid The SearchOrders routine should return the booksellerid. Booksellerid was returned before bug 10723. Quick test plan: Go on orderreceive.pl and verify that the vendor link is correct. Followed test plan. Vendor link is now correct. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Pushed to master. Thanks, Jonathan!
Pushed to 3.14.x, will be in 3.14.07