Bugzilla – Attachment 39437 Details for
Bug 8055
reversing fines wonky
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 8055 - reversing fines wonky
Signed-off-Bug-8055---reversing-fines-wonky.patch (text/plain), 2.84 KB, created by
Marc Véron
on 2015-05-23 09:27:00 UTC
(
hide
)
Description:
[Signed-off] Bug 8055 - reversing fines wonky
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-05-23 09:27:00 UTC
Size:
2.84 KB
patch
obsolete
>From 363697854a34330933733a61dbc3ce2fa1245b4b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 22 May 2015 07:27:10 -0400 >Subject: [PATCH] [Signed-off] Bug 8055 - reversing fines wonky >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test Plan: >1) Create a fine >2) Make a payment by "Pay amount" >3) Make a partial payment for the fine ( e.g. "Pay" ) >4) Reverse both payments >5) Note the amount owed is now the same as the original fine > >Patch behaves as advertised. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > C4/Accounts.pm | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index d0709d0..c747791 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -544,13 +544,13 @@ sub ReversePayment { > my $sth = $dbh->prepare('SELECT * FROM accountlines WHERE accountlines_id = ?'); > $sth->execute( $accountlines_id ); > my $row = $sth->fetchrow_hashref(); >- my $amount_outstanding = $row->{'amountoutstanding'}; >+ my $amount = $row->{'amount'}; > >- if ( $amount_outstanding <= 0 ) { >+ if ( $amount <= 0 ) { > $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = amount * -1, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?'); > $sth->execute( $accountlines_id ); > } else { >- $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = 0, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?'); >+ $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = amount, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?'); > $sth->execute( $accountlines_id ); > } > >@@ -558,17 +558,17 @@ sub ReversePayment { > my $manager_id = 0; > $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; > >- if ( $amount_outstanding <= 0 ) { >- $row->{'amountoutstanding'} *= -1; >+ if ( $amount <= 0 ) { >+ $row->{'amountoutstanding'} = $amount * -1; > } else { >- $row->{'amountoutstanding'} = '0'; >+ $row->{'amountoutstanding'} = $amount; > } > $row->{'description'} .= ' Reversed -'; > logaction("FINES", 'MODIFY', $row->{'borrowernumber'}, Dumper({ > action => 'reverse_fee_payment', > borrowernumber => $row->{'borrowernumber'}, >- old_amountoutstanding => $row->{'amountoutstanding'}, >- new_amountoutstanding => 0 - $amount_outstanding,, >+ old_amountoutstanding => 0, >+ new_amountoutstanding => $row->{'amountoutstanding'}, > accountlines_id => $row->{'accountlines_id'}, > accountno => $row->{'accountno'}, > manager_id => $manager_id, >-- >1.7.10.4
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 8055
:
37246
|
39390
| 39437