Bug 25389 - Inconsistent naming of account_credit_type for lost and returned items
Summary: Inconsistent naming of account_credit_type for lost and returned items
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on: 22563 23805
Blocks: 25478
  Show dependency treegraph
 
Reported: 2020-05-06 13:58 UTC by Andrew Fuerste-Henry
Modified: 2020-11-30 21:49 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 25389: Correct original DB update for bug 22563 (809 bytes, patch)
2020-05-11 10:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25389: Correct stray cases of LOST_RETURNED (1.20 KB, patch)
2020-05-11 10:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021 (1.34 KB, patch)
2020-05-11 10:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25389: Catch errant cases of LOST_RETURNED (1.32 KB, patch)
2020-05-11 10:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25389: Correct original DB update for bug 22563 (880 bytes, patch)
2020-05-12 11:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 25389: Correct stray cases of LOST_RETURNED (1.27 KB, patch)
2020-05-12 11:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021 (1.41 KB, patch)
2020-05-12 11:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 25389: Catch errant cases of LOST_RETURNED (1.39 KB, patch)
2020-05-12 11:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 25389: Correct original DB update for bug 22563 (938 bytes, patch)
2020-05-12 13:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25389: Correct stray cases of LOST_RETURNED (1.32 KB, patch)
2020-05-12 13:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021 (1.47 KB, patch)
2020-05-12 13:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25389: Catch errant cases of LOST_RETURNED (1.44 KB, patch)
2020-05-12 13:25 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-05-06 13:58:16 UTC
Bug 23805 creates the account_credit_types table with the type "LOST_RETURN."
Bug 22563 updates all existing "CR" account lines to "LOST_RETURNED."

I've got no preference between the two wordings, but we should be consistent about it.
Comment 1 Andrew Fuerste-Henry 2020-05-07 18:48:15 UTC
If I check in a lost item on 19.11, the accountline for the lost fee shows debit_type_code LOST with status RETURNED. The accountline that gets created for the credit -- what would have been accounttype 'CR' in 19.05 -  has credit_type_code "LOST_RETURN." I think bug 22563 got the value wrong when updating old credits.
Comment 2 Katrin Fischer 2020-05-09 22:16:53 UTC
Martin, I think you would be probably the best to have a look here - I am a little lost with the new status still.
Comment 3 Martin Renvoize 2020-05-11 10:25:43 UTC
You are completely right :(.. Working on a fix now.
Comment 4 Martin Renvoize 2020-05-11 10:40:40 UTC
Created attachment 104678 [details] [review]
Bug 25389: Correct original DB update for bug 22563
Comment 5 Martin Renvoize 2020-05-11 10:40:44 UTC
Created attachment 104679 [details] [review]
Bug 25389: Correct stray cases of LOST_RETURNED

The original DB update for bug 22563 incorrectly mapped CR to
LOST_RETURNED as aposed to LOST_RETURN.  This patch catches such cases
and updates them in the update for bug 23805
Comment 6 Martin Renvoize 2020-05-11 10:40:48 UTC
Created attachment 104680 [details] [review]
Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021

An errant update from bug 22563 could lead to cases of LOST_RETURNED as
aposed to LOST_RETURN as an account_credit_type. This patch adds code to
deal with those cases to the update for bug 24592
Comment 7 Martin Renvoize 2020-05-11 10:40:51 UTC
Created attachment 104681 [details] [review]
Bug 25389: Catch errant cases of LOST_RETURNED

For upgrades taking place after the fix for the update in bug 24592 was
pushed, we need to catch any last remaining error cases and correct
them.
Comment 8 Martin Renvoize 2020-05-11 10:44:21 UTC
It may be safer to skip the first patch entirely.. I'm open to peoples opinions there.
Comment 9 Nick Clemens 2020-05-11 15:15:13 UTC
If I read this right:

The first two patches fix the upgrade for site that have not yet upgraded to 19.11

The last two patches will fix sites going to 20.05

We will still need a patch to fix sites that got the bad upgrade in 19.11? The last patch moves to LOST_FOUND, but that isn't introduced before 20.05 (bug 24592)
Comment 10 Martin Renvoize 2020-05-12 09:33:57 UTC
So, each patch will need some careful backporting to their various branches to catch in the right place.

This set was for master.. I suppose to be safe I could create a corresponding set that applies cleanly to 19.11.x.. you are correct.. the final patch would need modifying to LOST_RETURN for that case.
Comment 11 Kyle M Hall 2020-05-12 11:08:27 UTC
Created attachment 104755 [details] [review]
Bug 25389: Correct original DB update for bug 22563

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Kyle M Hall 2020-05-12 11:08:37 UTC
Created attachment 104756 [details] [review]
Bug 25389: Correct stray cases of LOST_RETURNED

The original DB update for bug 22563 incorrectly mapped CR to
LOST_RETURNED as aposed to LOST_RETURN.  This patch catches such cases
and updates them in the update for bug 23805

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 13 Kyle M Hall 2020-05-12 11:08:40 UTC
Created attachment 104757 [details] [review]
Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021

An errant update from bug 22563 could lead to cases of LOST_RETURNED as
aposed to LOST_RETURN as an account_credit_type. This patch adds code to
deal with those cases to the update for bug 24592

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 14 Kyle M Hall 2020-05-12 11:08:43 UTC
Created attachment 104758 [details] [review]
Bug 25389: Catch errant cases of LOST_RETURNED

For upgrades taking place after the fix for the update in bug 24592 was
pushed, we need to catch any last remaining error cases and correct
them.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 15 Jonathan Druart 2020-05-12 13:25:09 UTC
Created attachment 104775 [details] [review]
Bug 25389: Correct original DB update for bug 22563

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Jonathan Druart 2020-05-12 13:25:13 UTC
Created attachment 104776 [details] [review]
Bug 25389: Correct stray cases of LOST_RETURNED

The original DB update for bug 22563 incorrectly mapped CR to
LOST_RETURNED as aposed to LOST_RETURN.  This patch catches such cases
and updates them in the update for bug 23805

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Jonathan Druart 2020-05-12 13:25:17 UTC
Created attachment 104777 [details] [review]
Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021

An errant update from bug 22563 could lead to cases of LOST_RETURNED as
aposed to LOST_RETURN as an account_credit_type. This patch adds code to
deal with those cases to the update for bug 24592

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Jonathan Druart 2020-05-12 13:25:20 UTC
Created attachment 104778 [details] [review]
Bug 25389: Catch errant cases of LOST_RETURNED

For upgrades taking place after the fix for the update in bug 24592 was
pushed, we need to catch any last remaining error cases and correct
them.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 19 Martin Renvoize 2020-05-13 09:34:49 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 20 Martin Renvoize 2020-05-13 10:06:36 UTC
See bug 25478 for a pre-ported version for easy application to the 19.11.x branch.