@@ -, +, @@
---
C4/Accounts.pm | 47 ----------------------
.../prog/en/modules/members/boraccount.tt | 9 +----
members/boraccount.pl | 6 +--
members/printfeercpt.pl | 4 --
t/db_dependent/Accounts.t | 1 -
5 files changed, 4 insertions(+), 63 deletions(-)
--- a/C4/Accounts.pm
+++ a/C4/Accounts.pm
@@ -41,7 +41,6 @@ BEGIN {
&getnextacctno
&getcharges
&chargelostitem
- &ReversePayment
&purge_zero_balance_fees
);
}
@@ -328,52 +327,6 @@ sub getcharges {
return (@results);
}
-#FIXME: ReversePayment should be replaced with a Void Payment feature
-sub ReversePayment {
- my ($accountlines_id) = @_;
- my $dbh = C4::Context->dbh;
-
- my $accountline = Koha::Account::Lines->find($accountlines_id);
- my $amount_outstanding = $accountline->amountoutstanding;
-
- my $new_amountoutstanding =
- $amount_outstanding <= 0 ? $accountline->amount * -1 : 0;
-
- $accountline->description( $accountline->description . " Reversed -" );
- $accountline->amountoutstanding($new_amountoutstanding);
- $accountline->store();
-
- my $account_offset = Koha::Account::Offset->new(
- {
- credit_id => $accountline->id,
- type => 'Reverse Payment',
- amount => $amount_outstanding - $new_amountoutstanding,
- }
- )->store();
-
- if ( C4::Context->preference("FinesLog") ) {
- my $manager_id = 0;
- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
-
- logaction(
- "FINES", 'MODIFY',
- $accountline->borrowernumber,
- Dumper(
- {
- action => 'reverse_fee_payment',
- borrowernumber => $accountline->borrowernumber,
- old_amountoutstanding => $amount_outstanding,
- new_amountoutstanding => $new_amountoutstanding,
- ,
- accountlines_id => $accountline->id,
- accountno => $accountline->accountno,
- manager_id => $manager_id,
- }
- )
- );
- }
-}
-
=head2 purge_zero_balance_fees
purge_zero_balance_fees( $days );
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
@@ -77,13 +77,8 @@
[% END %]
Details
[% IF ( reverse_col) %]
- [% IF ( account.payment || account.amount < 0 ) %]
- [% IF account.payment %]
- Reverse
- [% END %]
- [% IF account.amount < 0 %]
- Void
- [% END %]
+ [% IF account.object.is_credit %]
+ Void
[% ELSE %]
[% END %]
--- a/members/boraccount.pl
+++ a/members/boraccount.pl
@@ -60,10 +60,7 @@ unless ( $patron ) {
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
-if ( $action eq 'reverse' ) {
- ReversePayment( scalar $input->param('accountlines_id') );
-}
-elsif ( $action eq 'void' ) {
+if ( $action eq 'void' ) {
my $payment_id = scalar $input->param('accountlines_id');
my $payment = Koha::Account::Lines->find( $payment_id );
$payment->void();
@@ -87,6 +84,7 @@ 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;
--- a/members/printfeercpt.pl
+++ a/members/printfeercpt.pl
@@ -54,10 +54,6 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"
my $patron = Koha::Patrons->find( $borrowernumber );
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
-if ( $action eq 'print' ) {
-# ReversePayment( $borrowernumber, $input->param('accountno') );
-}
-
#get account details
my $total = $patron->account->balance;
--- a/t/db_dependent/Accounts.t
+++ a/t/db_dependent/Accounts.t
@@ -45,7 +45,6 @@ can_ok( 'C4::Accounts',
chargelostitem
manualinvoice
getcharges
- ReversePayment
purge_zero_balance_fees )
);
--