Bugzilla – Attachment 94158 Details for
Bug 23805
Add a dedicated credit_types table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23805: Update 'FOR' to 'FORGIVEN' for consistency
Bug-23805-Update-FOR-to-FORGIVEN-for-consistency.patch (text/plain), 8.06 KB, created by
Martin Renvoize (ashimema)
on 2019-10-15 08:47:29 UTC
(
hide
)
Description:
Bug 23805: Update 'FOR' to 'FORGIVEN' for consistency
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-15 08:47:29 UTC
Size:
8.06 KB
patch
obsolete
>From db4f0e2f3605d89b123a36edd53e320b7a3640e5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 14 Oct 2019 16:33:43 +0100 >Subject: [PATCH] Bug 23805: Update 'FOR' to 'FORGIVEN' for consistency > >--- > C4/Circulation.pm | 2 +- > Koha/Account.pm | 4 ++-- > api/v1/swagger/definitions/patron_account_credit.json | 2 +- > installer/data/mysql/account_credit_types.sql | 2 +- > installer/data/mysql/atomicupdate/bug_23908_credit.perl | 9 ++++++++- > .../data/mysql/en/mandatory/account_credit_types.sql | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc | 2 +- > .../opac-tmpl/bootstrap/en/includes/account-table.inc | 2 +- > reports/cash_register_stats.pl | 4 ++-- > t/db_dependent/Koha/Account.t | 2 +- > 10 files changed, 19 insertions(+), 12 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9533fd79d6..5ccf498739 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2366,7 +2366,7 @@ sub _FixOverduesOnReturn { > user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, > library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, > interface => C4::Context->interface, >- type => 'forgiven', >+ type => 'FORGIVEN', > item_id => $item > } > ); >diff --git a/Koha/Account.pm b/Koha/Account.pm >index f9d81050bb..baed3571df 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -717,7 +717,7 @@ sub reconcile_balance { > > our $offset_type = { > 'CREDIT' => 'Manual Credit', >- 'forgiven' => 'Writeoff', >+ 'FORGIVEN' => 'Writeoff', > 'lost_item_return' => 'Lost Item', > 'payment' => 'Payment', > 'writeoff' => 'Writeoff', >@@ -740,7 +740,7 @@ our $offset_type = { > > our $account_type_credit = { > 'CREDIT' => 'CREDIT', >- 'forgiven' => 'FOR', >+ 'FORGIVEN' => 'FORGIVEN', > 'lost_item_return' => 'LOST_RETURN', > 'payment' => 'Pay', > 'writeoff' => 'W' >diff --git a/api/v1/swagger/definitions/patron_account_credit.json b/api/v1/swagger/definitions/patron_account_credit.json >index a2eee7adb7..6b0889b168 100644 >--- a/api/v1/swagger/definitions/patron_account_credit.json >+++ b/api/v1/swagger/definitions/patron_account_credit.json >@@ -3,7 +3,7 @@ > "properties": { > "credit_type": { > "type": "string", >- "description": "Type of credit ('CREDIT', 'forgiven', 'lost_item_return', 'payment', 'writeoff' )" >+ "description": "Type of credit ('CREDIT', 'FORGIVEN', 'lost_item_return', 'payment', 'writeoff' )" > }, > "amount": { > "type": "number", >diff --git a/installer/data/mysql/account_credit_types.sql b/installer/data/mysql/account_credit_types.sql >index 021538e5d9..a91a7a32ba 100644 >--- a/installer/data/mysql/account_credit_types.sql >+++ b/installer/data/mysql/account_credit_types.sql >@@ -3,6 +3,6 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, is_s > ('PAY', 'Payment', 0, 1), > ('W', 'Writeoff', 0, 1), > ('WO', 'Writeoff', 0, 1), >-('FOR', 'Forgiven', 1, 1), >+('FORGIVEN', 'Forgiven', 1, 1), > ('CREDIT', 'Credit', 1, 1), > ('LOST_RETURN', 'Lost item fee refund', 0, 1); >diff --git a/installer/data/mysql/atomicupdate/bug_23908_credit.perl b/installer/data/mysql/atomicupdate/bug_23908_credit.perl >index 0ce6c07cc3..d3ca751054 100644 >--- a/installer/data/mysql/atomicupdate/bug_23908_credit.perl >+++ b/installer/data/mysql/atomicupdate/bug_23908_credit.perl >@@ -40,7 +40,7 @@ if ( CheckVersion($DBversion) ) { > ('PAY', 'Payment', 0, 1), > ('W', 'Writeoff', 0, 1), > ('WO', 'Writeoff', 0, 1), >- ('FOR', 'Forgiven', 1, 1), >+ ('FORGIVEN', 'Forgiven', 1, 1), > ('CREDIT', 'Credit', 1, 1), > ('LOST_RETURN', 'Lost item fee refund', 0, 1) > } >@@ -82,6 +82,13 @@ if ( CheckVersion($DBversion) ) { > } > ); > >+ # Update accountype 'FOR' to 'FORGIVEN' >+ $dbh->do( >+ qq{ >+ UPDATE accountlines SET accounttype = 'FORGIVEN' WHERE accounttype = 'FOR' OR accounttype = 'FORW' >+ } >+ ); >+ > # Populating credit_type_code > $dbh->do( > qq{ >diff --git a/installer/data/mysql/en/mandatory/account_credit_types.sql b/installer/data/mysql/en/mandatory/account_credit_types.sql >index 021538e5d9..a91a7a32ba 100644 >--- a/installer/data/mysql/en/mandatory/account_credit_types.sql >+++ b/installer/data/mysql/en/mandatory/account_credit_types.sql >@@ -3,6 +3,6 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, is_s > ('PAY', 'Payment', 0, 1), > ('W', 'Writeoff', 0, 1), > ('WO', 'Writeoff', 0, 1), >-('FOR', 'Forgiven', 1, 1), >+('FORGIVEN', 'Forgiven', 1, 1), > ('CREDIT', 'Credit', 1, 1), > ('LOST_RETURN', 'Lost item fee refund', 0, 1); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index 39df30a257..8884c0d6ed 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >@@ -4,7 +4,7 @@ > [%- SWITCH account.credit_type_code -%] > [%- CASE 'Pay' -%]Payment > [%- CASE 'W' -%]Writeoff >- [%- CASE 'FOR' -%]Forgiven >+ [%- CASE 'FORGIVEN' -%]Forgiven > [%- CASE 'PAY' -%]Payment > [%- CASE 'WO' -%]Writeoff > [%- CASE 'CREDIT' -%]Credit >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >index 09f21100fe..43bd8d5dff 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -175,7 +175,7 @@ > [%- SWITCH account.credit_type_code -%] > [%- CASE 'Pay' -%]Payment > [%- CASE 'W' -%]Writeoff >- [%- CASE 'FOR' -%]Forgiven >+ [%- CASE 'FORGIVEN' -%]Forgiven > [%- CASE 'PAY' -%]Payment > [%- CASE 'WO' -%]Writeoff > [%- CASE 'CREDIT' -%]Credit >diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl >index 9c9ae2ef67..52cf12488a 100755 >--- a/reports/cash_register_stats.pl >+++ b/reports/cash_register_stats.pl >@@ -74,7 +74,7 @@ if ($do_it) { > } elsif ($transaction_type eq 'ACT') { #Active > $whereTType = q{ AND credit_type_code IN ('Pay','CREDIT') }; > } elsif ($transaction_type eq 'FORW') { >- $whereTType = q{ AND credit_type_code IN ('FOR','W') }; >+ $whereTType = q{ AND credit_type_code IN ('FORGIVEN','W') }; > } else { > if ( any { $transaction_type eq $_->code } @debit_types ) { > $whereTType = q{ AND debit_type_code = ? }; >@@ -128,7 +128,7 @@ if ($do_it) { > if($row->{credit_type_code} =~ /^C$|^CR$/){ > $grantotal -= abs($row->{amount}); > $row->{amount} = '-' . $row->{amount}; >- }elsif($row->{credit_type_code} eq 'FORW' || $row->{credit_type_code} eq 'W'){ >+ }elsif($row->{credit_type_code} eq 'FORGIVEN' || $row->{credit_type_code} eq 'W'){ > }else{ > $grantotal += abs($row->{amount}); > } >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index a357a3e348..8280bbd4c0 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -236,7 +236,7 @@ subtest 'add_credit() tests' => sub { > description => 'Manual credit applied', > library_id => $patron->branchcode, > user_id => $patron->id, >- type => 'forgiven', >+ type => 'FORGIVEN', > interface => 'commandline' > } > ); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23805
:
94153
|
94154
|
94155
|
94156
|
94157
|
94158
|
94159
|
94160
|
94161
|
94162
|
94163
|
94164
|
94166
|
94167
|
94168
|
94169
|
94170
|
94171
|
94172
|
94173
|
94174
|
94175
|
94176
|
94177
|
94178
|
94801
|
94815
|
94832
|
94895