https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42788

--- Comment #2 from Martin Renvoize (ashimema) 
<[email protected]> ---
Correction to the description, after re-checking the code and testing in KTD
on the 25.11 line.

The description says an ORDRSP cancellation leaves the fund encumbrance
committed. I can't reproduce that, including on the code as it was before
bug 42789.

How the figure is calculated:
 GetBudgetOrdered / GetBudgetSpent (C4/Budgets.pm) and the funds page query
 only count order lines with datecancellationprinted IS NULL.

What process_ordrsp did before 42789:
 It called ModOrder with orderstatus=cancelled, cancellationreason and
 datecancellationprinted set. I ran that exact call against an order of
 quantity 2 at 10.00 each: the fund's Ordered figure went from 20 to 0.

What it does now (42789, pushed):
 It calls Koha::Acquisition::Order->cancel(), the same method the manual
 "cancel order line" action uses, so the two routes are now identical. The
 same test gives Ordered 20 -> 0, status cancelled, date set, on-order items
 deleted, linked suggestion reverted.

So 42789 did not fix this, because there was nothing to fix. It added item
deletion and suggestion handling, which the old path lacked. As far as the
code goes, the encumbrance was already released.

Cases that can still leave a fund looking wrong:
 * Only action code 2 (cancelled) triggers a cancel. Codes 3, 10 and 24 are
   stored as a supplier note and the line stays open and encumbered.
 * A cancelled line that never received a datecancellationprinted (status
   cancelled, date NULL) is still counted. The code paths above always set
   the date, so this would come from older data or other tooling. Orders->
   filter_by_obsolete finds these.
 * Cancelling removes a line from both Ordered and Spent. If the ORDRSP
   arrives after the line was received, the fund's Spent figure drops. That
   is a different problem, see bug 44256.
 * An ORDRSP cancelling only part of a line cancels the whole line, see bug
   44255.

Unless someone can show an order where an ORDRSP cancel leaves
datecancellationprinted NULL (or the fund figure unchanged) on a version with
or without 42789, I suggest this bug is closed as WORKSFORME, with the
follow-up work on 44255 and 44256. If the reporter has a specific order line
that still shows as encumbered, the aqorders row (orderstatus,
datecancellationprinted, quantity, quantityreceived) would tell us which of
the cases above applies.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to