Bugzilla – Attachment 84275 Details for
Bug 21721
Update C4::Circulation::AddRenewal to use Koha::Account->add_debit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21721: Use Koha::Account->add_debit in AddRenewal
Bug-21721-Use-KohaAccount-adddebit-in-AddRenewal.patch (text/plain), 3.22 KB, created by
Josef Moravec
on 2019-01-22 09:05:05 UTC
(
hide
)
Description:
Bug 21721: Use Koha::Account->add_debit in AddRenewal
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-01-22 09:05:05 UTC
Size:
3.22 KB
patch
obsolete
>From 7aa477a5278f55b52838fbad4043af1c5ac5969c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 1 Nov 2018 13:28:25 +0000 >Subject: [PATCH] Bug 21721: Use Koha::Account->add_debit in AddRenewal > >Known Side Effect: Prior to this patch renewal charges were not >recorded in the FinesLog. After this patch, if the FinesLog is >enabled then the 'action' will be recorded as `create_rent`. > >Sponsored-by: PTFS Europe > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Circulation.pm | 29 ++++++----------------------- > 1 file changed, 6 insertions(+), 23 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index a3e027c34a..3e8e33ce7d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1421,7 +1421,8 @@ sub AddIssue { > # If it costs to borrow this book, charge it to the patron's account. > my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); > if ( $charge > 0 ) { >- AddIssuingCharge( $issue, $charge ); >+ my $description = "Rental"; >+ AddIssuingCharge( $issue, $charge, $description ); > $item->{'charge'} = $charge; > } > >@@ -2892,26 +2893,8 @@ sub AddRenewal { > # Charge a new rental fee, if applicable? > my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); > if ( $charge > 0 ) { >- my $accountno = C4::Accounts::getnextacctno( $borrowernumber ); >- my $manager_id = 0; >- $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; >- my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; >- Koha::Account::Line->new( >- { >- date => dt_from_string(), >- borrowernumber => $borrowernumber, >- accountno => $accountno, >- amount => $charge, >- manager_id => $manager_id, >- accounttype => 'Rent', >- amountoutstanding => $charge, >- itemnumber => $itemnumber, >- branchcode => $branchcode, >- description => 'Renewal of Rental Item ' >- . $biblio->title >- . " $item->{'barcode'}", >- } >- )->store(); >+ my $description = "Renewal of Rental Item " . $biblio->title . " $item->{'barcode'}"; >+ AddIssuingCharge($issue, $charge, $description); > } > > # Send a renewal slip according to checkout alert preferencei >@@ -3236,7 +3219,7 @@ sub _get_discount_from_rule { > =cut > > sub AddIssuingCharge { >- my ( $checkout, $charge ) = @_; >+ my ( $checkout, $charge, $description ) = @_; > > # FIXME What if checkout does not exist? > >@@ -3244,7 +3227,7 @@ sub AddIssuingCharge { > my $accountline = $account->add_debit( > { > amount => $charge, >- description => 'Rental', >+ description => $description, > note => undef, > user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, > library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, >-- >2.11.0
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 21721
:
81884
|
81887
|
81888
|
83219
|
84275
|
85529
|
86065