Bug 23321

Summary: Add 'cash registers' to the accounts system
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Staff interfaceAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: new feature    
Priority: P5 - low CC: black23, gmcharlt, maryse.simard, 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 the ability to define cash registers in Koha and assign transactions to them. It introduces the new `UseCashRegisters` system preference which when enabled will expose the cash register management screen under the administration area and also require a cash register to be associated with any transaction of the payment type `CASH`.
Version(s) released in:
19.11.00
Circulation function:
Bug Depends on: 6759    
Bug Blocks: 23049, 24338, 24481, 24786, 24815, 24828, 26946, 29385    
Attachments: Bug 23321: Add cash_registers table
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: Add cash_registers table
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: Koha::Library additions
Bug 23321: Add cash_registers table
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: Koha::Library additions
Bug 23321: Add cash_registers table
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug 23321: Koha::Library additions
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: Add cash_registers table
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug 23321: Koha::Library additions
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: Add cash_registers table
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Koha::Library additions
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: (follow-up) Add cash register to admin-menu
Bug 23321: (follow-up) Correction to exception logic
Bug 23321: (follow-up) Add test for Koha::Account change
Bug 23321: (follow-up) Add test for Koha::Account change
Bug 23321: Add cash_registers table
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Koha::Library additions
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: (follow-up) Add cash register to admin-menu
Bug 23321: (follow-up) Correction to exception logic
Bug 23321: (follow-up) Add test for Koha::Account change
Bug 23321: [DO NOT PUSH] DBIC Classes
Bug 23321: Add cash_registers table
Bug 23321: Add cash register preference
Bug 23321: Add cash register permission
Bug 23321: Add cash register management
Bug 23321: Koha::Library additions
Bug 23321: Allow setting of branch default
Bug 23321: Add cash register support to paycollect
Bug 23321: (follow-up) Require cash registers for payments
Bug 23321: (follow-up) Add cash register to admin-menu
Bug 23321: (follow-up) Correction to exception logic
Bug 23321: (follow-up) Add test for Koha::Account change
Bug 23321: (QA follow-up) Make atomic update idempotent
Bug 23321: (QA follow-up) Booleans
Bug 23321: (QA follow-up) Add missing TT filters
Bug 23321: Add Koha::Object(s) info to the schema
Bug 23321: (QA follow-up) Accounts vs. Accounting
Bug 23321: (RM follow-up) Accounts vs. Accounting

Description Martin Renvoize (ashimema) 2019-07-16 08:35:46 UTC
It would be helpful to track where money was taken/refunded from to enable an end of day procedure for tracking cash and other transactions.
Comment 1 Martin Renvoize (ashimema) 2019-07-18 16:12:10 UTC
Created attachment 91596 [details] [review]
Bug 23321: Add cash_registers table
Comment 2 Martin Renvoize (ashimema) 2019-07-18 16:12:13 UTC
Created attachment 91597 [details] [review]
Bug 23321: [DO NOT PUSH] DBIC Classes
Comment 3 Martin Renvoize (ashimema) 2019-07-18 16:12:16 UTC
Created attachment 91598 [details] [review]
Bug 23321: Add cash register preference
Comment 4 Martin Renvoize (ashimema) 2019-07-18 16:12:19 UTC
Created attachment 91599 [details] [review]
Bug 23321: Add cash register permission
Comment 5 Martin Renvoize (ashimema) 2019-07-18 16:12:22 UTC
Created attachment 91600 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.
Comment 6 Martin Renvoize (ashimema) 2019-07-18 16:12:25 UTC
Created attachment 91601 [details] [review]
Bug 23321: Allow setting of branch default
Comment 7 Martin Renvoize (ashimema) 2019-07-18 16:12:28 UTC
Created attachment 91602 [details] [review]
Bug 23321: Add cash register support to paycollect
Comment 8 Martin Renvoize (ashimema) 2019-07-19 08:23:24 UTC
Created attachment 91621 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.
Comment 9 Martin Renvoize (ashimema) 2019-08-08 11:32:01 UTC
Created attachment 92057 [details] [review]
Bug 23321: Add cash_registers table
Comment 10 Martin Renvoize (ashimema) 2019-08-08 11:32:04 UTC
Created attachment 92058 [details] [review]
Bug 23321: [DO NOT PUSH] DBIC Classes
Comment 11 Martin Renvoize (ashimema) 2019-08-08 11:32:07 UTC
Created attachment 92059 [details] [review]
Bug 23321: Add cash register preference
Comment 12 Martin Renvoize (ashimema) 2019-08-08 11:32:10 UTC
Created attachment 92060 [details] [review]
Bug 23321: Add cash register permission
Comment 13 Martin Renvoize (ashimema) 2019-08-08 11:32:14 UTC
Created attachment 92061 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.
Comment 14 Martin Renvoize (ashimema) 2019-08-08 11:32:17 UTC
Created attachment 92062 [details] [review]
Bug 23321: Allow setting of branch default
Comment 15 Martin Renvoize (ashimema) 2019-08-08 11:32:20 UTC
Created attachment 92063 [details] [review]
Bug 23321: Add cash register support to paycollect
Comment 16 Martin Renvoize (ashimema) 2019-08-08 11:32:23 UTC
Created attachment 92064 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.
Comment 17 Martin Renvoize (ashimema) 2019-08-08 11:32:26 UTC
Created attachment 92065 [details] [review]
Bug 23321: Koha::Library additions
Comment 18 Martin Renvoize (ashimema) 2019-08-08 15:26:39 UTC
Created attachment 92083 [details] [review]
Bug 23321: Add cash_registers table
Comment 19 Martin Renvoize (ashimema) 2019-08-08 15:26:42 UTC
Created attachment 92084 [details] [review]
Bug 23321: [DO NOT PUSH] DBIC Classes
Comment 20 Martin Renvoize (ashimema) 2019-08-08 15:26:45 UTC
Created attachment 92085 [details] [review]
Bug 23321: Add cash register preference
Comment 21 Martin Renvoize (ashimema) 2019-08-08 15:26:48 UTC
Created attachment 92086 [details] [review]
Bug 23321: Add cash register permission
Comment 22 Martin Renvoize (ashimema) 2019-08-08 15:26:51 UTC
Created attachment 92087 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.
Comment 23 Martin Renvoize (ashimema) 2019-08-08 15:26:54 UTC
Created attachment 92088 [details] [review]
Bug 23321: Allow setting of branch default
Comment 24 Martin Renvoize (ashimema) 2019-08-08 15:26:57 UTC
Created attachment 92089 [details] [review]
Bug 23321: Add cash register support to paycollect
Comment 25 Martin Renvoize (ashimema) 2019-08-08 15:27:01 UTC
Created attachment 92090 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.
Comment 26 Martin Renvoize (ashimema) 2019-08-08 15:27:04 UTC
Created attachment 92091 [details] [review]
Bug 23321: Koha::Library additions
Comment 27 Martin Renvoize (ashimema) 2019-08-21 13:10:21 UTC
Created attachment 92394 [details] [review]
Bug 23321: Add cash_registers table
Comment 28 Martin Renvoize (ashimema) 2019-08-21 13:10:24 UTC
Created attachment 92395 [details] [review]
Bug 23321: [DO NOT PUSH] DBIC Classes
Comment 29 Martin Renvoize (ashimema) 2019-08-21 13:10:27 UTC
Created attachment 92396 [details] [review]
Bug 23321: Koha::Library additions

This patch adds the relationship accessor for Cash::Registers to the
Koha::Library class and include the relevant tests.
Comment 30 Martin Renvoize (ashimema) 2019-08-21 13:10:30 UTC
Created attachment 92397 [details] [review]
Bug 23321: Add cash register preference
Comment 31 Martin Renvoize (ashimema) 2019-08-21 13:10:33 UTC
Created attachment 92398 [details] [review]
Bug 23321: Add cash register permission
Comment 32 Martin Renvoize (ashimema) 2019-08-21 13:10:36 UTC
Created attachment 92399 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.

Test plan:
1) Enable the use of cash registers by setting 'UseCashRegisters' to
   'Do'
2) Check that the 'Accounts > Manage cash registers' option now appears
   in the 'Administration' area.
3) Click through to 'Manage cash registers' and note the message
   suggesting you add your first register
4) Add you're first cash register
5) Note that the message has now been replaced by a table of cash
   registers including the one you have added in the previous step.
6) Edit the cash register created in step 4 and note that the table
   reflects the changes
7) Signoff
Comment 33 Martin Renvoize (ashimema) 2019-08-21 13:10:39 UTC
Created attachment 92400 [details] [review]
Bug 23321: Allow setting of branch default

This adds the ability to set a cash register as the default selected
option when making payments at a particular branch.

1) Note the addition of a 'Make branch default' button in each row of
   the table under 'Manage cash registers'
2) Click the button and note that the button has changed.
3) Click on an alternative cash register for the same branch and note
   that the default has been switched to the new register.
4) Click the 'unset' button on the default branch and note that there is
   no longer a default register for this branch.
5) Signoff
Comment 34 Martin Renvoize (ashimema) 2019-08-21 13:10:43 UTC
Created attachment 92401 [details] [review]
Bug 23321: Add cash register support to paycollect

This patch ties in the cash registers system to the paycollect payment
pages in the staff client.

Test plan:
1) Add some manual fees to a test patron
2) Select some fees to pay off
3) Note the addition of a select box for selecting your cash register
   upon payment.
4) Set a branch default cash register for the current branch
5) Repeat step 3 and note that the pre-selected cash register is the one
   set in step 4.
6) Unset the branch default cash register for the current branch
7) Repeat step 3 and note that there is no cash register pre-selected
8) Set 'UseCashRegisters' to 'Do not'
9) Repeat step 3 and note that there is no longer an option to select a
   cash register
10) Signoff
Comment 35 Martin Renvoize (ashimema) 2019-08-21 13:10:46 UTC
Created attachment 92402 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.

Test plan:
1) Ensure you have 'UseCashRegisters' set to 'Do'
2) Attempt to make a payment for a fee whilst logged into a branch that
   has not yet had cash registers configured.
3) Note that you are shown a warning and cannot proceed.
4) Signoff
Comment 36 Maryse Simard 2019-08-23 20:37:19 UTC
Created attachment 92467 [details] [review]
Bug 23321: Add cash_registers table

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 37 Maryse Simard 2019-08-23 20:37:22 UTC
Created attachment 92468 [details] [review]
Bug 23321: [DO NOT PUSH] DBIC Classes

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 38 Maryse Simard 2019-08-23 20:37:25 UTC
Created attachment 92469 [details] [review]
Bug 23321: Koha::Library additions

This patch adds the relationship accessor for Cash::Registers to the
Koha::Library class and include the relevant tests.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 39 Maryse Simard 2019-08-23 20:37:28 UTC
Created attachment 92470 [details] [review]
Bug 23321: Add cash register preference

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 40 Maryse Simard 2019-08-23 20:37:31 UTC
Created attachment 92471 [details] [review]
Bug 23321: Add cash register permission

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 41 Maryse Simard 2019-08-23 20:37:33 UTC
Created attachment 92472 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.

Test plan:
1) Enable the use of cash registers by setting 'UseCashRegisters' to
   'Do'
2) Check that the 'Accounts > Manage cash registers' option now appears
   in the 'Administration' area.
3) Click through to 'Manage cash registers' and note the message
   suggesting you add your first register
4) Add you're first cash register
5) Note that the message has now been replaced by a table of cash
   registers including the one you have added in the previous step.
6) Edit the cash register created in step 4 and note that the table
   reflects the changes
7) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 42 Maryse Simard 2019-08-23 20:37:36 UTC
Created attachment 92473 [details] [review]
Bug 23321: Allow setting of branch default

This adds the ability to set a cash register as the default selected
option when making payments at a particular branch.

1) Note the addition of a 'Make branch default' button in each row of
   the table under 'Manage cash registers'
2) Click the button and note that the button has changed.
3) Click on an alternative cash register for the same branch and note
   that the default has been switched to the new register.
4) Click the 'unset' button on the default branch and note that there is
   no longer a default register for this branch.
5) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 43 Maryse Simard 2019-08-23 20:37:39 UTC
Created attachment 92474 [details] [review]
Bug 23321: Add cash register support to paycollect

This patch ties in the cash registers system to the paycollect payment
pages in the staff client.

Test plan:
1) Add some manual fees to a test patron
2) Select some fees to pay off
3) Note the addition of a select box for selecting your cash register
   upon payment.
4) Set a branch default cash register for the current branch
5) Repeat step 3 and note that the pre-selected cash register is the one
   set in step 4.
6) Unset the branch default cash register for the current branch
7) Repeat step 3 and note that there is no cash register pre-selected
8) Set 'UseCashRegisters' to 'Do not'
9) Repeat step 3 and note that there is no longer an option to select a
   cash register
10) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 44 Maryse Simard 2019-08-23 20:37:42 UTC
Created attachment 92475 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.

Test plan:
1) Ensure you have 'UseCashRegisters' set to 'Do'
2) Attempt to make a payment for a fee whilst logged into a branch that
   has not yet had cash registers configured.
3) Note that you are shown a warning and cannot proceed.
4) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 45 Maryse Simard 2019-08-23 20:38:03 UTC
Followed the test plans and everything work.

I resolved a small conflict in one of the patches, moving changes in staff-global.scss to _tables.scss where the styles now reside since Bug 23013.

Some comments:
    - In the cash registers page, I noticed that there seems to be a branch filter but I can't seem to make it work...
    - I wonder if a link to the page should be added to the admin-menu.inc so it appears in the navigation on the admin pages?
Comment 46 Martin Renvoize (ashimema) 2019-09-13 15:29:45 UTC
Created attachment 92803 [details] [review]
Bug 23321: Add cash_registers table

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 47 Martin Renvoize (ashimema) 2019-09-13 15:29:49 UTC
Created attachment 92804 [details] [review]
Bug 23321: [DO NOT PUSH] DBIC Classes

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 48 Martin Renvoize (ashimema) 2019-09-13 15:29:52 UTC
Created attachment 92805 [details] [review]
Bug 23321: Add cash register preference

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 49 Martin Renvoize (ashimema) 2019-09-13 15:29:55 UTC
Created attachment 92806 [details] [review]
Bug 23321: Add cash register permission

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 50 Martin Renvoize (ashimema) 2019-09-13 15:29:59 UTC
Created attachment 92807 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.

Test plan:
1) Enable the use of cash registers by setting 'UseCashRegisters' to
   'Do'
2) Check that the 'Accounts > Manage cash registers' option now appears
   in the 'Administration' area.
3) Click through to 'Manage cash registers' and note the message
   suggesting you add your first register
4) Add you're first cash register
5) Note that the message has now been replaced by a table of cash
   registers including the one you have added in the previous step.
6) Edit the cash register created in step 4 and note that the table
   reflects the changes
7) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 51 Martin Renvoize (ashimema) 2019-09-13 15:30:02 UTC
Created attachment 92808 [details] [review]
Bug 23321: Koha::Library additions

This patch adds the relationship accessor for Cash::Registers to the
Koha::Library class and include the relevant tests.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 52 Martin Renvoize (ashimema) 2019-09-13 15:30:06 UTC
Created attachment 92809 [details] [review]
Bug 23321: Allow setting of branch default

This adds the ability to set a cash register as the default selected
option when making payments at a particular branch.

1) Note the addition of a 'Make branch default' button in each row of
   the table under 'Manage cash registers'
2) Click the button and note that the button has changed.
3) Click on an alternative cash register for the same branch and note
   that the default has been switched to the new register.
4) Click the 'unset' button on the default branch and note that there is
   no longer a default register for this branch.
5) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 53 Martin Renvoize (ashimema) 2019-09-13 15:30:10 UTC
Created attachment 92810 [details] [review]
Bug 23321: Add cash register support to paycollect

This patch ties in the cash registers system to the paycollect payment
pages in the staff client.

Test plan:
1) Add some manual fees to a test patron
2) Select some fees to pay off
3) Note the addition of a select box for selecting your cash register
   upon payment.
4) Set a branch default cash register for the current branch
5) Repeat step 3 and note that the pre-selected cash register is the one
   set in step 4.
6) Unset the branch default cash register for the current branch
7) Repeat step 3 and note that there is no cash register pre-selected
8) Set 'UseCashRegisters' to 'Do not'
9) Repeat step 3 and note that there is no longer an option to select a
   cash register
10) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 54 Martin Renvoize (ashimema) 2019-09-13 15:30:13 UTC
Created attachment 92811 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.

Test plan:
1) Ensure you have 'UseCashRegisters' set to 'Do'
2) Attempt to make a payment for a fee whilst logged into a branch that
   has not yet had cash registers configured.
3) Note that you are shown a warning and cannot proceed.
4) Signoff

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 55 Martin Renvoize (ashimema) 2019-09-13 15:30:17 UTC
Created attachment 92812 [details] [review]
Bug 23321: (follow-up) Add cash register to admin-menu
Comment 56 Martin Renvoize (ashimema) 2019-09-13 15:33:16 UTC
(In reply to Maryse Simard from comment #45)
> Followed the test plans and everything work.
> 
> I resolved a small conflict in one of the patches, moving changes in
> staff-global.scss to _tables.scss where the styles now reside since Bug
> 23013.
> 
> Some comments:
>     - In the cash registers page, I noticed that there seems to be a branch
> filter but I can't seem to make it work...
>     - I wonder if a link to the page should be added to the admin-menu.inc
> so it appears in the navigation on the admin pages?

Thankyou for testing Maryse :)

Hmm, the cash registers filter is working for me here.. it starts out as not selected by default and then filters out on branch should you use the select box.. perhaps I'm missing something in my setup.. hopefully the QAer may catch it.

As for the admin-menu missing, good catch!.. I've added it as a final followup :)
Comment 57 Martin Renvoize (ashimema) 2019-09-13 16:04:41 UTC
Created attachment 92813 [details] [review]
Bug 23321: (follow-up) Correction to exception logic

This patch reduces the noisy warning of uninitialised variables
Comment 58 Martin Renvoize (ashimema) 2019-09-13 16:04:45 UTC
Created attachment 92814 [details] [review]
Bug 23321: (follow-up) Add test for Koha::Account change
Comment 59 Martin Renvoize (ashimema) 2019-09-16 11:30:05 UTC
Created attachment 92829 [details] [review]
Bug 23321: (follow-up) Add test for Koha::Account change
Comment 60 Martin Renvoize (ashimema) 2019-09-17 11:26:20 UTC
Created attachment 92879 [details] [review]
Bug 23321: Add cash_registers table

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 61 Martin Renvoize (ashimema) 2019-09-17 11:26:23 UTC
Created attachment 92880 [details] [review]
Bug 23321: Add cash register preference

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 62 Martin Renvoize (ashimema) 2019-09-17 11:26:27 UTC
Created attachment 92881 [details] [review]
Bug 23321: Add cash register permission

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 63 Martin Renvoize (ashimema) 2019-09-17 11:26:30 UTC
Created attachment 92882 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.

Test plan:
1) Enable the use of cash registers by setting 'UseCashRegisters' to
   'Do'
2) Check that the 'Accounts > Manage cash registers' option now appears
   in the 'Administration' area.
3) Click through to 'Manage cash registers' and note the message
   suggesting you add your first register
4) Add you're first cash register
5) Note that the message has now been replaced by a table of cash
   registers including the one you have added in the previous step.
6) Edit the cash register created in step 4 and note that the table
   reflects the changes
7) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 64 Martin Renvoize (ashimema) 2019-09-17 11:26:34 UTC
Created attachment 92883 [details] [review]
Bug 23321: Koha::Library additions

This patch adds the relationship accessor for Cash::Registers to the
Koha::Library class and include the relevant tests.

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 65 Martin Renvoize (ashimema) 2019-09-17 11:26:37 UTC
Created attachment 92884 [details] [review]
Bug 23321: Allow setting of branch default

This adds the ability to set a cash register as the default selected
option when making payments at a particular branch.

1) Note the addition of a 'Make branch default' button in each row of
   the table under 'Manage cash registers'
2) Click the button and note that the button has changed.
3) Click on an alternative cash register for the same branch and note
   that the default has been switched to the new register.
4) Click the 'unset' button on the default branch and note that there is
   no longer a default register for this branch.
5) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 66 Martin Renvoize (ashimema) 2019-09-17 11:26:41 UTC
Created attachment 92885 [details] [review]
Bug 23321: Add cash register support to paycollect

This patch ties in the cash registers system to the paycollect payment
pages in the staff client.

Test plan:
1) Add some manual fees to a test patron
2) Select some fees to pay off
3) Note the addition of a select box for selecting your cash register
   upon payment.
4) Set a branch default cash register for the current branch
5) Repeat step 3 and note that the pre-selected cash register is the one
   set in step 4.
6) Unset the branch default cash register for the current branch
7) Repeat step 3 and note that there is no cash register pre-selected
8) Set 'UseCashRegisters' to 'Do not'
9) Repeat step 3 and note that there is no longer an option to select a
   cash register
10) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 67 Martin Renvoize (ashimema) 2019-09-17 11:26:44 UTC
Created attachment 92886 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.

Test plan:
1) Ensure you have 'UseCashRegisters' set to 'Do'
2) Attempt to make a payment for a fee whilst logged into a branch that
   has not yet had cash registers configured.
3) Note that you are shown a warning and cannot proceed.
4) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 68 Martin Renvoize (ashimema) 2019-09-17 11:26:47 UTC
Created attachment 92887 [details] [review]
Bug 23321: (follow-up) Add cash register to admin-menu

Sponsored-by: PTFS Europe
Comment 69 Martin Renvoize (ashimema) 2019-09-17 11:26:51 UTC
Created attachment 92888 [details] [review]
Bug 23321: (follow-up) Correction to exception logic

This patch reduces the noisy warning of uninitialised variables

Sponsored-by: PTFS Europe
Comment 70 Martin Renvoize (ashimema) 2019-09-17 11:26:54 UTC
Created attachment 92889 [details] [review]
Bug 23321: (follow-up) Add test for Koha::Account change

Sponsored-by: PTFS Europe
Comment 71 Tomás Cohen Arazi (tcohen) 2019-09-20 19:01:27 UTC
Created attachment 93019 [details] [review]
Bug 23321: [DO NOT PUSH] DBIC Classes

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 72 Tomás Cohen Arazi (tcohen) 2019-09-20 19:01:33 UTC
Created attachment 93020 [details] [review]
Bug 23321: Add cash_registers table

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 73 Tomás Cohen Arazi (tcohen) 2019-09-20 19:01:38 UTC
Created attachment 93021 [details] [review]
Bug 23321: Add cash register preference

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 74 Tomás Cohen Arazi (tcohen) 2019-09-20 19:01:44 UTC
Created attachment 93022 [details] [review]
Bug 23321: Add cash register permission

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 75 Tomás Cohen Arazi (tcohen) 2019-09-20 19:01:49 UTC
Created attachment 93023 [details] [review]
Bug 23321: Add cash register management

Add in administrative interfaces to allow the management of cash
registers.

Test plan:
1) Enable the use of cash registers by setting 'UseCashRegisters' to
   'Do'
2) Check that the 'Accounts > Manage cash registers' option now appears
   in the 'Administration' area.
3) Click through to 'Manage cash registers' and note the message
   suggesting you add your first register
4) Add you're first cash register
5) Note that the message has now been replaced by a table of cash
   registers including the one you have added in the previous step.
6) Edit the cash register created in step 4 and note that the table
   reflects the changes
7) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 76 Tomás Cohen Arazi (tcohen) 2019-09-20 19:01:54 UTC
Created attachment 93024 [details] [review]
Bug 23321: Koha::Library additions

This patch adds the relationship accessor for Cash::Registers to the
Koha::Library class and include the relevant tests.

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 77 Tomás Cohen Arazi (tcohen) 2019-09-20 19:01:58 UTC
Created attachment 93025 [details] [review]
Bug 23321: Allow setting of branch default

This adds the ability to set a cash register as the default selected
option when making payments at a particular branch.

1) Note the addition of a 'Make branch default' button in each row of
   the table under 'Manage cash registers'
2) Click the button and note that the button has changed.
3) Click on an alternative cash register for the same branch and note
   that the default has been switched to the new register.
4) Click the 'unset' button on the default branch and note that there is
   no longer a default register for this branch.
5) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 78 Tomás Cohen Arazi (tcohen) 2019-09-20 19:02:02 UTC
Created attachment 93026 [details] [review]
Bug 23321: Add cash register support to paycollect

This patch ties in the cash registers system to the paycollect payment
pages in the staff client.

Test plan:
1) Add some manual fees to a test patron
2) Select some fees to pay off
3) Note the addition of a select box for selecting your cash register
   upon payment.
4) Set a branch default cash register for the current branch
5) Repeat step 3 and note that the pre-selected cash register is the one
   set in step 4.
6) Unset the branch default cash register for the current branch
7) Repeat step 3 and note that there is no cash register pre-selected
8) Set 'UseCashRegisters' to 'Do not'
9) Repeat step 3 and note that there is no longer an option to select a
   cash register
10) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 79 Tomás Cohen Arazi (tcohen) 2019-09-20 19:02:07 UTC
Created attachment 93027 [details] [review]
Bug 23321: (follow-up) Require cash registers for payments

This follow-up catches the case where no cash registers have been
defined for the current branch and as such payments cannot be processed.

Test plan:
1) Ensure you have 'UseCashRegisters' set to 'Do'
2) Attempt to make a payment for a fee whilst logged into a branch that
   has not yet had cash registers configured.
3) Note that you are shown a warning and cannot proceed.
4) Signoff

Sponsored-by: PTFS Europe
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 80 Tomás Cohen Arazi (tcohen) 2019-09-20 19:02:13 UTC
Created attachment 93028 [details] [review]
Bug 23321: (follow-up) Add cash register to admin-menu

Sponsored-by: PTFS Europe
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 81 Tomás Cohen Arazi (tcohen) 2019-09-20 19:02:25 UTC
Created attachment 93029 [details] [review]
Bug 23321: (follow-up) Correction to exception logic

This patch reduces the noisy warning of uninitialised variables

Sponsored-by: PTFS Europe
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 82 Tomás Cohen Arazi (tcohen) 2019-09-20 19:02:37 UTC
Created attachment 93030 [details] [review]
Bug 23321: (follow-up) Add test for Koha::Account change

Sponsored-by: PTFS Europe
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 83 Tomás Cohen Arazi (tcohen) 2019-09-20 19:02:47 UTC
Created attachment 93031 [details] [review]
Bug 23321: (QA follow-up) Make atomic update idempotent

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 84 Tomás Cohen Arazi (tcohen) 2019-09-20 19:02:53 UTC
Created attachment 93032 [details] [review]
Bug 23321: (QA follow-up) Booleans

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 85 Tomás Cohen Arazi (tcohen) 2019-09-20 19:03:03 UTC
Created attachment 93033 [details] [review]
Bug 23321: (QA follow-up) Add missing TT filters

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 86 Tomás Cohen Arazi (tcohen) 2019-09-20 19:03:10 UTC
Created attachment 93034 [details] [review]
Bug 23321: Add Koha::Object(s) info to the schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 87 Tomás Cohen Arazi (tcohen) 2019-09-20 19:03:24 UTC
Created attachment 93035 [details] [review]
Bug 23321: (QA follow-up) Accounts vs. Accounting

The UI uses 'Accounting' in several places (patron details tab, admin
page section name, breadcrumbs, etc). Use the same name on the sysprefs.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 88 Tomás Cohen Arazi (tcohen) 2019-09-20 19:05:39 UTC
Not much to say. Great job!
It feels like some actions on the cash registers table should've been done through AJAX requests to avoid refreshing, but works for now.

Things I found were all minor. The feature works as expected.
Cheers!
Comment 89 Martin Renvoize (ashimema) 2019-09-23 10:09:12 UTC
Thanks for the QA and follow-ups Tomas, much appreciated.

Totally agree that it would be great to use AJAX for at least some of the actions, but at this point, I was aiming for pragmatic coding to 'get it done' and concentrating mostly on the backend implementation. I hope to switch back around to the UI again sometime soon and add API routes and correspondingly AJAXifying the UI :)
Comment 90 Martin Renvoize (ashimema) 2019-09-23 10:50:06 UTC
Nice work!

Pushed to master for 19.11.00
Comment 91 Martin Renvoize (ashimema) 2019-09-27 09:37:01 UTC
Created attachment 93188 [details] [review]
Bug 23321: (RM follow-up) Accounts vs. Accounting

The QA follow-up converting 'Accounts' to 'Accounting' missed some cases
and ended up breaking the perferences screen.  This follow-up corrects
that.