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

(-)a/installer/data/mysql/atomicupdate/bug_40932.pl (+34 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  => "40932",
6
    description => "Add automatic invoice closing on physical item receipt",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        if ( !column_exists( 'aqorders_items', 'received' ) ) {
12
            $dbh->do(
13
                q{
14
                ALTER TABLE aqorders_items
15
                    ADD COLUMN `received` datetime DEFAULT NULL
16
                    COMMENT 'Datetime the item was first physically received via circulation check-in'
17
            }
18
            );
19
            say_success( $out, "Added column 'aqorders_items.received'" );
20
        }
21
22
        $dbh->do(
23
            q{
24
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
25
            VALUES
26
            ('AutoCloseInvoicesOnCheckin', '0', NULL,
27
             'Automatically close acquisitions invoices when all their items have been physically checked in at circulation', 'YesNo'),
28
            ('AutoCloseInvoiceAlertDays', '14', NULL,
29
             'Show staff alert for open invoices with outstanding items older than this many days. 0 = disabled.', 'Integer')
30
        }
31
        );
32
        say_success( $out, "Added system preferences 'AutoCloseInvoicesOnCheckin' and 'AutoCloseInvoiceAlertDays'" );
33
    },
34
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 833-838 CREATE TABLE `aqorders_items` ( Link Here
833
  `ordernumber` int(11) NOT NULL COMMENT 'the order this item is attached to (aqorders.ordernumber)',
833
  `ordernumber` int(11) NOT NULL COMMENT 'the order this item is attached to (aqorders.ordernumber)',
834
  `itemnumber` int(11) NOT NULL COMMENT 'the item number for this item (items.itemnumber)',
834
  `itemnumber` int(11) NOT NULL COMMENT 'the item number for this item (items.itemnumber)',
835
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this order item was last touched',
835
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this order item was last touched',
836
  `received` datetime DEFAULT NULL COMMENT 'Datetime the item was first physically received via circulation check-in',
836
  PRIMARY KEY (`itemnumber`),
837
  PRIMARY KEY (`itemnumber`),
837
  KEY `ordernumber` (`ordernumber`),
838
  KEY `ordernumber` (`ordernumber`),
838
  CONSTRAINT `aqorders_items_ibfk_1` FOREIGN KEY (`ordernumber`) REFERENCES `aqorders` (`ordernumber`) ON DELETE CASCADE ON UPDATE CASCADE
839
  CONSTRAINT `aqorders_items_ibfk_1` FOREIGN KEY (`ordernumber`) REFERENCES `aqorders` (`ordernumber`) ON DELETE CASCADE ON UPDATE CASCADE
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +2 lines)
Lines 91-96 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
91
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
91
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
92
('AutoClaimReturnStatusOnCheckin','',NULL,'When in use this system preference will automatically resolve the claim return and will update the lost authorized value upon check in.','Free'),
92
('AutoClaimReturnStatusOnCheckin','',NULL,'When in use this system preference will automatically resolve the claim return and will update the lost authorized value upon check in.','Free'),
93
('AutoClaimReturnStatusOnCheckout','',NULL,'When in use this system preference will automatically resolve the claim return and will update the lost authorized value upon check out.','Free'),
93
('AutoClaimReturnStatusOnCheckout','',NULL,'When in use this system preference will automatically resolve the claim return and will update the lost authorized value upon check out.','Free'),
94
('AutoCloseInvoiceAlertDays','14',NULL,'Show a staff alert for open invoices with items not yet physically received for more than this many days (0 to disable).','Integer'),
95
('AutoCloseInvoicesOnCheckin','0',NULL,'If enabled, automatically close acquisition invoices when all items on non-cancelled order lines have been physically checked in at circulation.','YesNo'),
94
('autoControlNumber','OFF','biblionumber|OFF','Used to autogenerate a Control Number: biblionumber will be as biblionumber, OFF will leave the field as it is;','Choice'),
96
('autoControlNumber','OFF','biblionumber|OFF','Used to autogenerate a Control Number: biblionumber will be as biblionumber, OFF will leave the field as it is;','Choice'),
95
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
97
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
96
('AutoCreditNumber', '', NULL, 'Automatically generate a number for account credits', 'Choice'),
98
('AutoCreditNumber', '', NULL, 'Automatically generate a number for account credits', 'Choice'),
97
- 

Return to bug 40932