The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee.
Resolve this bug opens many oportunities of enhancements that are being waiting by the librarian communitiy.
*** Bug 16902 has been marked as a duplicate of this bug. ***
Created attachment 53318 [details] [review] Bug 14826 - Update database
Created attachment 53319 [details] [review] Bug 14826 - Update table schema
Created attachment 53320 [details] [review] Bug 14826 - Add Koha modules for offsets
Created attachment 53321 [details] [review] Bug 14826 - Resurrect account offsets table
Created attachment 53324 [details] [review] Bug 14826 - Resurrect account offsets table
Created attachment 53326 [details] [review] Bug 14826 - Resurrect account offsets table
Setting back to assigned until I can write some unit tests.
Created attachment 53602 [details] [review] Bug 14826 - Update database
Created attachment 53603 [details] [review] Bug 14826 - Update table schema
Created attachment 53604 [details] [review] Bug 14826 - Add Koha modules for offsets
Created attachment 53605 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets
Created attachment 53606 [details] [review] Bug 14826 - Unit Tests
Created attachment 53607 [details] [review] Bug 14826 - Unit Tests
fatal: sha1 information is lacking or useless (C4/Accounts.pm)
Created attachment 59254 [details] [review] Bug 14826 - Update database
Created attachment 59255 [details] [review] Bug 14826 - Add Koha modules for offsets
Created attachment 59256 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets
Created attachment 59257 [details] [review] Bug 14826 - Unit Tests
Created attachment 59258 [details] [review] Bug 14826 - Update table schemas
Looks good, just when I check out an item with type with defined charge, this charge doesn't make line in acount_offsets.
Created attachment 60270 [details] [review] Bug 14826 - Update database
Created attachment 60271 [details] [review] Bug 14826 - Add Koha modules for offsets
Created attachment 60272 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets
Created attachment 60273 [details] [review] Bug 14826 - Unit Tests
Created attachment 60274 [details] [review] Bug 14826 - Remove old offset table schema file
Created attachment 60275 [details] [review] Bug 14826 - Add new offset table schema file
Created attachment 60276 [details] [review] Bug 14826 - Update existing schema files
Created attachment 60277 [details] [review] Bug 14826 - Add offset for rental fees
Created attachment 60278 [details] [review] Bug 14826 - Add offset for rental fees
Created attachment 60439 [details] [review] [SIGNED-OFF] Bug 14826 - Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 60440 [details] [review] [SIGNED-OFF] Bug 14826 - Add Koha modules for offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 60441 [details] [review] [SIGNED-OFF] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 60442 [details] [review] [SIGNED-OFF] Bug 14826 - Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 60443 [details] [review] [SIGNED-OFF] Bug 14826 - Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 60444 [details] [review] [SIGNED-OFF] Bug 14826 - Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 60445 [details] [review] [SIGNED-OFF] Bug 14826 - Update existing schema files Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 60446 [details] [review] [SIGNED-OFF] Bug 14826 - Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
What would be a test plan for the 2 calls to _FixAccountForLostAndReturned in AddIssue and AddReturn? It would be good to have tests to cover these 2 changes. Same for _FixOverduesOnReturn
Created attachment 64051 [details] [review] Bug 14826 - Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64052 [details] [review] Bug 14826 - Add Koha modules for offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64053 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64054 [details] [review] Bug 14826 - Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64055 [details] [review] Bug 14826 - Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64056 [details] [review] Bug 14826 - Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64057 [details] [review] Bug 14826 - Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64058 [details] [review] Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn
Created attachment 64059 [details] [review] Bug 14826 - Update existing schema files
Good idea, here they are! (In reply to Jonathan Druart from comment #40) > What would be a test plan for the 2 calls to _FixAccountForLostAndReturned > in AddIssue and AddReturn? > It would be good to have tests to cover these 2 changes. > > Same for _FixOverduesOnReturn
Created attachment 64217 [details] [review] Bug 14826 - Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64220 [details] [review] Bug 14826 - Add Koha modules for offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64222 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64223 [details] [review] Bug 14826 - Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64224 [details] [review] Bug 14826 - Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64225 [details] [review] Bug 14826 - Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64226 [details] [review] Bug 14826 - Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 64227 [details] [review] Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn
Created attachment 64228 [details] [review] Bug 14826 - Update existing schema files
Created attachment 65459 [details] [review] Bug 14826 - Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65460 [details] [review] Bug 14826 - Add Koha modules for offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65461 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65462 [details] [review] Bug 14826 - Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65463 [details] [review] Bug 14826 - Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65464 [details] [review] Bug 14826 - Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65465 [details] [review] Bug 14826 - Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65466 [details] [review] Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn
Created attachment 65467 [details] [review] Bug 14826 - Update existing schema files
Created attachment 65642 [details] [review] Bug 14826 - Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65643 [details] [review] Bug 14826 - Add Koha modules for offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65644 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65645 [details] [review] Bug 14826 - Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65646 [details] [review] Bug 14826 - Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65647 [details] [review] Bug 14826 - Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65648 [details] [review] Bug 14826 - Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 65649 [details] [review] Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn
Created attachment 65650 [details] [review] Bug 14826 - Update existing schema files
Created attachment 65651 [details] [review] Bug 14826 [QA Followup] - Fix minor issues with unit tests
Created attachment 65652 [details] [review] Bug 14826 [QA Followup] - Only use plural modules in other modules
Created attachment 66387 [details] [review] Bug 14826 - Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66388 [details] [review] Bug 14826 - Add Koha modules for offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66389 [details] [review] Bug 14826 - Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66390 [details] [review] Bug 14826 - Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66391 [details] [review] Bug 14826 - Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66392 [details] [review] Bug 14826 - Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66393 [details] [review] Bug 14826 - Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66394 [details] [review] Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66395 [details] [review] Bug 14826 - Update existing schema files Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66396 [details] [review] Bug 14826 [QA Followup] - Fix minor issues with unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 66397 [details] [review] Bug 14826 [QA Followup] - Only use plural modules in other modules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch set is actually pretty simple and is not changing any behaviour (besides the side effect of recording the account offsets on each operation that involves charges/payments). It passes the usual QA tests, and opens the door for really cool and missing features in Koha (see the blocked bugs and it becomes obvious). My only observation would be that the 'type' column values should somehow be better controlled (possibly an ENUM, or better a FK to a separate table). This would set a clearer path for eventual added flexibility and avoiding migration/upgrades nightmares. Congrats Kyle!
Created attachment 66716 [details] [review] Bug 14826 - Add account offset type table
Created attachment 67453 [details] [review] Bug 14826: Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67454 [details] [review] Bug 14826: Add Koha::Account::Offset(s) modules Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67455 [details] [review] Bug 14826: Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67456 [details] [review] Bug 14826; Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67457 [details] [review] Bug 14826: Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67458 [details] [review] Bug 14826: Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67459 [details] [review] Bug 14826: Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67460 [details] [review] Bug 14826: Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67461 [details] [review] Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67462 [details] [review] Bug 14826: (QA followup) Fix minor issues with unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67463 [details] [review] Bug 14826: (QA followup) Only use plural modules in other modules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67464 [details] [review] Bug 14826: Add account offset type table Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67465 [details] [review] Bug 14826: (QA followup) POD fixes This patch just fixes POD. There are still some false positives with the QA scripts. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Patches rebased.
@RM: Please note that I obsoleted the (non-applying) schema file changes. They need to be generated when pushing.
RM: Whats the plan with this patch set? Some reports in the SO queue depend on it.
RM: Really excited for this patch set, given the dependencies. Do we know what the plan is? Thanks!
I share Martha's excitement :) We've been trying to fix Accounts for several years and in several ways now. I hope this will move us further as we have been experiencing more and more problems.
Please rebase Applying: Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn error: sha1 information is lacking or useless (t/db_dependent/Circulation.t).
Created attachment 67936 [details] [review] Bug 14826: Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67937 [details] [review] Bug 14826: Add Koha::Account::Offset(s) modules Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67938 [details] [review] Bug 14826: Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67939 [details] [review] Bug 14826; Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67940 [details] [review] Bug 14826: Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67941 [details] [review] Bug 14826: Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67942 [details] [review] Bug 14826: Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67943 [details] [review] Bug 14826: Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67944 [details] [review] Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67945 [details] [review] Bug 14826: (QA followup) Fix minor issues with unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67946 [details] [review] Bug 14826: (QA followup) Only use plural modules in other modules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67947 [details] [review] Bug 14826: Add account offset type table Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67948 [details] [review] Bug 14826: (QA followup) POD fixes This patch just fixes POD. There are still some false positives with the QA scripts. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67949 [details] [review] Bug 14826 [QA Followup] - Correct number of tests run following rebase
1. I think these patches must be based on top of bug 12768 (or the reverse). 2. Could you document this enhancement for the release notes? 3. (In reply to Jonathan Druart from comment #40) > What would be a test plan for the 2 calls to _FixAccountForLostAndReturned > in AddIssue and AddReturn? ? 4. diff --git a/Koha/Schema/Result/Rating.pm b/Koha/Schema/Result/Rating.pm deleted file mode 100644 Hum!? At this point it may be better to remove these schema files from the patches, I will regenerate them. Just make sure that the update DB process will generate the same schema as new installations (accountoffsets is not dropped by the atomic update for instance). 5. The update DB process fails if executed twice
Created attachment 68018 [details] [review] Bug 14826: Update database Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68019 [details] [review] Bug 14826: Add Koha::Account::Offset(s) modules Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68020 [details] [review] Bug 14826: Resurrect account offsets table The account offsets table should be used to track increments and decrements of fines via payments and credits, as well as fine accruals. It should be able to match fees to payments and visa versa, so we can know which fee was paid by a given payment, and which payments applied to a given fee. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Note the table accountoffsets has been renamed to account_offsets 4) Ensure fine generation creates offsets 5) Ensure creating a manual invoice creates an offset 6) Ensure a lost item charge creates an offset 7) Ensure Reverse Payment creates an offset 8) Ensure a payment creates an offset 9) Ensure a payment for multiple fees creates an offset for each 10) Ensure writeoffs create offsets Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68021 [details] [review] Bug 14826; Unit Tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68022 [details] [review] Bug 14826: Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68023 [details] [review] Bug 14826: Remove old offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68024 [details] [review] Bug 14826: Add new offset table schema file Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68025 [details] [review] Bug 14826: Add offset for rental fees Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68026 [details] [review] Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68027 [details] [review] Bug 14826: (QA followup) Fix minor issues with unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68028 [details] [review] Bug 14826: (QA followup) Only use plural modules in other modules Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68029 [details] [review] Bug 14826: Add account offset type table Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68030 [details] [review] Bug 14826: (QA followup) POD fixes This patch just fixes POD. There are still some false positives with the QA scripts. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68031 [details] [review] Bug 14826 [QA Followup] - Correct number of tests run following rebase
Created attachment 68032 [details] [review] Bug 14826 [QA Followup] - Make db update idempotent
Pushed to master for 17.11, thanks to everybody involved!
Created attachment 68334 [details] [review] Bug 14826: account_offset_types.sql is not in the mandatory subdir
(In reply to Jonathan Druart from comment #144) > Created attachment 68334 [details] [review] [review] > Bug 14826: account_offset_types.sql is not in the mandatory subdir Pushed to master
Created attachment 68383 [details] [review] Bug 14826: (QA Follow-up) Remove obsolete DBIx schema file Removes Accountoffset.pm. Has been replaced by AccountOffset.pm on bug 14826. Test plan: Run TestBuilder.t. Should pass now again. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Jonathan Druart from comment #145) > (In reply to Jonathan Druart from comment #144) > > Created attachment 68334 [details] [review] [review] [review] > > Bug 14826: account_offset_types.sql is not in the mandatory subdir > > Pushed to master Squee! Thanks Jonathan!
(In reply to Marcel de Rooy from comment #146) > Created attachment 68383 [details] [review] [review] > Bug 14826: (QA Follow-up) Remove obsolete DBIx schema file > > Removes Accountoffset.pm. > Has been replaced by AccountOffset.pm on bug 14826. > > Test plan: > Run TestBuilder.t. Should pass now again. > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Thanks for the followup Marcel!