Bug 20980: Make mancredit.pl use Koha::Account::add_credit
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 22 Jun 2018 15:23:47 +0000 (12:23 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 2 Aug 2018 15:29:54 +0000 (16:29 +0100)
commit665faa45e7178d0fe916125246986f81bc8e1103
tree636ce6698aa16107b83824ce477389d93319e54c
parent359a045cfc331cf2a928fbe0cff11792c8a6959c
Bug 20980: Make mancredit.pl use Koha::Account::add_credit

This patch makes creating a manual credit from the UI record the account
offset as 'Manual Credit', and properly set account_offsets.credit_id
instead of account_offsets.debit_id.

To test:
- Create a manual credit (of 'Credit' type) for a known patron (acevedo?)
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM account_offsets;
=> FAIL: The account offset for the manual credit has type=Manual Debit,
    credit_id=NULL and debit_id=accountlines_id
- Run the atomic update:
  $ updatedatabase
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM account_offsets;
=> SUCCESS: The account offset has been corrected and now has
type=Manual Credit, credit_id=accountlines_id and debit_id=NULL
- Create a new manual credit (of 'Forgiven' type) for a known patron
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM account_offsets;
=> SUCCESS: The account offset has been stored correctly as a credit!
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cc30dc39bf3c8f627865c1a4891fac534266dc03)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt
members/mancredit.pl