Browse Source

Bug 23805: Update 'C' to 'CREDIT' for consistency

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Martin Renvoize 3 years ago
parent
commit
40613eb3c8
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 6
      Koha/Account.pm
  2. 2
      Koha/Account/Line.pm
  3. 2
      api/v1/swagger/definitions/patron_account_credit.json
  4. 2
      installer/data/mysql/account_credit_types.sql
  5. 9
      installer/data/mysql/atomicupdate/bug_23805_credit.perl
  6. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
  7. 2
      koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc
  8. 2
      reports/cash_register_stats.pl

6
Koha/Account.pm

@ -322,7 +322,7 @@ my $credit_line = Koha::Account->new({ patron_id => $patron_id })->add_credit(
);
$credit_type can be any of:
- 'credit'
- 'CREDIT'
- 'payment'
- 'forgiven'
- 'lost_item_return'
@ -716,7 +716,7 @@ sub reconcile_balance {
=cut
our $offset_type = {
'credit' => 'Manual Credit',
'CREDIT' => 'Manual Credit',
'forgiven' => 'Writeoff',
'lost_item_return' => 'Lost Item',
'payment' => 'Payment',
@ -739,7 +739,7 @@ our $offset_type = {
=cut
our $account_type_credit = {
'credit' => 'C',
'CREDIT' => 'CREDIT',
'forgiven' => 'FOR',
'lost_item_return' => 'LOST_RETURN',
'payment' => 'Pay',

2
Koha/Account/Line.pm

@ -338,7 +338,7 @@ sub adjust {
{
amount => $new_outstanding * -1,
description => 'Overpayment refund',
type => 'credit',
type => 'CREDIT',
interface => $interface,
( $update_type eq 'overdue_update' ? ( item_id => $self->itemnumber ) : ()),
}

2
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",

2
installer/data/mysql/account_credit_types.sql

@ -4,5 +4,5 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, is_s
('W', 'Writeoff', 0, 1),
('WO', 'Writeoff', 0, 1),
('FOR', 'Forgiven', 1, 1),
('C', 'Credit', 1, 1),
('CREDIT', 'Credit', 1, 1),
('LOST_RETURN', 'Lost item fee refund', 0, 1);

9
installer/data/mysql/atomicupdate/bug_23805_credit.perl

@ -41,7 +41,7 @@ if ( CheckVersion($DBversion) ) {
('W', 'Writeoff', 0, 1),
('WO', 'Writeoff', 0, 1),
('FOR', 'Forgiven', 1, 1),
('C', 'Credit', 1, 1),
('CREDIT', 'Credit', 1, 1),
('LOST_RETURN', 'Lost item fee refund', 0, 1)
}
);
@ -75,6 +75,13 @@ if ( CheckVersion($DBversion) ) {
}
);
# Update accountype 'C' to 'CREDIT'
$dbh->do(
qq{
UPDATE accountlines SET accounttype = 'CREDIT' WHERE accounttype = 'C' OR accounttype = 'CR'
}
);
# Populating credit_type_code
$dbh->do(
qq{

2
koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc

@ -7,7 +7,7 @@
[%- CASE 'FOR' -%]Forgiven
[%- CASE 'PAY' -%]Payment
[%- CASE 'WO' -%]Writeoff
[%- CASE 'C' -%]Credit
[%- CASE 'CREDIT' -%]Credit
[%- CASE 'LOST_RETURN' -%]Lost item fee refund
[%- CASE -%][% account.credit_type.description | html %]
[%- END -%]

2
koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc

@ -178,7 +178,7 @@
[%- CASE 'FOR' -%]Forgiven
[%- CASE 'PAY' -%]Payment
[%- CASE 'WO' -%]Writeoff
[%- CASE 'C' -%]Credit
[%- CASE 'CREDIT' -%]Credit
[%- CASE 'LOST_RETURN' -%]Lost item fee refund
[%- CASE -%][% account.credit_type.description | html %]
[%- END -%]

2
reports/cash_register_stats.pl

@ -72,7 +72,7 @@ if ($do_it) {
if ($transaction_type eq 'ALL') { #All Transactons
$whereTType = q{};
} elsif ($transaction_type eq 'ACT') { #Active
$whereTType = q{ AND credit_type_code IN ('Pay','C') };
$whereTType = q{ AND credit_type_code IN ('Pay','CREDIT') };
} elsif ($transaction_type eq 'FORW') {
$whereTType = q{ AND credit_type_code IN ('FOR','W') };
} else {

Loading…
Cancel
Save