Bug 22435: Fix CREATE offset amounts

Updateing the tests highlighted a mistake in the original code.. the
offsets for the cancel and reduce creation lines were incorrectly
signed.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Martin Renvoize 2021-03-18 10:23:57 +00:00 committed by Jonathan Druart
parent 9b34ca9fe2
commit c188ec1567
1 changed files with 2 additions and 2 deletions

View File

@ -416,7 +416,7 @@ sub cancel {
{
credit_id => $cancellation->accountlines_id,
type => 'CREATE',
amount => $self->amount
amount => 0 - $self->amount
}
)->store();
@ -535,7 +535,7 @@ sub reduce {
{
credit_id => $reduction->accountlines_id,
type => 'CREATE',
amount => $params->{amount}
amount => 0 - $params->{amount}
}
)->store();