View | Details | Raw Unified | Return to bug 22761
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt (+7 lines)
Lines 18-23 Link Here
18
<body id="pat_printfeercpt" class="pat">
18
<body id="pat_printfeercpt" class="pat">
19
19
20
<div id="receipt">
20
<div id="receipt">
21
22
[% IF letter %]
23
    [% letter.content | evaltt %]
24
[% ELSE %]
21
<!-- The table with the account items -->
25
<!-- The table with the account items -->
22
<table>
26
<table>
23
[% IF ( LibraryName ) %]
27
[% IF ( LibraryName ) %]
Lines 69-74 Link Here
69
  </tr>
73
  </tr>
70
  </tfoot>
74
  </tfoot>
71
</table>
75
</table>
76
<!-- / The table with the account items -->
77
[% END %]
78
72
</div>
79
</div>
73
80
74
[% MACRO jsinclude BLOCK %]
81
[% MACRO jsinclude BLOCK %]
(-)a/members/printfeercpt.pl (-17 / +16 lines)
Lines 29-34 use C4::Output; Link Here
29
use CGI qw ( -utf8 );
29
use CGI qw ( -utf8 );
30
use C4::Members;
30
use C4::Members;
31
use C4::Accounts;
31
use C4::Accounts;
32
use C4::Letters;
32
use Koha::Account::Lines;
33
use Koha::Account::Lines;
33
use Koha::DateUtils;
34
use Koha::DateUtils;
34
use Koha::Patrons;
35
use Koha::Patrons;
Lines 59-65 my $total = $patron->account->balance; Link Here
59
60
60
# FIXME This whole stuff is ugly and should be rewritten
61
# FIXME This whole stuff is ugly and should be rewritten
61
# FIXME We should pass the $accts iterator to the template and do this formatting part there
62
# FIXME We should pass the $accts iterator to the template and do this formatting part there
62
my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed;
63
my $accountline_object = Koha::Account::Lines->find($accountlines_id);
64
my $accountline = $accountline_object->unblessed;
63
my $totalcredit;
65
my $totalcredit;
64
if($total <= 0){
66
if($total <= 0){
65
        $totalcredit = 1;
67
        $totalcredit = 1;
Lines 75-98 if ( $accountline->{'amountoutstanding'} <= 0 ) { Link Here
75
    $accountline->{'amountoutstandingcredit'} = 1;
77
    $accountline->{'amountoutstandingcredit'} = 1;
76
}
78
}
77
79
78
my %row = (
80
my $letter_code = $accountline_object->accounttype eq 'WO' ? 'ACCOUNT_WRITEOFF' : 'ACCOUNT_PAYMENT';
79
    'date'                    => dt_from_string( $accountline->{'date'} ),
81
my $letter = C4::Letters::getletter( 'circulation', $letter_code, C4::Context::mybranch, 'print', $patron->lang );
80
    'amountcredit'            => $accountline->{'amountcredit'},
81
    'amountoutstandingcredit' => $accountline->{'amountoutstandingcredit'},
82
    'description'             => $accountline->{'description'},
83
    'amount'                  => $accountline->{'amount'},
84
    'amountoutstanding'       => $accountline->{'amountoutstanding'},
85
    accounttype => $accountline->{accounttype},
86
    'note'      => $accountline->{'note'},
87
);
88
82
83
my @account_offsets = Koha::Account::Offsets->search( { credit_id => $accountline_object->id } );
89
84
90
$template->param(
85
$template->param(
91
    patron               => $patron,
86
    letter      => $letter,
92
    finesview           => 1,
87
    patron      => $patron,
93
    total               => $total,
88
    library     => C4::Context::mybranch,
94
    totalcredit         => $totalcredit,
89
    offsets     => \@account_offsets,
95
    accounts            => [$accountline], # FIXME There is always only 1 row!
90
    credit      => $accountline_object,
91
92
    finesview   => 1,
93
    total       => $total,
94
    totalcredit => $totalcredit,
95
    accounts    => [$accountline],        # FIXME There is always only 1 row!
96
);
96
);
97
97
98
output_html_with_http_headers $input, $cookie, $template->output;
98
output_html_with_http_headers $input, $cookie, $template->output;
99
- 

Return to bug 22761