Bug 21443: Update database
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 9 Mar 2020 17:11:55 +0000 (13:11 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 11:08:42 +0000 (11:08 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_21443.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql

diff --git a/installer/data/mysql/atomicupdate/bug_21443.perl b/installer/data/mysql/atomicupdate/bug_21443.perl
new file mode 100644 (file)
index 0000000..74cf57f
--- /dev/null
@@ -0,0 +1,22 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    if( !column_exists( 'itemtypes', 'rentalcharge_daily_calendar' ) ) {
+        $dbh->do(q{
+            ALTER TABLE itemtypes ADD COLUMN
+            rentalcharge_daily_calendar tinyint(1) NOT NULL DEFAULT 1
+            AFTER rentalcharge_daily;
+        });
+    }
+
+    if( !column_exists( 'itemtypes', 'rentalcharge_hourly_calendar' ) ) {
+        $dbh->do(q{
+            ALTER TABLE itemtypes ADD COLUMN
+            rentalcharge_hourly_calendar tinyint(1) NOT NULL DEFAULT 1
+            AFTER rentalcharge_hourly;
+        });
+    }
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21443: Add ability to exclude holidays when calculating rentals fees by time period)\n";
+}
index 6495f25..6fc6fa2 100644 (file)
@@ -878,7 +878,9 @@ CREATE TABLE `itemtypes` ( -- defines the item types
   description LONGTEXT, -- a plain text explanation of the item type
   rentalcharge decimal(28,6) default NULL, -- the amount charged when this item is checked out/issued
   rentalcharge_daily decimal(28,6) default NULL, -- the amount charged for each day between checkout date and due date
+  rentalcharge_daily_calendar tinyint(1) NOT NULL DEFAULT 1, -- controls if the daily retnal fee is calculated directly or using finesCalendar
   rentalcharge_hourly decimal(28,6) default NULL, -- the amount charged for each hour between checkout date and due date
+  rentalcharge_hourly_calendar tinyint(1) NOT NULL DEFAULT 1, -- controls if the hourly retnal fee is calculated directly or using finesCalendar
   defaultreplacecost decimal(28,6) default NULL, -- default replacement cost
   processfee decimal(28,6) default NULL, -- default text be recorded in the column note when the processing fee is applied
   notforloan smallint(6) default NULL, -- 1 if the item is not for loan, 0 if the item is available for loan