@@ -, +, @@ and will destroy settings --- installer/data/mysql/kohastructure.sql | 4 ++-- installer/data/mysql/updatedatabase.pl | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -904,9 +904,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_daily_calendar tinyint(1) NOT NULL DEFAULT 1, -- controls if the daily rental 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 + rentalcharge_hourly_calendar tinyint(1) NOT NULL DEFAULT 1, -- controls if the hourly rental 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 --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -21260,12 +21260,17 @@ if( CheckVersion( $DBversion ) ) { $DBversion = '19.12.00.052'; if( CheckVersion( $DBversion ) ) { + my $finesCalendar = C4::Context->preference('finesCalendar'); + my $value = $finesCalendar eq 'noFinesWhenClosed' ? 1 : 0; + 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; }); + + $dbh->do("UPDATE itemtypes SET rentalcharge_daily_calendar = $value"); } if( !column_exists( 'itemtypes', 'rentalcharge_hourly_calendar' ) ) { @@ -21274,11 +21279,9 @@ if( CheckVersion( $DBversion ) ) { rentalcharge_hourly_calendar tinyint(1) NOT NULL DEFAULT 1 AFTER rentalcharge_hourly; }); - } - my $finesCalendar = C4::Context->preference('finesCalendar'); - my $value = $finesCalendar eq 'noFinesWhenClosed' ? 1 : 0; - $dbh->do("UPDATE itemtypes SET rentalcharge_hourly_calendar = $value, rentalcharge_daily_calendar = $value"); + $dbh->do("UPDATE itemtypes SET rentalcharge_hourly_calendar = $value"); + } NewVersion( $DBversion, 21443, "Add ability to exclude holidays when calculating rentals fees by time period"); } --