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

(-)a/installer/data/mysql/atomicupdate/bug_4858-print-notice-charge.pl (+58 lines)
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
};
(-)a/installer/data/mysql/en/mandatory/account_debit_types.yml (+7 lines)
Lines 74-79 tables: Link Here
74
          default_amount: ~
74
          default_amount: ~
75
          is_system: "1"
75
          is_system: "1"
76
76
77
        - code: "PRINT_NOTICE"
78
          description: "Print notice charge"
79
          can_be_invoiced: "0"
80
          can_be_sold: "0"
81
          default_amount: ~
82
          is_system: "1"
83
77
        - code: "PROCESSING"
84
        - code: "PROCESSING"
78
          description: "Lost item processing fee"
85
          description: "Lost item processing fee"
79
          can_be_invoiced: "0"
86
          can_be_invoiced: "0"
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 1804-1809 CREATE TABLE `categories` ( Link Here
1804
  `enrolmentfee` decimal(28,6) DEFAULT NULL COMMENT 'enrollment fee for the patron',
1804
  `enrolmentfee` decimal(28,6) DEFAULT NULL COMMENT 'enrollment fee for the patron',
1805
  `overduenoticerequired` tinyint(1) DEFAULT NULL COMMENT 'are overdue notices sent to this patron category (1 for yes, 0 for no)',
1805
  `overduenoticerequired` tinyint(1) DEFAULT NULL COMMENT 'are overdue notices sent to this patron category (1 for yes, 0 for no)',
1806
  `reservefee` decimal(28,6) DEFAULT NULL COMMENT 'cost to place holds',
1806
  `reservefee` decimal(28,6) DEFAULT NULL COMMENT 'cost to place holds',
1807
  `print_notice_charge` decimal(28,6) DEFAULT 0.00 COMMENT 'charge for print notices (0.00 = disabled)',
1807
  `hidelostitems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'are lost items shown to this category (1 for yes, 0 for no)',
1808
  `hidelostitems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'are lost items shown to this category (1 for yes, 0 for no)',
1808
  `category_type` varchar(1) NOT NULL DEFAULT 'A' COMMENT 'type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)',
1809
  `category_type` varchar(1) NOT NULL DEFAULT 'A' COMMENT 'type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)',
1809
  `BlockExpiredPatronOpacActions` varchar(128) NOT NULL DEFAULT 'follow_syspref_BlockExpiredPatronOpacActions' COMMENT 'specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed',
1810
  `BlockExpiredPatronOpacActions` varchar(128) NOT NULL DEFAULT 'follow_syspref_BlockExpiredPatronOpacActions' COMMENT 'specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed',
1810
- 

Return to bug 4858