Bug 8154 - The export today's checked in barcodes generated file is always empty
Summary: The export today's checked in barcodes generated file is always empty
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low blocker (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 6430 6751
  Show dependency treegraph
 
Reported: 2012-05-25 10:38 UTC by Jonathan Druart
Modified: 2019-06-27 09:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8154 - The export today's checked in barcodes generated file is always empty (1.02 KB, patch)
2012-05-25 10:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8154 - The export today's checked in barcodes generated file is always empty (1.08 KB, patch)
2012-06-09 10:16 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 8154: The export today's checked in barcodes generated file is always empty (1.04 KB, patch)
2012-06-18 08:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8154: The export today's checked in barcodes generated file is always empty (1.19 KB, patch)
2012-06-19 15:17 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2012-05-25 10:38:05 UTC

    
Comment 1 Jonathan Druart 2012-05-25 10:40:37 UTC Comment hidden (obsolete)
Comment 2 Paul Poulain 2012-06-09 10:16:10 UTC
Patch tested with a sandbox, by Francois Charbonnier <francois.charbonnier@biblibre.com>
Comment 3 Paul Poulain 2012-06-09 10:16:29 UTC Comment hidden (obsolete)
Comment 4 Francois Charbonnier 2012-06-09 10:21:12 UTC
I did 2 tests :

1/
- checked-out 2 books
- checked-in these books through returns.pl page
- exported today's checkins barcode

2/
- checked-out 2 books
- checked-in these books through circulation.pl page
- exported today's checkins barcode

In both cases it works.
Comment 5 Ian Walls 2012-06-15 14:32:37 UTC
Reformats the datetime in issue->{returndate} into iso-formatted date.  Uses C4::Dates, rather than DateTime, though, which we're looking to phase out.

if ( ($input->param('op') eq 'export_barcodes')
and ($today eq C4::Dates->new( $issue->{'returndate'}, 'iso' )->output("iso")) ) {

could be

my $return_dt = Koha::DateUtils::dt_from_string($issue->{'returndate'}, 'iso');
if ( ($input->param('op') eq 'export_barcodes')
and ($today eq $return_dt->ymd() ) {

My initial testing shows this change should work, and it won't introduce a new dependence on C4::Dates we'll just have to replace later.
Comment 6 Jonathan Druart 2012-06-18 08:19:06 UTC Comment hidden (obsolete)
Comment 7 Tomás Cohen Arazi 2012-06-19 15:17:32 UTC
Created attachment 10364 [details] [review]
Bug 8154: The export today's checked in barcodes generated file is always empty

Comparation of date and datetime is always false

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Exported file contains the list of checked in items.
Comment 8 Ian Walls 2012-06-20 18:42:38 UTC
As this patch implements something I suggested, perhaps I'm not the best person to QA it, but from what I can tell, it does the job of fixing the comparison types most handily, and using modern Koha modules.  Marking Passed QA.... if anyone objects to this, please say so.
Comment 9 Chris Cormack 2012-06-23 08:33:24 UTC
Pushed to 3.8.x, will be in 3.8.3