From 3082ad80bc022164d8dbbb52f5ac6ece54b4d1e1 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Thu, 27 Sep 2007 16:28:06 -0500 Subject: [PATCH] Bugfix for 1429 Signed-off-by: Chris Cormack --- C4/Print.pm | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/C4/Print.pm b/C4/Print.pm index 957c65bd16..e7c7b32f45 100644 --- a/C4/Print.pm +++ b/C4/Print.pm @@ -24,6 +24,8 @@ require Exporter; use C4::Context; use C4::Circulation; +use C4::Members; +use C4::Date; use vars qw($VERSION @ISA @EXPORT); @@ -186,31 +188,11 @@ EOF sub printslip { my ( $borrowernumber ) = @_; my ( $borrower, $flags ) = GetMemberDetails( $borrowernumber); - my ($borrowerissues) = GetBorrowerIssues( $borrower ); - my ($borroweriss2) = GetBorrowerIssues( $borrower ); - my $i = 0; - my @issues; - - foreach ( sort { $a <=> $b } keys %$borrowerissues ) { - $issues[$i] = $borrowerissues->{$_}; - my $dd = $issues[$i]->{'date_due'}; - - #convert to nz style dates - #this should be set with some kinda config variable - my @tempdate = split( /-/, $dd ); - $issues[$i]->{'date_due'} = "$tempdate[2]/$tempdate[1]/$tempdate[0]"; - $i++; - } - foreach ( sort { $a <=> $b } keys %$borroweriss2 ) { - $issues[$i] = $borroweriss2->{$_}; - my $dd = $issues[$i]->{'date_due'}; - - #convert to nz style dates - #this should be set with some kinda config variable - my @tempdate = split( /-/, $dd ); - $issues[$i]->{'date_due'} = "$tempdate[2]/$tempdate[1]/$tempdate[0]"; - $i++; - } + my ($countissues,$issueslist) = GetPendingIssues($borrowernumber); + foreach my $it (@$issueslist){ + $it->{'date_due'}=format_date($it->{'date_due'}); + } + my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist; remoteprint(\@issues, $borrower ); } -- 2.39.5