Bugzilla – Attachment 74021 Details for
Bug 20562
issue_id is not stored in accountlines for rental fees
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20562: issue_id is not stored in accountlines for rental fees
Bug-20562-issueid-is-not-stored-in-accountlines-fo.patch (text/plain), 3.22 KB, created by
Kyle M Hall (khall)
on 2018-04-11 17:43:46 UTC
(
hide
)
Description:
Bug 20562: issue_id is not stored in accountlines for rental fees
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-04-11 17:43:46 UTC
Size:
3.22 KB
patch
obsolete
>From df40e643dea0c793e0140c532589ec3f29be793e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Sun, 8 Apr 2018 07:11:11 +0000 >Subject: [PATCH] Bug 20562: issue_id is not stored in accountlines for rental > fees > >Test Plan: >1) Apply this patch >2) Assign a charge to an item type >3) Checkout an item of that type to a patron >4) View the accountlines table for that patron >SELECT * FROM accountlines WHERE accounttype='Rent' and borrowernumber=##; >5) Note there is an issue_id > >Or > >1) Apply this patch >2) prove t/db_dependent/Circulation/issue.t >--- > C4/Circulation.pm | 7 ++++--- > t/db_dependent/Circulation/issue.t | 8 +++++--- > 2 files changed, 9 insertions(+), 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 67ee4e56fe..c1e8262bdf 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1406,7 +1406,7 @@ 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( $item->{'itemnumber'}, $borrower->{'borrowernumber'}, $charge ); >+ AddIssuingCharge( $item->{'itemnumber'}, $borrower->{'borrowernumber'}, $issue->id, $charge ); > $item->{'charge'} = $charge; > } > >@@ -3165,12 +3165,12 @@ sub _get_discount_from_rule { > > =head2 AddIssuingCharge > >- &AddIssuingCharge( $itemno, $borrowernumber, $charge ) >+ &AddIssuingCharge( $itemno, $borrowernumber, $issue_id, $charge ) > > =cut > > sub AddIssuingCharge { >- my ( $itemnumber, $borrowernumber, $charge ) = @_; >+ my ( $itemnumber, $borrowernumber, $issue_id, $charge ) = @_; > > my $nextaccntno = getnextacctno($borrowernumber); > >@@ -3181,6 +3181,7 @@ sub AddIssuingCharge { > { > borrowernumber => $borrowernumber, > itemnumber => $itemnumber, >+ issue_id => $issue_id, > accountno => $nextaccntno, > amount => $charge, > amountoutstanding => $charge, >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index 0986d0283a..e2cbf9d7d3 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 31; >+use Test::More tests => 32; > use DateTime::Duration; > > use t::lib::Mocks; >@@ -207,8 +207,10 @@ $sth = $dbh->prepare($query); > $sth->execute; > my $countaccount = $sth -> fetchrow_array; > is ($countaccount,0,"0 accountline exists"); >-is( ref( C4::Circulation::AddIssuingCharge( $item_id1, $borrower_id1, 10 ) ), >- 'Koha::Account::Offset', "An issuing charge has been added" ); >+my $offset = C4::Circulation::AddIssuingCharge( $item_id1, $borrower_id1, $issue_id1, 10 ); >+is( ref( $offset ), 'Koha::Account::Offset', "An issuing charge has been added" ); >+my $charge = Koha::Account::Lines->find( $offset->debit_id ); >+is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); > my $account_id = $dbh->last_insert_id( undef, undef, 'accountlines', undef ); > $sth->execute; > $countaccount = $sth -> fetchrow_array; >-- >2.15.1 (Apple Git-101)
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 20562
:
74019
|
74020
|
74021
|
74102
|
74240
|
74250
|
74253
|
74584
|
74586