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

(-)a/installer/data/mysql/atomicupdate/bug_30144_edifact_servicing_instruction.pl (+76 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  => "30144",
6
    description => "Add servicing_instruction support for EDIFACT orders",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        # Add servicing_instruction column to aqorders table
12
        if ( !column_exists( 'aqorders', 'servicing_instruction' ) ) {
13
            $dbh->do(
14
                q{
15
                ALTER TABLE aqorders
16
                ADD COLUMN servicing_instruction TEXT DEFAULT NULL
17
                COMMENT 'Servicing instructions from vendor (EDIFACT LVT/LVC) stored as JSON array'
18
                AFTER suppliers_report
19
            }
20
            );
21
            say_success( $out, "Added column 'aqorders.servicing_instruction'" );
22
        }
23
24
        # Add EDIFACT_SI category for servicing instruction codes
25
        $dbh->do(
26
            q{
27
            INSERT IGNORE INTO authorised_value_categories (category_name, is_system)
28
            VALUES ('EDIFACT_SI', 0)
29
        }
30
        );
31
        say_success( $out, "Added authorized value category 'EDIFACT_SI'" );
32
33
        # Add EDItEUR List 3B servicing instruction codes
34
        $dbh->do(
35
            q{
36
            INSERT IGNORE INTO authorised_values (category, authorised_value, lib, lib_opac)
37
            VALUES
38
                ('EDIFACT_SI', 'BB', 'Barcode labelling', 'Barcode labelling'),
39
                ('EDIFACT_SI', 'BBN', 'Do not apply barcode labels', 'Do not apply barcode labels'),
40
                ('EDIFACT_SI', 'BC', 'Classification', 'Classification'),
41
                ('EDIFACT_SI', 'BCN', 'Do not classify', 'Do not classify'),
42
                ('EDIFACT_SI', 'BI', 'Binding: binding, reinforcing, laminating', 'Binding: binding, reinforcing, laminating'),
43
                ('EDIFACT_SI', 'BIN', 'Do not apply normal binding', 'Do not apply normal binding'),
44
                ('EDIFACT_SI', 'BJ', 'Sleeving: jackets, sleeves, wallets', 'Sleeving: jackets, sleeves, wallets'),
45
                ('EDIFACT_SI', 'BJN', 'Do not supply normal sleeving', 'Do not supply normal sleeving'),
46
                ('EDIFACT_SI', 'BP', 'Audio/CD-ROM packaging: special pouches', 'Audio/CD-ROM packaging: special pouches'),
47
                ('EDIFACT_SI', 'BPN', 'Do not supply normal audio/CD-ROM packaging', 'Do not supply normal audio/CD-ROM packaging'),
48
                ('EDIFACT_SI', 'BS', 'Security fitting: triggers, Knogo labels', 'Security fitting: triggers, Knogo labels'),
49
                ('EDIFACT_SI', 'BSN', 'Do not apply usual security fitting', 'Do not apply usual security fitting'),
50
                ('EDIFACT_SI', 'CA', 'Cataloguing: catalogue record supply', 'Cataloguing: catalogue record supply'),
51
                ('EDIFACT_SI', 'CAN', 'Do not supply catalogue record', 'Do not supply catalogue record'),
52
                ('EDIFACT_SI', 'JK', 'Plastic wallet on paperback', 'Plastic wallet on paperback'),
53
                ('EDIFACT_SI', 'JKN', 'Do not supply plastic wallet', 'Do not supply plastic wallet'),
54
                ('EDIFACT_SI', 'KA', 'Kapco: thick laminate film on paperback', 'Kapco: thick laminate film on paperback'),
55
                ('EDIFACT_SI', 'KAN', 'Do not apply Kapco', 'Do not apply Kapco'),
56
                ('EDIFACT_SI', 'LA', 'Thin laminate film on paperback', 'Thin laminate film on paperback'),
57
                ('EDIFACT_SI', 'LAN', 'Do not laminate', 'Do not laminate'),
58
                ('EDIFACT_SI', 'RE', 'Reinforcement of hardback', 'Reinforcement of hardback'),
59
                ('EDIFACT_SI', 'REN', 'Do not reinforce hardback', 'Do not reinforce hardback'),
60
                ('EDIFACT_SI', 'RP', 'Reinforcement of paperback', 'Reinforcement of paperback'),
61
                ('EDIFACT_SI', 'RPN', 'Do not reinforce paperback', 'Do not reinforce paperback'),
62
                ('EDIFACT_SI', 'SF', 'Sewn flexi', 'Sewn flexi'),
63
                ('EDIFACT_SI', 'SFN', 'Do not sew', 'Do not sew'),
64
                ('EDIFACT_SI', 'SL', 'Plastic sleeve on hardback', 'Plastic sleeve on hardback'),
65
                ('EDIFACT_SI', 'SLN', 'Do not sleeve plastic on hardback', 'Do not sleeve plastic on hardback'),
66
                ('EDIFACT_SI', 'TR', 'Traditional case binding of paperback', 'Traditional case binding of paperback'),
67
                ('EDIFACT_SI', 'TRN', 'Do not case bind paperback', 'Do not case bind paperback'),
68
                ('EDIFACT_SI', 'NF', 'Non-standard servicing: see free text', 'Non-standard servicing: see free text'),
69
                ('EDIFACT_SI', 'NS', 'No servicing', 'No servicing'),
70
                ('EDIFACT_SI', 'NX', 'Non-standard servicing: see instructions sent outside EDI', 'Non-standard servicing: see instructions sent outside EDI'),
71
                ('EDIFACT_SI', 'PF', 'Binding as supplied by publisher', 'Binding as supplied by publisher')
72
        }
73
        );
74
        say_success( $out, "Added EDItEUR List 3B servicing instruction codes to 'EDIFACT_SI' category" );
75
    },
76
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 780-785 CREATE TABLE `aqorders` ( Link Here
780
  `suppliers_reference_number` varchar(35) DEFAULT NULL COMMENT 'Suppliers unique edifact quote ref',
780
  `suppliers_reference_number` varchar(35) DEFAULT NULL COMMENT 'Suppliers unique edifact quote ref',
781
  `suppliers_reference_qualifier` varchar(3) DEFAULT NULL COMMENT 'Type of number above usually ''QLI''',
781
  `suppliers_reference_qualifier` varchar(3) DEFAULT NULL COMMENT 'Type of number above usually ''QLI''',
782
  `suppliers_report` mediumtext DEFAULT NULL COMMENT 'reports received from suppliers',
782
  `suppliers_report` mediumtext DEFAULT NULL COMMENT 'reports received from suppliers',
783
  `servicing_instruction` text DEFAULT NULL COMMENT 'Servicing instructions from vendor (EDIFACT LVT/LVC) stored as JSON array',
783
  `estimated_delivery_date` date DEFAULT NULL COMMENT 'Estimated delivery date',
784
  `estimated_delivery_date` date DEFAULT NULL COMMENT 'Estimated delivery date',
784
  `invoice_unitprice` decimal(28,6) DEFAULT NULL COMMENT 'the unit price in foreign currency',
785
  `invoice_unitprice` decimal(28,6) DEFAULT NULL COMMENT 'the unit price in foreign currency',
785
  `invoice_currency` varchar(10) DEFAULT NULL COMMENT 'the currency of the invoice_unitprice',
786
  `invoice_currency` varchar(10) DEFAULT NULL COMMENT 'the currency of the invoice_unitprice',
786
- 

Return to bug 30144