Bug 24080

Summary: Add a 'payout' process to accounts
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Fines and feesAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: new feature    
Priority: P5 - low CC: 1joynelson, gmcharlt, koha-bugs, kyle, lucy.vaux-harvey, maryse.simard, testopia, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This new feature adds an audited process for paying out excess credits on a patrons account.
Version(s) released in:
20.05.00
Circulation function:
Bug Depends on: 23805    
Bug Blocks: 24252, 24300, 24951    
Attachments: Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add account_payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add updatecharge payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add updatecharge payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add updatecharge payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: Payout account debit type
Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add updatecharge payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add updatecharge payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: (QA follow-up) Add missing filters
Bug 24080: Adjust text in modal
Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add updatecharge payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: Adjust text in modal
Bug 24080: (QA follow-up) Remove processing for removed field
Bug 24080: Payout account debit type
Bug 24080: Add 'payout' method to Koha::Account::Line
Bug 24080: Add updatecharge payout permission
Bug 24080: Add payout option to patron account page
Bug 24080: Adjust text in modal
Bug 24080: (QA follow-up) Remove processing for removed field

Description Martin Renvoize (ashimema) 2019-11-21 11:12:13 UTC
There are times when a patron may end up with surplus credit on their account. The library should be able to pay out this credit as required and record the payout as a transaction.
Comment 1 Martin Renvoize (ashimema) 2019-11-21 15:50:44 UTC
Created attachment 95665 [details] [review]
Bug 24080: Payout account debit type
Comment 2 Martin Renvoize (ashimema) 2019-11-21 15:50:47 UTC
Created attachment 95666 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff
Comment 3 Martin Renvoize (ashimema) 2019-11-21 15:50:50 UTC
Created attachment 95667 [details] [review]
Bug 24080: Add account_payout permission
Comment 4 Martin Renvoize (ashimema) 2019-11-21 15:50:52 UTC
Created attachment 95668 [details] [review]
Bug 24080: Add payout option to patron account page
Comment 5 Martin Renvoize (ashimema) 2019-11-21 16:03:43 UTC
Created attachment 95669 [details] [review]
Bug 24080: Payout account debit type
Comment 6 Martin Renvoize (ashimema) 2019-11-21 16:03:46 UTC
Created attachment 95670 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff
Comment 7 Martin Renvoize (ashimema) 2019-11-21 16:03:49 UTC
Created attachment 95671 [details] [review]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.
Comment 8 Martin Renvoize (ashimema) 2019-11-21 16:03:52 UTC
Created attachment 95672 [details] [review]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff
Comment 9 Maryse Simard 2019-11-22 19:44:15 UTC
> Test Plan:
> 1) Run the included tests and verify they pass.

I can't seem to find which tests this refers to. Could they be missing?
Comment 10 Martin Renvoize (ashimema) 2019-11-25 15:18:53 UTC
Created attachment 95793 [details] [review]
Bug 24080: Payout account debit type
Comment 11 Martin Renvoize (ashimema) 2019-11-25 15:18:56 UTC
Created attachment 95794 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff
Comment 12 Martin Renvoize (ashimema) 2019-11-25 15:18:59 UTC
Created attachment 95795 [details] [review]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.
Comment 13 Martin Renvoize (ashimema) 2019-11-25 15:19:02 UTC
Created attachment 95796 [details] [review]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff
Comment 14 Martin Renvoize (ashimema) 2019-11-25 15:19:51 UTC
Oops, seems I managed to miss committing the tests.. I've corrected that now.. thanks for bringing it to my attention.
Comment 15 Martin Renvoize (ashimema) 2019-12-16 13:23:05 UTC
Created attachment 96332 [details] [review]
Bug 24080: Payout account debit type
Comment 16 Martin Renvoize (ashimema) 2019-12-16 13:23:09 UTC
Created attachment 96333 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff
Comment 17 Martin Renvoize (ashimema) 2019-12-16 13:23:12 UTC
Created attachment 96334 [details] [review]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.
Comment 18 Martin Renvoize (ashimema) 2019-12-16 13:23:15 UTC
Created attachment 96335 [details] [review]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff
Comment 19 Martin Renvoize (ashimema) 2019-12-16 13:24:25 UTC
Question.. should we prevent staff from paying out to themselves as a security measure?
Comment 20 Kyle M Hall (khall) 2019-12-20 12:01:15 UTC
Created attachment 96519 [details] [review]
Bug 24080: Payout account debit type

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 21 Kyle M Hall (khall) 2019-12-20 12:02:55 UTC
Created attachment 96520 [details] [review]
Bug 24080: Payout account debit type

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 22 Kyle M Hall (khall) 2019-12-20 12:03:03 UTC
Created attachment 96521 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Kyle M Hall (khall) 2019-12-20 12:03:06 UTC
Created attachment 96522 [details] [review]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 24 Kyle M Hall (khall) 2019-12-20 12:03:09 UTC
Created attachment 96523 [details] [review]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 25 Tomás Cohen Arazi (tcohen) 2019-12-23 13:04:37 UTC
Created attachment 96597 [details] [review]
Bug 24080: Payout account debit type

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 26 Tomás Cohen Arazi (tcohen) 2019-12-23 13:04:41 UTC
Created attachment 96598 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 27 Tomás Cohen Arazi (tcohen) 2019-12-23 13:04:45 UTC
Created attachment 96599 [details] [review]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 28 Tomás Cohen Arazi (tcohen) 2019-12-23 13:04:49 UTC
Created attachment 96600 [details] [review]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 29 Tomás Cohen Arazi (tcohen) 2019-12-23 13:04:53 UTC
Created attachment 96601 [details] [review]
Bug 24080: (QA follow-up) Add missing filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 30 Tomás Cohen Arazi (tcohen) 2019-12-23 13:04:56 UTC
Created attachment 96602 [details] [review]
Bug 24080: Adjust text in modal

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 31 Martin Renvoize (ashimema) 2019-12-23 15:00:16 UTC
Created attachment 96605 [details] [review]
Bug 24080: Payout account debit type

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 32 Martin Renvoize (ashimema) 2019-12-23 15:00:19 UTC
Created attachment 96606 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 33 Martin Renvoize (ashimema) 2019-12-23 15:00:23 UTC
Created attachment 96607 [details] [review]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 34 Martin Renvoize (ashimema) 2019-12-23 15:00:27 UTC
Created attachment 96608 [details] [review]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 35 Martin Renvoize (ashimema) 2019-12-23 15:00:30 UTC
Created attachment 96609 [details] [review]
Bug 24080: Adjust text in modal

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 36 Martin Renvoize (ashimema) 2019-12-23 15:00:33 UTC
Created attachment 96610 [details] [review]
Bug 24080: (QA follow-up) Remove processing for removed field
Comment 37 Tomás Cohen Arazi (tcohen) 2020-01-02 14:20:08 UTC
Created attachment 96748 [details] [review]
Bug 24080: Payout account debit type

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 38 Tomás Cohen Arazi (tcohen) 2020-01-02 14:20:12 UTC
Created attachment 96749 [details] [review]
Bug 24080: Add 'payout' method to Koha::Account::Line

This enhancement adds a 'payout' method to Koha::Account::Line which can
be used to 'pay out' a credit to a patron.

When such a credit is 'paid out' this method will create a corresponding
account debit line with an amount equal to the amountoutstanding on the
original credit and the two acocuntlines will be immediately applied against
each other.

Test Plan:
1) Run the included tests and verify they pass.
2) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 39 Tomás Cohen Arazi (tcohen) 2020-01-02 14:20:17 UTC
Created attachment 96750 [details] [review]
Bug 24080: Add updatecharge payout permission

Add a new subpermission called 'payout' to the 'updatecharges'
permission group which will allow/prevent payout actions to be performed
by staff.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 40 Tomás Cohen Arazi (tcohen) 2020-01-02 14:20:21 UTC
Created attachment 96751 [details] [review]
Bug 24080: Add payout option to patron account page

This enhancement adds a refined workflow to allow librarians to pay out
money to patrons and record these payouts on the patrons account.

The use case is that a patron has somehow accrued credit, through a
refund perhaps, and the library wants to be able to physically hand over
some money to balance the patrons account.

Test plan:
1) Undertake a series of transactions that result in some outstanding
   credit on a patrons account.
2) Note that a new 'Issue payout' button appears next to a credit with
   an outstanding balance (but only if your user has the payout
   permission or is a superlibrarian)
3) Click the 'Issue payout' button and a modal should appear
   pre-populated with the amountoutstanding.
4) You should be able to edit the amount you wish to payout, make
   payment or cancel.
5) Signoff

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 41 Tomás Cohen Arazi (tcohen) 2020-01-02 14:20:25 UTC
Created attachment 96752 [details] [review]
Bug 24080: Adjust text in modal

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 42 Tomás Cohen Arazi (tcohen) 2020-01-02 14:20:29 UTC
Created attachment 96753 [details] [review]
Bug 24080: (QA follow-up) Remove processing for removed field

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 43 Martin Renvoize (ashimema) 2020-01-03 16:36:13 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 44 Martin Renvoize (ashimema) 2020-01-03 16:47:41 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 45 Joy Nelson 2020-01-14 00:57:11 UTC
not backported to 19.11.x