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

(-)a/installer/data/mysql/account_credit_types.sql (-1 / +1 lines)
Lines 4-10 INSERT INTO account_credit_types ( code, description, can_be_added_manually, is_ Link Here
4
('FORGIVEN', 'Forgiven', 1, 1),
4
('FORGIVEN', 'Forgiven', 1, 1),
5
('CREDIT', 'Credit', 1, 1),
5
('CREDIT', 'Credit', 1, 1),
6
('REFUND', 'A refund applied to a patrons fine', 0, 1),
6
('REFUND', 'A refund applied to a patrons fine', 0, 1),
7
('LOST_RETURN', 'Lost item fee refund', 0, 1),
7
('LOST_FOUND', 'Lost item fee refund', 0, 1),
8
('PURCHASE', 'Purchase', 0, 1);
8
('PURCHASE', 'Purchase', 0, 1);
9
9
10
INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('PAYMENT_TYPE','CASH','Cash');
10
INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('PAYMENT_TYPE','CASH','Cash');
(-)a/installer/data/mysql/atomicupdate/bug_24592.perl (-1 / +41 lines)
Line 0 Link Here
0
- 
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    # Add LOST_FOUND debit type
5
    $dbh->do(qq{
6
        INSERT IGNORE INTO
7
          account_credit_types ( code, description, can_be_added_manually, is_system )
8
        VALUES
9
          ('LOST_FOUND', 'Lost item fee refund', 0, 1)
10
    });
11
12
    # Migrate LOST_RETURN to LOST_FOUND
13
    $dbh->do(qq{
14
        UPDATE
15
          accountlines
16
        SET
17
          credit_type_code = 'LOST_FOUND'
18
        WHERE
19
          credit_type_code = 'LOST_RETURN'
20
    });
21
22
    # Migrate LOST + RETURNED to LOST + FOUND
23
    $dbh->do(qq{
24
        UPDATE
25
          accountlines
26
        SET
27
          status = 'FOUND'
28
        WHERE
29
          debit_type_code = 'LOST'
30
        AND
31
          status = 'RETURNED'
32
    });
33
34
    # Drop LOST_RETURNED credit type
35
    $dbh->do(qq{
36
        DELETE FROM account_credit_types WHERE code = 'LOST_RETURN'
37
    });
38
39
    SetVersion( $DBversion );
40
    print "Upgrade to $DBversion done (Bug 24592 - Update LOST_RETURN to LOST_FOUND)\n";
41
}

Return to bug 24592