@@ -, +, @@ sysprefs --- 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 --- a/Koha/Schema/Result/AccountDebitType.pm +++ a/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'; } --- a/installer/data/mysql/atomicupdate/bug_32450-add_debit_type_flag.pl +++ a/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' + }); + }, +}; --- a/installer/data/mysql/kohastructure.sql +++ a/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 */; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/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'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/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 noissuescharge system preference. - - - - pref: ManInvInNoissuesCharge - choices: - 1: Include - 0: "Don't include" - - custom debit type charges when summing up charges for limit set in the noissuescharge system preference. - - - - pref: HoldsInNoissuesCharge - choices: - 1: Include - 0: "Don't include" - - hold charges when summing up charges for limit set in the noissuescharge system preference. - - pref: ReturnBeforeExpiry choices: --