Bugzilla – Attachment 80620 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 - Remove ability to 'reverse' payments
Bug-20629---Remove-ability-to-reverse-payments.patch (text/plain), 6.24 KB, created by
Kyle M Hall (khall)
on 2018-10-15 16:36:49 UTC
(
hide
)
Description:
Bug 20629 - Remove ability to 'reverse' payments
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-10-15 16:36:49 UTC
Size:
6.24 KB
patch
obsolete
>From b1c88dc480ae919dd618a6ca6a3a1089ca66a7d0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 15 Oct 2018 08:02:31 -0400 >Subject: [PATCH] Bug 20629 - Remove ability to 'reverse' payments > >Test Plan: >1) Apply this patch >2) Note all references to reversing payments have been removed >3) Note ability to void payments remains unchanged >--- > 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(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index f087ba6b1a..78cd003176 100644 >--- a/C4/Accounts.pm >+++ b/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 ); >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 a27937ee99..2a41a9bcb8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -77,13 +77,8 @@ > [% 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.payment || account.amount < 0 ) %] >- [% IF account.payment %] >- <a href="boraccount.pl?action=reverse&accountlines_id=[% account.accountlines_id | html %]&borrowernumber=[% account.borrowernumber | html %]" class="btn btn-default btn-xs"><i class="fa fa-undo"></i> Reverse</a> >- [% END %] >- [% IF account.amount < 0 %] >- <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> >- [% END %] >+ [% IF account.object.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 %] > > [% END %] >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 582264a6fe..a36979aed2 100755 >--- a/members/boraccount.pl >+++ b/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; >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index 4aa8bd0794..6333330f70 100755 >--- a/members/printfeercpt.pl >+++ b/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; > >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 26a789c96a..8d0cfd68cf 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -45,7 +45,6 @@ can_ok( 'C4::Accounts', > chargelostitem > manualinvoice > getcharges >- ReversePayment > purge_zero_balance_fees ) > ); > >-- >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