Bug 29385

Summary: Add missing cash register support to SIP2
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Fines and feesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: 1joynelson, andrewfh, fridolin.somers, jonathan.druart, kyle, sally.healey, testopia, victor, wainuiwitikapark
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03,21.05.11,20.11.17
Bug Depends on: 23321, 24828    
Bug Blocks: 13985    
Attachments: Bug 29385: Catch register_id for payments against fees
Bug 29385: Catch register_id for payments against fees
Bug 29385: [ALTERNATIVE] Catch register_id for payments against fees
Bug 29385: Catch register_id for payments against fees
Bug 29385: Catch register_id for payments against fees
Bug 29385: Catch register_id for payments against fees

Description Martin Renvoize 2021-11-01 14:20:43 UTC
+++ This bug was initially created as a clone of Bug #24828 +++

We add support for defining cash registers for SIP with bug 24828, however, we missed the case when specific fees are being paid.
Comment 1 Martin Renvoize 2021-11-01 14:23:14 UTC
Created attachment 127173 [details] [review]
Bug 29385: Catch register_id for payments against fees

This patch adds the missing cash_register definition in the call to pay
with a set of lines defined.
Comment 2 Kyle M Hall 2021-11-01 16:32:22 UTC
Created attachment 127178 [details] [review]
Bug 29385: Catch register_id for payments against fees

This patch adds the missing cash_register definition in the call to pay
with a set of lines defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 3 Jonathan Druart 2021-12-02 12:53:15 UTC
Created attachment 128159 [details] [review]
Bug 29385: [ALTERNATIVE] Catch register_id for payments against fees
Comment 4 Jonathan Druart 2021-12-02 12:54:24 UTC
To prevent such problems from happening again I would prefer a version that will not duplicate code. But hard to provide patch and be confident in it as this code is not covered by tests.
Comment 5 Martin Renvoize 2022-01-18 16:29:59 UTC
Created attachment 129583 [details] [review]
Bug 29385: Catch register_id for payments against fees

This patch refactors the pay method in SIP FeePayment such that we
consistently pass parameters to both invocations of Koha::Account->pay.

It ensure the missing cash_register definition is passed when a set of
account lines to pay is defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2022-01-18 16:34:45 UTC
Jonathan's patch is much better.. I've replaced my own and signed off.
Comment 7 Kyle M Hall 2022-02-10 19:11:23 UTC
Created attachment 130469 [details] [review]
Bug 29385: Catch register_id for payments against fees

This patch refactors the pay method in SIP FeePayment such that we
consistently pass parameters to both invocations of Koha::Account->pay.

It ensure the missing cash_register definition is passed when a set of
account lines to pay is defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Fridolin Somers 2022-02-15 06:45:58 UTC
Sorry maybe silly question :
With patch $register_id is not used anymore.
Is it on purpose ?
Comment 9 Jonathan Druart 2022-02-15 07:53:38 UTC
Created attachment 130595 [details] [review]
Bug 29385: Catch register_id for payments against fees

This patch refactors the pay method in SIP FeePayment such that we
consistently pass parameters to both invocations of Koha::Account->pay.

It ensure the missing cash_register definition is passed when a set of
account lines to pay is defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Jonathan Druart 2022-02-15 07:53:51 UTC
(In reply to Fridolin Somers from comment #8)
> Sorry maybe silly question :
> With patch $register_id is not used anymore.
> Is it on purpose ?

Absolutely not! That was the point of the patch and it got lost!
Comment 11 Jonathan Druart 2022-02-15 07:54:09 UTC
I've amended the patch to reintroduce it.
Comment 12 Fridolin Somers 2022-02-16 21:51:58 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 13 Kyle M Hall 2022-02-18 12:37:26 UTC
Pushed to 21.11.x for 21.11.03
Comment 14 Andrew Fuerste-Henry 2022-02-21 17:00:50 UTC
Pushed to 21.05.x for 21.05.11
Comment 15 Victor Grousset/tuxayo 2022-03-18 00:11:53 UTC
Backported: Pushed to 20.11.x branch for 20.11.17
Comment 16 wainuiwitikapark 2022-03-21 00:39:17 UTC
Does this need to be backported to 19.11.x?
Comment 17 Fridolin Somers 2022-03-21 21:57:26 UTC
(In reply to wainuiwitikapark from comment #16)
> Does this need to be backported to 19.11.x?

I bet not.
Depends on Bug 24828 only in >= 20.05
Comment 18 wainuiwitikapark 2022-03-23 01:31:50 UTC
Not backported to 19.11.x