Bugzilla – Attachment 80622 Details for
Bug 20629
Remove ability to 'reverse' payments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20629 - Pass accountline objects to template instead of hashref
Bug-20629---Pass-accountline-objects-to-template-i.patch (text/plain), 4.82 KB, created by
Kyle M Hall (khall)
on 2018-10-15 16:53:58 UTC
(
hide
)
Description:
Bug 20629 - Pass accountline objects to template instead of hashref
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-10-15 16:53:58 UTC
Size:
4.82 KB
patch
obsolete
>From b7c6869e60c9b5435ca50fcc95eaeb2d7789142a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 15 Oct 2018 12:53:27 -0400 >Subject: [PATCH] Bug 20629 - Pass accountline objects to template instead of > hashref > >--- > .../prog/en/modules/members/boraccount.tt | 8 ++--- > members/boraccount.pl | 31 +------------------ > 2 files changed, 5 insertions(+), 34 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index 2a41a9bcb8..72c84b0a37 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -67,17 +67,17 @@ > [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | html %]&itemnumber=[% account.itemnumber | html %]">[% account.item.biblio.title | html %]</a>[% END %]</td> > <td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td> > <td>[% account.note | html_line_break %]</td> >- [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td> >- [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td> >+ [% IF account.amount <= 0 %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td> >+ [% IF account.amountoutstanding <= 0 %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td> > <td class="actions"> >- [% IF ( account.payment ) %] >+ [% IF ( account.is_credit ) %] > <a target="_blank" href="printfeercpt.pl?action=print&accountlines_id=[% account.accountlines_id | html %]&borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a> > [% ELSE %] > <a target="_blank" href="printinvoice.pl?action=print&accountlines_id=[% account.accountlines_id | html %]&borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print</a> > [% END %] > <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id | html %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a> > [% IF ( reverse_col) %] >- [% IF account.object.is_credit %] >+ [% IF account.is_credit %] > <a href="boraccount.pl?action=void&accountlines_id=[% account.accountlines_id | html %]&borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void</a> > [% ELSE %] > >diff --git a/members/boraccount.pl b/members/boraccount.pl >index a36979aed2..7f94bf2e45 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -69,7 +69,7 @@ if ( $action eq 'void' ) { > #get account details > my $total = $patron->account->balance; > >-my $accts = Koha::Account::Lines->search( >+my @accountlines = Koha::Account::Lines->search( > { borrowernumber => $patron->borrowernumber }, > { order_by => { -desc => 'accountlines_id' } } > ); >@@ -80,35 +80,6 @@ if($total <= 0){ > } > > my $reverse_col = 0; # Flag whether we need to show the reverse column >-my @accountlines; >-while ( my $line = $accts->next ) { >- # FIXME We should pass the $accts iterator to the template and do this formatting part there >- my $accountline = $line->unblessed; >- $accountline->{object} = $line; >- $accountline->{amount} += 0.00; >- if ($accountline->{amount} <= 0 ) { >- $accountline->{amountcredit} = 1; >- } >- $accountline->{amountoutstanding} += 0.00; >- if ( $accountline->{amountoutstanding} <= 0 ) { >- $accountline->{amountoutstandingcredit} = 1; >- } >- >- $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; >- $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding}; >- if ($accountline->{amount} < 0) { >- $accountline->{payment} = 1 >- if ( $accountline->{accounttype} =~ /^Pay/ ); >- >- $reverse_col = 1; >- } >- >- if ( $accountline->{itemnumber} ) { >- # Because we will not have access to the object from the template >- $accountline->{item} = $line->item; >- } >- push @accountlines, $accountline; >-} > > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($borrowernumber); >-- >2.17.1 (Apple Git-112)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20629
:
74935
|
80590
|
80620
|
80621
|
80622
|
80629
|
80630
|
80631
|
80632
|
80633
|
80634
|
80635
|
80636
|
80692
|
80693
|
81311
|
81312
|
81313
|
81314
|
81315
|
81349
|
81350
|
81351
|
81352
|
81353