Bugzilla – Attachment 72367 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: Remove need for bug 19966
Bug-19191-Remove-need-for-bug-19966.patch (text/plain), 5.38 KB, created by
Kyle M Hall (khall)
on 2018-03-02 15:05:04 UTC
(
hide
)
Description:
Bug 19191: Remove need for bug 19966
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-03-02 15:05:04 UTC
Size:
5.38 KB
patch
obsolete
>From 2f8bed4bb019598069d5b499792d6256e87d7b89 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 2 Mar 2018 15:04:10 +0000 >Subject: [PATCH] Bug 19191: Remove need for bug 19966 > >--- > C4/Letters.pm | 14 ++++++++++++++ > Koha/Account.pm | 14 +++++++++----- > installer/data/mysql/en/mandatory/sample_notices.sql | 4 ++-- > 3 files changed, 25 insertions(+), 7 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 219779b..4b0fcae 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -846,6 +846,8 @@ sub _parseletter_sth { > ($table eq 'aqorders' ) ? "SELECT * FROM $table WHERE ordernumber = ?" : > ($table eq 'opac_news' ) ? "SELECT * FROM $table WHERE idnew = ?" : > ($table eq 'article_requests') ? "SELECT * FROM $table WHERE id = ?" : >+ ($table eq 'account_offsets') ? "SELECT * FROM $table WHERE id = ?" : >+ ($table eq 'accountlines') ? "SELECT * FROM $table WHERE accountlines_id = ?" : > ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" : > ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" : > ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" : >@@ -1582,6 +1584,18 @@ sub _get_tt_params { > plural => 'patron_modifications', > fk => 'verification_token', > }, >+ account_offsets => { >+ module => 'Koha::Account::Offsets', >+ singular => 'account_offset', >+ plural => 'account_offsets', >+ pk => 'id', >+ }, >+ accountlines => { >+ module => 'Koha::Account::Lines', >+ singular => 'accountline', >+ plural => 'accountlines', >+ pk => 'accountlines_id', >+ }, > }; > > foreach my $table ( keys %$tables ) { >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 7d62591..ecf6d1e 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -268,12 +268,16 @@ sub pay { > letter_code => uc("ACCOUNT_$type"), > message_transport_type => 'email', > lang => Koha::Patrons->find( $self->{patron_id} )->lang, >- objects => { >- patron => scalar Koha::Patrons->find( $self->{patron_id} ), >- library => scalar Koha::Libraries->find( $self->{library_id} ), >- offsets => \@account_offsets, >- credit => $payment, >+ tables => { >+ borrowers => $self->{patron_id}, >+ branches => $self->{library_id}, > }, >+ substitute => { >+ credit => $payment, >+ }, >+ loops => { >+ account_offsets => [ map { $_->id } @account_offsets ], >+ } > ) > ) > { >diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql >index bc5102f..7302ef1 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.sql >+++ b/installer/data/mysql/en/mandatory/sample_notices.sql >@@ -178,5 +178,5 @@ INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title` > > INSERT 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_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 account_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 account_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'); >-- >2.10.2
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