}
use C4::Context;
-use C4::Dates;
use C4::Search;
use C4::Search::History;
use Getopt::Long;
--z3950 purge records from import tables that are the result
of Z39.50 searches
--fees DAYS purge entries accountlines older than DAYS days, where
- amountoutstanding is 0.
+ amountoutstanding is 0 or NULL.
+ In the case of --feees, DAYS must be greater than
+ or equal to 1.
+ WARNING: Fees and payments may not be deleted together.
+ This will not affect the account balance but may be
+ confusing to staff.
--logs DAYS purge entries from action_logs older than DAYS days.
Defaults to 180 days if no days specified.
--searchhistory DAYS purge entries from search_history older than DAYS days.
exit $_[0];
}
-my (
- $help,
- $sessions,
- $sess_days,
- $verbose,
- $zebraqueue_days,
- $mail,
- $purge_merged,
- $pImport,
- $pLogs,
- $pSearchhistory,
- $pZ3950,
- $pListShareInvites,
- $pDebarments,
- $allDebarments,
- $pExpSelfReg,
- $pUnvSelfReg,
- $fees_days
- $help, $sessions, $sess_days, $verbose, $zebraqueue_days,
- $mail, $purge_merged, $pImport, $pLogs, $pSearchhistory,
- $pZ3950, $pListShareInvites, $pDebarments, $allDebarments,
-);
+my $help;
+my $sessions;
+my $sess_days;
+my $verbose;
+my $zebraqueue_days;
+my $mail;
+my $purge_merged;
+my $pImport;
+my $pLogs;
+my $pSearchhistory;
+my $pZ3950;
+my $pListShareInvites;
+my $pDebarments;
+my $allDebarments;
+my $pExpSelfReg;
+my $pUnvSelfReg;
+my $fees_days;
GetOptions(
'h|help' => \$help,
}
sub PurgeDebarments {
- require Koha::Borrower::Debarments;
+ require Koha::Patron::Debarments;
my $days = shift;
$count = 0;
$sth = $dbh->prepare(
);
$sth->execute($days) or die $dbh->errstr;
while ( my ($borrower_debarment_id) = $sth->fetchrow_array ) {
- Koha::Borrower::Debarments::DelDebarment($borrower_debarment_id);
+ Koha::Patron::Debarments::DelDebarment($borrower_debarment_id);
$count++;
}
return $count;