Bug 5811: Add sysprefs to control overriding fines
This patch adds two sysprefs to allow libraries more fine-grained control over when fines can and can't be overridden. The two sysprefs are: * AllFinesNeedOverride - when this syspref is set to "Require" (default) any fine will require a staffmember to override the fine in order to check out a book. When set to "Don't require," fines below noissuescharge will not need any override. * AllowFineOverride - when this syspref is set to "Allow," staff will be able to override fines that are above noissuescharge. When set to "Don't allow" (default), staff will not be able to check out items to patrons with fines greater than noissuescharge. Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
parent
6ded7b9897
commit
83ab549724
11 changed files with 52 additions and 11 deletions
|
@ -730,17 +730,24 @@ sub CanBookBeIssued {
|
|||
# DEBTS
|
||||
my ($amount) =
|
||||
C4::Members::GetMemberAccountRecords( $borrower->{'borrowernumber'}, '' && $duedate->output('iso') );
|
||||
my $amountlimit = C4::Context->preference("noissuescharge");
|
||||
my $allowfineoverride = C4::Context->preference("AllowFineOverride");
|
||||
my $allfinesneedoverride = C4::Context->preference("AllFinesNeedOverride");
|
||||
if ( C4::Context->preference("IssuingInProcess") ) {
|
||||
my $amountlimit = C4::Context->preference("noissuescharge");
|
||||
if ( $amount > $amountlimit && !$inprocess ) {
|
||||
if ( $amount > $amountlimit && !$inprocess && !$allowfineoverride) {
|
||||
$issuingimpossible{DEBT} = sprintf( "%.2f", $amount );
|
||||
}
|
||||
elsif ( $amount > 0 && $amount <= $amountlimit && !$inprocess ) {
|
||||
} elsif ( $amount > $amountlimit && !$inprocess && $allowfineoverride) {
|
||||
$needsconfirmation{DEBT} = sprintf( "%.2f", $amount );
|
||||
} elsif ( $allfinesneedoverride && $amount > 0 && $amount <= $amountlimit && !$inprocess ) {
|
||||
$needsconfirmation{DEBT} = sprintf( "%.2f", $amount );
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( $amount > 0 ) {
|
||||
if ( $amount > $amountlimit && $allowfineoverride ) {
|
||||
$needsconfirmation{DEBT} = sprintf( "%.2f", $amount );
|
||||
} elsif ( $amount > $amountlimit && !$allowfineoverride) {
|
||||
$issuingimpossible{DEBT} = sprintf( "%.2f", $amount );
|
||||
} elsif ( $amount > 0 && $allfinesneedoverride ) {
|
||||
$needsconfirmation{DEBT} = sprintf( "%.2f", $amount );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -444,7 +444,7 @@ sub patronflags {
|
|||
my $noissuescharge = C4::Context->preference("noissuescharge") || 5;
|
||||
$flaginfo{'message'} = sprintf "Patron owes \$%.02f", $amount;
|
||||
$flaginfo{'amount'} = sprintf "%.02f", $amount;
|
||||
if ( $amount > $noissuescharge ) {
|
||||
if ( $amount > $noissuescharge && !C4::Context->preference("AllowFineOverride") ) {
|
||||
$flaginfo{'noissues'} = 1;
|
||||
}
|
||||
$flags{'CHARGES'} = \%flaginfo;
|
||||
|
|
|
@ -285,3 +285,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
|
|||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo');
|
||||
|
|
|
@ -285,3 +285,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
|
|||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo');
|
||||
|
|
|
@ -286,4 +286,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
|
|||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo');
|
||||
|
|
|
@ -271,4 +271,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
|
|||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo');
|
||||
|
|
|
@ -283,4 +283,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
|
|||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo');
|
||||
|
|
|
@ -338,4 +338,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
|
|||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo');
|
||||
|
|
|
@ -363,4 +363,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
|
|||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo');
|
||||
|
|
|
@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
|||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
$DBversion = '3.03.00.XXX';
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo')");
|
||||
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo')");
|
||||
print "Upgrade to $DBversion done (Bug 5811: Add sysprefs controlling overriding fines)\n";
|
||||
SetVersion($DBversion);
|
||||
};
|
||||
|
||||
=head1 FUNCTIONS
|
||||
|
||||
=head2 DropAllForeignKeys($table)
|
||||
|
|
|
@ -85,6 +85,18 @@ Circulation:
|
|||
yes: Allow
|
||||
no: "Don't allow"
|
||||
- staff to manually override the renewal limit and renew a checkout when it would go over the renewal limit.
|
||||
-
|
||||
- pref: AllFinesNeedOverride
|
||||
choices:
|
||||
yes: Require
|
||||
no: "Don't require"
|
||||
- staff to manually override all fines, even fines less than noissuescharge.
|
||||
-
|
||||
- pref: AllowFineOverride
|
||||
choices:
|
||||
yes: Allow
|
||||
no: "Don't allow"
|
||||
- staff to manually override and check out items to patrons who have more than noissuescharge in fines.
|
||||
-
|
||||
- pref: InProcessingToShelvingCart
|
||||
choices:
|
||||
|
|
Loading…
Reference in a new issue