Bugzilla – Attachment 129141 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_requests.debit_id and ARTICLE_REQUEST account debit type
Bug-27946-Add-articlerequestsdebitid-and-ARTICLERE.patch (text/plain), 4.70 KB, created by
Kyle M Hall (khall)
on 2022-01-07 12:14:21 UTC
(
hide
)
Description:
Bug 27946: Add article_requests.debit_id and ARTICLE_REQUEST account debit type
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-01-07 12:14:21 UTC
Size:
4.70 KB
patch
obsolete
>From d85942dcafaed70c37665b0e179321212034c6f0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 8 Nov 2021 15:29:14 -0300 >Subject: [PATCH] Bug 27946: Add article_requests.debit_id and ARTICLE_REQUEST > account debit type > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../data/mysql/atomicupdate/bug_27946.pl | 34 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 4 ++- > .../mysql/mandatory/account_debit_types.sql | 3 +- > 3 files changed, 39 insertions(+), 2 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_27946.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_27946.pl b/installer/data/mysql/atomicupdate/bug_27946.pl >new file mode 100755 >index 00000000000..0905496ce4f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27946.pl >@@ -0,0 +1,34 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "27946", >+ description => "Add article request fees", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ if ( !column_exists( 'article_requests', 'debit_id' ) ) { >+ >+ $dbh->do( >+ q{ >+ ALTER TABLE `article_requests` >+ ADD COLUMN `debit_id` int(11) NULL DEFAULT NULL COMMENT 'Debit line with cost for article scan request' AFTER `cancellation_reason` >+ } >+ ); >+ >+ $dbh->do( >+ q{ >+ ALTER TABLE `article_requests` >+ ADD CONSTRAINT `article_requests_ibfk_5` FOREIGN KEY (`debit_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); >+ } >+ ); >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index a309cea736f..95ff9f25956 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -784,6 +784,7 @@ CREATE TABLE `article_requests` ( > `format` enum('PHOTOCOPY','SCAN') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PHOTOCOPY', > `urls` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, > `cancellation_reason` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'optional authorised value AR_CANCELLATION', >+ `debit_id` int(11) NULL 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(), > `toc_request` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'borrower requested table of contents', >@@ -795,7 +796,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_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 */; > >diff --git a/installer/data/mysql/mandatory/account_debit_types.sql b/installer/data/mysql/mandatory/account_debit_types.sql >index 8a133197fe0..e1e1a7eb99e 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.30.2
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