We aren't validating as much as we should in the add_credit and upcoming add_debut and adjust methods in the Koha::Account classes. This bug adds a couple of new exceptions for such cases.
Created attachment 83008 [details] [review] Bug 21980: Add new excpetions for Koha::Account He add two new exceptions here; One to be thrown when negative 'amount' is passed into verious account methods that always expect positive decimals and another to be thrown when a bad 'type' is passed into an account method.
This patch was split out from bug 21002 to prevent 21002 from blocking bug 21727. It is a trivial patch adding 2 new exceptions.
Created attachment 83046 [details] [review] Bug 21980: Add new excpetions for Koha::Account He add two new exceptions here; One to be thrown when negative 'amount' is passed into verious account methods that always expect positive decimals and another to be thrown when a bad 'type' is passed into an account method. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This trivial enhancement can skip QA.
Created attachment 83085 [details] [review] Bug 21980: Add new excpetions for Koha::Account He add two new exceptions here; One to be thrown when negative 'amount' is passed into verious account methods that always expect positive decimals and another to be thrown when a bad 'type' is passed into an account method. Sponsored-by: PTFS Europe Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Awesome work all! Pushed to master for 19.05
Enhancement, this will not be backported for 18.11.x at the moment.