Bugzilla – Attachment 188174 Details for
Bug 40255
Allow custom debit descriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40255: Allow for custom debit descriptions
Bug-40255-Allow-for-custom-debit-descriptions.patch (text/plain), 3.67 KB, created by
Lucas Gass (lukeg)
on 2025-10-20 19:52:13 UTC
(
hide
)
Description:
Bug 40255: Allow for custom debit descriptions
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-10-20 19:52:13 UTC
Size:
3.67 KB
patch
obsolete
>From a10238e71aae35a4a9530cd6207acbca86b6ec79 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 20 Oct 2025 19:45:30 +0000 >Subject: [PATCH] Bug 40255: Allow for custom debit descriptions > >--- > Koha/Account/Line.pm | 21 +++++++++++++++++++ > .../prog/en/modules/tools/letter.tt | 8 +++++++ > 2 files changed, 29 insertions(+) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index f44761fcf48..391d95af79c 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -28,6 +28,7 @@ use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Exceptions::Account; > use Koha::Patron::Debarments; >+use C4::Letters; > > use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); > >@@ -1097,6 +1098,26 @@ sub store { > } > } > >+ #if there is a matching debit description letter, pull that content and render it for the accountline.description >+ if ( $self->is_debit && !$self->in_storage && !$self->description ) { >+ my $debit_type = $self->debit_type; >+ if ($debit_type) { >+ my $letter = C4::Letters::GetPreparedLetter( >+ module => 'debit_description', >+ letter_code => $debit_type->code, >+ tables => { >+ borrowers => $self->borrowernumber, >+ branches => $self->branchcode, >+ accountline => $self, >+ }, >+ ); >+ >+ if ( $letter && $letter->{content} ) { >+ $self->description( $letter->{content} ); >+ } >+ } >+ } >+ > return $self->SUPER::store(); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index 6ec0ce10799..63d6a293b49 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -208,6 +208,7 @@ > <li><a class="dropdown-item" href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=pos">Point of sale</a></li> > <li><a class="dropdown-item" href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=report">Reports</a></li> > <li><a class="dropdown-item" href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=bookings">Bookings</a></li> >+ <li><a class="dropdown-item" href="/cgi-bin/koha/tools/letter.pl?op=add_form&module=debit_description">Debit description (custom)</a></li> > </ul> > </div> > </div> >@@ -290,6 +291,8 @@ > <span>Reports</span> > [% CASE 'bookings' %] > <span>Bookings</span> >+ [% CASE 'debit_description' %] >+ <span>Debit description (custom)</span> > [% CASE %] > <span>[% lette.module | html %]</span> > [% END %] >@@ -501,6 +504,11 @@ > [% ELSE %] > <option value="bookings">Bookings</option> > [% END %] >+ [% IF ( module == "debit_descriptions" ) %] >+ <option value="bookings" selected="selected">Debit description (custom)</option> >+ [% ELSE %] >+ <option value="bookings">Bookings</option> >+ [% END %] > </select> > </li> > <li> >-- >2.39.5
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 40255
:
188174
|
188176
|
188177
|
188178
|
188179
|
188180
|
188181
|
189641