|
Lines 69-75
if ( $action eq 'void' ) {
Link Here
|
| 69 |
#get account details |
69 |
#get account details |
| 70 |
my $total = $patron->account->balance; |
70 |
my $total = $patron->account->balance; |
| 71 |
|
71 |
|
| 72 |
my $accts = Koha::Account::Lines->search( |
72 |
my @accountlines = Koha::Account::Lines->search( |
| 73 |
{ borrowernumber => $patron->borrowernumber }, |
73 |
{ borrowernumber => $patron->borrowernumber }, |
| 74 |
{ order_by => { -desc => 'accountlines_id' } } |
74 |
{ order_by => { -desc => 'accountlines_id' } } |
| 75 |
); |
75 |
); |
|
Lines 80-114
if($total <= 0){
Link Here
|
| 80 |
} |
80 |
} |
| 81 |
|
81 |
|
| 82 |
my $reverse_col = 0; # Flag whether we need to show the reverse column |
82 |
my $reverse_col = 0; # Flag whether we need to show the reverse column |
| 83 |
my @accountlines; |
|
|
| 84 |
while ( my $line = $accts->next ) { |
| 85 |
# FIXME We should pass the $accts iterator to the template and do this formatting part there |
| 86 |
my $accountline = $line->unblessed; |
| 87 |
$accountline->{object} = $line; |
| 88 |
$accountline->{amount} += 0.00; |
| 89 |
if ($accountline->{amount} <= 0 ) { |
| 90 |
$accountline->{amountcredit} = 1; |
| 91 |
} |
| 92 |
$accountline->{amountoutstanding} += 0.00; |
| 93 |
if ( $accountline->{amountoutstanding} <= 0 ) { |
| 94 |
$accountline->{amountoutstandingcredit} = 1; |
| 95 |
} |
| 96 |
|
| 97 |
$accountline->{amount} = sprintf '%.2f', $accountline->{amount}; |
| 98 |
$accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding}; |
| 99 |
if ($accountline->{amount} < 0) { |
| 100 |
$accountline->{payment} = 1 |
| 101 |
if ( $accountline->{accounttype} =~ /^Pay/ ); |
| 102 |
|
| 103 |
$reverse_col = 1; |
| 104 |
} |
| 105 |
|
| 106 |
if ( $accountline->{itemnumber} ) { |
| 107 |
# Because we will not have access to the object from the template |
| 108 |
$accountline->{item} = $line->item; |
| 109 |
} |
| 110 |
push @accountlines, $accountline; |
| 111 |
} |
| 112 |
|
83 |
|
| 113 |
if (C4::Context->preference('ExtendedPatronAttributes')) { |
84 |
if (C4::Context->preference('ExtendedPatronAttributes')) { |
| 114 |
my $attributes = GetBorrowerAttributes($borrowernumber); |
85 |
my $attributes = GetBorrowerAttributes($borrowernumber); |
| 115 |
- |
|
|