Bugzilla – Attachment 4991 Details for
Bug 6634
manager_id not populated when paying fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bugs 6634: manager_id not recorded for payments and rental charges
SIGNED-OFF-Bugs-6634-managerid-not-recorded-for-pa.patch (text/plain), 4.81 KB, created by
Katrin Fischer
on 2011-08-14 12:37:45 UTC
(
hide
)
Description:
[SIGNED-OFF] Bugs 6634: manager_id not recorded for payments and rental charges
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-08-14 12:37:45 UTC
Size:
4.81 KB
patch
obsolete
>From 9befea6e46d92bcba217eb17dfef930e5c400a5c Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian.walls@bywatersolutions.com> >Date: Tue, 26 Jul 2011 22:11:42 -0400 >Subject: [PATCH] [SIGNED-OFF] Bugs 6634: manager_id not recorded for payments and rental charges >Content-Type: text/plain; charset="utf-8" > >Manager_id, the borrowernumber of the staff person doing the action, was not recorded >for payments, rental charges, or rental charges on renewals. This patch implements that. > >This patch also adds the recording of itemnumber in a payment, by taking the itemnumber of >the account that it's paying off. This addresses bug 2696, though it does not make any >change to the display logic of the Payments line in the staff client. > >To test: >1. Check out an item with an issuing charge >2. Renew the item >3. Pay one of the rental charges on the item >4. Verify in koha.accountlines that each of the three above operations recorded your borrowernumber >in accountlines.manager_id > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/Accounts.pm | 18 ++++++------------ > C4/Circulation.pm | 21 +++++++++++---------- > 2 files changed, 17 insertions(+), 22 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 3275099..5ae695f 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -158,6 +158,8 @@ sub makepayment { > # from their card, and put a note on the item record > my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_; > my $dbh = C4::Context->dbh; >+ my $manager_id = 0; >+ $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; > > # begin transaction > my $nextaccntno = getnextacctno($borrowernumber); >@@ -175,21 +177,13 @@ sub makepayment { > AND accountno = ?"); > $sth->execute($borrowernumber, $accountno); > >- # print $updquery; >-# $dbh->do( " >-# INSERT INTO accountoffsets >-# (borrowernumber, accountno, offsetaccount, >-# offsetamount) >-# VALUES ($borrowernumber, $accountno, $nextaccntno, $newamtos) >-# " ); >- > # create new line > my $payment = 0 - $amount; > $sth = $dbh->prepare("INSERT INTO accountlines >- (borrowernumber, accountno, date, amount, >- description, accounttype, amountoutstanding) >- VALUES (?,?,now(),?,?,'Pay',0)"); >- $sth->execute($borrowernumber, $nextaccntno, $payment, "Payment,thanks - $user"); >+ (borrowernumber, accountno, date, amount,itemnumber, >+ description, accounttype, amountoutstanding, manager_id) >+ VALUES (?,?,now(),?,?,?,'Pay',0,?)"); >+ $sth->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'},"Payment,thanks - $user", $manager_id); > > # FIXME - The second argument to &UpdateStats is supposed to be the > # branch code. >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 179fe70..47068f9 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2283,16 +2283,15 @@ sub AddRenewal { > if ( $charge > 0 ) { > my $accountno = getnextacctno( $borrowernumber ); > my $item = GetBiblioFromItemNumber($itemnumber); >+ my $manager_id = 0; >+ $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; > $sth = $dbh->prepare( > "INSERT INTO accountlines >- (date, >- borrowernumber, accountno, amount, >- description, >- accounttype, amountoutstanding, itemnumber >- ) >- VALUES (now(),?,?,?,?,?,?,?)" >+ (date, borrowernumber, accountno, amount, manager_id, >+ description,accounttype, amountoutstanding, itemnumber) >+ VALUES (now(),?,?,?,?,?,?,?,?)" > ); >- $sth->execute( $borrowernumber, $accountno, $charge, >+ $sth->execute( $borrowernumber, $accountno, $charge, $manager_id, > "Renewal of Rental Item $item->{'title'} $item->{'barcode'}", > 'Rent', $charge, $itemnumber ); > $sth->finish; >@@ -2445,15 +2444,17 @@ sub AddIssuingCharge { > my ( $itemnumber, $borrowernumber, $charge ) = @_; > my $dbh = C4::Context->dbh; > my $nextaccntno = getnextacctno( $borrowernumber ); >+ my $manager_id = 0; >+ $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; > my $query =" > INSERT INTO accountlines > (borrowernumber, itemnumber, accountno, > date, amount, description, accounttype, >- amountoutstanding) >- VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?) >+ amountoutstanding, manager_id) >+ VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?) > "; > my $sth = $dbh->prepare($query); >- $sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge ); >+ $sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id ); > $sth->finish; > } > >-- >1.7.4.1
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 6634
:
4743
|
4745
|
4754
|
4991
|
7478
|
7527
|
8676