=head2 GetBorrowersToExpunge
$borrowers = &GetBorrowersToExpunge(
- not_borrowered_since => $not_borrowered_since,
+ not_borrowed_since => $not_borrowed_since,
expired_before => $expired_before,
category_code => $category_code,
patron_list_id => $patron_list_id,
sub GetBorrowersToExpunge {
my $params = shift;
- my $filterdate = $params->{'not_borrowered_since'};
+ my $filterdate = $params->{'not_borrowed_since'};
my $filterexpiry = $params->{'expired_before'};
my $filtercategory = $params->{'category_code'};
my $filterbranch = $params->{'branchcode'} ||
my $members = GetBorrowersToExpunge(
{
- not_borrowered_since => $not_borrowed_since,
+ not_borrowed_since => $not_borrowed_since,
expired_before => $expired_before,
category_code => $category_code,
branchcode => $branchcode,
ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Staff patron not deleted by branchcode and list');
$patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02', patron_list_id => $list1->patron_list_id() } );
ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Staff patron not deleted by expirationdate and list');
-$patstodel = GetBorrowersToExpunge( {not_borrowered_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } );
+$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } );
ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Staff patron not deleted by last issue date');
ModMember( borrowernumber => $bor1inlist, categorycode => 'CIVILIAN' );
ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Guarantor patron not deleted by branchcode and list');
$patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02', patron_list_id => $list1->patron_list_id() } );
ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Guarantor patron not deleted by expirationdate and list');
-$patstodel = GetBorrowersToExpunge( {not_borrowered_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } );
+$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } );
ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Guarantor patron not deleted by last issue date');
ModMember( borrowernumber => $guarantee->{borrowernumber}, guarantorid=>'' );
is( scalar(@$patstodel),2,'Borrowers without issues deleted by category_code and list');
$patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02',patron_list_id => $list1->patron_list_id() } );
is( scalar(@$patstodel),2,'Borrowers without issues deleted by expiration_date and list');
-$patstodel = GetBorrowersToExpunge( {not_borrowered_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } );
+$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } );
is( scalar(@$patstodel),2,'Borrowers without issues deleted by last issue date');
=item * Anonymise the borrowers' issues if issue is older than a given date. see C<datefilter1>.
-=item * Delete the borrowers who has not borrowered since a given date. see C<datefilter2>.
+=item * Delete the borrowers who has not borrowed since a given date. see C<datefilter2>.
=back
my $params = $cgi->Vars;
my $step = $params->{step} || 1;
-my $not_borrowered_since = # the date which filter on issue history.
- $params->{not_borrowered_since}
- ? dt_from_string $params->{not_borrowered_since}
+my $not_borrowed_since = # the date which filter on issue history.
+ $params->{not_borrowed_since}
+ ? dt_from_string $params->{not_borrowed_since}
: undef;
my $last_issue_date = # the date which filter on borrowers last issue.
$params->{last_issue_date}
if ( $checkboxes{borrower} ) {
$patrons_to_delete = GetBorrowersToExpunge(
_get_selection_params(
- $not_borrowered_since,
+ $not_borrowed_since,
$borrower_dateexpiry,
$borrower_categorycode,
$patron_list_id,
if ($do_delete) {
my $patrons_to_delete = GetBorrowersToExpunge(
_get_selection_params(
- $not_borrowered_since, $borrower_dateexpiry,
+ $not_borrowed_since, $borrower_dateexpiry,
$borrower_categorycode, $patron_list_id
)
);
$template->param(
step => $step,
- not_borrowered_since => $not_borrowered_since,
+ not_borrowed_since => $not_borrowed_since,
borrower_dateexpiry => $borrower_dateexpiry,
last_issue_date => $last_issue_date,
borrower_categorycodes => GetBorrowercategoryList(),
}
sub _get_selection_params {
- my ($not_borrowered_since, $borrower_dateexpiry, $borrower_categorycode, $patron_list_id) = @_;
+ my ($not_borrowed_since, $borrower_dateexpiry, $borrower_categorycode, $patron_list_id) = @_;
my $params = {};
- $params->{not_borrowered_since} = output_pref({
- dt => $not_borrowered_since,
+ $params->{not_borrowed_since} = output_pref({
+ dt => $not_borrowed_since,
dateformat => 'iso',
dateonly => 1
- }) if $not_borrowered_since;
+ }) if $not_borrowed_since;
$params->{expired_before} = output_pref({
dt => $borrower_dateexpiry,
dateformat => 'iso',