Bug 14826 - Store account offsets
Summary: Store account offsets
Status: Pushed to Master
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature with 22 votes (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 16902 (view as bug list)
Depends on: 15894
Blocks: 12768 14825 15273 15985 18786 19036 19191
  Show dependency treegraph
 
Reported: 2015-09-15 15:09 UTC by Kyle M Hall
Modified: 2017-11-09 12:10 UTC (History)
14 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
The account offsets table allows libraries to know the entire history of fees and payments in Koha. Previously there was no way to directly connect fees and payments. The addition of the account offsets table allows you to know which fees paid which fines visa versa. This data will be accessible via reports and later via the staff intranet ( via Bug 2696 ).


Attachments
Bug 14826 - Update database (3.46 KB, patch)
2016-07-12 16:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update table schema (8.05 KB, patch)
2016-07-12 16:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.08 KB, patch)
2016-07-12 16:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (20.04 KB, patch)
2016-07-12 16:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (26.65 KB, patch)
2016-07-12 17:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (27.44 KB, patch)
2016-07-12 17:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update database (3.46 KB, patch)
2016-07-21 18:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update table schema (8.05 KB, patch)
2016-07-21 18:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.08 KB, patch)
2016-07-21 18:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (28.58 KB, patch)
2016-07-21 18:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (16.81 KB, patch)
2016-07-21 18:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.27 KB, patch)
2016-07-21 19:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update database (3.46 KB, patch)
2017-01-19 14:43 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.08 KB, patch)
2017-01-19 14:43 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (23.54 KB, patch)
2017-01-19 14:43 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.40 KB, patch)
2017-01-19 14:43 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update table schemas (6.97 KB, patch)
2017-01-19 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update database (3.46 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.08 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (23.53 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.40 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Remove old offset table schema file (2.62 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add new offset table schema file (3.14 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update existing schema files (2.86 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add offset for rental fees (1.95 KB, patch)
2017-02-15 16:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add offset for rental fees (1.95 KB, patch)
2017-02-15 16:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Update database (3.52 KB, patch)
2017-02-19 21:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Add Koha modules for offsets (3.15 KB, patch)
2017-02-19 21:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Resurrect account offsets table (23.60 KB, patch)
2017-02-19 21:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Unit Tests (5.46 KB, patch)
2017-02-19 21:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Remove old offset table schema file (2.68 KB, patch)
2017-02-19 21:02 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Add new offset table schema file (3.21 KB, patch)
2017-02-19 21:02 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Update existing schema files (2.93 KB, patch)
2017-02-19 21:02 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14826 - Add offset for rental fees (2.02 KB, patch)
2017-02-19 21:02 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 14826 - Update database (3.51 KB, patch)
2017-06-06 13:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.14 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (23.59 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.41 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Remove old offset table schema file (2.67 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add new offset table schema file (3.20 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add offset for rental fees (2.01 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.40 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update existing schema files (2.86 KB, patch)
2017-06-06 13:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update database (3.51 KB, patch)
2017-06-12 16:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.14 KB, patch)
2017-06-12 16:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (23.60 KB, patch)
2017-06-12 16:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.41 KB, patch)
2017-06-12 16:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Remove old offset table schema file (2.67 KB, patch)
2017-06-12 17:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add new offset table schema file (3.20 KB, patch)
2017-06-12 17:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add offset for rental fees (2.01 KB, patch)
2017-06-12 17:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.40 KB, patch)
2017-06-12 17:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update existing schema files (2.86 KB, patch)
2017-06-12 17:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update database (3.51 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.14 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (23.61 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.41 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Remove old offset table schema file (2.67 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add new offset table schema file (3.20 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add offset for rental fees (2.01 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.83 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update existing schema files (2.86 KB, patch)
2017-08-03 14:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update database (3.51 KB, patch)
2017-08-08 14:38 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.14 KB, patch)
2017-08-08 14:38 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (23.61 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.29 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Remove old offset table schema file (2.67 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add new offset table schema file (3.20 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add offset for rental fees (2.01 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.83 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update existing schema files (2.86 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 [QA Followup] - Fix minor issues with unit tests (1.40 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 [QA Followup] - Only use plural modules in other modules (1.95 KB, patch)
2017-08-08 14:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 - Update database (3.56 KB, patch)
2017-08-23 16:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Add Koha modules for offsets (3.19 KB, patch)
2017-08-23 16:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Resurrect account offsets table (23.66 KB, patch)
2017-08-23 16:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Unit Tests (5.34 KB, patch)
2017-08-23 16:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Remove old offset table schema file (2.72 KB, patch)
2017-08-23 16:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Add new offset table schema file (3.25 KB, patch)
2017-08-23 16:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Add offset for rental fees (2.06 KB, patch)
2017-08-23 16:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.88 KB, patch)
2017-08-23 16:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Update existing schema files (2.91 KB, patch)
2017-08-23 16:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 [QA Followup] - Fix minor issues with unit tests (1.45 KB, patch)
2017-08-23 16:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 [QA Followup] - Only use plural modules in other modules (2.00 KB, patch)
2017-08-23 16:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826 - Add account offset type table (8.48 KB, patch)
2017-09-01 12:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Update database (3.56 KB, patch)
2017-09-29 13:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Add Koha::Account::Offset(s) modules (3.20 KB, patch)
2017-09-29 14:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Resurrect account offsets table (23.66 KB, patch)
2017-09-29 14:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826; Unit Tests (5.34 KB, patch)
2017-09-29 14:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Remove old offset table schema file (2.72 KB, patch)
2017-09-29 14:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Remove old offset table schema file (2.86 KB, patch)
2017-09-29 14:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Add new offset table schema file (3.25 KB, patch)
2017-09-29 14:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Add offset for rental fees (2.06 KB, patch)
2017-09-29 14:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.88 KB, patch)
2017-09-29 14:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: (QA followup) Fix minor issues with unit tests (1.45 KB, patch)
2017-09-29 14:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: (QA followup) Only use plural modules in other modules (2.00 KB, patch)
2017-09-29 14:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Add account offset type table (8.54 KB, patch)
2017-09-29 14:02 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: (QA followup) POD fixes (1.31 KB, patch)
2017-09-29 14:02 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14826: Update database (3.56 KB, patch)
2017-10-11 11:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add Koha::Account::Offset(s) modules (3.20 KB, patch)
2017-10-11 11:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Resurrect account offsets table (23.66 KB, patch)
2017-10-11 11:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826; Unit Tests (5.34 KB, patch)
2017-10-11 11:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Remove old offset table schema file (2.72 KB, patch)
2017-10-11 11:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Remove old offset table schema file (2.86 KB, patch)
2017-10-11 11:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add new offset table schema file (3.25 KB, patch)
2017-10-11 11:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add offset for rental fees (2.06 KB, patch)
2017-10-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.90 KB, patch)
2017-10-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: (QA followup) Fix minor issues with unit tests (1.45 KB, patch)
2017-10-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: (QA followup) Only use plural modules in other modules (2.00 KB, patch)
2017-10-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add account offset type table (8.54 KB, patch)
2017-10-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: (QA followup) POD fixes (1.31 KB, patch)
2017-10-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 [QA Followup] - Correct number of tests run following rebase (637 bytes, patch)
2017-10-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Update database (3.56 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add Koha::Account::Offset(s) modules (3.20 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Resurrect account offsets table (23.66 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826; Unit Tests (5.34 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Remove old offset table schema file (2.72 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Remove old offset table schema file (2.86 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add new offset table schema file (3.25 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add offset for rental fees (2.06 KB, patch)
2017-10-12 16:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn (5.90 KB, patch)
2017-10-12 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: (QA followup) Fix minor issues with unit tests (1.45 KB, patch)
2017-10-12 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: (QA followup) Only use plural modules in other modules (2.00 KB, patch)
2017-10-12 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: Add account offset type table (8.54 KB, patch)
2017-10-12 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: (QA followup) POD fixes (1.31 KB, patch)
2017-10-12 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 [QA Followup] - Correct number of tests run following rebase (637 bytes, patch)
2017-10-12 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826 [QA Followup] - Make db update idempotent (1.29 KB, patch)
2017-10-12 16:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14826: account_offset_types.sql is not in the mandatory subdir (1.11 KB, patch)
2017-10-20 21:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14826: (QA Follow-up) Remove obsolete DBIx schema file (2.85 KB, patch)
2017-10-23 10:50 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2015-09-15 15:09:04 UTC
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.
Comment 1 Claudio 2015-12-03 13:00:21 UTC
Resolve this bug opens many oportunities of enhancements that are being waiting by the librarian communitiy.
Comment 2 Kyle M Hall 2016-07-12 13:26:08 UTC
*** Bug 16902 has been marked as a duplicate of this bug. ***
Comment 3 Kyle M Hall 2016-07-12 16:37:35 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2016-07-12 16:37:42 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2016-07-12 16:37:44 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2016-07-12 16:37:47 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall 2016-07-12 17:37:17 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall 2016-07-12 17:46:14 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall 2016-07-12 17:47:22 UTC
Setting back to assigned until I can write some unit tests.
Comment 10 Kyle M Hall 2016-07-21 18:45:12 UTC
Created attachment 53602 [details] [review]
Bug 14826 - Update database
Comment 11 Kyle M Hall 2016-07-21 18:45:21 UTC
Created attachment 53603 [details] [review]
Bug 14826 - Update table schema
Comment 12 Kyle M Hall 2016-07-21 18:45:23 UTC
Created attachment 53604 [details] [review]
Bug 14826 - Add Koha modules for offsets
Comment 13 Kyle M Hall 2016-07-21 18:45:26 UTC
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
Comment 14 Kyle M Hall 2016-07-21 18:45:28 UTC Comment hidden (obsolete)
Comment 15 Kyle M Hall 2016-07-21 19:04:46 UTC
Created attachment 53607 [details] [review]
Bug 14826 - Unit Tests
Comment 16 Aleisha Amohia 2016-08-23 03:05:54 UTC
fatal: sha1 information is lacking or useless (C4/Accounts.pm)
Comment 17 Kyle M Hall 2017-01-19 14:43:42 UTC
Created attachment 59254 [details] [review]
Bug 14826 - Update database
Comment 18 Kyle M Hall 2017-01-19 14:43:50 UTC
Created attachment 59255 [details] [review]
Bug 14826 - Add Koha modules for offsets
Comment 19 Kyle M Hall 2017-01-19 14:43:53 UTC
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
Comment 20 Kyle M Hall 2017-01-19 14:43:56 UTC
Created attachment 59257 [details] [review]
Bug 14826 - Unit Tests
Comment 21 Kyle M Hall 2017-01-19 14:44:00 UTC
Created attachment 59258 [details] [review]
Bug 14826 - Update table schemas
Comment 22 Josef Moravec 2017-01-23 21:32:17 UTC
Looks good, just when I check out an item with type with defined charge, this charge doesn't make line in acount_offsets.
Comment 23 Kyle M Hall 2017-02-15 16:25:08 UTC
Created attachment 60270 [details] [review]
Bug 14826 - Update database
Comment 24 Kyle M Hall 2017-02-15 16:25:17 UTC
Created attachment 60271 [details] [review]
Bug 14826 - Add Koha modules for offsets
Comment 25 Kyle M Hall 2017-02-15 16:25:20 UTC
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
Comment 26 Kyle M Hall 2017-02-15 16:25:24 UTC
Created attachment 60273 [details] [review]
Bug 14826 - Unit Tests
Comment 27 Kyle M Hall 2017-02-15 16:25:28 UTC
Created attachment 60274 [details] [review]
Bug 14826 - Remove old offset table schema file
Comment 28 Kyle M Hall 2017-02-15 16:25:31 UTC
Created attachment 60275 [details] [review]
Bug 14826 - Add new offset table schema file
Comment 29 Kyle M Hall 2017-02-15 16:25:35 UTC
Created attachment 60276 [details] [review]
Bug 14826 - Update existing schema files
Comment 30 Kyle M Hall 2017-02-15 16:25:39 UTC
Created attachment 60277 [details] [review]
Bug 14826 - Add offset for rental fees
Comment 31 Kyle M Hall 2017-02-15 16:29:50 UTC
Created attachment 60278 [details] [review]
Bug 14826 - Add offset for rental fees
Comment 32 Josef Moravec 2017-02-19 21:01:25 UTC
Created attachment 60439 [details] [review]
[SIGNED-OFF] Bug 14826 - Update database

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 33 Josef Moravec 2017-02-19 21:01:32 UTC
Created attachment 60440 [details] [review]
[SIGNED-OFF] Bug 14826 - Add Koha modules for offsets

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 34 Josef Moravec 2017-02-19 21:01:46 UTC
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>
Comment 35 Josef Moravec 2017-02-19 21:01:54 UTC
Created attachment 60442 [details] [review]
[SIGNED-OFF] Bug 14826 - Unit Tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 36 Josef Moravec 2017-02-19 21:02:01 UTC
Created attachment 60443 [details] [review]
[SIGNED-OFF] Bug 14826 - Remove old offset table schema file

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 37 Josef Moravec 2017-02-19 21:02:08 UTC
Created attachment 60444 [details] [review]
[SIGNED-OFF] Bug 14826 - Add new offset table schema file

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 38 Josef Moravec 2017-02-19 21:02:14 UTC
Created attachment 60445 [details] [review]
[SIGNED-OFF] Bug 14826 - Update existing schema files

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 39 Josef Moravec 2017-02-19 21:02:22 UTC
Created attachment 60446 [details] [review]
[SIGNED-OFF] Bug 14826 - Add offset for rental fees

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 40 Jonathan Druart 2017-03-30 19:25:02 UTC
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
Comment 41 Kyle M Hall 2017-06-06 13:36:57 UTC
Created attachment 64051 [details] [review]
Bug 14826 - Update database

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 42 Kyle M Hall 2017-06-06 13:37:07 UTC
Created attachment 64052 [details] [review]
Bug 14826 - Add Koha modules for offsets

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 43 Kyle M Hall 2017-06-06 13:37:12 UTC
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>
Comment 44 Kyle M Hall 2017-06-06 13:37:16 UTC
Created attachment 64054 [details] [review]
Bug 14826 - Unit Tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 45 Kyle M Hall 2017-06-06 13:37:20 UTC
Created attachment 64055 [details] [review]
Bug 14826 - Remove old offset table schema file

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 46 Kyle M Hall 2017-06-06 13:37:24 UTC
Created attachment 64056 [details] [review]
Bug 14826 - Add new offset table schema file

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 47 Kyle M Hall 2017-06-06 13:37:28 UTC
Created attachment 64057 [details] [review]
Bug 14826 - Add offset for rental fees

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 48 Kyle M Hall 2017-06-06 13:37:32 UTC
Created attachment 64058 [details] [review]
Bug 14826 - Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn
Comment 49 Kyle M Hall 2017-06-06 13:37:36 UTC
Created attachment 64059 [details] [review]
Bug 14826 - Update existing schema files
Comment 50 Kyle M Hall 2017-06-06 13:38:38 UTC
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
Comment 51 Kyle M Hall 2017-06-12 16:59:39 UTC Comment hidden (obsolete)
Comment 52 Kyle M Hall 2017-06-12 16:59:48 UTC Comment hidden (obsolete)
Comment 53 Kyle M Hall 2017-06-12 16:59:52 UTC Comment hidden (obsolete)
Comment 54 Kyle M Hall 2017-06-12 16:59:56 UTC Comment hidden (obsolete)
Comment 55 Kyle M Hall 2017-06-12 17:00:01 UTC Comment hidden (obsolete)
Comment 56 Kyle M Hall 2017-06-12 17:00:06 UTC Comment hidden (obsolete)
Comment 57 Kyle M Hall 2017-06-12 17:00:10 UTC Comment hidden (obsolete)
Comment 58 Kyle M Hall 2017-06-12 17:00:16 UTC Comment hidden (obsolete)
Comment 59 Kyle M Hall 2017-06-12 17:00:20 UTC Comment hidden (obsolete)
Comment 60 Kyle M Hall 2017-08-03 14:04:04 UTC Comment hidden (obsolete)
Comment 61 Kyle M Hall 2017-08-03 14:04:13 UTC Comment hidden (obsolete)
Comment 62 Kyle M Hall 2017-08-03 14:04:18 UTC Comment hidden (obsolete)
Comment 63 Kyle M Hall 2017-08-03 14:04:22 UTC Comment hidden (obsolete)
Comment 64 Kyle M Hall 2017-08-03 14:04:26 UTC Comment hidden (obsolete)
Comment 65 Kyle M Hall 2017-08-03 14:04:31 UTC Comment hidden (obsolete)
Comment 66 Kyle M Hall 2017-08-03 14:04:35 UTC Comment hidden (obsolete)
Comment 67 Kyle M Hall 2017-08-03 14:04:39 UTC Comment hidden (obsolete)
Comment 68 Kyle M Hall 2017-08-03 14:04:43 UTC Comment hidden (obsolete)
Comment 69 Kyle M Hall 2017-08-08 14:38:45 UTC Comment hidden (obsolete)
Comment 70 Kyle M Hall 2017-08-08 14:38:55 UTC Comment hidden (obsolete)
Comment 71 Kyle M Hall 2017-08-08 14:39:00 UTC Comment hidden (obsolete)
Comment 72 Kyle M Hall 2017-08-08 14:39:05 UTC Comment hidden (obsolete)
Comment 73 Kyle M Hall 2017-08-08 14:39:10 UTC Comment hidden (obsolete)
Comment 74 Kyle M Hall 2017-08-08 14:39:15 UTC Comment hidden (obsolete)
Comment 75 Kyle M Hall 2017-08-08 14:39:19 UTC Comment hidden (obsolete)
Comment 76 Kyle M Hall 2017-08-08 14:39:24 UTC Comment hidden (obsolete)
Comment 77 Kyle M Hall 2017-08-08 14:39:29 UTC Comment hidden (obsolete)
Comment 78 Kyle M Hall 2017-08-08 14:39:33 UTC Comment hidden (obsolete)
Comment 79 Kyle M Hall 2017-08-08 14:39:38 UTC Comment hidden (obsolete)
Comment 80 Tomás Cohen Arazi 2017-08-23 16:04:12 UTC Comment hidden (obsolete)
Comment 81 Tomás Cohen Arazi 2017-08-23 16:04:22 UTC Comment hidden (obsolete)
Comment 82 Tomás Cohen Arazi 2017-08-23 16:04:31 UTC Comment hidden (obsolete)
Comment 83 Tomás Cohen Arazi 2017-08-23 16:04:38 UTC Comment hidden (obsolete)
Comment 84 Tomás Cohen Arazi 2017-08-23 16:04:48 UTC Comment hidden (obsolete)
Comment 85 Tomás Cohen Arazi 2017-08-23 16:04:55 UTC Comment hidden (obsolete)
Comment 86 Tomás Cohen Arazi 2017-08-23 16:05:03 UTC Comment hidden (obsolete)
Comment 87 Tomás Cohen Arazi 2017-08-23 16:05:11 UTC Comment hidden (obsolete)
Comment 88 Tomás Cohen Arazi 2017-08-23 16:05:19 UTC Comment hidden (obsolete)
Comment 89 Tomás Cohen Arazi 2017-08-23 16:05:27 UTC Comment hidden (obsolete)
Comment 90 Tomás Cohen Arazi 2017-08-23 16:05:35 UTC Comment hidden (obsolete)
Comment 91 Tomás Cohen Arazi 2017-08-23 16:09:06 UTC
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!
Comment 92 Kyle M Hall 2017-09-01 12:07:56 UTC
Created attachment 66716 [details] [review]
Bug 14826 - Add account offset type table
Comment 93 Tomás Cohen Arazi 2017-09-29 13:59:47 UTC
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>
Comment 94 Tomás Cohen Arazi 2017-09-29 14:00:07 UTC
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>
Comment 95 Tomás Cohen Arazi 2017-09-29 14:00:24 UTC
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>
Comment 96 Tomás Cohen Arazi 2017-09-29 14:00:40 UTC
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>
Comment 97 Tomás Cohen Arazi 2017-09-29 14:00:53 UTC
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>
Comment 98 Tomás Cohen Arazi 2017-09-29 14:01:04 UTC
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>
Comment 99 Tomás Cohen Arazi 2017-09-29 14:01:14 UTC
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>
Comment 100 Tomás Cohen Arazi 2017-09-29 14:01:23 UTC
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>
Comment 101 Tomás Cohen Arazi 2017-09-29 14:01:34 UTC
Created attachment 67461 [details] [review]
Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 102 Tomás Cohen Arazi 2017-09-29 14:01:46 UTC
Created attachment 67462 [details] [review]
Bug 14826: (QA followup) Fix minor issues with unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 103 Tomás Cohen Arazi 2017-09-29 14:01:58 UTC
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>
Comment 104 Tomás Cohen Arazi 2017-09-29 14:02:09 UTC
Created attachment 67464 [details] [review]
Bug 14826: Add account offset type table

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 105 Tomás Cohen Arazi 2017-09-29 14:02:24 UTC
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>
Comment 106 Tomás Cohen Arazi 2017-09-29 14:07:11 UTC
Patches rebased.
Comment 107 Tomás Cohen Arazi 2017-09-29 14:09:51 UTC
@RM: Please note that I obsoleted the (non-applying) schema file changes. They need to be generated when pushing.
Comment 108 Marcel de Rooy 2017-10-06 09:24:14 UTC
RM: Whats the plan with this patch set? Some reports in the SO queue depend on it.
Comment 109 Martha Fuerst 2017-10-06 16:19:56 UTC
RM: Really excited for this patch set, given the dependencies. Do we know what the plan is? Thanks!
Comment 110 Martha Fuerst 2017-10-06 16:21:27 UTC
RM: Really excited for this patch set, given the dependencies. Do we know what the plan is? Thanks!
Comment 111 Katrin Fischer 2017-10-08 15:01:47 UTC
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.
Comment 112 Jonathan Druart 2017-10-09 20:14:52 UTC
Please rebase

Applying: Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn
error: sha1 information is lacking or useless (t/db_dependent/Circulation.t).
Comment 113 Kyle M Hall 2017-10-11 11:26:25 UTC
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>
Comment 114 Kyle M Hall 2017-10-11 11:26:35 UTC
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>
Comment 115 Kyle M Hall 2017-10-11 11:26:39 UTC
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>
Comment 116 Kyle M Hall 2017-10-11 11:26:44 UTC
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>
Comment 117 Kyle M Hall 2017-10-11 11:26:49 UTC
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>
Comment 118 Kyle M Hall 2017-10-11 11:26:54 UTC
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>
Comment 119 Kyle M Hall 2017-10-11 11:26:59 UTC
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>
Comment 120 Kyle M Hall 2017-10-11 11:27:05 UTC
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>
Comment 121 Kyle M Hall 2017-10-11 11:27:10 UTC
Created attachment 67944 [details] [review]
Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 122 Kyle M Hall 2017-10-11 11:27:15 UTC
Created attachment 67945 [details] [review]
Bug 14826: (QA followup) Fix minor issues with unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 123 Kyle M Hall 2017-10-11 11:27:19 UTC
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>
Comment 124 Kyle M Hall 2017-10-11 11:27:25 UTC
Created attachment 67947 [details] [review]
Bug 14826: Add account offset type table

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 125 Kyle M Hall 2017-10-11 11:27:30 UTC
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>
Comment 126 Kyle M Hall 2017-10-11 11:27:35 UTC
Created attachment 67949 [details] [review]
Bug 14826 [QA Followup] - Correct number of tests run following rebase
Comment 127 Jonathan Druart 2017-10-11 16:45:23 UTC
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
Comment 128 Kyle M Hall 2017-10-12 16:02:01 UTC
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>
Comment 129 Kyle M Hall 2017-10-12 16:02:15 UTC
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>
Comment 130 Kyle M Hall 2017-10-12 16:02:22 UTC
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>
Comment 131 Kyle M Hall 2017-10-12 16:02:31 UTC
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>
Comment 132 Kyle M Hall 2017-10-12 16:02:37 UTC
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>
Comment 133 Kyle M Hall 2017-10-12 16:02:44 UTC
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>
Comment 134 Kyle M Hall 2017-10-12 16:02:51 UTC
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>
Comment 135 Kyle M Hall 2017-10-12 16:02:57 UTC
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>
Comment 136 Kyle M Hall 2017-10-12 16:03:02 UTC
Created attachment 68026 [details] [review]
Bug 14826: Add unit tests for _FixAccountForLostAndReturned and _FixOverduesOnReturn

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 137 Kyle M Hall 2017-10-12 16:03:09 UTC
Created attachment 68027 [details] [review]
Bug 14826: (QA followup) Fix minor issues with unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 138 Kyle M Hall 2017-10-12 16:03:16 UTC
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>
Comment 139 Kyle M Hall 2017-10-12 16:03:22 UTC
Created attachment 68029 [details] [review]
Bug 14826: Add account offset type table

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 140 Kyle M Hall 2017-10-12 16:03:30 UTC
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>
Comment 141 Kyle M Hall 2017-10-12 16:03:36 UTC
Created attachment 68031 [details] [review]
Bug 14826 [QA Followup] - Correct number of tests run following rebase
Comment 142 Kyle M Hall 2017-10-12 16:03:42 UTC
Created attachment 68032 [details] [review]
Bug 14826 [QA Followup] - Make db update idempotent
Comment 143 Jonathan Druart 2017-10-20 20:15:40 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 144 Jonathan Druart 2017-10-20 21:14:50 UTC
Created attachment 68334 [details] [review]
Bug 14826: account_offset_types.sql is not in the mandatory subdir
Comment 145 Jonathan Druart 2017-10-20 21:16:12 UTC
(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
Comment 146 Marcel de Rooy 2017-10-23 10:50:46 UTC
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>
Comment 147 Kyle M Hall 2017-10-23 13:37:17 UTC
(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!
Comment 148 Kyle M Hall 2017-10-23 13:37:55 UTC
(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!