Bugzilla – Attachment 27475 Details for
Bug 10694
Allow arbitrary backdating of returns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] [Bug 10694 [QA Followup] - Unit Tests, improve AddReturn POD
SIGNED-OFF-Bug-10694-QA-Followup---Unit-Tests-impr.patch (text/plain), 2.82 KB, created by
Martin Renvoize (ashimema)
on 2014-04-23 13:17:52 UTC
(
hide
)
Description:
[SIGNED OFF] [Bug 10694 [QA Followup] - Unit Tests, improve AddReturn POD
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2014-04-23 13:17:52 UTC
Size:
2.82 KB
patch
obsolete
>From 24b61974fcb9d8f713960a2648fe7aaff9bd8175 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 23 Apr 2014 07:38:11 -0400 >Subject: [PATCH] [SIGNED OFF] [Bug 10694 [QA Followup] - Unit Tests, improve > AddReturn POD > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Circulation.pm | 8 ++++---- > t/db_dependent/Circulation_issue.t | 12 +++++++++++- > 2 files changed, 15 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 3fafdba..91ed2db 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1634,7 +1634,7 @@ sub GetBranchItemRule { > =head2 AddReturn > > ($doreturn, $messages, $iteminformation, $borrower) = >- &AddReturn($barcode, $branch, $exemptfine, $dropbox, $returndate); >+ &AddReturn( $barcode, $branch [,$exemptfine] [,$dropbox] [,$returndate] ); > > Returns a book. > >@@ -1645,16 +1645,16 @@ Returns a book. > =item C<$branch> is the code of the branch where the book is being returned. > > =item C<$exemptfine> indicates that overdue charges for the item will be >-removed. >+removed. Optional. > > =item C<$dropbox> indicates that the check-in date is assumed to be > yesterday, or the last non-holiday as defined in C4::Calendar . If > overdue charges are applied and C<$dropbox> is true, the last charge > will be removed. This assumes that the fines accrual script has run >-for _today_. >+for _today_. Optional. > > =item C<$return_date> allows the default return date to be overridden >-by the given return date. >+by the given return date. Optional. > > =back > >diff --git a/t/db_dependent/Circulation_issue.t b/t/db_dependent/Circulation_issue.t >index 18ef405..ea70131 100644 >--- a/t/db_dependent/Circulation_issue.t >+++ b/t/db_dependent/Circulation_issue.t >@@ -10,7 +10,7 @@ use C4::Circulation; > use C4::Items; > use C4::Context; > >-use Test::More tests => 25; >+use Test::More tests => 27; > > BEGIN { > use_ok('C4::Circulation'); >@@ -331,6 +331,16 @@ is_deeply( > "With issuing rules (renewal allowed, 1 remaining) and with a valid parameter, Getrenewcount of item1 returns 0 renews left" > ); > >+$dbh->do("TRUNCATE TABLE old_issues"); >+AddReturn('barcode_1'); >+my $return = $dbh->selectrow_hashref("SELECT DATE(returndate) AS return_date, CURRENT_DATE() AS today FROM old_issues LIMIT 1" ); >+ok( $return->{return_date} eq $return->{today}, "Item returned with no return date specified has todays date" ); >+ >+$dbh->do("TRUNCATE TABLE old_issues"); >+C4::Circulation::AddIssue( $borrower_1, 'barcode_1', $daysago10, 0, $today ); >+AddReturn('barcode_1', undef, undef, undef, '2014-04-01 23:42'); >+$return = $dbh->selectrow_hashref("SELECT * FROM old_issues LIMIT 1" ); >+ok( $return->{returndate} eq '2014-04-01 23:42:00', "Item returned with a return date of '2014-04-01 23:42' has that return date" ); > > #End transaction > $dbh->rollback; >-- >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 10694
:
20146
|
20147
|
21094
|
21095
|
21096
|
22122
|
22123
|
23672
|
23673
|
23697
|
25658
|
25659
|
25660
|
25661
|
26162
|
26163
|
26707
|
26708
|
27461
| 27475