[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-12-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

--- Comment #6 from Tomás Cohen Arazi  ---
Created attachment 83029
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83029=edit
Bug 21759: Regression tests

This patch tests for a new behaviour in the _FixAccountForLostAndFound
method.

The method will now add the amountoutstanding value for the lost item
fee to the CR credit to be generated. This means that:
- If there's some remaining debt, the same amount  will be added to the
  CR credit and used to cancel that debt. The final amountoutstanding
  will be the same as before, but an offset will be generated as
  required.
- If the line was written off, the behaviour remains unchanged, so no
  offset.
- If the line was payed and/or written off in full only the payments are
  refund, preserving the current behaviour.

Only changes to the 'remaining debt' use cases on this tests are
expected.

To test:
- Apply this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation.t
=> FAIL: Tests fail because the behaviour is not correct.

Note: some tests order changes are introduced to avoid calling
discard_changes twice

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-12-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

--- Comment #7 from Tomás Cohen Arazi  ---
Created attachment 83030
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83030=edit
Bug 21759: Avoid manually setting amountoutstanding in
_FixAccountForLostAndReturned

This patch changes the behaviour in the _FixAccountForLostAndFound
method.

The method will now add the amountoutstanding value for the lost item
fee to the CR credit to be generated. This means that:
- If there's some remaining debt, the same amount  will be added to the
  CR credit and used to cancel that debt. The final amountoutstanding
  will be the same as before, but an offset will be generated as
  required.
- If the line was written off, the behaviour remains unchanged, so no
  offset.
- If the line was payed and/or written off in full only the payments are
  refund, preserving the current behaviour.

To test:
- Apply the regression tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation.t
=> FAIL: Tests fail because the behaviour is not correct
- Apply this patch
- Run:
 k$ prove t/db_dependent/Circulation.t
=> SUCCESS: Tests now pass!
- Sign off :-D

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-12-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Status|NEW |Needs Signoff

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-12-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

--- Comment #5 from Tomás Cohen Arazi  ---
Kyle, Martin and I agreed this will be implemented by making this add and apply
a credit instead of manually setting amount to 0. The use of the changed
accounttype is spread in many places and should remain untouched.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-08 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759
Bug 21759 depends on bug 13098, which changed state.

Bug 13098 Summary: Item lost multiple times by the same patron will create only 
be charged once
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13098

   What|Removed |Added

 Status|Pushed to Master|RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

--- Comment #4 from Tomás Cohen Arazi  ---
(In reply to Martin Renvoize from comment #3)
> Though actually, thinking more about this I'm not sure I understand why
> we're editing the amount directly here at all.. surely it's just a case of
> adding a credit to offset the amount outstanding to zero as per other
> payments/waivers.. I don't know the history, perhaps someone could enlighten
> me?

I'm suspecting about adjust as well

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

--- Comment #3 from Martin Renvoize  ---
Though actually, thinking more about this I'm not sure I understand why we're
editing the amount directly here at all.. surely it's just a case of adding a
credit to offset the amount outstanding to zero as per other payments/waivers..
I don't know the history, perhaps someone could enlighten me?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-04 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

--- Comment #2 from Martin Renvoize  ---
I indeed left the amount in the adjust method open for just this sort of thing.
A new offset type seems sensible .

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

Tomás Cohen Arazi  changed:

   What|Removed |Added

   See Also||https://bugs.koha-community
   ||.org/bugzilla3/show_bug.cgi
   ||?id=21727
 CC||martin.renvoize@ptfs-europe
   ||.com

--- Comment #1 from Tomás Cohen Arazi  ---
Just a guess: this could be implemented using Koha::Account::Line->adjust,
provided we allowed negative increments and a suitable update type/offset type
is defined.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Depends on||13098


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13098
[Bug 13098] Item lost multiple times by the same patron will create only be
charged once
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

Kyle M Hall  changed:

   What|Removed |Added

   Assignee|koha-b...@lists.koha-commun |tomasco...@gmail.com
   |ity.org |

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 21759] _FixAccountForLostAndReturned does not always create an account offset

2018-11-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21759

Kyle M Hall  changed:

   What|Removed |Added

   Severity|enhancement |normal

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/