|
Line 0
Link Here
|
|
|
1 |
use Modern::Perl; |
| 2 |
use Koha::Installer::Output qw(say_warning say_failure say_success say_info); |
| 3 |
|
| 4 |
return { |
| 5 |
bug_number => "38207", |
| 6 |
description => "Add a payment method to the vendor table", |
| 7 |
up => sub { |
| 8 |
my ($args) = @_; |
| 9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
| 10 |
|
| 11 |
unless ( column_exists( 'aqbooksellers', 'payment_method' ) ) { |
| 12 |
$dbh->do( |
| 13 |
q{ |
| 14 |
ALTER TABLE aqbooksellers |
| 15 |
ADD COLUMN `payment_method` varchar(255) NULL DEFAULT NULL |
| 16 |
COMMENT 'the payment method for the vendor' |
| 17 |
AFTER external_id |
| 18 |
} |
| 19 |
); |
| 20 |
|
| 21 |
say $out "Added new column 'aqbooksellers.payment_method'"; |
| 22 |
} |
| 23 |
|
| 24 |
$dbh->do( |
| 25 |
q{ |
| 26 |
INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) VALUES ('VENDOR_PAYMENT_METHOD', 1); |
| 27 |
} |
| 28 |
); |
| 29 |
say $out "Added VENDOR_PAYMENT_METHOD authorised value category"; |
| 30 |
|
| 31 |
$dbh->do( |
| 32 |
q{ |
| 33 |
INSERT IGNORE INTO authorised_values (category, authorised_value, lib) |
| 34 |
VALUES |
| 35 |
('VENDOR_PAYMENT_METHOD', 'card', 'Card'), |
| 36 |
('VENDOR_PAYMENT_METHOD', 'bacs', 'BACS'); |
| 37 |
} |
| 38 |
); |
| 39 |
say $out "Added Card and BACS to VENDOR_PAYMENT_METHODS authorised value category"; |
| 40 |
}, |
| 41 |
}; |