Bug 20086: Execute AddRenewal in a transaction to avoid partial success and doubled fines
This patch starts a transaction and only commits if renewal and fines
updates and charges are successful (partial in any cna be problematic)
There is no feedback (as currently there is none either) but if part
fails, all fails.
I didn't include stats and notifications in the transaction, but we
could. (Edit JD: not true, they are included)
To test:
1 - Apply patch
2 - prove t/db_dependent/Circulation.t
3 - Attempt circs and renewals should be no difference
4 - If possible make part of transaction fail and ensure all fails
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended: commit title and one indendation (return statement) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>