Bug 22435: Fix _set_found_trigger
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 14 May 2021 13:04:35 +0000 (14:04 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 4 Aug 2021 12:06:43 +0000 (14:06 +0200)
commitdec9f754f8bbebaf6d2a2e9ba1ce1b9935ba45da
treef7a35cc5848a6ef9da0eac1cc92d1491e000076d
parentc188ec1567e69a1ee9e9fff19320a273e4ea65dd
Bug 22435: Fix _set_found_trigger

The _set_found_trigger utilised the 'Writeoff' offset type to
distinguish between the application of a writeoff and any other form of
offset application.

This patch updates the trigger to use the full link through from offset
to account credit line to get the credit type being offset.

Test plan
1/ Run t/db_dependent/Koha/Items.t and prove it fails before the patch,
but passes after applying this patch.
2/ Run t/db_dependent/Koha/Account/Offsets.t and prove it passes both
before and after applying this patch.

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>
Koha/Account/Line.pm
Koha/Account/Offsets.pm
Koha/Item.pm
t/db_dependent/Koha/Account/Offsets.t