# If the patron changes to a category with enrollment fee, we add a fee
if ( $data{categorycode} and $data{categorycode} ne $old_categorycode ) {
- AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} );
+ if ( C4::Context->preference('FeeOnChangePatronCategory') ) {
+ AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} );
+ }
}
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a
('ExtendedPatronAttributes','0',NULL,'Use extended patron IDs and attributes','YesNo'),
('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'),
('FacetMaxCount','20',NULL,'Specify the max facet count for each category','Integer'),
+('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is added','YesNo')
('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'),
('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'),
('finesCalendar','noFinesWhenClosed','ignoreCalendar|noFinesWhenClosed','Specify whether to use the Calendar in calculating duedates and fines','Choice'),
SetVersion ($DBversion);
}
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`)
+ VALUES ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is added','YesNo')
+ });
+ print "Upgrade to $DBversion done (Bug 13697 - Option to don't add a fee, if the patron changes to a category with enrolment fee)\n";
+ SetVersion($DBversion);
+}
+
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.