Lines 88-94
BEGIN {
Link Here
|
88 |
&GetRenewCount |
88 |
&GetRenewCount |
89 |
&GetSoonestRenewDate |
89 |
&GetSoonestRenewDate |
90 |
&GetLatestAutoRenewDate |
90 |
&GetLatestAutoRenewDate |
91 |
&GetItemIssue |
|
|
92 |
&GetIssuingCharges |
91 |
&GetIssuingCharges |
93 |
&GetBranchBorrowerCircRule |
92 |
&GetBranchBorrowerCircRule |
94 |
&GetBranchItemRule |
93 |
&GetBranchItemRule |
Lines 2451-2495
sub _GetCircControlBranch {
Link Here
|
2451 |
return $branch; |
2450 |
return $branch; |
2452 |
} |
2451 |
} |
2453 |
|
2452 |
|
2454 |
|
|
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
=head2 GetItemIssue |
2460 |
|
2461 |
$issue = &GetItemIssue($itemnumber); |
2462 |
|
2463 |
Returns patron currently having a book, or undef if not checked out. |
2464 |
|
2465 |
C<$itemnumber> is the itemnumber. |
2466 |
|
2467 |
C<$issue> is a hashref of the row from the issues table. |
2468 |
|
2469 |
=cut |
2470 |
|
2471 |
sub GetItemIssue { |
2472 |
my ($itemnumber) = @_; |
2473 |
return unless $itemnumber; |
2474 |
my $sth = C4::Context->dbh->prepare( |
2475 |
"SELECT items.*, issues.* |
2476 |
FROM issues |
2477 |
LEFT JOIN items ON issues.itemnumber=items.itemnumber |
2478 |
WHERE issues.itemnumber=?"); |
2479 |
$sth->execute($itemnumber); |
2480 |
my $data = $sth->fetchrow_hashref; |
2481 |
return unless $data; |
2482 |
$data->{issuedate_sql} = $data->{issuedate}; |
2483 |
$data->{date_due_sql} = $data->{date_due}; |
2484 |
$data->{issuedate} = dt_from_string($data->{issuedate}, 'sql'); |
2485 |
$data->{issuedate}->truncate(to => 'minute'); |
2486 |
$data->{date_due} = dt_from_string($data->{date_due}, 'sql'); |
2487 |
$data->{date_due}->truncate(to => 'minute'); |
2488 |
my $dt = DateTime->now( time_zone => C4::Context->tz)->truncate( to => 'minute'); |
2489 |
$data->{'overdue'} = DateTime->compare($data->{'date_due'}, $dt ) == -1 ? 1 : 0; |
2490 |
return $data; |
2491 |
} |
2492 |
|
2493 |
=head2 GetOpenIssue |
2453 |
=head2 GetOpenIssue |
2494 |
|
2454 |
|
2495 |
$issue = GetOpenIssue( $itemnumber ); |
2455 |
$issue = GetOpenIssue( $itemnumber ); |
2496 |
- |
|
|