Bug 21915: Call reconcile_balance on manual invoice creation

This patch makes the manual invoice creation step call
Koha::Account::reconcile_balance when the AccountAutoReconcile syspref
is set.

To test:
- Apply the patch
- Have some outstanding credit
- Create a manual invoice
=> SUCCESS: Same behaviour as always
- Set AccountAutoReconcile
- Create a manual invoice
=> SUCCESS: Reconcillation happened
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0c43fa326a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Tomas Cohen Arazi 2018-11-30 09:45:19 -03:00 committed by Martin Renvoize
parent 9765cab777
commit 86342bf681
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,11 @@ if ($add){
$template->param( 'ERROR' => $error );
output_html_with_http_headers $input, $cookie, $template->output;
} else {
if ( C4::Context->preference('AccountAutoReconcile') ) {
$patron->account->reconcile_balance;
}
print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber");
exit;
}