Lines 1496-1509
sub AddIssue {
Link Here
|
1496 |
$auto_renew = $rule->rule_value if $rule; |
1496 |
$auto_renew = $rule->rule_value if $rule; |
1497 |
} |
1497 |
} |
1498 |
|
1498 |
|
1499 |
# Record in the database the fact that the book was issued. |
|
|
1500 |
unless ($datedue) { |
1501 |
my $itype = $item_object->effective_itemtype; |
1502 |
$datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); |
1503 |
|
1504 |
} |
1505 |
$datedue->truncate( to => 'minute' ); |
1506 |
|
1507 |
my $issue_attributes = { |
1499 |
my $issue_attributes = { |
1508 |
borrowernumber => $borrower->{'borrowernumber'}, |
1500 |
borrowernumber => $borrower->{'borrowernumber'}, |
1509 |
issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), |
1501 |
issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), |
Lines 1513-1518
sub AddIssue {
Link Here
|
1513 |
auto_renew => $auto_renew ? 1 : 0, |
1505 |
auto_renew => $auto_renew ? 1 : 0, |
1514 |
}; |
1506 |
}; |
1515 |
|
1507 |
|
|
|
1508 |
# In the case that the borrower has an on-site checkout |
1509 |
# and SwitchOnSiteCheckouts is enabled this converts it to a regular checkout |
1516 |
$issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } ); |
1510 |
$issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } ); |
1517 |
if ($issue) { |
1511 |
if ($issue) { |
1518 |
$issue->set($issue_attributes)->store; |
1512 |
$issue->set($issue_attributes)->store; |
Lines 1540-1547
sub AddIssue {
Link Here
|
1540 |
$item_object->itemlost(0); |
1534 |
$item_object->itemlost(0); |
1541 |
$item_object->onloan($datedue->ymd()); |
1535 |
$item_object->onloan($datedue->ymd()); |
1542 |
$item_object->datelastborrowed( dt_from_string()->ymd() ); |
1536 |
$item_object->datelastborrowed( dt_from_string()->ymd() ); |
|
|
1537 |
$item_object->datelastseen( dt_from_string()->ymd() ); |
1543 |
$item_object->store({log_action => 0}); |
1538 |
$item_object->store({log_action => 0}); |
1544 |
ModDateLastSeen( $item_object->itemnumber ); |
|
|
1545 |
|
1539 |
|
1546 |
# If it costs to borrow this book, charge it to the patron's account. |
1540 |
# If it costs to borrow this book, charge it to the patron's account. |
1547 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} ); |
1541 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} ); |
1548 |
- |
|
|