Bugzilla – Attachment 74935 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), 5.88 KB, created by
Kyle M Hall (khall)
on 2018-04-30 10:58:06 UTC
(
hide
)
Description:
Bug 20629: Remove ability to 'reverse' payments
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-04-30 10:58:06 UTC
Size:
5.88 KB
patch
obsolete
>From 0b6537ac86593cf8ffd26a162e419379bf7cd1a7 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatetsolutions.com> >Date: Mon, 30 Apr 2018 06:57:41 -0400 >Subject: [PATCH] Bug 20629: Remove ability to 'reverse' payments > >--- > C4/Accounts.pm | 47 ---------------------- > Koha/Account/Line.pm | 16 ++++++++ > .../prog/en/modules/members/boraccount.tt | 1 - > members/boraccount.pl | 7 +--- > members/printfeercpt.pl | 4 -- > 5 files changed, 18 insertions(+), 57 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index eef9766b20..279580940e 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -42,7 +42,6 @@ BEGIN { > &getnextacctno > &getcharges > &chargelostitem >- &ReversePayment > &purge_zero_balance_fees > ); > } >@@ -329,52 +328,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/Account/Line.pm b/Koha/Account/Line.pm >index b32f9a7b91..c1be7cd711 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -125,6 +125,22 @@ sub void { > > } > >+=head3 is_payment >+ >+$accountline->is_payment(); >+ >+=cut >+ >+sub is_payment { >+ my ($self) = @_; >+ >+ return Koha::Account::Offsets->search( >+ { >+ credit_id => $self->id >+ } >+ )->count(); >+} >+ > =head3 _type > > =cut >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 f91f929ff0..8e20600893 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -72,7 +72,6 @@ > <a href="accountline-details.pl?accountlines_id=[% account.accountlines_id %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a> > [% IF ( reverse_col) %] > [% IF ( account.payment ) %] >- <a href="boraccount.pl?action=reverse&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-undo"></i> Reverse</a> > <a href="boraccount.pl?action=void&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-ban"></i> Void</a> > [% ELSE %][% SET footerjs = 1 %] > >diff --git a/members/boraccount.pl b/members/boraccount.pl >index b3d1431e58..f5c6518eb6 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(); >@@ -104,7 +101,7 @@ while ( my $line = $accts->next ) { > > $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; > $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding}; >- if ($accountline->{accounttype} =~ /^Pay/) { >+ if ( $line->is_payment ) { > $accountline->{payment} = 1; > $reverse_col = 1; > } >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index c73f8f5bf4..91a4180252 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') ); >-} >- > if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; >-- >2.15.1 (Apple Git-101)
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