Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin
Julian Maurice 9205d4ef45 Bug 19036: Add ability to auto generate a number for account credits
In some areas it's required to sequentially number payment slips /
receipts.

This patch adds a database column accountlines.credit_number and a
system preference AutoCreditNumber to control how this number will be
generated.  The following options are available:

- Do not automatically generate credit numbers.
  This is the current behaviour and the default syspref value.

- Automatically generate credit numbers in the form <year>-0001 (annual)

- Automatically generate credit numbers in the form
  <branchcode>yyyymm0001 (branchyyyymmincr)
  where <branchcode> is the branch where the user (staff member) is
  logged in

- Automatically generate credit numbers in the form 1, 2, 3
  (incremental)

It also adds a column (hidden by default) in the table under
Transactions tab to display this number.

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. Change syspref 'AutoCreditNumber' to 'incremental'
4. Create more manual credits, and verify that the numbers generated are
   1, 2, 3, ...
5. Change syspref 'AutoCreditNumber' to 'annual'
6. Create more manual credits, and verify that the numbers generated are
   '2020-0001', '2020-0002', ...
7. Change syspref to 'AutoCreditNumber' to 'branchyyyymmincr'
8. Create more manual credits, and verify that the numbers generated are
   'BRANCHA2020020001', 'BRANCHA2020020002', ... (assuming you are
   connected to library BRANCHA, and it's February 2020)
9. Set library to another one, say BRANCHB
10. Create more manual credits, and verify that the numbers generated are
    'BRANCHB2020020001', 'BRANCHB2020020002', ...
11. 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.
12. prove t/db_dependent/Koha/Account.t

Signed-off-by: Michal Denar <black23@gmail.com>
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
..
preferences Bug 19036: Add ability to auto generate a number for account credits 2020-08-20 12:31:59 +02:00
searchengine/elasticsearch Bug 20484: (RM follow-up) Highlight ES disablement 2020-04-21 12:14:13 +01:00
additional-fields.tt
admin-home.tt Bug 24156: (follow-up) UI - Use "Table settings" 2020-06-25 10:55:41 +02:00
adveditorshortcuts.tt
aqbudgetperiods.tt Bug 25499: Fix fund code column when closing a budget 2020-07-30 17:44:27 +02:00
aqbudgets.tt Bug 26098: Fix JS error on the fund list view when no fund displayed 2020-08-06 11:37:06 +02:00
aqcontract.tt
aqplan.tt Bug 24636: (follow-up) - move 'by' into include file 2020-05-04 08:53:04 +01:00
audio_alerts.tt
auth_subfields_structure.tt Bug 25832: Add DataTables to MARC subfield structure admin page for authorities 2020-08-18 17:39:48 +02:00
auth_tag_structure.tt Bug 25282: Correct Bootstrap dropdown button markup 2020-04-29 16:20:08 +01:00
authorised_values.tt Bug 26234: Teach our KohaTable constructor the specific th classes 2020-08-19 08:24:04 +02:00
authtypes.tt Bug 25282: Correct Bootstrap dropdown button markup 2020-04-29 16:20:08 +01:00
biblio_framework.tt Bug 25282: Correct Bootstrap dropdown button markup 2020-04-29 16:20:08 +01:00
branch_transfer_limits.tt
branches.tt Bug 25862: Prevent TinyMCE to mangle local url links 2020-07-20 14:05:21 +02:00
cash_registers.tt Bug 26194: (follow-up) Default to current branch 2020-08-18 15:45:49 +02:00
categories.tt Bug 24156: move ColumnsSettings to TablesSettings 2020-06-25 10:51:59 +02:00
checkmarc.tt
cities.tt Bug 25279: (QA follow-up) Use .escapeHtml 2020-05-12 11:40:22 +01:00
classsources.tt
clone-rules.tt
columns_settings.tt Bug 26160: Make POS items table configurable 2020-08-12 12:07:12 +02:00
credit_types.tt
currency.tt Bug 26234: Teach our KohaTable constructor the specific th classes 2020-08-19 08:24:04 +02:00
debit_types.tt
desks.tt
didyoumean.tt
edi_accounts.tt Bug 25687: Switch Y/N in EDI accounts table for Yes and No for better translatability 2020-06-15 11:53:36 +02:00
edi_ean_accounts.tt
item_circulation_alerts.tt
items_search_field.tt
items_search_fields.tt
itemtypes.tt Bug 26234: Teach our KohaTable constructor the specific th classes 2020-08-19 08:24:04 +02:00
koha2marclinks.tt
library_groups.tt Bug 22937: Add hint to groups editor 2020-04-08 11:52:25 +01:00
localization.tt
marc_subfields_structure.tt Bug 25826: fix failing test 2020-08-10 10:00:34 +02:00
marctagstructure.tt Bug 25282: Correct Bootstrap dropdown button markup 2020-04-29 16:20:08 +01:00
matching-rules.tt
oai_set_mappings.tt
oai_sets.tt Bug 25282: Correct Bootstrap dropdown button markup 2020-04-29 16:20:08 +01:00
overdrive.tt
patron-attr-types.tt Bug 26119: Enable patron's attribute edition when PatronSelfRegistrationVerifyByEmail 2020-08-18 14:47:44 +02:00
preferences.tt Bug 22844: Simplify the process of selecting database columns for system preferences 2020-07-20 16:08:22 +02:00
share_content.tt
smart-rules.tt Bug 21946: (follow-up) Add optgroup label in circ rules 2020-08-13 10:13:14 +02:00
sms_providers.tt
sru_modmapping.tt
sru_modmapping_auth.tt
systempreferences.tt
transport-cost-matrix.tt
usage_statistics.tt
z3950servers.tt Bug 25282: Correct Bootstrap dropdown button markup 2020-04-29 16:20:08 +01:00