Bug 2696: (QA follow-up) Fix POD, results sorting, permissions
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
2730659213
commit
0269200bc6
|
|
@ -20,7 +20,7 @@ use Modern::Perl;
|
|||
use Carp;
|
||||
|
||||
use Koha::Database;
|
||||
use Koha::Account::Line;
|
||||
use Koha::Account::Lines;
|
||||
|
||||
use base qw(Koha::Object);
|
||||
|
||||
|
|
@ -38,6 +38,10 @@ Account offsets are used to track the changes in account lines
|
|||
|
||||
=head3 debit
|
||||
|
||||
my $debit = $account_offset->debit;
|
||||
|
||||
Returns the related accountline that increased the amount owed by the patron.
|
||||
|
||||
=cut
|
||||
|
||||
sub debit {
|
||||
|
|
@ -49,6 +53,10 @@ sub debit {
|
|||
|
||||
=head3 credit
|
||||
|
||||
my $credit = $account_offset->credit;
|
||||
|
||||
Returns the related accountline that decreased the amount owed by the patron.
|
||||
|
||||
=cut
|
||||
|
||||
sub credit {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
</thead>
|
||||
|
||||
<tbody>
|
||||
[% FOREACH ao IN account_offsets.sort('created_on') %]
|
||||
[% FOREACH ao IN account_offsets %]
|
||||
[% IF type == 'credit' %]
|
||||
[% SET offset_accountline = ao.debit %]
|
||||
[% ELSIF type == 'debit' %]
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {
|
||||
borrowers => 1,
|
||||
borrowers => 'edit_borrowers',
|
||||
updatecharges => 'remaining_permissions'
|
||||
},
|
||||
}
|
||||
|
|
@ -49,12 +49,15 @@ 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(
|
||||
{ $column => $accountlines_id },
|
||||
{ order_by => 'created_on' },
|
||||
);
|
||||
|
||||
$template->param(
|
||||
type => $type,
|
||||
accountline => $accountline,
|
||||
account_offsets => \@account_offsets,
|
||||
account_offsets => $account_offsets,
|
||||
|
||||
finesview => 1,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue