Summary: | Offsets not stored correctly in _FixOverduesOnReturn | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Fines and fees | Assignee: | Kyle M Hall <kyle> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, lucas, martin.renvoize, nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20598 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Attachments: |
Bug 21849: Two useless Koha::Account::Offset->new calls need attention
Bug 21849: Add unit tests Bug 21849: Add unit tests Bug 21849: Two useless Koha::Account::Offset->new calls need attention Bug 21849: Add unit tests Bug 21849: Two useless Koha::Account::Offset->new calls need attention |
Description
Marcel de Rooy
2018-11-16 10:10:04 UTC
Created attachment 82397 [details] [review] Bug 21849: Two useless Koha::Account::Offset->new calls need attention Came across those calls in bug 20598 in _FixOverduesOnReturn Koha::Account::Offset->new( { debit_id => $accountline->id, type => 'Forgiven', amount => $amountoutstanding * -1, } ); This does nothing if you don't store data. Test Plan: 1) Apply this patch 2) Set up 2 items with overdue fines 3) Return one with dropbox mode 4) Note the dropbox account offset is created 5) Return one with full fine forgiveness 6) Note the forgiven account offset is created THis is a good opportunity to have tests for this behaviour, in preparation to the replacement of manually adding the accountline and the offset, in favour of Koha::Account methods (add_credit, add_debit and adjust). (In reply to Tomás Cohen Arazi from comment #2) > THis is a good opportunity to have tests for this behaviour, in preparation > to the replacement of manually adding the accountline and the offset, in > favour of Koha::Account methods (add_credit, add_debit and adjust). Good idea. Created attachment 82404 [details] [review] Bug 21849: Add unit tests Created attachment 82919 [details] [review] Bug 21849: Add unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 82920 [details] [review] Bug 21849: Two useless Koha::Account::Offset->new calls need attention Came across those calls in bug 20598 in _FixOverduesOnReturn Koha::Account::Offset->new( { debit_id => $accountline->id, type => 'Forgiven', amount => $amountoutstanding * -1, } ); This does nothing if you don't store data. Test Plan: 1) Apply this patch 2) Set up 2 items with overdue fines 3) Return one with dropbox mode 4) Note the dropbox account offset is created 5) Return one with full fine forgiveness 6) Note the forgiven account offset is created Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 82947 [details] [review] Bug 21849: Add unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 82948 [details] [review] Bug 21849: Two useless Koha::Account::Offset->new calls need attention Came across those calls in bug 20598 in _FixOverduesOnReturn Koha::Account::Offset->new( { debit_id => $accountline->id, type => 'Forgiven', amount => $amountoutstanding * -1, } ); This does nothing if you don't store data. Test Plan: 1) Apply this patch 2) Set up 2 items with overdue fines 3) Return one with dropbox mode 4) Note the dropbox account offset is created 5) Return one with full fine forgiveness 6) Note the forgiven account offset is created Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Awesome work all! Pushed to master for 19.05 Pushed to 18.11.x for 18.11.01 backported to 18.05 for 18.05.07 Pushed to 17.11.x for 17.11.14 |