Bugzilla – Attachment 73575 Details for
Bug 19935
Move C4::Members::GetPendingIssues to the Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19935: Replace GetPendingIssues - summary-print
Bug-19935-Replace-GetPendingIssues---summary-print.patch (text/plain), 2.69 KB, created by
Josef Moravec
on 2018-04-03 13:13:36 UTC
(
hide
)
Description:
Bug 19935: Replace GetPendingIssues - summary-print
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-04-03 13:13:36 UTC
Size:
2.69 KB
patch
obsolete
>From 9e6d5097611fd9263349fe75156c90cb0dd1a913 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 8 Jan 2018 11:40:10 -0300 >Subject: [PATCH] Bug 19935: Replace GetPendingIssues - summary-print > >We are in the notices part, so we need to fetch all the data to avoid >regressions. > >Test plan: >Print a summary slip before and after this patch. >They must be the same > >Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > members/summary-print.pl | 31 +++++++++++++++---------------- > 1 file changed, 15 insertions(+), 16 deletions(-) > >diff --git a/members/summary-print.pl b/members/summary-print.pl >index 03e9d89..342685b 100755 >--- a/members/summary-print.pl >+++ b/members/summary-print.pl >@@ -75,36 +75,35 @@ output_html_with_http_headers $input, $cookie, $template->output; > > sub build_issue_data { > my ( $borrowernumber ) = @_; >- my $issues = GetPendingIssues( $borrowernumber ); >+ my $patron = Koha::Patrons->find( $borrowernumber ); >+ return unless $patron; > >- my $return = []; >+ my $pending_checkouts = $patron->pending_checkouts->search( {}, >+ { order_by => [ { -desc => 'date_due' }, { -asc => 'issue_id' } ] } ); > >- my $today = DateTime->now( time_zone => C4::Context->tz ); >- $today->truncate( to => 'day' ); >+ my @checkouts; > >- foreach my $issue ( @{$issues} ) { >+ while ( my $c = $pending_checkouts->next ) { >+ my $checkout = $c->unblessed_all_relateds; > >- my %row = %{$issue}; >- $totalprice += $issue->{replacementprice} >- if ( $issue->{replacementprice} ); >+ $totalprice += $checkout->{replacementprice} >+ if $checkout->{replacementprice}; > > #find the charge for an item > my ( $charge, $itemtype ) = >- GetIssuingCharges( $issue->{itemnumber}, $borrowernumber ); >+ GetIssuingCharges( $checkout->{itemnumber}, $borrowernumber ); > > $itemtype = Koha::ItemTypes->find( $itemtype ); >- $row{'itemtype_description'} = $itemtype->description; #FIXME Should not it be translated_description >+ $checkout->{itemtype_description} = $itemtype->description; #FIXME Should not it be translated_description > >- $row{'charge'} = sprintf( "%.2f", $charge ); >+ $checkout->{charge} = sprintf( "%.2f", $charge ); # TODO Should be done in the template using Price > >- $row{date_due} = $row{date_due_sql}; >+ $checkout->{overdue} = $c->is_overdue; > >- push( @{$return}, \%row ); >+ push @checkouts, $checkout; > } > >- @{$return} = sort { $a->{date_due} eq $b->{date_due} } @{$return}; >- >- return $return; >+ return \@checkouts; > > } > >-- >2.1.4
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 19935
:
70351
|
70352
|
70353
|
70354
|
70355
|
70356
|
70357
|
70358
|
70359
|
70360
|
70361
|
71807
|
71808
|
71809
|
71810
|
71811
|
71812
|
71813
|
72752
|
72753
|
72754
|
72755
|
72756
|
72757
|
72758
|
72759
|
72760
|
72761
|
72762
|
73557
|
73558
|
73559
|
73560
|
73561
|
73562
|
73563
|
73564
|
73565
|
73566
|
73567
|
73568
|
73569
|
73570
|
73571
|
73572
|
73573
|
73574
| 73575 |
73576
|
73577
|
73578
|
73579
|
73580
|
73581
|
73582