[Bug 28995] New: Add --added_after to writeoff_debts.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Bug ID: 28995 Summary: Add --added_after to writeoff_debts.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Depends on: 27049 writeoff_debts.pl currently supports --added_before to make it work on fines added before a given date. It would be nice if we could also tell it to work on fines added after a given date, with --added_after. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27049 [Bug 27049] Add a script to bulk writeoff debts -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127463&action=edit Bug 28995: Add `--added_after` filter to writeoff_debts script This adds, as requested, the `added_after` filter option to writeoff_debts. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|27049 |28994 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27049 [Bug 27049] Add a script to bulk writeoff debts https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28994 [Bug 28994] Make writeoff_debts.pl use amountoutstanding, not amount -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Options should be named --added-before and --added-after (_vs -) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127463|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127624 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127624&action=edit Bug 28995: Add `--added_after` filter to writeoff_debts script This adds, as requested, the `added_after` filter option to writeoff_debts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127625&action=edit Bug 28995: Update aliases Add an alias for added-before, added-after (Using an alias makes it backwards compatible) and update the POD. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Fair.. follow-up added.. I kept it backward compatible with the _ notation as I believe there may be uses already int the wild. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> --- Martin, this still applies cleanly and seems to work for me. Do you have a test plan so I can sign it off? -- You are receiving this mail because: You are watching all bug changes.
From memory, it would be to add some debts to a patron record.. adapt the `date` (i.e when the charge was added) field of those charges to a date in the
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hmm, I was hoping Magnus would SO as he asked for the feature.. past and then run this script with the --added_after option with a date after the date you just set and check the lines remain unchanged.. then run again passing a date before the date you added above and this time the lines should have been written off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127624|0 |1 is obsolete| | --- Comment #8 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 152520 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152520&action=edit Bug 28995: Add `--added_after` filter to writeoff_debts script This adds, as requested, the `added_after` filter option to writeoff_debts. Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127625|0 |1 is obsolete| | --- Comment #9 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 152521 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152521&action=edit Bug 28995: Update aliases Add an alias for added-before, added-after (Using an alias makes it backwards compatible) and update the POD. Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com --- Comment #10 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- I wrote what I did as a test plan, I hope it helps 1. Add two fees in a patron account 1.1. Go into a patron record > Accounting tab 1.2. Go to the Create a manual invoice tab 1.3. Fill out the form 1.4. Click 'Save' 1.5. Redo steps 1.2 to 1.4 to add a second fee 2. Manually change the date in the database 2.1. In the database, find the accountlines_id for the two fees Here's what I did select * from accountlines where borrowernumber = 21 and amountoutstanding > 0; +-----------------+----------+----------------+------------+---------------------+-----------+-------------+------------------+-----------------+---------------+--------+--------------+-------------------+---------------------+------+------------+-------------+-----------+------------+ | accountlines_id | issue_id | borrowernumber | itemnumber | date | amount | description | credit_type_code | debit_type_code | credit_number | status | payment_type | amountoutstanding | timestamp | note | manager_id | register_id | interface | branchcode | +-----------------+----------+----------------+------------+---------------------+-----------+-------------+------------------+-----------------+---------------+--------+--------------+-------------------+---------------------+------+------------+-------------+-----------+------------+ | 652 | NULL | 21 | NULL | 2023-06-21 09:34:05 | 10.000000 | Lost item | NULL | LOST | NULL | NULL | NULL | 10.000000 | 2023-06-21 09:34:05 | | 51 | NULL | intranet | CPL | | 653 | NULL | 21 | NULL | 2023-06-21 09:35:44 | 2.000000 | Lost item | NULL | LOST | NULL | NULL | NULL | 2.000000 | 2023-06-21 09:35:44 | | 51 | NULL | intranet | CPL | +-----------------+----------+----------------+------------+---------------------+-----------+-------------+------------------+-----------------+---------------+--------+--------------+-------------------+---------------------+------+------------+-------------+-----------+------------+ 2 rows in set (0.001 sec) select * from account_offsets where debit_id = '652'; +-----+-----------+----------+--------+-----------+---------------------+ | id | credit_id | debit_id | type | amount | created_on | +-----+-----------+----------+--------+-----------+---------------------+ | 799 | NULL | 652 | CREATE | 10.000000 | 2023-06-21 09:34:05 | +-----+-----------+----------+--------+-----------+---------------------+ 1 row in set (0.001 sec) 2.2. Update the date for one of the fees using the accountlines_id Here's what I did update accountlines set date = '2023-06-01 09:34:05' where accountlines_id = 652; update account_offsets set created_on = '2023-06-01 09:34:05' where debit_id = '652'; I now have one fee on June 1st and one fee on June 21st, the account_offset is also modified (not sure if that last part is necessary). select * from accountlines where borrowernumber = 21 and amountoutstanding > 0; +-----------------+----------+----------------+------------+---------------------+-----------+-------------+------------------+-----------------+---------------+--------+--------------+-------------------+---------------------+------+------------+-------------+-----------+------------+ | accountlines_id | issue_id | borrowernumber | itemnumber | date | amount | description | credit_type_code | debit_type_code | credit_number | status | payment_type | amountoutstanding | timestamp | note | manager_id | register_id | interface | branchcode | +-----------------+----------+----------------+------------+---------------------+-----------+-------------+------------------+-----------------+---------------+--------+--------------+-------------------+---------------------+------+------------+-------------+-----------+------------+ | 652 | NULL | 21 | NULL | 2023-06-01 09:34:05 | 10.000000 | Lost item | NULL | LOST | NULL | NULL | NULL | 10.000000 | 2023-06-21 09:40:46 | | 51 | NULL | intranet | CPL | | 653 | NULL | 21 | NULL | 2023-06-21 09:35:44 | 2.000000 | Lost item | NULL | LOST | NULL | NULL | NULL | 2.000000 | 2023-06-21 09:35:44 | | 51 | NULL | intranet | CPL | +-----------------+----------+----------------+------------+---------------------+-----------+-------------+------------------+-----------------+---------------+--------+--------------+-------------------+---------------------+------+------------+-------------+-----------+------------+ 2 rows in set (0.001 sec) select * from account_offsets where debit_id = '652'; +-----+-----------+----------+--------+-----------+---------------------+ | id | credit_id | debit_id | type | amount | created_on | +-----+-----------+----------+--------+-----------+---------------------+ | 799 | NULL | 652 | CREATE | 10.000000 | 2023-06-01 09:34:05 | +-----+-----------+----------+--------+-----------+---------------------+ 1 row in set (0.001 sec) 3. Run writeoff_debts.pl with --added_after with a date after the first fee but before the second 3.1. In the terminal, run (for example) ./misc/cronjobs/writeoff_debts.pl --added_after 2023-06-20 --confirm 4. Check the patron record --> The fee with the date after should be written off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34077 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | CC| |m.de.rooy@rijksmuseum.nl --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Looking here -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152520|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 155385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155385&action=edit Bug 28995: Add `--added_after` filter to writeoff_debts script This adds, as requested, the `added_after` filter option to writeoff_debts. Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152521|0 |1 is obsolete| | --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 155386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155386&action=edit Bug 28995: Update aliases Add an alias for added-before, added-after (Using an alias makes it backwards compatible) and update the POD. Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- - print " added before " . $added if $added; + print " added before " . $before if $before; Nothing about after here? No blocker -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00 |23.11.00,23.05.04 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- Small nice enhancement. I think it is safe to backport. Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@ptfs-europe | |.com Status|Pushed to stable |Needs documenting --- Comment #17 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Enhancement - not backporting to 22.11.x Nice work everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34077 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34077 [Bug 34077] writeoff_debts without --confirm doesn't show which accountline records it would have been written off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28995 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Documentation| |https://gitlab.com/koha-com submission| |munity/koha-manual/-/merge_ | |requests/796 Status|Needs documenting |RESOLVED Documentation| |Caroline Cyr La Rose contact| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org