Lines 26-32
use C4::Output qw( output_html_with_http_headers );
Link Here
|
26 |
use C4::Auth qw( get_template_and_user ); |
26 |
use C4::Auth qw( get_template_and_user ); |
27 |
use C4::Context; |
27 |
use C4::Context; |
28 |
use C4::Accounts; |
28 |
use C4::Accounts; |
29 |
use C4::Circulation qw( barcodedecode GetOpenIssue AddRenewal AddIssue MarkIssueReturned ); |
29 |
use C4::Circulation qw( barcodedecode AddRenewal AddIssue MarkIssueReturned ); |
30 |
use C4::Items qw( ModDateLastSeen ); |
30 |
use C4::Items qw( ModDateLastSeen ); |
31 |
use C4::Members; |
31 |
use C4::Members; |
32 |
use C4::Stats; |
32 |
use C4::Stats; |
Lines 253-265
sub kocIssueItem {
Link Here
|
253 |
|
253 |
|
254 |
if ( $issue ) { ## Item is currently checked out to another person. |
254 |
if ( $issue ) { ## Item is currently checked out to another person. |
255 |
#warn "Item Currently Issued."; |
255 |
#warn "Item Currently Issued."; |
256 |
my $issue = GetOpenIssue( $item->itemnumber ); # FIXME Hum? That does not make sense, if it's in the issue table, the issue is open (i.e. returndate is null) |
|
|
257 |
|
256 |
|
258 |
if ( $issue->{'borrowernumber'} eq $borrower->{'borrowernumber'} ) { ## Issued to this person already, renew it. |
257 |
if ( $issue->borrowernumber eq $borrower->{'borrowernumber'} ) { ## Issued to this person already, renew it. |
259 |
#warn "Item issued to this member already, renewing."; |
258 |
#warn "Item issued to this member already, renewing."; |
260 |
|
259 |
|
261 |
C4::Circulation::AddRenewal( |
260 |
C4::Circulation::AddRenewal( |
262 |
$issue->{'borrowernumber'}, # borrowernumber |
261 |
$issue->borrowernumber, # borrowernumber |
263 |
$item->itemnumber, # itemnumber |
262 |
$item->itemnumber, # itemnumber |
264 |
undef, # branch |
263 |
undef, # branch |
265 |
undef, # datedue - let AddRenewal calculate it automatically |
264 |
undef, # datedue - let AddRenewal calculate it automatically |
Lines 280-288
sub kocIssueItem {
Link Here
|
280 |
|
279 |
|
281 |
} else { |
280 |
} else { |
282 |
#warn "Item issued to a different member."; |
281 |
#warn "Item issued to a different member."; |
283 |
#warn "Date of previous issue: $issue->{'issuedate'}"; |
282 |
#warn "Date of previous issue: $issue->issuedate"; |
284 |
#warn "Date of this issue: $circ->{'date'}"; |
283 |
#warn "Date of this issue: $circ->{'date'}"; |
285 |
my ( $i_y, $i_m, $i_d ) = split( /-/, $issue->{'issuedate'} ); |
284 |
my ( $i_y, $i_m, $i_d ) = split( /-/, $issue->issuedate ); |
286 |
my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} ); |
285 |
my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} ); |
287 |
|
286 |
|
288 |
if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue. |
287 |
if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue. |