Bugzilla – Attachment 13649 Details for
Bug 9122
Writing off fees broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9122: fix the problem when writing-off a fine
Bug-9122-fix-the-problem-when-writing-off-a-fine.patch (text/plain), 2.60 KB, created by
Paul Poulain
on 2012-11-23 13:35:46 UTC
(
hide
)
Description:
Bug 9122: fix the problem when writing-off a fine
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2012-11-23 13:35:46 UTC
Size:
2.60 KB
patch
obsolete
>From 27b2f0b898fc70562f0d17999916df801a0a0d89 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Fri, 23 Nov 2012 14:32:42 +0100 >Subject: [PATCH] Bug 9122: fix the problem when writing-off a fine > >The problem was introduced by the addition of accountlines_id in bug 7671 > >The WriteOffFee sub was called with accountlines_id as second parameter >but still dealing with the accountno column. > >As a result, the UPDATE was failing (updating nothing), and the fine note written off >even if the writeoff itself was saved. In other words: the writeoff was not "attached" to the fine. > >This patch fixes the problem. > >Test plan: do what katrin says in initial description of the problem: >- add some fines manually, I did 'new card' and sundry >- try writing off all of them or one of them >- the fine is correctly written off >--- > C4/Accounts.pm | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 8a0212f..5aa4fef 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -768,13 +768,13 @@ sub makepartialpayment { > return; > } > >-=head2 WriteOff >+=head2 WriteOffFee > >- WriteOff( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount, $branch ); >+ WriteOff( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch ); > > Write off a fine for a patron. > C<$borrowernumber> is the patron's borrower number. >-C<$accountnum> is the accountnumber of the fee to write off. >+C<$accountline_id> is the accountline_id of the fee to write off. > C<$itemnum> is the itemnumber of of item whose fine is being written off. > C<$accounttype> is the account type of the fine being written off. > C<$amount> is a floating-point number, giving the amount that is being written off. >@@ -783,7 +783,7 @@ C<$branch> is the branchcode of the library where the writeoff occurred. > =cut > > sub WriteOffFee { >- my ( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount, $branch ) = @_; >+ my ( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch ) = @_; > $branch ||= C4::Context->userenv->{branch}; > my $manager_id = 0; > $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >@@ -796,10 +796,10 @@ sub WriteOffFee { > > $query = " > UPDATE accountlines SET amountoutstanding = 0 >- WHERE accountno = ? AND borrowernumber = ? >+ WHERE accountlines_id = ? AND borrowernumber = ? > "; > $sth = $dbh->prepare( $query ); >- $sth->execute( $accountnum, $borrowernumber ); >+ $sth->execute( $accountline_id, $borrowernumber ); > > $query =" > INSERT INTO accountlines >-- >1.7.9.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 9122
:
13649
|
13651