Bug 24338 - CASH is missing from the default payment_types
Summary: CASH is missing from the default payment_types
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: 19.11
Hardware: All All
: P5 - low major
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 23321 24339
Blocks: 23894
  Show dependency treegraph
 
Reported: 2020-01-03 16:53 UTC by Martin Renvoize (ashimema)
Modified: 2021-06-14 21:29 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fix adds CASH as an authorized value for PAYMENT_TYPES. This is required for the new cash register feature.
Version(s) released in:
19.11.03
Circulation function:


Attachments
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV (2.36 KB, patch)
2020-01-27 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV (2.11 KB, patch)
2020-02-04 11:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24338: (QA follow-up) Make update idempotent (1.51 KB, patch)
2020-02-04 13:20 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV (2.15 KB, patch)
2020-02-04 20:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 24338: (QA follow-up) Make update idempotent (1.56 KB, patch)
2020-02-04 20:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV (2.15 KB, patch)
2020-02-05 14:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24338: (QA follow-up) Make update idempotent (1.45 KB, patch)
2020-02-05 14:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV (2.23 KB, patch)
2020-02-05 15:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24338: (QA follow-up) Make update idempotent (1.52 KB, patch)
2020-02-05 15:17 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2020-01-03 16:53:14 UTC
Bug 23321 added cash registers to koha which utilise a payment_type value of CASH which is expected to be present in the system by default.  It appears that this part of the DB update went missing during subsequent rebases of the patchset :(
Comment 1 Martin Renvoize (ashimema) 2020-01-27 11:15:10 UTC
Created attachment 97972 [details] [review]
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV

Bug 23321 adds cash registers to the koha accounts system and as part of
that work introduces the 'CASH' payment type as a required option to
allow requirment of a 'CASH_REGISTER' when making cash payments. The
original patchset, however, forgot to add this new authorised value
during installation and upgrade.
Comment 2 David Nind 2020-01-30 10:38:56 UTC
On master I can already see a CASH payment type, so not sure whether this is required or not.
Comment 3 Martin Renvoize (ashimema) 2020-02-03 11:32:52 UTC
OK, so on master it's already added in bug 23354, but it's not in the 19.11 branch yet.  Setting branch appropriately.
Comment 4 David Nind 2020-02-03 17:23:28 UTC
Patch doesn't apply on 19.11.x
Comment 5 Jonathan Druart 2020-02-04 11:50:19 UTC
Created attachment 98381 [details] [review]
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV

Bug 23321 adds cash registers to the koha accounts system and as part of
that work introduces the 'CASH' payment type as a required option to
allow requirment of a 'CASH_REGISTER' when making cash payments. The
original patchset, however, forgot to add this new authorised value
during installation and upgrade.
Comment 6 Nick Clemens (kidclamp) 2020-02-04 12:08:08 UTC
Does it matter that this is not idempotent? You can have repeated values in the authorised_values table with no complaints - should there be a key on id,category,authorised_value?
Comment 7 Martin Renvoize (ashimema) 2020-02-04 13:20:01 UTC
Created attachment 98388 [details] [review]
Bug 24338: (QA follow-up) Make update idempotent
Comment 8 Martin Renvoize (ashimema) 2020-02-04 13:20:19 UTC
Good catch
Comment 9 David Nind 2020-02-04 20:20:54 UTC
Created attachment 98412 [details] [review]
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV

Bug 23321 adds cash registers to the koha accounts system and as part of
that work introduces the 'CASH' payment type as a required option to
allow requirment of a 'CASH_REGISTER' when making cash payments. The
original patchset, however, forgot to add this new authorised value
during installation and upgrade.

Test plan:
1) Check the values shown for the PAYMENT_TYPE authorized value category 
   (Home > Administration > Basic parameters > Authorized values)
2) There should be no CASH authorized value
3) Apply the patch
4) Run the database update (perl installer/data/mysql/updatedatabase.pl)
5) Refresh the PAYMENT_TYPE authorized value page
6) A CASH authorized value should now be one of the values
7) Sign-off!

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 David Nind 2020-02-04 20:20:58 UTC
Created attachment 98413 [details] [review]
Bug 24338: (QA follow-up) Make update idempotent

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 Jonathan Druart 2020-02-05 10:01:30 UTC
Do we really need the print statements?
Comment 12 Martin Renvoize (ashimema) 2020-02-05 11:36:38 UTC
(In reply to Jonathan Druart from comment #11)
> Do we really need the print statements?

Oops, not at all.. leftover debugging whilst I was working on the DB update.. my bad.
Comment 13 Martin Renvoize (ashimema) 2020-02-05 14:13:56 UTC
Created attachment 98490 [details] [review]
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV

Bug 23321 adds cash registers to the koha accounts system and as part of
that work introduces the 'CASH' payment type as a required option to
allow requirment of a 'CASH_REGISTER' when making cash payments. The
original patchset, however, forgot to add this new authorised value
during installation and upgrade.

Signed-off-by: David Nind <david@davidnind.com>
Comment 14 Martin Renvoize (ashimema) 2020-02-05 14:13:59 UTC
Created attachment 98491 [details] [review]
Bug 24338: (QA follow-up) Make update idempotent

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 Martin Renvoize (ashimema) 2020-02-05 14:14:16 UTC
Second patch now corrected to remove debug print lines.
Comment 16 Jonathan Druart 2020-02-05 15:17:52 UTC
Created attachment 98504 [details] [review]
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV

Bug 23321 adds cash registers to the koha accounts system and as part of
that work introduces the 'CASH' payment type as a required option to
allow requirment of a 'CASH_REGISTER' when making cash payments. The
original patchset, however, forgot to add this new authorised value
during installation and upgrade.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Jonathan Druart 2020-02-05 15:17:56 UTC
Created attachment 98505 [details] [review]
Bug 24338: (QA follow-up) Make update idempotent

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Joy Nelson 2020-02-06 21:37:11 UTC
Pushed to 19.11.x branch for 19.11.03 release
Comment 19 Lucas Gass (lukeg) 2020-02-13 17:56:25 UTC
missing dependencies for 19.05.x, no backport