X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;ds=sidebyside;f=members%2Faccountline-details.pl;h=b798ef9647792f4b9f6b2d7a4529a4705304c6e8;hb=a925b07f7b5c182f2c8050886d58e08ce065eff3;hp=cd22d80bafaf8cd0ae5d94b9639a2a70424b2686;hpb=5643de4d79f274b35f92aa03f5f8cbc124359e52;p=koha-ffzg.git diff --git a/members/accountline-details.pl b/members/accountline-details.pl old mode 100644 new mode 100755 index cd22d80baf..b798ef9647 --- a/members/accountline-details.pl +++ b/members/accountline-details.pl @@ -19,23 +19,22 @@ use Modern::Perl; -use CGI; -use C4::Auth; -use C4::Output; +use CGI qw ( -utf8 ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Patrons; use Koha::Account::Lines; -my $input = new CGI; +my $input = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "members/accountline-details.tt", query => $input, type => "intranet", - authnotrequired => 0, flagsrequired => { - borrowers => 1, + borrowers => 'edit_borrowers', updatecharges => 'remaining_permissions' }, } @@ -46,17 +45,21 @@ my $accountlines_id = $input->param('accountlines_id'); my $accountline = Koha::Account::Lines->find($accountlines_id); if ($accountline) { - my $type = $accountline->amount < 0 ? 'credit' : 'debit'; - my $column = $type eq 'credit' ? 'credit_id' : 'debit_id'; - - my @account_offsets = Koha::Account::Offsets->search( { $column => $accountlines_id } ); + my $account_offsets = Koha::Account::Offsets->search( + [ + { + credit_id => $accountline->accountlines_id + }, + { + debit_id => $accountline->accountlines_id + } + ], + { order_by => 'created_on' } + ); $template->param( - type => $type, accountline => $accountline, - account_offsets => \@account_offsets, - - finesview => 1, + account_offsets => $account_offsets, ); my $patron = Koha::Patrons->find( $accountline->borrowernumber );