Koha::Patron::Debarments - Module for managing patron debarments
my $arrayref = GetDebarments({ borrowernumber => $borrowernumber [, key => $value ] );
my $success = AddDebarment({ borrowernumber => $borrowernumber, expiration => $expiration, type => $type, ## enum('FINES','OVERDUES','MANUAL') comment => $comment, });
Creates a new debarment.
Required keys: borrowernumber, type
my $success = DelDebarment( $borrower_debarment_id );
Deletes a debarment.
my $success = ModDebarment({ borrower_debarment_id => $borrower_debarment_id, expiration => $expiration, type => $type, ## enum('FINES','OVERDUES','MANUAL','DISCHARGE') comment => $comment, });
Updates an existing debarment.
Required keys: borrower_debarment_id
my $debarment_expiration = IsDebarred( $borrowernumber );
Returns the date a borrowers debarment will expire, or undef if the patron is not debarred
my $success = AddUniqueDebarment({ borrowernumber => $borrowernumber, type => $type, expiration => $expiration, comment => $comment, });
Creates a new debarment of the type defined by the key type. If a unique debarment already exists of the given type, it is updated instead. The current unique debarment types are OVERDUES, and SUSPENSION
Required keys: borrowernumber, type
my $success = _DelUniqueDebarment({ borrowernumber => $borrowernumber, type => $type, });
Deletes a unique debarment of the type defined by the key type. The current unique debarment types are OVERDUES, and SUSPENSION
Required keys: borrowernumber, type
my $success = _UpdateBorrowerDebarmentFlags( $borrowernumber );
So as not to create additional latency, the fields borrowers.debarred and borrowers.debarredcomment remain in the borrowers table. Whenever the a borrowers debarrments are modified, this subroutine is run to decide if the borrower is currently debarred and update the 'quick flags' in the borrowers table accordingly.
my $borrowernumber = _GetBorrowernumberByDebarmentId( $borrower_debarment_id );
Kyle M Hall <kyle@bywatersoltuions.com>