From 4247994e4636f0747811571371d62626a1427389 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 24 Oct 2017 18:45:31 -0300 Subject: [PATCH] Bug 10021: Restore "Pay fines" list Previous changes were wrong, the notify_id was always equal to 1 and GetBorNotifyAcctRecord was used to retrieved the account lines to pay Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/en/modules/members/pay.tt | 9 ++------- members/pay.pl | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index 243f777015..f59a4cf450 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -79,21 +79,18 @@ function enableCheckboxActions(){ Description Payment note Account type - Notify id - Level Amount Amount outstanding - Total due: + Total due: [% total | $Price %] -[% FOREACH account_grp IN accounts %] - [% FOREACH line IN account_grp.accountlines %] +[% FOREACH line IN accounts %] [% IF ( line.amountoutstanding > 0 ) %] @@ -112,7 +109,6 @@ function enableCheckboxActions(){ - [% SWITCH line.accounttype %] @@ -154,7 +150,6 @@ function enableCheckboxActions(){ [% account_grp.total | $Price %] [% END %] -[% END %]
diff --git a/members/pay.pl b/members/pay.pl index 6d60556880..186367d21d 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -133,7 +133,18 @@ output_html_with_http_headers $input, $cookie, $template->output; sub add_accounts_to_template { my ( $total, undef, undef ) = GetMemberAccountRecords($borrowernumber); - my $accounts = []; + my $accounts = Koha::Account::Lines->search({ borrowernumber => $borrowernumber, }, { order_by => ['accounttype'] }); + my @accounts; + while ( my $account = $accounts->next ) { + $account = $account->unblessed; + if ( $account->{itemnumber} ) { + my $item = Koha::Items->find( $account->{itemnumber} ); + my $biblio = $item->biblio; + $account->{biblionumber} = $biblio->biblionumber; + $account->{title} = $biblio->title; + } + push @accounts, $account; + } borrower_add_additional_fields($borrower); $template->param(%$borrower); @@ -141,7 +152,7 @@ sub add_accounts_to_template { my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber}); $template->param( picture => 1 ) if $patron_image; $template->param( - accounts => $accounts, + accounts => \@accounts, borrower => $borrower, categoryname => $borrower->{'description'}, total => $total, -- 2.39.5