Bugzilla – Attachment 75093 Details for
Bug 19191
Add ability to email receipts for account payments and write-offs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19191 [QA Followup] - Remove double fetches from database
Bug-19191-QA-Followup---Remove-double-fetches-from.patch (text/plain), 4.02 KB, created by
Kyle M Hall (khall)
on 2018-05-04 19:18:12 UTC
(
hide
)
Description:
Bug 19191 [QA Followup] - Remove double fetches from database
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-05-04 19:18:12 UTC
Size:
4.02 KB
patch
obsolete
>From 2a87015dca8a3d4b1dc9e286c5b63820e72a4632 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatetsolutions.com> >Date: Fri, 4 May 2018 15:17:51 -0400 >Subject: [PATCH] Bug 19191 [QA Followup] - Remove double fetches from database > >--- > Koha/Account.pm | 4 ++-- > installer/data/mysql/atomicupdate/bug_19191.sql | 2 +- > t/db_dependent/Accounts.t | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 9b087df97d..02cf662747 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -270,14 +270,14 @@ sub pay { > module => 'circulation', > letter_code => uc("ACCOUNT_$type"), > message_transport_type => 'email', >- lang => Koha::Patrons->find( $self->{patron_id} )->lang, >+ lang => $patron->lang, > tables => { > borrowers => $self->{patron_id}, > branches => $self->{library_id}, > }, > substitute => { > credit => $payment, >- offsets => scalar Koha::Account::Offsets->search( { id => { -in => [ map { $_->id } @account_offsets ] } } ), >+ offsets => \@account_offsets, > }, > ) > ) >diff --git a/installer/data/mysql/atomicupdate/bug_19191.sql b/installer/data/mysql/atomicupdate/bug_19191.sql >index 99d9f97756..8e54bb6e18 100644 >--- a/installer/data/mysql/atomicupdate/bug_19191.sql >+++ b/installer/data/mysql/atomicupdate/bug_19191.sql >@@ -1,7 +1,7 @@ > INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) > VALUES > ('circulation', 'ACCOUNT_PAYMENT', '', 'Account payment', 0, 'Account payment', '[%- USE Price -%]\r\nA payment of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis payment affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'), >- ('circulation', 'ACCOUNT_WRITEOFF', '', 'Account Writeoff', 0, 'Account Writeoff', '[%- USE Price -%]\r\nAn account writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis writeoff affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'); >+ ('circulation', 'ACCOUNT_WRITEOFF', '', 'Account writeoff', 0, 'Account writeoff', '[%- USE Price -%]\r\nAn account writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis writeoff affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'); > > $dbh->do(q{ > INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index c2771b9230..feac857a4c 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -1004,7 +1004,7 @@ subtest "Payment notice tests" => sub { > > $id = $account->pay( { amount => 13, type => 'writeoff' } ); > $notice = Koha::Notice::Messages->search()->next(); >- is( $notice->subject, 'Account Writeoff', 'Notice subject is correct for payment' ); >+ is( $notice->subject, 'Account writeoff', 'Notice subject is correct for payment' ); > is( $notice->letter_code, 'ACCOUNT_WRITEOFF', 'Notice letter code is correct for writeoff' ); > is( $notice->content, 'A writeoff of 13.00 has been applied to your account.', 'Notice content is correct for writeoff' ); > }; >-- >2.15.1 (Apple Git-101)
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 19191
:
66554
|
68605
|
68812
|
70465
|
70466
|
70471
|
72366
|
72367
|
72370
|
73924
|
74092
|
74093
|
74094
|
74095
|
74104
|
74105
|
74423
|
74424
|
74504
|
74505
|
74506
|
74507
|
74508
|
74625
|
74626
|
74627
|
74628
|
74629
|
74630
|
74631
|
74686
|
75066
|
75067
|
75068
|
75069
|
75070
|
75071
|
75072
|
75093
|
75134