Bug 28138 - Add system preference to make the payment type required
Summary: Add system preference to make the payment type required
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on: 27796
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-13 08:17 UTC by Julian Maurice
Modified: 2023-02-22 20:56 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/629
Text to go in the release notes:
Version(s) released in:
22.05.00


Attachments
Bug 28138: Add syspref to make the payment type required (4.78 KB, patch)
2021-04-13 08:19 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 28138: Add syspref to make the payment type required (4.78 KB, patch)
2021-04-13 08:21 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 28138: Add syspref to make the payment type required (4.95 KB, patch)
2021-12-02 13:58 UTC, Thibaud Guillot
Details | Diff | Splinter Review
Bug 28138: Add syspref to make the payment type required (4.99 KB, patch)
2022-03-09 20:46 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 28138: (follow-up) New atomic update (2.03 KB, patch)
2022-03-11 23:07 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 28138: (follow-up) Add empty option to payment type selection (2.12 KB, patch)
2022-04-21 18:28 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28138: Add syspref to make the payment type required (5.05 KB, patch)
2022-04-21 21:11 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 28138: (follow-up) New atomic update (2.08 KB, patch)
2022-04-21 21:11 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 28138: (follow-up) Add empty option to payment type selection (2.17 KB, patch)
2022-04-21 21:11 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 28138: Add syspref to make the payment type required (5.10 KB, patch)
2022-04-25 16:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28138: (follow-up) New atomic update (2.14 KB, patch)
2022-04-25 16:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28138: (follow-up) Add empty option to payment type selection (2.23 KB, patch)
2022-04-25 16:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28138: (QA follow-up) Slight rephrase of system preference text (1.44 KB, patch)
2022-04-25 16:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28138: (QA follow-up) Link system preference in new system preference description (1.38 KB, patch)
2022-04-25 16:40 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2021-04-13 08:17:16 UTC
The payment type is already required when using the cash register feature, but some users want to force selecting a payment type even when cash registers are not used
Comment 1 Julian Maurice 2021-04-13 08:19:08 UTC Comment hidden (obsolete)
Comment 2 Julian Maurice 2021-04-13 08:21:24 UTC Comment hidden (obsolete)
Comment 3 Fridolin Somers 2021-05-26 09:19:17 UTC
Needs rebase since Bug 27796 deleted payments.inc
Comment 4 Thibaud Guillot 2021-12-02 10:55:21 UTC Comment hidden (obsolete)
Comment 5 Thibaud Guillot 2021-12-02 13:58:50 UTC Comment hidden (obsolete)
Comment 6 Shi Yao Wang 2022-03-09 20:46:08 UTC
Created attachment 131530 [details] [review]
Bug 28138: Add syspref to make the payment type required

The payment type is already required when using the cash register
feature, but some users want to force selecting a payment type even
when cash registers are not used

The new system preference name is RequirePaymentType

Test plan:
1. Apply patch and run updatedatabase.pl
2. Disable UseCashRegisters and RequirePaymentType sysprefs
3. Create some authorised values in PAYMENT_TYPE category if needed
4. Create a manual invoice and pay it. Notice that the payment type is
   optional.
5. Enable RequirePaymentType
6. Create a manual invoice and pay it. Notice that the payment type is
   now required.
7. Enable UseCashRegisters and verify that the payment type is always
   required, even if RequirePaymentType is disabled

Rebased by Thibaud Guillot <thibaud.guillot@biblibre.com> on 21-12-02

Signed-off-by: shiyao <shiyao@inlibro.com>
Comment 7 Fridolin Somers 2022-03-11 23:02:06 UTC
> installer/data/mysql/atomicupdate/add-system-preference-RequirePaymentType.perl
This needs to be in new format of DBrev
https://wiki.koha-community.org/wiki/Database_updates#How_to_write_an_atomicupdate_file
Comment 8 Fridolin Somers 2022-03-11 23:07:33 UTC
Created attachment 131643 [details] [review]
Bug 28138: (follow-up) New atomic update
Comment 9 Lucas Gass 2022-04-19 17:40:33 UTC
When RequirePaymentType is enabled the dropdown for 'Payment type' defaults to the first choice in the list. I know this has been a problem in other parts of Koha since the user can submit the form without actually making a choice about payment type. In my opinion, if RequirePaymentType we should also add an empty value as the defualt choice. This actually forces the user to make a selection, instead of just clicking through.
Comment 10 Owen Leonard 2022-04-21 18:28:02 UTC
Created attachment 133606 [details] [review]
Bug 28138: (follow-up) Add empty option to payment type selection

This patch adds an empty <option> to the "Payment type" selection when
paying fine. This forces the user to actively make a selection. I've
also added the text "None selected" to the other empty <option> on the
page for consistency.

To test, apply the patch and test the pay fine interface with and
without the RequirePaymentType preference enabled. When enabled the
payment type should be required and it should default to "None
selected."
Comment 11 Lucas Gass 2022-04-21 21:11:10 UTC
Created attachment 133609 [details] [review]
Bug 28138: Add syspref to make the payment type required

The payment type is already required when using the cash register
feature, but some users want to force selecting a payment type even
when cash registers are not used

The new system preference name is RequirePaymentType

Test plan:
1. Apply patch and run updatedatabase.pl
2. Disable UseCashRegisters and RequirePaymentType sysprefs
3. Create some authorised values in PAYMENT_TYPE category if needed
4. Create a manual invoice and pay it. Notice that the payment type is
   optional.
5. Enable RequirePaymentType
6. Create a manual invoice and pay it. Notice that the payment type is
   now required.
7. Enable UseCashRegisters and verify that the payment type is always
   required, even if RequirePaymentType is disabled

Rebased by Thibaud Guillot <thibaud.guillot@biblibre.com> on 21-12-02

Signed-off-by: shiyao <shiyao@inlibro.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 12 Lucas Gass 2022-04-21 21:11:15 UTC
Created attachment 133610 [details] [review]
Bug 28138: (follow-up) New atomic update

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 13 Lucas Gass 2022-04-21 21:11:20 UTC
Created attachment 133611 [details] [review]
Bug 28138: (follow-up) Add empty option to payment type selection

This patch adds an empty <option> to the "Payment type" selection when
paying fine. This forces the user to actively make a selection. I've
also added the text "None selected" to the other empty <option> on the
page for consistency.

To test, apply the patch and test the pay fine interface with and
without the RequirePaymentType preference enabled. When enabled the
payment type should be required and it should default to "None
selected."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 14 Katrin Fischer 2022-04-25 16:05:31 UTC
Created attachment 133814 [details] [review]
Bug 28138: Add syspref to make the payment type required

The payment type is already required when using the cash register
feature, but some users want to force selecting a payment type even
when cash registers are not used

The new system preference name is RequirePaymentType

Test plan:
1. Apply patch and run updatedatabase.pl
2. Disable UseCashRegisters and RequirePaymentType sysprefs
3. Create some authorised values in PAYMENT_TYPE category if needed
4. Create a manual invoice and pay it. Notice that the payment type is
   optional.
5. Enable RequirePaymentType
6. Create a manual invoice and pay it. Notice that the payment type is
   now required.
7. Enable UseCashRegisters and verify that the payment type is always
   required, even if RequirePaymentType is disabled

Rebased by Thibaud Guillot <thibaud.guillot@biblibre.com> on 21-12-02

Signed-off-by: shiyao <shiyao@inlibro.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Katrin Fischer 2022-04-25 16:05:36 UTC
Created attachment 133815 [details] [review]
Bug 28138: (follow-up) New atomic update

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Katrin Fischer 2022-04-25 16:05:41 UTC
Created attachment 133816 [details] [review]
Bug 28138: (follow-up) Add empty option to payment type selection

This patch adds an empty <option> to the "Payment type" selection when
paying fine. This forces the user to actively make a selection. I've
also added the text "None selected" to the other empty <option> on the
page for consistency.

To test, apply the patch and test the pay fine interface with and
without the RequirePaymentType preference enabled. When enabled the
payment type should be required and it should default to "None
selected."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2022-04-25 16:05:46 UTC
Created attachment 133817 [details] [review]
Bug 28138: (QA follow-up) Slight rephrase of system preference text

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2022-04-25 16:40:28 UTC
Created attachment 133821 [details] [review]
Bug 28138: (QA follow-up) Link system preference in new system preference description
Comment 19 Martin Renvoize 2022-04-26 11:29:36 UTC
Nice :)
Comment 20 Fridolin Somers 2022-05-05 00:32:22 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄