View | Details | Raw Unified | Return to bug 26583
Collapse All | Expand All

(-)a/C4/Circulation.pm (-10 / +3 lines)
Lines 1469-1482 sub AddIssue { Link Here
1469
                $auto_renew = $rule->rule_value if $rule;
1469
                $auto_renew = $rule->rule_value if $rule;
1470
            }
1470
            }
1471
1471
1472
            # Record in the database the fact that the book was issued.
1473
            unless ($datedue) {
1474
                my $itype = $item_object->effective_itemtype;
1475
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1476
1477
            }
1478
            $datedue->truncate( to => 'minute' );
1479
1480
            my $issue_attributes = {
1472
            my $issue_attributes = {
1481
                borrowernumber  => $borrower->{'borrowernumber'},
1473
                borrowernumber  => $borrower->{'borrowernumber'},
1482
                issuedate       => $issuedate->strftime('%Y-%m-%d %H:%M:%S'),
1474
                issuedate       => $issuedate->strftime('%Y-%m-%d %H:%M:%S'),
Lines 1486-1491 sub AddIssue { Link Here
1486
                auto_renew      => $auto_renew ? 1 : 0,
1478
                auto_renew      => $auto_renew ? 1 : 0,
1487
            };
1479
            };
1488
1480
1481
            # In the case that the borrower has an on-site checkout
1482
            # and SwitchOnSiteCheckouts is enabled this converts it to a regular checkout
1489
            $issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } );
1483
            $issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } );
1490
            if ($issue) {
1484
            if ($issue) {
1491
                $issue->set($issue_attributes)->store;
1485
                $issue->set($issue_attributes)->store;
Lines 1513-1520 sub AddIssue { Link Here
1513
            $item_object->itemlost(0);
1507
            $item_object->itemlost(0);
1514
            $item_object->onloan($datedue->ymd());
1508
            $item_object->onloan($datedue->ymd());
1515
            $item_object->datelastborrowed( dt_from_string()->ymd() );
1509
            $item_object->datelastborrowed( dt_from_string()->ymd() );
1510
            $item_object->datelastseen( dt_from_string()->ymd() );
1516
            $item_object->store({log_action => 0});
1511
            $item_object->store({log_action => 0});
1517
            ModDateLastSeen( $item_object->itemnumber );
1518
1512
1519
            # If it costs to borrow this book, charge it to the patron's account.
1513
            # If it costs to borrow this book, charge it to the patron's account.
1520
            my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} );
1514
            my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} );
1521
- 

Return to bug 26583