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

--- Comment #26 from Tomás Cohen Arazi <tomasco...@gmail.com> ---
Created attachment 125844
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125844&action=edit
[21.05.x] Bug 29139: $line->debit_offsets doesn't honor list context

Being based on _new_from_dbic (discussion on bug 28883), makes the
assignment incorrect:

my @account_offsets = $payment->debit_offsets;

This patch explicitly makes the resultset be assigned as a list by
calling *as_list*.

To test:
1. Have UseEmailReceipts disabled
2. Have a patron with a debt of 6
3. Make a payment of 2
=> SUCCESS: All good
4. Enable UseEmailReceipts
5. Repeat 3
=> FAIL: You get something like:

ERROR PROCESSING TEMPLATE: undef error - The method
Koha::Account::Offsets->debit is not covered by tests!

Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595
Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called
at input text line 6
eval {...} at input text line 6
eval {...} at input text line 23

6. Apply this patch
7. Repeat 3
=> SUCCESS: It doesn't explode anymore!
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io>
Signed-off-by: Andrew Fuerste-Henry <and...@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io>
Signed-off-by: Andrew Fuerste-Henry <and...@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://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/

Reply via email to