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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-4 / +4 lines)
Lines 67-83 Link Here
67
        &nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&amp;itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>[% END %]</td>
67
        &nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&amp;itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>[% END %]</td>
68
      <td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td>
68
      <td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td>
69
      <td>[% account.note | html_line_break %]</td>
69
      <td>[% account.note | html_line_break %]</td>
70
      [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
70
      [% IF account.amount <= 0 %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
71
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td>
71
      [% IF account.amountoutstanding <= 0 %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td>
72
      <td class="actions">
72
      <td class="actions">
73
        [% IF ( account.payment ) %]
73
        [% IF ( account.is_credit ) %]
74
          <a target="_blank" href="printfeercpt.pl?action=print&amp;accountlines_id=[% account.accountlines_id | html %]&amp;borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a>
74
          <a target="_blank" href="printfeercpt.pl?action=print&amp;accountlines_id=[% account.accountlines_id | html %]&amp;borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a>
75
        [% ELSE %]
75
        [% ELSE %]
76
          <a target="_blank" href="printinvoice.pl?action=print&amp;accountlines_id=[% account.accountlines_id | html %]&amp;borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a>
76
          <a target="_blank" href="printinvoice.pl?action=print&amp;accountlines_id=[% account.accountlines_id | html %]&amp;borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a>
77
        [% END %]
77
        [% END %]
78
        <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a>
78
        <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a>
79
        [% IF ( reverse_col) %]
79
        [% IF ( reverse_col) %]
80
          [% IF account.object.is_credit %]
80
          [% IF account.is_credit %]
81
              <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void</a>
81
              <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id | uri %]&amp;borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void</a>
82
          [% ELSE %]
82
          [% ELSE %]
83
            &nbsp;
83
            &nbsp;
(-)a/members/boraccount.pl (-31 / +1 lines)
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
- 

Return to bug 20629