https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39463

            Bug ID: 39463
           Summary: delete_patrons.pl to delete all patrons or provide
                    reason why they're not deleted
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Command-line Utilities
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]

I'm trying to use the delete_patrons.pl script to delete all the patrons from a
library (the library closed and I'm trying to delete everything from the
environment which it shared with other independent libraries). I noticed I have
to run it several times in order to delete all the patrons, but even with -v,
it doesn't tell me why it doesn't delete some patrons.

Note that I already returned all the checkouts and written off all the unpaid
charges for the patrons of that library.

I was able to recreate it partially on KTD
1. Count the patrons per branch before running the script

MariaDB [koha_kohadev]> select branchcode, count(*) from borrowers group by
branchcode;
+------------+----------+
| branchcode | count(*) |
+------------+----------+
| CPL        |        3 |
| FRL        |        9 |
| MPL        |       18 |
| PVL        |        1 |
| SPL        |       22 |
+------------+----------+
5 rows in set (0.001 sec)

2. Use delete_patrons.pl to delete all MPL patrons

./misc/cronjobs/delete_patrons.pl --library MPL --confirm -v

Notice it says only 16 patrons "match conditions" even though I have 18 patrons
with MPL branchcode. It does not explain why there are some that don't match. 

On my test DB for the actual environment, I have to run the script several
times in a row to delete almost all the ~1000 patrons. When I run it the first
time, it says 925 matches, then 88, then 1 then 0. And even after it says there
are 0 matches, there are still 6 patrons in the database. It's probably the
staff users, but I'd like it to tell me.

Maybe I'm misunderstanding the way this works. For example, in the KTD
database, I would expect it to "match" all 18 patrons whose branchcode is MPL
and tell me why the two are not deletable.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to