Bug 19804: Add new DB column issuingrules.suspension_chargeperiod
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 13 Dec 2017 19:56:38 +0000 (16:56 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 9 Apr 2018 19:15:18 +0000 (16:15 -0300)
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug_19804.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql

diff --git a/installer/data/mysql/atomicupdate/bug_19804.perl b/installer/data/mysql/atomicupdate/bug_19804.perl
new file mode 100644 (file)
index 0000000..76f2122
--- /dev/null
@@ -0,0 +1,12 @@
+$DBversion = 'XXX';
+if( CheckVersion( $DBversion ) ) {
+
+    if( !column_exists( 'issuingrules', 'suspension_chargeperiod' ) ) {
+        $dbh->do(q|
+            ALTER TABLE issuingrules ADD COLUMN suspension_chargeperiod int(11) DEFAULT '1' AFTER maxsuspensiondays;
+        |);
+    }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 19804: Add issuingrules.suspension_chargeperiod)\n";
+}
index aa8f78f..52f0922 100644 (file)
@@ -837,6 +837,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules
   `fine` decimal(28,6) default NULL, -- fine amount
   `finedays` int(11) default NULL, -- suspension in days
   `maxsuspensiondays` int(11) default NULL, -- max suspension days
+  `suspension_chargeperiod` int(11) default '1', -- how often the finedays is charged
   `firstremind` int(11) default NULL, -- fine grace period
   `chargeperiod` int(11) default NULL, -- how often the fine amount is charged
   `chargeperiod_charge_at` tinyint(1) NOT NULL DEFAULT '0', -- Should fine be given at the start ( 1 ) or the end ( 0 ) of the period