All account handling should go via the Koha::Account class.
Created attachment 81882 [details] [review] Bug 21720: Use Koha::Account->add_debit in AddIssuingCharge
Created attachment 82787 [details] [review] Bug 21720: Use Koha::Account->add_debit in AddIssuingCharge
Created attachment 82788 [details] [review] Bug 21720: Update Tests AddIssuing charge is always called in void context, but the tests checked that the return value was a Koha::Account::Offset and we now return a Koha::Account::Line. This patch changes the test to accept a Koha::Account::Line as returned, adds a test to ensure a Koha::Account::Offset is also created and corrects the logic that tests that only one accountline is added.
Created attachment 83199 [details] [review] Bug 21720: Use Koha::Account->add_debit in AddIssuingCharge Known Side Effect: Prior to this patch issuing charges were not recorded in the FinesLog. After this patch, if the FinesLog is enabled then the 'action' will be recorded as `create_rent`. Sponsored-by: PTFS Europe
Created attachment 83200 [details] [review] Bug 21720: Update Tests AddIssuing charge is always called in void context, but the tests checked that the return value was a Koha::Account::Offset and we now return a Koha::Account::Line. This patch changes the test to accept a Koha::Account::Line as returned, adds a test to ensure a Koha::Account::Offset is also created and corrects the logic that tests that only one accountline is added.
QA Question: Regarding the side effect, this is reasonably easy to avert within the add_debit method but I'd like input as to whether the FinesLog should really be just about Fines or should include all Charges.. as it stands it's a bit of a mix of both.. this patch series turns it into more of the ChargesLog but upping the logging but it could alternatively go the other way and make what is recorded a bit more explicitly about fines and only fines.
(In reply to Martin Renvoize from comment #6) > QA Question: Regarding the side effect, this is reasonably easy to avert > within the add_debit method but I'd like input as to whether the FinesLog > should really be just about Fines or should include all Charges.. as it > stands it's a bit of a mix of both.. this patch series turns it into more of > the ChargesLog but upping the logging but it could alternatively go the > other way and make what is recorded a bit more explicitly about fines and > only fines. I would prefer to log all charges, not only fines.
Created attachment 84271 [details] [review] Bug 21720: Use Koha::Account->add_debit in AddIssuingCharge Known Side Effect: Prior to this patch issuing charges were not recorded in the FinesLog. After this patch, if the FinesLog is enabled then the 'action' will be recorded as `create_rent`. Sponsored-by: PTFS Europe Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 84272 [details] [review] Bug 21720: Update Tests AddIssuing charge is always called in void context, but the tests checked that the return value was a Koha::Account::Offset and we now return a Koha::Account::Line. This patch changes the test to accept a Koha::Account::Line as returned, adds a test to ensure a Koha::Account::Offset is also created and corrects the logic that tests that only one accountline is added. Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 85175 [details] [review] Bug 21720: Use Koha::Account->add_debit in AddIssuingCharge Known Side Effect: Prior to this patch issuing charges were not recorded in the FinesLog. After this patch, if the FinesLog is enabled then the 'action' will be recorded as `create_rent`. Sponsored-by: PTFS Europe Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 85176 [details] [review] Bug 21720: Update Tests AddIssuing charge is always called in void context, but the tests checked that the return value was a Koha::Account::Offset and we now return a Koha::Account::Line. This patch changes the test to accept a Koha::Account::Line as returned, adds a test to ensure a Koha::Account::Offset is also created and corrects the logic that tests that only one accountline is added. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Awesome work all! Pushed to master for 19.05
Enhancement will not be backported to the stable branch.