Bugzilla – Attachment 125508 Details for
Bug 29139
Paying gives ISE if UseEmailReceipts is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29139: Only pass the offsets for lines the credit was applied to
Bug-29139-Only-pass-the-offsets-for-lines-the-cred.patch (text/plain), 1.58 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-09-30 13:11:51 UTC
(
hide
)
Description:
Bug 29139: Only pass the offsets for lines the credit was applied to
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-09-30 13:11:51 UTC
Size:
1.58 KB
patch
obsolete
>From 3ca97987fff09248b32168e0af5ba2df080f2415 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 30 Sep 2021 10:02:20 -0300 >Subject: [PATCH] Bug 29139: Only pass the offsets for lines the credit was > applied to > >On writing the regression tests, I noticed the CREATE offset was added >to the template. The idea behind passing the offsets is that we can >print information about the lines that got the credit applied. Having >the CREATE offset is meaningless, and (worse) would require users to add >logic to skip it. And all the payment information is already passed in >the 'credit' variable anyway. > >This patch filters the credit_offsets by type, leaving the APPLY ones >only. > >To test: >1. Apply up to the regression tests >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Account.t >=> FAIL: 3 offsets, including the CREATE one, boo! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! Only the two APPLY offsets are returned! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Account.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 45f0fa6f64..5f4da3f11e 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -110,7 +110,7 @@ sub pay { > } > > my $patron = Koha::Patrons->find( $self->{patron_id} ); >- my @account_offsets = $payment->credit_offsets->as_list; >+ my @account_offsets = $payment->credit_offsets({ type => 'APPLY' })->as_list; > if ( C4::Context->preference('UseEmailReceipts') ) { > if ( > my $letter = C4::Letters::GetPreparedLetter( >-- >2.32.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29139
:
125463
|
125464
|
125474
|
125475
|
125476
|
125504
|
125505
|
125506
|
125507
|
125508
|
125509
|
125510
|
125511
|
125512
|
125513
|
125592
|
125593
|
125594
|
125595
|
125596
|
125844
|
125845
|
125846
|
125847
|
125848