When using the batch patron deletion tool, patrons are not deleted if:
- They have current checkouts
- They have a non-zero balance
- They are the guarantor to another patron
- They are of a patron category of type staff
But Koha never specifically tells the user which borrowers out of their defined pool for deletion are not deleted or why.
- Create a patron list
- Add to that list one patron for each of these conditions:
-- one patron with an item checked out
-- one patron with a non-zero balance
-- one patron who is a guarantor
-- one patron in a staff category
-- one patron not meeting any of the conditions above
- Go to batch patron deletion, attempt to delete all patrons on your list
- Koha tells you 1 patron will be deleted
Ideally, Koha would give a list of which patrons will not be deleted and why.
Noting that bug 14708 would add another constraint and prevent the deletion of the AnonymousPatron.
In the meantime, I wrote a report to tell you who isn't going to get deleted:
SELECT cardnumber, surname, firstname, if(sum(amountoutstanding)=0,null,sum(amountoutstanding)) as account_balance, if(count(issues.issue_id)=0,null,count(issues.issue_id)) as current_checkouts, guarantees, if(category_type='S','Staff',null) as is_staff
FROM borrowers left join accountlines using (borrowernumber) left join issues using (borrowernumber) left join categories using (categorycode) left join
(SELECT guarantorid, group_concat(concat(firstname,' ',surname,' ',cardnumber)) as guarantees from borrowers where guarantorid is not null group by guarantorid) g on (borrowers.borrowernumber=g.guarantorid)
WHERE [plug in how you're defining your deletion -- could be categorycode, patron list, etc]
GROUP BY borrowernumber
HAVING account_balance is not null OR current_checkouts is not null OR guarantees is not null OR is_staff is not null
*** Bug 21292 has been marked as a duplicate of this bug. ***
I would suggest to implement bug 26170 first.