Summary: | When batch deleting patrons, report who was not deleted and why | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrewfh> |
Component: | Tools | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, kelly, kyle, marjorie.barry-vila, nick, sally.healey |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | 14708 | ||
Bug Blocks: |
Description
Andrew Fuerste-Henry
2020-01-22 14:36:44 UTC
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. *** |