In the acquisition module the spent and ordered amounts are linked to separate pages which show the records and freight costs that build up to the amount seen in the table. The page showing the ordered records appearst to be always correct, but there are problems with the spent page. At the moment, the problem always seems to occur for the 'serials' fund in each library (subscription order workflow?) The list is missing records in this case and the total is incorrect and not matching the value shown on the acq start page. We see this behaviour in several databases using acquisitons + serials with 3.18.5.1.
Hm, the problem seems to be that there is an entry in aqorders_items, but the corresponding item has since been deleted.
The big problem is the 'missing' item, independent of the existence of an entry in aqorders.items. As this is a very normal thing for serial orders (no items, but a subscription instead) we need to make the SQL query for the spent page more flexible to include those as well. Haven't succeeded there so far, but maybe someone else wants to give it a try.
*** Bug 12459 has been marked as a duplicate of this bug. ***
Created attachment 39207 [details] [review] Bug 14172: Acq: Orders without items missing from 'spent' list If the item for an order had been deleted since or there was never an item created for the order (subscription orders) those records where missing from the "Spent" page in acquisitions. Patch corrects the SQL to list the correct records. To test: - Create different orders for one fund and receive them - normal order with a few items - subscription order (no item) - normal order with an item, delete the item after receiving - include some freight cost in one of the invoices - Compare the amount spent shown on the acq start page with the amount shown at the end of the 'spent' page - Without the patch, the amounts don't match and not all received titles are listed - With the patch, amounts should match and list shoudl be complete
I have tried the patch, it applied cleanly to current master. I have tested the subscription aquisition bug and can confirm both the bug and that the patch fixes that particular issue. I have not yet tested the 'Delete Item' bug.
Created attachment 39279 [details] [review] Bug 14172: Acq: Orders without items missing from 'spent' list If the item for an order had been deleted since or there was never an item created for the order (subscription orders) those records where missing from the "Spent" page in acquisitions. Patch corrects the SQL to list the correct records. To test: - Create different orders for one fund and receive them - normal order with a few items - subscription order (no item) - normal order with an item, delete the item after receiving - include some freight cost in one of the invoices - Compare the amount spent shown on the acq start page with the amount shown at the end of the 'spent' page - Without the patch, the amounts don't match and not all received titles are listed - With the patch, amounts should match and list shoudl be complete Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signing off with the following notes: On page spent.pl I see typo: Sub total A total of 52 euro is not listed as 52,00 although the items are listed as 12,00 and 40,00 The total of the shipping costs is not mentioned on the first form. But is included in the final total of the spent page. The removed item number is still in the aqorders_items table. The fact that an order number is corresponding with an item, is not intuitively clear. (Probably, the main cause is that an order is actually an order line.) A comment in the code where you join aqorders_items on ordernumber might be helpful.
Created attachment 39280 [details] [review] Bug 14172: Acq: Orders without items missing from 'spent' list If the item for an order had been deleted since or there was never an item created for the order (subscription orders) those records where missing from the "Spent" page in acquisitions. Patch corrects the SQL to list the correct records. To test: - Create different orders for one fund and receive them - normal order with a few items - subscription order (no item) - normal order with an item, delete the item after receiving - include some freight cost in one of the invoices - Compare the amount spent shown on the acq start page with the amount shown at the end of the 'spent' page - Without the patch, the amounts don't match and not all received titles are listed - With the patch, amounts should match and list shoudl be complete Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Patch pushed to master. Thanks Katrina!
Pushed to 3.18.x will be in 3.18.7