Bugzilla – Attachment 120145 Details for
Bug 27946
Add a charge per article request to patron categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27946: Add article_request_fee to categories table and ARTICLE_REQUEST account debit type
Bug-27946-Add-articlerequestfee-to-categories-tabl.patch (text/plain), 5.46 KB, created by
Agustín Moyano
on 2021-04-24 00:10:05 UTC
(
hide
)
Description:
Bug 27946: Add article_request_fee to categories table and ARTICLE_REQUEST account debit type
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2021-04-24 00:10:05 UTC
Size:
5.46 KB
patch
obsolete
>From e069bf7254ade3b13b08253aeeb6deff835ff5cc Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Thu, 22 Apr 2021 17:46:26 -0300 >Subject: [PATCH] Bug 27946: Add article_request_fee to categories table and > ARTICLE_REQUEST account debit type > >--- > .../data/mysql/atomicupdate/bug_27946.perl | 29 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 5 +++- > .../mysql/mandatory/account_debit_types.sql | 3 +- > 3 files changed, 35 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_27946.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_27946.perl b/installer/data/mysql/atomicupdate/bug_27946.perl >new file mode 100644 >index 0000000000..902f5d2751 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27946.perl >@@ -0,0 +1,29 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ # you can use $dbh here like: >+ # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); >+ >+ # or perform some test and warn >+ if( !column_exists( 'categories', 'article_request_fee' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE `categories` ADD COLUMN `article_request_fee` decimal(28,6) DEFAULT NULL COMMENT 'Cost for article scan request' AFTER `exclude_from_local_holds_priority` >+ }); >+ } >+ >+ if( !column_exists( 'article_requests', 'debit_line_id' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE `article_requests` ADD COLUMN `debit_line_id` int(11) DEFAULT NULL COMMENT 'Debit line with cost for article scan request' AFTER `notes` >+ }); >+ $dbh->do(q{ >+ ALTER TABLE `article_requests` ADD CONSTRAINT `article_requests_ibfk_5` FOREIGN KEY (`debit_line_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE SET NULL ON UPDATE CASCADE >+ }); >+ } >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO account_debit_types ( code, description, can_be_invoiced, can_be_sold, default_amount, is_system ) VALUES >+ ('ARTICLE_REQUEST', 'Article scan request fee', 0, 0, NULL, 1); >+ }); >+ >+ # Always end with this (adjust the bug info) >+ NewVersion( $DBversion, 27946, "Add article_request_fee to categories table, add debit_line_id column to article_requests table and add ARTICLE_REQUEST as a debit type"); >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 16d2b6eb0d..f589708760 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -766,6 +766,7 @@ CREATE TABLE `article_requests` ( > `patron_notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, > `status` enum('PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING', > `notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, >+ `debit_line_id` int(11) DEFAULT NULL COMMENT 'Debit line with cost for article scan request', > `created_on` timestamp NULL DEFAULT NULL COMMENT 'Be careful with two timestamps in one table not allowing NULL', > `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), > PRIMARY KEY (`id`), >@@ -776,7 +777,8 @@ CREATE TABLE `article_requests` ( > CONSTRAINT `article_requests_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `article_requests_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `article_requests_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE, >- CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE >+ CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE, >+ CONSTRAINT `article_requests_ibfk_5` FOREIGN KEY (`debit_line_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE SET NULL ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >@@ -1632,6 +1634,7 @@ CREATE TABLE `categories` ( > `min_password_length` smallint(6) DEFAULT NULL COMMENT 'set minimum password length for patrons in this category', > `require_strong_password` tinyint(1) DEFAULT NULL COMMENT 'set required password strength for patrons in this category', > `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude patrons of this category from local holds priority', >+ `article_request_fee` decimal(28,6) DEFAULT NULL COMMENT 'Cost for article scan request', > PRIMARY KEY (`categorycode`), > UNIQUE KEY `categorycode` (`categorycode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >diff --git a/installer/data/mysql/mandatory/account_debit_types.sql b/installer/data/mysql/mandatory/account_debit_types.sql >index 8a133197fe..e1e1a7eb99 100644 >--- a/installer/data/mysql/mandatory/account_debit_types.sql >+++ b/installer/data/mysql/mandatory/account_debit_types.sql >@@ -13,4 +13,5 @@ INSERT INTO account_debit_types ( code, description, can_be_invoiced, can_be_sol > ('RENT_DAILY_RENEW', 'Renewal of daily rental item', 0, 0, NULL, 1), > ('RESERVE', 'Hold fee', 0, 0, NULL, 1), > ('RESERVE_EXPIRED', 'Hold waiting too long', 0, 0, NULL, 1), >-('VOID', 'Credit has been voided', 0, 0, NULL, 1); >+('VOID', 'Credit has been voided', 0, 0, NULL, 1), >+('ARTICLE_REQUEST', 'Article scan request fee', 0, 0, NULL, 1); >-- >2.27.0
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 27946
:
120144
|
120145
|
120146
|
120147
|
122522
|
122529
|
122530
|
122531
|
122532
|
122552
|
123503
|
123504
|
123505
|
123506
|
123507
|
128660
|
128661
|
128662
|
128663
|
128664
|
128665
|
128868
|
128869
|
128870
|
128871
|
128872
|
128873
|
129141
|
129142
|
129143
|
129144
|
129145
|
129146
|
129147
|
129171
|
129172
|
129173
|
129174
|
129175
|
129176
|
129177