Bugzilla – Attachment 36555 Details for
Bug 12768
Replacement cost and processing fee management
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12768 [QA Followup] - Fix unit tests
Bug-12768-QA-Followup---Fix-unit-tests.patch (text/plain), 2.65 KB, created by
Kyle M Hall (khall)
on 2015-03-05 10:50:03 UTC
(
hide
)
Description:
Bug 12768 [QA Followup] - Fix unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-03-05 10:50:03 UTC
Size:
2.65 KB
patch
obsolete
>From d191039317299aac3cbe81699a9c2af9f5ea11dc Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 5 Mar 2015 11:46:37 +0100 >Subject: [PATCH] Bug 12768 [QA Followup] - Fix unit tests > >--- > C4/Accounts.pm | 20 ++++++++++++++------ > t/db_dependent/Circulation/Chargelostitem.t | 6 +++--- > 2 files changed, 17 insertions(+), 9 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 102c008..b57c7d0 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -467,12 +467,20 @@ sub manualinvoice { > > sub getcharges { > my ( $borrowerno, $accountno ) = @_; >- my $dbh = C4::Context->dbh; >- my $query = ""; >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?" >- ); >- $sth->execute( $borrowerno, $accountno ); >+ my $dbh = C4::Context->dbh; >+ >+ my @params; >+ >+ my $query = "SELECT * FROM accountlines WHERE borrowernumber = ?"; >+ push( @params, $borrowerno ); >+ >+ if ( $accountno ) { >+ $query .= " AND accountno = ?"; >+ push( @params, $accountno ); >+ } >+ >+ my $sth = $dbh->prepare( $query ); >+ $sth->execute( @params ); > > my @results; > while ( my $data = $sth->fetchrow_hashref ) { >diff --git a/t/db_dependent/Circulation/Chargelostitem.t b/t/db_dependent/Circulation/Chargelostitem.t >index e9d9694..06770c9 100644 >--- a/t/db_dependent/Circulation/Chargelostitem.t >+++ b/t/db_dependent/Circulation/Chargelostitem.t >@@ -76,9 +76,9 @@ my $issues; > $issues = C4::Circulation::GetIssues({biblionumber => $biblionumber1}); > my $issue=$issues->[0]; > $issue->{'processfee'} = $processfee; >-my $accountlineId = C4::Accounts::chargelostitem($issue, 'test'); >+C4::Accounts::chargelostitem($issue, 'test'); > >-my @accountline = C4::Accounts::getcharges($borrowernumber, $accountlineId); >+my @accountline = C4::Accounts::getcharges($borrowernumber); > > is( scalar(@accountline), 1, 'accountline should have 1 row' ); > is( int($accountline[0]->{amount}), $processfee, "The accountline amount should be precessfee value " ); >@@ -86,4 +86,4 @@ is( $accountline[0]->{accounttype}, 'PF', "The accountline accounttype should be > is( $accountline[0]->{borrowernumber}, $borrowernumber, "The accountline borrowernumber should be the exemple borrownumber" ); > my $itemnumber = C4::Items::GetItemnumberFromBarcode('0101'); > is( $accountline[0]->{itemnumber}, $itemnumber, "The accountline itemnumber should the linked with barcode '0101'" ); >-is( $accountline[0]->{description}, 'test', "The accountline description should be 'test'" ); >+is( $accountline[0]->{description}, 'test ' . $issue->{itemnumber}, "The accountline description should be 'test'" ); >-- >1.7.10.4
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 12768
:
34333
|
34334
|
36350
|
36505
|
36506
|
36552
|
36553
|
36554
|
36555
|
38365
|
38367
|
38368
|
38375
|
39298
|
39299
|
39300
|
39999
|
40000
|
40001
|
40002
|
42157
|
42158
|
43181
|
43546
|
64775
|
64776
|
66760
|
66761
|
67875
|
67876
|
67877
|
67878
|
67891
|
67892
|
67893
|
67894
|
67895
|
67896
|
67897
|
68035
|
68036
|
68037
|
68038
|
68039
|
68040
|
68041
|
68042
|
68076
|
68264
|
68265
|
68266
|
68267
|
68268
|
68269
|
68270
|
68271
|
68272
|
68273
|
68274
|
68332
|
68415
|
68416
|
68417
|
68426
|
68427