[Koha-bugs] [Bug 18501] Automatic refunds need protection from failure

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 6 13:43:18 CEST 2020


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

--- Comment #118 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 111295
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111295&action=edit
Bug 18501: [20.05.x] Automatic refunds need protection from failure Bug 18501:
(QA follow-up) Add test of *_on functionality

This patch adds a test for the *_on trigger functionality to ensure
matching behaviour before and after the triggers change.

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: Prepare the ground

This code was duplicated and we are going to need it.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: Remove the borrowernumber parameter

It was not used

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: Auto refund if mark as found from cataloguing

If an item is marked as found (ie. not itemlost) we need to refund the
patron.

Test plan:
Mark an item as lost to create a fee for the patron
Mark it as found from the cataloguing module and confirm that the patron
is refunded

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: Add _set_found_trigger

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: but.. what was the meaning of holdingbranch here?

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: wip - need to know it has been refunded

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: set the is_refunded flag as internal var

After discussion with Martin we decided that it could be the correct way

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: Adjust condition for flagging an item found

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: (QA follow-up) Remove FIXME + Track issue_id

We correct some compilation errors here by updating the transfered
_FixAccountForLostAndFound method to use $self references.  We add
issue_id tracking so that future reports can clearly see how a refund
relates to the original charge and finally we remove a FIXME as I agree
that the 'discard_changes' call is not required.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: (QA follow-up) Migrate and update unit tests

This patch moves the _FixAccountForLostAndFound tests from Circulation.t
to Koha/Items.t and updates then to call an item store as aposed to the
now removed _FixAccountForLostAndFound method.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: (QA follow-up) Fix regressions highlighted by unit tests

The migration of unit tests in the preceeding patch highlighted a few
regressions which are dealt with here.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

Bug 18501: Fix QA issues

 FAIL   Koha/Item.pm
   FAIL   critic
                # Variables::ProhibitConditionalDeclarations: Got 1
violation(s).
   FAIL   spelling
                 Retreive ==> Retrieve
                 appropriatly ==> appropriately
                 somehwere ==> somewhere

Bug 18501: (follow-up) Remove duplicate test

The ModItem test found in t/db_dependent/Items.t was a duplciate (but
slightly less functional) for the test we introduced for the *_on
trigger functionality in t/db_dependent/Koha/Items.t::store

The failure was a missing C4::Context mock, but the logical fix is to
simply remove the duplicate test.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Bug 18501: (follow-up) Test undefined userenv behaviour

This patch adds a test to ensure that the 'Koha::Item->store' method
will function when the userenv is not set

Bug 18501: (follow-up) Do not rely on userenv->{branchcode}

Bug 18501: (follow-up) Add fallback to ItemHomeBranch

When 'RefundLostOnReturnControl' is set to 'CheckinLibrary' but
return_branch is passed as undefined we should fallback to
'ItemHomeBranch' before falling back to the default rule.

Bug 18501: (follow-up) Use t::lib::Dates::compare in tests

Bug 18501: Don't use paidfor for DB fields not mapped with a MARC field

On "Bug 25964: Prevent data loss when editing items from a MARC record"
we picked paidfor as an example, but it has a specific behaviour and is
now handled in Koha::Item->store.
Let's pick another one, new_status

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


More information about the Koha-bugs mailing list