Line 0
Link Here
|
|
|
1 |
use Modern::Perl; |
2 |
use Koha::Installer::Output qw(say_warning say_success say_info); |
3 |
|
4 |
return { |
5 |
bug_number => "4858", |
6 |
description => "Add print notice charge to patron categories and setup print transports", |
7 |
up => sub { |
8 |
my ($args) = @_; |
9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
10 |
|
11 |
# Add print_notice_charge column to categories table |
12 |
$dbh->do( |
13 |
q{ALTER TABLE categories |
14 |
ADD COLUMN print_notice_charge decimal(28,6) DEFAULT 0.00 |
15 |
COMMENT 'charge for print notices (0.00 = disabled)' |
16 |
AFTER reservefee} |
17 |
); |
18 |
|
19 |
# Add PRINT_NOTICE debit type |
20 |
$dbh->do( |
21 |
q{ |
22 |
INSERT IGNORE INTO account_debit_types (code, description, can_be_invoiced, can_be_sold, default_amount, is_system, restricts_checkouts) |
23 |
VALUES ('PRINT_NOTICE', 'Print notice charge', 0, 0, 0.50, 1, 0) |
24 |
} |
25 |
); |
26 |
|
27 |
# Add comprehensive print transport entries for all standard notice types |
28 |
# This enables print checkboxes to appear in messaging preferences |
29 |
$dbh->do( |
30 |
q{ |
31 |
INSERT IGNORE INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code, branchcode) |
32 |
VALUES |
33 |
(1, 'print', 0, 'circulation', 'DUE', ''), |
34 |
(1, 'print', 1, 'circulation', 'DUEDGST', ''), |
35 |
(2, 'print', 0, 'circulation', 'PREDUE', ''), |
36 |
(2, 'print', 1, 'circulation', 'PREDUEDGST', ''), |
37 |
(4, 'print', 0, 'reserves', 'HOLD', ''), |
38 |
(4, 'print', 1, 'reserves', 'HOLDDGST', ''), |
39 |
(5, 'print', 0, 'circulation', 'CHECKIN', ''), |
40 |
(6, 'print', 0, 'circulation', 'CHECKOUT', ''), |
41 |
(7, 'print', 0, 'ill', 'ILL_PICKUP_READY', ''), |
42 |
(8, 'print', 0, 'ill', 'ILL_REQUEST_UNAVAIL', ''), |
43 |
(9, 'print', 0, 'circulation', 'AUTO_RENEWALS', ''), |
44 |
(9, 'print', 1, 'circulation', 'AUTO_RENEWALS_DGST', ''), |
45 |
(10, 'print', 0, 'circulation', 'HOLD_REMINDER', ''), |
46 |
(11, 'print', 0, 'ill', 'ILL_REQUEST_UPDATE', ''), |
47 |
(12, 'print', 0, 'circulation', 'PICKUP_RECALLED_ITEM', ''), |
48 |
(13, 'print', 0, 'circulation', 'RETURN_RECALLED_ITEM', ''), |
49 |
(14, 'print', 0, 'members', 'MEMBERSHIP_EXPIRY', '') |
50 |
} |
51 |
); |
52 |
|
53 |
say_success( |
54 |
$out, |
55 |
"Added print_notice_charge column to categories table, debit type, and comprehensive print transport entries for print notice charging" |
56 |
); |
57 |
}, |
58 |
}; |