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

(-)a/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl (-5 / +6 lines)
Lines 9-15 return { Link Here
9
9
10
        if( !column_exists( 'account_debit_types', 'restricts_checkouts' ) ) {
10
        if( !column_exists( 'account_debit_types', 'restricts_checkouts' ) ) {
11
          $dbh->do(q{
11
          $dbh->do(q{
12
              ALTER TABLE account_debit_types ADD COLUMN `restricts_checkouts` tinyint(1) NOT NULL DEFAULT 1 AFTER `archived`
12
              ALTER TABLE account_debit_types ADD COLUMN `restricts_checkouts` tinyint(1) NOT NULL DEFAULT 1
13
                  COMMENT 'boolean flag to denote if the noissuescharge syspref for this debit type is active'
14
                  AFTER `archived`;
13
          });
15
          });
14
16
15
          say $out "Added column 'account_debit_types.restricts_checkouts'";
17
          say $out "Added column 'account_debit_types.restricts_checkouts'";
Lines 20-26 return { Link Here
20
22
21
        # Hardcoded values from sub non_issues_charges
23
        # Hardcoded values from sub non_issues_charges
22
        my @holds = ('RESERVE');
24
        my @holds = ('RESERVE');
23
        my @renewals = ('RENT', 'RENT_DAILY', 'RENT_RENEW', 'RENT_DAILY_RENEW');
25
        my @rentals = ('RENT', 'RENT_DAILY', 'RENT_RENEW', 'RENT_DAILY_RENEW');
24
        my @manual;
26
        my @manual;
25
        my $sth = $dbh->prepare("SELECT code FROM account_debit_types WHERE is_system = 0");
27
        my $sth = $dbh->prepare("SELECT code FROM account_debit_types WHERE is_system = 0");
26
        $sth->execute;
28
        $sth->execute;
Lines 51-57 return { Link Here
51
                    my @debit_types_to_update;
53
                    my @debit_types_to_update;
52
54
53
                    if($_ eq 'ManInvInNoissuesCharge') { push @debit_types_to_update, @manual};
55
                    if($_ eq 'ManInvInNoissuesCharge') { push @debit_types_to_update, @manual};
54
                    if($_ eq 'RentalsInNoissuesCharge') { push @debit_types_to_update, @renewals};
56
                    if($_ eq 'RentalsInNoissuesCharge') { push @debit_types_to_update, @rentals};
55
                    if($_ eq 'HoldsInNoissuesCharge') { push @debit_types_to_update, @holds};
57
                    if($_ eq 'HoldsInNoissuesCharge') { push @debit_types_to_update, @holds};
56
58
57
                    my $string = join(",", map { $dbh->quote($_) } @debit_types_to_update);
59
                    my $string = join(",", map { $dbh->quote($_) } @debit_types_to_update);
Lines 74-77 return { Link Here
74
76
75
        }
77
        }
76
    },
78
    },
77
};
79
};
78
- 

Return to bug 32450