Bug 21607 - Koha::Account::Line->apply should store credit offsets as negative amounts
Summary: Koha::Account::Line->apply should store credit offsets as negative amounts
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on: 20997
Blocks: 13098 21646 22837
  Show dependency treegraph
 
Reported: 2018-10-18 14:38 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2020-01-06 20:13 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 21607: Make Koha::Account::Line->apply store credits as negative amounts (2.69 KB, patch)
2018-10-18 14:41 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 21607: Make Koha::Account::Line->apply store credits as negative amounts (2.74 KB, patch)
2018-10-18 18:42 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 21607: Make Koha::Account::Line->apply store credits as negative amounts (2.80 KB, patch)
2018-10-19 14:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 21621: Remove incorrect GROUP BY from tools/letter.pl (1.41 KB, patch)
2018-10-19 18:07 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2018-10-18 14:38:46 UTC
It incorrectly sets positive values, which are internally considered debits in Koha. This should be fixed ASAP so 18.11 doesn't include the bug (it is the first release to have this code).
Comment 1 Tomás Cohen Arazi (tcohen) 2018-10-18 14:41:30 UTC
Created attachment 80858 [details] [review]
Bug 21607: Make Koha::Account::Line->apply store credits as negative amounts

This is a trivial patch, that makes offsets have 'amount' stored as
negative values for applied credits.

The behaviour is changed on the tests and adjusted in the code. To test:
- Run
  $ kshell
 k$ prove t/db_dependent/Koha/Account/Lines.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Michal Denar 2018-10-18 18:42:27 UTC
Created attachment 80874 [details] [review]
Bug 21607: Make Koha::Account::Line->apply store credits as negative amounts

This is a trivial patch, that makes offsets have 'amount' stored as
negative values for applied credits.

The behaviour is changed on the tests and adjusted in the code. To test:
- Run
  $ kshell
 k$ prove t/db_dependent/Koha/Account/Lines.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Michal Denar <black23@gmail.com>
Comment 3 Martin Renvoize (ashimema) 2018-10-19 14:48:35 UTC
Created attachment 80938 [details] [review]
Bug 21607: Make Koha::Account::Line->apply store credits as negative amounts

This is a trivial patch, that makes offsets have 'amount' stored as
negative values for applied credits.

The behaviour is changed on the tests and adjusted in the code. To test:
- Run
  $ kshell
 k$ prove t/db_dependent/Koha/Account/Lines.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2018-10-19 14:49:29 UTC
I concur.. passing qa
Comment 5 Nick Clemens (kidclamp) 2018-10-19 17:42:26 UTC
Awesome work all!

Pushed to master for 18.11
Comment 6 Pierre-Marc Thibault 2018-10-19 18:07:20 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize (ashimema) 2018-10-24 11:42:47 UTC
Looks like this went to the wrong bug Pierre ;)
Comment 8 Martin Renvoize (ashimema) 2018-11-06 10:19:27 UTC
Bug not present in 18.05.x series.