[Koha-bugs] [Bug 21786] Routes for credits should include library_id

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 27 16:45:38 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786

Alex Arnaud <alex.arnaud at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #82281|0                           |1
        is obsolete|                            |

--- Comment #13 from Alex Arnaud <alex.arnaud at biblibre.com> ---
Created attachment 83532
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83532&action=edit
Bug 21786: Make balance and credits endpoints handle library_id

This patch:
- Adds the branchcode <-> library_id mapping in the controller
- Adds 'library_id' to the credit and account_line definitions
- Makes add_credit handle the library_id param, passing it to the
  underlying $account->add_credit method.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> FAIL: Tests fail, because library_id is not mapped
(balance) and because it is not handled when adding a credit.
- Apply this patch
- Run:
  k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud at biblibre.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list