View | Details | Raw Unified | Return to bug 23805
Collapse All | Expand All

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 2366-2372 sub _FixOverduesOnReturn { Link Here
2366
                        user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
2366
                        user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
2367
                        library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
2367
                        library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
2368
                        interface  => C4::Context->interface,
2368
                        interface  => C4::Context->interface,
2369
                        type       => 'forgiven',
2369
                        type       => 'FORGIVEN',
2370
                        item_id    => $item
2370
                        item_id    => $item
2371
                    }
2371
                    }
2372
                );
2372
                );
(-)a/Koha/Account.pm (-2 / +2 lines)
Lines 717-723 sub reconcile_balance { Link Here
717
717
718
our $offset_type = {
718
our $offset_type = {
719
    'CREDIT'           => 'Manual Credit',
719
    'CREDIT'           => 'Manual Credit',
720
    'forgiven'         => 'Writeoff',
720
    'FORGIVEN'         => 'Writeoff',
721
    'lost_item_return' => 'Lost Item',
721
    'lost_item_return' => 'Lost Item',
722
    'payment'          => 'Payment',
722
    'payment'          => 'Payment',
723
    'writeoff'         => 'Writeoff',
723
    'writeoff'         => 'Writeoff',
Lines 740-746 our $offset_type = { Link Here
740
740
741
our $account_type_credit = {
741
our $account_type_credit = {
742
    'CREDIT'           => 'CREDIT',
742
    'CREDIT'           => 'CREDIT',
743
    'forgiven'         => 'FOR',
743
    'FORGIVEN'         => 'FORGIVEN',
744
    'lost_item_return' => 'LOST_RETURN',
744
    'lost_item_return' => 'LOST_RETURN',
745
    'payment'          => 'Pay',
745
    'payment'          => 'Pay',
746
    'writeoff'         => 'W'
746
    'writeoff'         => 'W'
(-)a/api/v1/swagger/definitions/patron_account_credit.json (-1 / +1 lines)
Lines 3-9 Link Here
3
  "properties": {
3
  "properties": {
4
    "credit_type": {
4
    "credit_type": {
5
      "type": "string",
5
      "type": "string",
6
      "description": "Type of credit ('CREDIT', 'forgiven', 'lost_item_return', 'payment', 'writeoff' )"
6
      "description": "Type of credit ('CREDIT', 'FORGIVEN', 'lost_item_return', 'payment', 'writeoff' )"
7
    },
7
    },
8
    "amount": {
8
    "amount": {
9
      "type": "number",
9
      "type": "number",
(-)a/installer/data/mysql/account_credit_types.sql (-1 / +1 lines)
Lines 3-8 INSERT INTO account_debit_types ( code, description, can_be_added_manually, is_s Link Here
3
('PAY', 'Payment', 0, 1),
3
('PAY', 'Payment', 0, 1),
4
('W', 'Writeoff', 0, 1),
4
('W', 'Writeoff', 0, 1),
5
('WO', 'Writeoff', 0, 1),
5
('WO', 'Writeoff', 0, 1),
6
('FOR', 'Forgiven', 1, 1),
6
('FORGIVEN', 'Forgiven', 1, 1),
7
('CREDIT', 'Credit', 1, 1),
7
('CREDIT', 'Credit', 1, 1),
8
('LOST_RETURN', 'Lost item fee refund', 0, 1);
8
('LOST_RETURN', 'Lost item fee refund', 0, 1);
(-)a/installer/data/mysql/atomicupdate/bug_23908_credit.perl (-1 / +8 lines)
Lines 40-46 if ( CheckVersion($DBversion) ) { Link Here
40
              ('PAY', 'Payment', 0, 1),
40
              ('PAY', 'Payment', 0, 1),
41
              ('W', 'Writeoff', 0, 1),
41
              ('W', 'Writeoff', 0, 1),
42
              ('WO', 'Writeoff', 0, 1),
42
              ('WO', 'Writeoff', 0, 1),
43
              ('FOR', 'Forgiven', 1, 1),
43
              ('FORGIVEN', 'Forgiven', 1, 1),
44
              ('CREDIT', 'Credit', 1, 1),
44
              ('CREDIT', 'Credit', 1, 1),
45
              ('LOST_RETURN', 'Lost item fee refund', 0, 1)
45
              ('LOST_RETURN', 'Lost item fee refund', 0, 1)
46
        }
46
        }
Lines 82-87 if ( CheckVersion($DBversion) ) { Link Here
82
        }
82
        }
83
    );
83
    );
84
84
85
    # Update accountype 'FOR' to 'FORGIVEN'
86
    $dbh->do(
87
        qq{
88
          UPDATE accountlines SET accounttype = 'FORGIVEN' WHERE accounttype = 'FOR' OR accounttype = 'FORW'
89
        }
90
    );
91
85
    # Populating credit_type_code
92
    # Populating credit_type_code
86
    $dbh->do(
93
    $dbh->do(
87
        qq{
94
        qq{
(-)a/installer/data/mysql/en/mandatory/account_credit_types.sql (-1 / +1 lines)
Lines 3-8 INSERT INTO account_debit_types ( code, description, can_be_added_manually, is_s Link Here
3
('PAY', 'Payment', 0, 1),
3
('PAY', 'Payment', 0, 1),
4
('W', 'Writeoff', 0, 1),
4
('W', 'Writeoff', 0, 1),
5
('WO', 'Writeoff', 0, 1),
5
('WO', 'Writeoff', 0, 1),
6
('FOR', 'Forgiven', 1, 1),
6
('FORGIVEN', 'Forgiven', 1, 1),
7
('CREDIT', 'Credit', 1, 1),
7
('CREDIT', 'Credit', 1, 1),
8
('LOST_RETURN', 'Lost item fee refund', 0, 1);
8
('LOST_RETURN', 'Lost item fee refund', 0, 1);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (-1 / +1 lines)
Lines 4-10 Link Here
4
        [%- SWITCH account.credit_type_code -%]
4
        [%- SWITCH account.credit_type_code -%]
5
            [%- CASE 'Pay'              -%]Payment
5
            [%- CASE 'Pay'              -%]Payment
6
            [%- CASE 'W'                -%]Writeoff
6
            [%- CASE 'W'                -%]Writeoff
7
            [%- CASE 'FOR'              -%]Forgiven
7
            [%- CASE 'FORGIVEN'         -%]Forgiven
8
            [%- CASE 'PAY'              -%]Payment
8
            [%- CASE 'PAY'              -%]Payment
9
            [%- CASE 'WO'               -%]Writeoff
9
            [%- CASE 'WO'               -%]Writeoff
10
            [%- CASE 'CREDIT'           -%]Credit
10
            [%- CASE 'CREDIT'           -%]Credit
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (-1 / +1 lines)
Lines 175-181 Link Here
175
        [%- SWITCH account.credit_type_code -%]
175
        [%- SWITCH account.credit_type_code -%]
176
            [%- CASE 'Pay'              -%]Payment
176
            [%- CASE 'Pay'              -%]Payment
177
            [%- CASE 'W'                -%]Writeoff
177
            [%- CASE 'W'                -%]Writeoff
178
            [%- CASE 'FOR'              -%]Forgiven
178
            [%- CASE 'FORGIVEN'         -%]Forgiven
179
            [%- CASE 'PAY'              -%]Payment
179
            [%- CASE 'PAY'              -%]Payment
180
            [%- CASE 'WO'               -%]Writeoff
180
            [%- CASE 'WO'               -%]Writeoff
181
            [%- CASE 'CREDIT'           -%]Credit
181
            [%- CASE 'CREDIT'           -%]Credit
(-)a/reports/cash_register_stats.pl (-2 / +2 lines)
Lines 74-80 if ($do_it) { Link Here
74
    } elsif ($transaction_type eq 'ACT') { #Active
74
    } elsif ($transaction_type eq 'ACT') { #Active
75
        $whereTType = q{ AND credit_type_code IN ('Pay','CREDIT') };
75
        $whereTType = q{ AND credit_type_code IN ('Pay','CREDIT') };
76
    } elsif ($transaction_type eq 'FORW') {
76
    } elsif ($transaction_type eq 'FORW') {
77
        $whereTType = q{ AND credit_type_code IN ('FOR','W') };
77
        $whereTType = q{ AND credit_type_code IN ('FORGIVEN','W') };
78
    } else {
78
    } else {
79
        if ( any { $transaction_type eq $_->code } @debit_types ) {
79
        if ( any { $transaction_type eq $_->code } @debit_types ) {
80
            $whereTType = q{ AND debit_type_code = ? };
80
            $whereTType = q{ AND debit_type_code = ? };
Lines 128-134 if ($do_it) { Link Here
128
            if($row->{credit_type_code} =~ /^C$|^CR$/){
128
            if($row->{credit_type_code} =~ /^C$|^CR$/){
129
                $grantotal -= abs($row->{amount});
129
                $grantotal -= abs($row->{amount});
130
                $row->{amount} = '-' . $row->{amount};
130
                $row->{amount} = '-' . $row->{amount};
131
            }elsif($row->{credit_type_code} eq 'FORW' || $row->{credit_type_code} eq 'W'){
131
            }elsif($row->{credit_type_code} eq 'FORGIVEN' || $row->{credit_type_code} eq 'W'){
132
            }else{
132
            }else{
133
                $grantotal += abs($row->{amount});
133
                $grantotal += abs($row->{amount});
134
            }
134
            }
(-)a/t/db_dependent/Koha/Account.t (-2 / +1 lines)
Lines 236-242 subtest 'add_credit() tests' => sub { Link Here
236
            description => 'Manual credit applied',
236
            description => 'Manual credit applied',
237
            library_id  => $patron->branchcode,
237
            library_id  => $patron->branchcode,
238
            user_id     => $patron->id,
238
            user_id     => $patron->id,
239
            type        => 'forgiven',
239
            type        => 'FORGIVEN',
240
            interface   => 'commandline'
240
            interface   => 'commandline'
241
        }
241
        }
242
    );
242
    );
243
- 

Return to bug 23805