|
Lines 43-51
my $data = GetMember( 'borrowernumber' => $borrowernumber );
Link Here
|
| 43 |
|
43 |
|
| 44 |
my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); |
44 |
my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); |
| 45 |
foreach my $accountline (@$accts) { |
45 |
foreach my $accountline (@$accts) { |
| 46 |
$accountline->{amount} = sprintf '%.2f', $accountline->{amount}; |
46 |
$accountline->{amount} = sprintf( '%.2f', $accountline->{amount} ) |
| 47 |
$accountline->{amountoutstanding} = sprintf '%.2f', |
47 |
if ( $accountline->{amount} ) ; |
| 48 |
$accountline->{amountoutstanding}; |
48 |
$accountline->{amountoutstanding} = sprintf( '%.2f', $accountline->{amountoutstanding} ) |
|
|
49 |
if ( $accountline->{amountoutstanding} ); |
| 49 |
|
50 |
|
| 50 |
if ( $accountline->{accounttype} ne 'F' |
51 |
if ( $accountline->{accounttype} ne 'F' |
| 51 |
&& $accountline->{accounttype} ne 'FU' ) |
52 |
&& $accountline->{accounttype} ne 'FU' ) |
|
Lines 56-63
foreach my $accountline (@$accts) {
Link Here
|
| 56 |
|
57 |
|
| 57 |
my $roadtype = |
58 |
my $roadtype = |
| 58 |
C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); |
59 |
C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); |
|
|
60 |
$roadtype = '' if ( ! $roadtype ); |
| 59 |
|
61 |
|
| 60 |
our $totalprice = 0; |
62 |
our $totalprice = 0; |
|
|
63 |
my $total_format = ''; |
| 64 |
$total_format = sprintf( "%.2f", $total ) if ($total); |
| 65 |
|
| 61 |
$template->param( |
66 |
$template->param( |
| 62 |
%$data, |
67 |
%$data, |
| 63 |
|
68 |
|
|
Lines 65-71
$template->param(
Link Here
|
| 65 |
address => $data->{'streetnumber'} . " $roadtype " . $data->{'address'}, |
70 |
address => $data->{'streetnumber'} . " $roadtype " . $data->{'address'}, |
| 66 |
|
71 |
|
| 67 |
accounts => $accts, |
72 |
accounts => $accts, |
| 68 |
totaldue => sprintf( "%.2f", $total ), |
73 |
totaldue => $total_format, |
| 69 |
|
74 |
|
| 70 |
issues => build_issue_data( GetPendingIssues($borrowernumber) ), |
75 |
issues => build_issue_data( GetPendingIssues($borrowernumber) ), |
| 71 |
totalprice => $totalprice, |
76 |
totalprice => $totalprice, |
|
Lines 84-90
sub build_issue_data {
Link Here
|
| 84 |
foreach my $issue ( @{$issues} ) { |
89 |
foreach my $issue ( @{$issues} ) { |
| 85 |
|
90 |
|
| 86 |
my %row = %{$issue}; |
91 |
my %row = %{$issue}; |
| 87 |
$totalprice += $issue->{replacementprice}; |
92 |
$totalprice += $issue->{replacementprice} |
|
|
93 |
if ( $issue->{replacementprice} ); |
| 88 |
|
94 |
|
| 89 |
#find the charge for an item |
95 |
#find the charge for an item |
| 90 |
my ( $charge, $itemtype ) = |
96 |
my ( $charge, $itemtype ) = |
|
Lines 100-106
sub build_issue_data {
Link Here
|
| 100 |
push( @{$return}, \%row ); |
106 |
push( @{$return}, \%row ); |
| 101 |
} |
107 |
} |
| 102 |
|
108 |
|
| 103 |
@{$return} = sort { $a->{date_due} <=> $b->{date_due} } @{$return}; |
109 |
@{$return} = sort { $a->{date_due} eq $b->{date_due} } @{$return}; |
| 104 |
|
110 |
|
| 105 |
return $return; |
111 |
return $return; |
| 106 |
} |
112 |
} |
| 107 |
- |
|
|