Bugzilla – Attachment 184436 Details for
Bug 40458
Discharge.pm is missing pod coverage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40458: add pod coverage to Discharge.pm
Bug-40458-add-pod-coverage-to-Dischargepm.patch (text/plain), 4.21 KB, created by
Marcel de Rooy
on 2025-07-21 12:06:19 UTC
(
hide
)
Description:
Bug 40458: add pod coverage to Discharge.pm
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-07-21 12:06:19 UTC
Size:
4.21 KB
patch
obsolete
>From 3bf00b697d8ced20708f93453e0e936c24e8a6d5 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Mon, 21 Jul 2025 11:51:40 +0200 >Subject: [PATCH] Bug 40458: add pod coverage to Discharge.pm >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >[EDIT] Replaced borrowers in the ->request POD by borrower >--- > Koha/Patron/Discharge.pm | 92 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 92 insertions(+) > >diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm >index 7da95ab7c3..1d4b41e84b 100644 >--- a/Koha/Patron/Discharge.pm >+++ b/Koha/Patron/Discharge.pm >@@ -14,6 +14,24 @@ use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Patrons; > use Koha::Patron::Debarments qw( AddDebarment ); > >+=head1 NAME >+ >+Koha::Patron::Discharge - Koha Discharge object class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 count >+ >+ Koha::Patron:Discharge->count; >+ >+Return the number of discharges corresponding to the asked criteria >+ >+=cut >+ > sub count { > my ($params) = @_; > my $values = {}; >@@ -31,6 +49,14 @@ sub count { > return search_limited($values)->count; > } > >+=head3 can_be_discharged >+ >+ my $can_be_discharged = Koha::Patron:Discharge->can_be_discharged({borrowernumber => $borrowernumber}); >+ >+Return true if the borrower can be discharged >+ >+=cut >+ > sub can_be_discharged { > my ($params) = @_; > return unless $params->{borrowernumber}; >@@ -56,6 +82,14 @@ sub can_be_discharged { > return ( $can_be_discharged, $problems ); > } > >+=head3 is_discharged >+ >+ my $is_discharged = Koha::Patron:Discharge->is_discharged({borrowernumber => $borrowernumber}); >+ >+Return true if the borrower is discharged >+ >+=cut >+ > sub is_discharged { > my ($params) = @_; > return unless $params->{borrowernumber}; >@@ -71,6 +105,14 @@ sub is_discharged { > } > } > >+=head3 request >+ >+ my $request = Koha::Patron:Discharge->request({borrowernumber => $borrowernumber}); >+ >+Place a discharge request on a given borrower after checking the borrower has the right to be discharged. >+ >+=cut >+ > sub request { > my ($params) = @_; > my $borrowernumber = $params->{borrowernumber}; >@@ -87,6 +129,14 @@ sub request { > ); > } > >+=head3 discharge >+ >+ my $request = Koha::Patron:Discharge->discharge({borrowernumber => $borrowernumber}); >+ >+Place a discharge request on a given borrower, if a discharge was requested, update the status to discharged and place a suspension on the user. >+ >+=cut >+ > sub discharge { > my ($params) = @_; > my $borrowernumber = $params->{borrowernumber}; >@@ -124,6 +174,14 @@ sub discharge { > } > } > >+=head3 generate_as_pdf >+ >+ my $request = Koha::Patron:Discharge->generate_as_pdf({borrowernumber => $borrowernumber}); >+ >+Create a pdf from an existing discharge associated to the borrowernumber. >+ >+=cut >+ > sub generate_as_pdf { > my ($params) = @_; > return unless $params->{borrowernumber}; >@@ -175,6 +233,17 @@ sub generate_as_pdf { > return $pdf_path; > } > >+=head3 get_pendings >+ >+ my $rs = Koha::Patron:Discharge->get_pendings({ >+ borrowernumber => $borrowernumber >+ branchcode => $branchcode >+ }); >+ >+Get all pending discharges associated to a borrowernumber and/or a given branch >+ >+=cut >+ > sub get_pendings { > my ($params) = @_; > my $branchcode = $params->{branchcode}; >@@ -190,6 +259,17 @@ sub get_pendings { > return search_limited($cond); > } > >+=head3 get_validated >+ >+ my $rs = Koha::Patron:Discharge->get_validated({ >+ borrowernumber => $borrowernumber >+ branchcode => $branchcode >+ }); >+ >+Get all validated discharges associated to a borrowernumber and/or a given branch >+ >+=cut >+ > sub get_validated { > my ($params) = @_; > my $branchcode = $params->{branchcode}; >@@ -205,6 +285,18 @@ sub get_validated { > } > > # TODO This module should be based on Koha::Object[s] >+ >+=head3 search_limited >+ >+ my $rs = Koha::Patron:Discharge->search_limited({ >+ borrower.branchcode => $branchcode >+ }, >+ $attributes); >+ >+Search all discharges that can be seen by the user and fitting the given conditions >+ >+=cut >+ > sub search_limited { > my ( $params, $attributes ) = @_; > my $userenv = C4::Context->userenv; >-- >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 40458
:
184433
| 184436