Bugzilla – Attachment 145128 Details for
Bug 32450
Make it possible to exclude debit types from charges counted for circulation restriction (noissuecharge)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32450: Update db to add noissuescharge flag and remove sysprefs
Bug-32450-Update-db-to-add-noissuescharge-flag-and.patch (text/plain), 9.27 KB, created by
ByWater Sandboxes
on 2023-01-07 10:18:45 UTC
(
hide
)
Description:
Bug 32450: Update db to add noissuescharge flag and remove sysprefs
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2023-01-07 10:18:45 UTC
Size:
9.27 KB
patch
obsolete
>From 78dd1b01b180fa95d09f2a898ce7943ff2c9a2d9 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 6 Jan 2023 13:52:32 +0000 >Subject: [PATCH] Bug 32450: Update db to add noissuescharge flag and remove > sysprefs > >This commit updates the database to add a new flag to show which debit_types are included in noissuescharge. It also deletes the current sysprefs that are hardcoded for this as these are now redundant. > >Test plan: >1) Choose a patron and add some fines to this patron that have different debit_types >2) Navigate to system preferences and observe that currently you can only amend the noissuescharge included debit types using three preferences: ManInvInNoissuesCharge, RentalsInNoissuesCharge, HoldsInNoissuesCharge >3) Apply both commits attached to this bug >4) Navigate as above and observe that these three system preferences are now gone >5) Navigate to Debit Types in System Preferences, the table should have a column called No issues charge that shows whether a debit_type is Included or Not included >6) Click the edit button and there should be a checkbox for Included in noissuescharge >7) Change some of the debit_types using this option and observe that the patron you added fines to will either be blocked from checkouts or able to checkout depending on which debit_types you include and the value of >these fines. > >Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> >--- > Koha/Schema/Result/AccountDebitType.pm | 18 ++++++++++-- > .../bug_32450-add_debit_type_flag.pl | 29 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > installer/data/mysql/mandatory/sysprefs.sql | 2 -- > .../admin/preferences/circulation.pref | 18 ------------ > 5 files changed, 46 insertions(+), 22 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl > >diff --git a/Koha/Schema/Result/AccountDebitType.pm b/Koha/Schema/Result/AccountDebitType.pm >index 74c6da8a80..e6608a0aa6 100644 >--- a/Koha/Schema/Result/AccountDebitType.pm >+++ b/Koha/Schema/Result/AccountDebitType.pm >@@ -71,6 +71,14 @@ boolean flag to denote if this debit type is available at point of sale > > boolean flag to denote if this till is archived or not > >+=head2 no_issues_charge >+ >+ data_type: 'tinyint' >+ default_value: 1 >+ is_nullable: 0 >+ >+boolean flag to denote if the noissuescharge syspref for this debit type is active >+ > =cut > > __PACKAGE__->add_columns( >@@ -88,6 +96,8 @@ __PACKAGE__->add_columns( > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > "archived", > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ "no_issues_charge", >+ { data_type => "tinyint", default_value => 1, is_nullable => 0 }, > ); > > =head1 PRIMARY KEY >@@ -135,8 +145,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ulpJRbi7H40EXr1QG+URKg >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-01-06 13:08:15 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4yfwGQzH8AzZYXfje3MH/A > > __PACKAGE__->add_columns( > '+is_system' => { is_boolean => 1 } >@@ -150,6 +160,10 @@ __PACKAGE__->add_columns( > "+can_be_invoiced" => { is_boolean => 1 } > ); > >+__PACKAGE__->add_columns( >+ "+no_issues_charge" => { is_boolean => 1 } >+); >+ > sub koha_objects_class { > 'Koha::Account::DebitTypes'; > } >diff --git a/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl b/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl >new file mode 100644 >index 0000000000..22fccd94f9 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl >@@ -0,0 +1,29 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "32450", >+ description => "Create a database flag for whether a debit type should be included in the noissuescharge block on circulation and remove redundant sysprefs.", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ if( !column_exists( 'account_debit_types', 'no_issues_charge' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE account_debit_types ADD COLUMN `no_issues_charge` tinyint(1) NOT NULL DEFAULT 1 AFTER `archived` >+ }); >+ >+ say $out "Added column 'account_debit_types.no_issues_charge'"; >+ } >+ >+ $dbh->do(q{ >+ DELETE FROM systempreferences WHERE variable = 'ManInvInNoissuesCharge' >+ }); >+ >+ $dbh->do(q{ >+ DELETE FROM systempreferences WHERE variable = 'RentalsInNoissuesCharge' >+ }); >+ $dbh->do(q{ >+ DELETE FROM systempreferences WHERE variable = 'HoldsInNoissuesCharge' >+ }); >+ }, >+}; >\ No newline at end of file >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index d831006cd5..38afeba795 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -65,6 +65,7 @@ CREATE TABLE `account_debit_types` ( > `default_amount` decimal(28,6) DEFAULT NULL, > `is_system` tinyint(1) NOT NULL DEFAULT 0, > `archived` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to denote if this till is archived or not', >+ `no_issues_charge` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'boolean flag to denote if the noissuescharge syspref for this debit type is active', > PRIMARY KEY (`code`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index beebd27a6f..6065329b9d 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -354,7 +354,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('LockExpiredDelay','','','Delay for locking expired patrons (empty means no locking)','Integer'), > ('makePreviousSerialAvailable','0','','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','YesNo'), > ('Mana','2',NULL,'request to Mana Webservice. Mana centralize common information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','Choice'), >-('ManInvInNoissuesCharge','1',NULL,'MANUAL_INV charges block checkouts (added to noissuescharge).','YesNo'), > ('MARCAuthorityControlField008','|| aca||aabn | a|a d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'), > ('MarcFieldDocURL', NULL, NULL, 'URL used for MARC field documentation. Following substitutions are available: {MARC} = marc flavour, eg. "MARC21" or "UNIMARC". {FIELD} = field number, eg. "000" or "048". {LANG} = user language, eg. "en" or "fi-FI"', 'free'), > ('MarcFieldForCreatorId','',NULL,'Where to store the borrowernumber of the record''s creator','Free'), >@@ -599,7 +598,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RenewalSendNotice','0','',NULL,'YesNo'), > ('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'), > ('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'), >-('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'), > ('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'), > ('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'), > ('RequireCashRegister','0',NULL,'Require a cash register when collecting a payment','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index e025fc6e9d..5683384fd6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -375,24 +375,6 @@ Circulation: > - pref: NoIssuesChargeGuarantorsWithGuarantees > class: integer > - '[% local_currency %] in fines.' >- - >- - pref: RentalsInNoissuesCharge >- choices: >- 1: Include >- 0: "Don't include" >- - rental charges when summing up charges for limit set in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=noissuescharge">noissuescharge</a> system preference. >- - >- - pref: ManInvInNoissuesCharge >- choices: >- 1: Include >- 0: "Don't include" >- - custom debit type charges when summing up charges for limit set in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=noissuescharge">noissuescharge</a> system preference. >- - >- - pref: HoldsInNoissuesCharge >- choices: >- 1: Include >- 0: "Don't include" >- - hold charges when summing up charges for limit set in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=noissuescharge">noissuescharge</a> system preference. > - > - pref: ReturnBeforeExpiry > choices: >-- >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 32450
:
145080
|
145081
|
145127
|
145128
|
145171
|
145172
|
145189
|
145190
|
145191
|
145194
|
145198
|
147563
|
149653
|
149654
|
149655
|
149656
|
149657
|
149658
|
149659
|
149660
|
149858
|
149859
|
149872
|
149873
|
149874
|
149875
|
149876
|
149877
|
149878
|
149879
|
149880
|
149881
|
149882