]> git.koha-community.org Git - koha.git/commit
Bug 21727: Add ->adjust to Koha::Account::Line
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 1 Nov 2018 17:12:14 +0000 (17:12 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 11 Jan 2019 12:18:59 +0000 (12:18 +0000)
commit7ece45328481988b472cbd9f68bf412a36acd117
tree17e8ee1c5d21b0374b5373bc8fc8a1ba6c3e7009
parent89b8414d3fd8ce8426d9747ec2489f7abf5985a1
Bug 21727: Add ->adjust to Koha::Account::Line

This patch introduces a high-level method for updating existing debits,
similar to Koha::Account::add_credit and Koha::Account::add_debit.

It updates the Koha::Account::Line object, and adds an offset. It also
logs if required.

It whitelists the account types that are allowed to be adjusted, just in
case some others require adjusting, having a single source for truth.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Account/Lines.t
=> SUCCESS: Tests pass!

Sponsored-by: PTFS Europe
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha/Account/Line.pm