Bugzilla – Attachment 187412 Details for
Bug 36506
Processing Fee should be configurable by branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36506: Database update
Bug-36506-Database-update.patch (text/plain), 3.61 KB, created by
Nick Clemens (kidclamp)
on 2025-10-03 16:28:44 UTC
(
hide
)
Description:
Bug 36506: Database update
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-10-03 16:28:44 UTC
Size:
3.61 KB
patch
obsolete
>From bf219ca50a929d793197c1dd392e1a8da8e379bd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 6 Aug 2025 19:14:56 +0000 >Subject: [PATCH] Bug 36506: Database update > >Sponsored-by: The Main Library Alliance <https://www.mainlib.org/> >--- > .../data/mysql/atomicupdate/bug_36506.pl | 41 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 - > 2 files changed, 41 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_36506.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_36506.pl b/installer/data/mysql/atomicupdate/bug_36506.pl >new file mode 100755 >index 00000000000..20106703c04 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_36506.pl >@@ -0,0 +1,41 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "36506", >+ description => "Move itemtype processing fees to the circulation rules", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ if ( column_exists( 'itemtypes', 'processfee' ) ) { >+ my $existing_fees = $dbh->selectall_arrayref( >+ q|SELECT itemtype, processfee FROM itemtypes WHERE processfee IS NOT NULL|, >+ { Slice => {} } >+ ); >+ foreach my $existing_fee ( @{$existing_fees} ) { >+ my $itemtype = $existing_fee->{itemtype}; >+ my $fee = $existing_fee->{processfee}; >+ my $existing_rule = $dbh->selectall_arrayref( >+ q|SELECT * FROM circulation_rules WHERE branchcode IS NULL AND categorycode IS NULL >+ AND rule_name = "lost_item_processing_fee" AND itemtype = ?|, undef, $itemtype >+ ); >+ if ( @{$existing_rule} ) { >+ say_warning( $out, "Existing default rule for $itemtype found, not moving value from itemtypes" ); >+ next; >+ } >+ $dbh->do( >+ q{ >+ INSERT INTO circulation_rules (branchcode, categorycode, itemtype, rule_name, rule_value ) >+ VALUES ( NULL, NULL, ?, "lost_item_processing_fee", ? ) >+ }, undef, $itemtype, $fee >+ ); >+ } >+ say $out "Moved existing processing fees from itemtypes to circulation rules"; >+ >+ $dbh->do('ALTER TABLE itemtypes DROP COLUMN processfee'); >+ say $out "Removed existing processfee column from itemtypes"; >+ } >+ >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e391dc68f5d..ac6d3275efd 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4233,7 +4233,6 @@ CREATE TABLE `itemtypes` ( > `rentalcharge_hourly` decimal(28,6) DEFAULT NULL COMMENT 'the amount charged for each hour between checkout date and due date', > `rentalcharge_hourly_calendar` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'controls if the hourly rental fee is calculated directly or using finesCalendar', > `defaultreplacecost` decimal(28,6) DEFAULT NULL COMMENT 'default replacement cost', >- `processfee` decimal(28,6) DEFAULT NULL COMMENT 'default text be recorded in the column note when the processing fee is applied', > `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1 if the item is not for loan, 0 if the item is available for loan', > `imageurl` varchar(200) DEFAULT NULL COMMENT 'URL for the item type icon', > `summary` mediumtext DEFAULT NULL COMMENT 'information from the summary field, may include HTML', >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36506
:
187411
|
187412
|
187413
|
187414
|
187415
|
187416
|
187417
|
187418
|
187573
|
187574
|
187575
|
187576
|
187577
|
187578
|
187579
|
187580