Bugzilla – Attachment 39390 Details for
Bug 8055
reversing fines wonky
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8055 - reversing fines wonky
Bug-8055---reversing-fines-wonky.patch (text/plain), 2.66 KB, created by
Kyle M Hall (khall)
on 2015-05-22 11:29:24 UTC
(
hide
)
Description:
Bug 8055 - reversing fines wonky
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-05-22 11:29:24 UTC
Size:
2.66 KB
patch
obsolete
>From 291b89f301352b6afab8d216637b1a6c76d9892e 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] Bug 8055 - reversing fines wonky > >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 >--- > C4/Accounts.pm | 16 ++++++++-------- > 1 files 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.2.5
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