Koha/installer/data/mysql
Julian Maurice 58edcef03d Bug 19036: Add ability to enable credit number for only some credit types
This feature is disabled by default for all credit types. To enable it
you have to set the syspref AutoCreditNumber to the value of your choice
and then enable the feature for each credit type you want.
System credit types can be modified too (but only this particular field
can be modified)

Also, throw an exception when the feature is enabled and a value for
credit_number has already been set

Updated test plan:
Test plan:
0. Apply patch, run updatedatabase and update_dbix_class_files
1. Go to Admin » Column settings, and uncheck the 'hidden' box for
   column credit_number in table account-fines. It will be easier for
   testing
2. Create a manual credit for a borrower. Verify in Transactions tab
   that this credit has no number generated
3. In Admin » Credit types:
  a. edit the FORGIVEN type and enable credit number generation
  b. create a new type A, check "can be manually added" and "enable
     credit number"
  c. create a new type B, check "can be manually added". Do NOT enable
     credit number
4. Change syspref 'AutoCreditNumber' to 'incremental'
5. Create more manual credits with types CREDIT and B, and verify that
   the numbers are not generated
6. Create more manual credits with types FORGIVEN and A, and verify that
   the numbers generated are 1, 2, 3, ...
7. Change syspref 'AutoCreditNumber' to 'annual'
8. Create more manual credits with types CREDIT and B, and verify that
   the numbers are not generated
9. Create more manual credits with types FORGIVEN and A, and verify that
   the numbers generated are '2020-0001', '2020-0002', ...
10. Change syspref to 'AutoCreditNumber' to 'branchyyyymmincr'
11. Create more manual credits with types CREDIT and B, and verify that
    the numbers are not generated
12. Create more manual credits with types FORGIVEN and A, and verify
    that the numbers generated are 'BRANCHA2020020001',
    'BRANCHA2020020002', ... (assuming you are connected to library
    BRANCHA, and it's February 2020)
13. Set library to another one, say BRANCHB
14. Create more manual credits with types FORGIVEN and A, and verify
    that the numbers generated are 'BRANCHB2020020001',
    'BRANCHB2020020002', ...
15. Edit the letter ACCOUNT_CREDIT, and add [% account.credit_number %]
    somewhere. Go back to Transactions tab and click on 'Print' for one
    line that has a credit number. Make sure the number is there.
16. prove t/db_dependent/Koha/Account.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-08-20 12:31:59 +02:00
..
atomicupdate Bug 19036: Add ability to enable credit number for only some credit types 2020-08-20 12:31:59 +02:00
de-DE Bug 23148: Fix bridge image paths in de-DE installer files 2020-07-20 16:16:37 +02:00
en Bug 25867: Label "Current location" as "Current library" and "Permanent location" as "Home library" 2020-08-18 15:48:37 +02:00
fr-CA Bug 25629: Fix capitalization in sample notices 2020-07-22 10:17:53 +02:00
fr-FR Bug 25867: Label "Current location" as "Current library" and "Permanent location" as "Home library" 2020-08-18 15:48:37 +02:00
it-IT Bug 25629: Fix capitalization in sample notices 2020-07-22 10:17:53 +02:00
mandatory Bug 17355: DB changes - set is_system for categories 2020-05-04 07:57:21 +01:00
nb-NO Bug 25867: Label "Current location" as "Current library" and "Permanent location" as "Home library" 2020-08-18 15:48:37 +02:00
pl-PL Bug 25867: Label "Current location" as "Current library" and "Permanent location" as "Home library" 2020-08-18 15:48:37 +02:00
ru-RU Bug 25629: Fix capitalization in sample notices 2020-07-22 10:17:53 +02:00
uk-UA Bug 25629: Fix capitalization in sample notices 2020-07-22 10:17:53 +02:00
account_credit_types.sql
account_debit_types.sql Bug 25010: Fix typo 'rewewal' in debit types 2020-04-03 14:26:35 +01:00
account_offset_types.sql
audio_alerts.sql
backfill_statistics.pl
fix_unclosed_nonaccruing_fines_bug17135.pl Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
kohastructure.sql Bug 19036: Add ability to enable credit number for only some credit types 2020-08-20 12:31:59 +02:00
labels_upgrade.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
patroncards_upgrade.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
sysprefs.sql Bug 19036: Add ability to auto generate a number for account credits 2020-08-20 12:31:59 +02:00
update22to30.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
updatedatabase.pl Bug 6725: DBRev 20.06.00.025 2020-08-18 17:41:49 +02:00
userflags.sql Bug 4461: Adding user flags for managing OPAC problem reports 2020-04-06 11:18:13 +01:00
userpermissions.sql Bug 24157: New permission - merge_invoices 2020-07-30 17:30:23 +02:00