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

(-)a/C4/Circulation.pm (-12 / +27 lines)
Lines 1355-1371 sub AddIssue { Link Here
1355
            }
1355
            }
1356
            $datedue->truncate( to => 'minute' );
1356
            $datedue->truncate( to => 'minute' );
1357
1357
1358
            $issue = Koha::Database->new()->schema()->resultset('Issue')->update_or_create(
1358
            $issue =
1359
                {
1359
              Koha::Checkouts->find( { itemnumber => $item->{'itemnumber'} } );
1360
                    borrowernumber => $borrower->{'borrowernumber'},
1360
            if ($issue) {
1361
                    itemnumber     => $item->{'itemnumber'},
1361
                $issue->set(
1362
                    issuedate      => $issuedate->strftime('%Y-%m-%d %H:%M:%S'),
1362
                    {
1363
                    date_due       => $datedue->strftime('%Y-%m-%d %H:%M:%S'),
1363
                        borrowernumber => $borrower->{'borrowernumber'},
1364
                    branchcode     => C4::Context->userenv->{'branch'},
1364
                        issuedate  => $issuedate->strftime('%Y-%m-%d %H:%M:%S'),
1365
                    onsite_checkout => $onsite_checkout,
1365
                        date_due   => $datedue->strftime('%Y-%m-%d %H:%M:%S'),
1366
                    auto_renew      => $auto_renew ? 1 : 0
1366
                        branchcode => C4::Context->userenv->{'branch'},
1367
                }
1367
                        onsite_checkout => $onsite_checkout,
1368
              );
1368
                        auto_renew      => $auto_renew ? 1 : 0
1369
                    }
1370
                )->store;
1371
            }
1372
            else {
1373
                $issue = Koha::Checkout->new(
1374
                    {
1375
                        borrowernumber => $borrower->{'borrowernumber'},
1376
                        itemnumber     => $item->{'itemnumber'},
1377
                        issuedate  => $issuedate->strftime('%Y-%m-%d %H:%M:%S'),
1378
                        date_due   => $datedue->strftime('%Y-%m-%d %H:%M:%S'),
1379
                        branchcode => C4::Context->userenv->{'branch'},
1380
                        onsite_checkout => $onsite_checkout,
1381
                        auto_renew      => $auto_renew ? 1 : 0
1382
                    }
1383
                )->store;
1384
            }
1369
1385
1370
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1386
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1371
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1387
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1372
- 

Return to bug 21999