Bugzilla – Attachment 135214 Details for
Bug 28556
Make guarantor information available in notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28556: Guarantor's information is available in notice
Bug-28556-Guarantors-information-is-available-in-n.patch (text/plain), 4.09 KB, created by
Shi Yao Wang
on 2022-05-19 19:07:47 UTC
(
hide
)
Description:
Bug 28556: Guarantor's information is available in notice
Filename:
MIME Type:
Creator:
Shi Yao Wang
Created:
2022-05-19 19:07:47 UTC
Size:
4.09 KB
patch
obsolete
>From a3c0ea89ec3089da5b4522eeaefcbf3a0fde8f16 Mon Sep 17 00:00:00 2001 >From: The Minh Luong <the-minh.luong@inlibro.com> >Date: Tue, 8 Feb 2022 17:22:30 -0500 >Subject: [PATCH] Bug 28556: Guarantor's information is available in notice > >This patch adds the guarantor's information when sending overdue >notice. > >To test: >1. Make sure that there is an overdue letter. > a) Go in Tools/Notices & Slips. > b) Search for the code "ODUE" and note the "Name" of the letter. > c) Click on "Edit". > d) Click on "Email" and make sure that there is text inside the box. > e) Add the following code in the textbox: > C/O <<guarantor.firstname>> <<guarantor.surname>> <br/> > f) Click on "Save". > >2. Set up the status trigger. > a) Go in Tools/Overdue notice/status triggers. > b) In "First" tab, put a number of days in the "Delay" column (ex: 1). > c) In the column "Letter", put the "Name" of the letter of step 1a) . > d) Check "Email". > e) Click "Save". > >3. Create a patron with a guarantor. > a) Go in Administration/Patron categories. > b) Create a child category AND a adult category. > c) Create an adult patron. > d) Create a child patron. > e) Go in the child patron's page and click "Edit". > f) In the "Patron guarantor" section, click add guarantor. > g) Search for your adult patron and click "Select". > h) Select a relationship for the guarantor (ex: Mother). > i) Click on "Save". > >4. Borrow an overdue item. > a) Click on the arrow next to "Search button" (Top of the screen). > b) Click on "Items search". > c) Click on search. > d) Copy a barcode in the list. > e) Search for your child patron. > f) Go in his page and click on "Checkout". > g) Paste the barcode copied at step 4d) . > h) Click on "Checkout settings". > i) Put a date in the past greater than the number of days that you put > on step 2b). > j) Click on "Check out". > k) Click on "Yes" Notice tht there is a message saying that Patron has > ITEMS OVERDUE. > >5. Test the patch. > a) In the terminal, run ./misc/cronjobs/overdue_notices.pl > b) Return in your child patron's page. > c) Click on "Notice" and you should see a letter. > d) Click on the letter to see the content. > c) Notice that you can't see the guarantor's informations (Adult patron). > d) Apply the patch. > e) Repeat steps a) to d) > f) Notice that you can see the guarantor's informations. > >This also works if you decide to add a non-patron guarantor instead of a >patron guarantor at step 3. > >NOTE: If you want to delete the letters, go in your database and run: >- delete from message_queue; >--- > C4/Letters.pm | 15 +++++++++++++++ > Koha/Patron.pm | 16 ++++++++++++++++ > 2 files changed, 31 insertions(+) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 9ed1de0e44..ffdde74fac 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -643,6 +643,21 @@ sub GetPreparedLetter { > } > } > >+ my $patron = Koha::Patrons->find($tables->{borrowers}); >+ my @guarantors; >+ if ( $patron->guarantor_relationships->count ) { >+ @guarantors = $patron->guarantor_relationships->guarantors; >+ } >+ my $guarantor = $guarantors[0]; >+ if ( $guarantor ) { >+ $$tables{guarantor}=$guarantor->unblessed; >+ } else { >+ my ($firstname, $surname, $relationship) = $patron->non_patron_guarantor_info(); >+ >+ $$tables{guarantor}->{firstname} = $firstname; >+ $$tables{guarantor}->{surname} = $surname; >+ } >+ > if (%$tables) { > _substitute_tables( $letter, $tables ); > } >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index e205e23fd3..f2c1acb6ab 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -506,6 +506,22 @@ sub guarantee_relationships { > ); > } > >+=head3 non_patron_guarantor_info >+ >+Returns ($contactfirstname, $contactname, $relationship) of this patron's non-patron guarantor >+ >+=cut >+ >+sub non_patron_guarantor_info { >+ my ($self) = @_; >+ >+ my $contactfirstname = $self->_result->contactfirstname; >+ my $contactname = $self->_result->contactname; >+ my $relationship = $self->_result->relationship; >+ >+ return ($contactfirstname, $contactname, $relationship); >+} >+ > =head3 relationships_debt > > Returns the amount owed by the patron's guarantors *and* the other guarantees of those guarantors >-- >2.25.1
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 28556
:
130339
|
130340
|
135214
|
146397
|
146398