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

(-)a/C4/Circulation.pm (-12 / +11 lines)
Lines 1170-1176 sub CanBookBeReturned { Link Here
1170
1170
1171
sub checkHighHolds {
1171
sub checkHighHolds {
1172
    my ( $item, $borrower ) = @_;
1172
    my ( $item, $borrower ) = @_;
1173
    my $branch = _GetCircControlBranch( $item, $borrower );
1173
    my $branchcode = _GetCircControlBranch( $item, $borrower );
1174
    my $item_object = Koha::Items->find( $item->{itemnumber} );
1174
    my $item_object = Koha::Items->find( $item->{itemnumber} );
1175
1175
1176
    my $return_data = {
1176
    my $return_data = {
Lines 1228-1237 sub checkHighHolds { Link Here
1228
1228
1229
        my $issuedate = DateTime->now( time_zone => C4::Context->tz() );
1229
        my $issuedate = DateTime->now( time_zone => C4::Context->tz() );
1230
1230
1231
        my $calendar = Koha::Calendar->new( branchcode => $branch );
1231
        my $calendar = Koha::Calendar->new( branchcode => $branchcode );
1232
1232
1233
        my $itype = $item_object->effective_itemtype;
1233
        my $itype = $item_object->effective_itemtype;
1234
        my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branch, $borrower );
1234
        my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1235
1235
1236
        my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration');
1236
        my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration');
1237
1237
Lines 1321-1327 sub AddIssue { Link Here
1321
          or return;    # if we don't get an Item, abort.
1321
          or return;    # if we don't get an Item, abort.
1322
        my $item_unblessed = $item_object->unblessed;
1322
        my $item_unblessed = $item_object->unblessed;
1323
1323
1324
        my $branch = _GetCircControlBranch( $item_unblessed, $borrower );
1324
        my $branchcode = _GetCircControlBranch( $item_unblessed, $borrower );
1325
1325
1326
        # get actual issuing if there is one
1326
        # get actual issuing if there is one
1327
        my $actualissue = $item_object->checkout;
1327
        my $actualissue = $item_object->checkout;
Lines 1332-1338 sub AddIssue { Link Here
1332
            $datedue = AddRenewal(
1332
            $datedue = AddRenewal(
1333
                $borrower->{'borrowernumber'},
1333
                $borrower->{'borrowernumber'},
1334
                $item_object->itemnumber,
1334
                $item_object->itemnumber,
1335
                $branch,
1335
                $branchcode,
1336
                $datedue,
1336
                $datedue,
1337
                $issuedate,    # here interpreted as the renewal date
1337
                $issuedate,    # here interpreted as the renewal date
1338
            );
1338
            );
Lines 1340-1352 sub AddIssue { Link Here
1340
        else {
1340
        else {
1341
            unless ($datedue) {
1341
            unless ($datedue) {
1342
                my $itype = $item_object->effective_itemtype;
1342
                my $itype = $item_object->effective_itemtype;
1343
                $datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower );
1343
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1344
1344
1345
            }
1345
            }
1346
            $datedue->truncate( to => 'minute' );
1346
            $datedue->truncate( to => 'minute' );
1347
1347
1348
            my $patron = Koha::Patrons->find( $borrower );
1348
            my $patron = Koha::Patrons->find( $borrower );
1349
            my $library = Koha::Libraries->find( $branch );
1349
            my $library = Koha::Libraries->find( $branchcode );
1350
            my $fees = Koha::Charges::Fees->new(
1350
            my $fees = Koha::Charges::Fees->new(
1351
                {
1351
                {
1352
                    patron    => $patron,
1352
                    patron    => $patron,
Lines 1387-1393 sub AddIssue { Link Here
1387
                my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule(
1387
                my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule(
1388
                    {   categorycode => $borrower->{categorycode},
1388
                    {   categorycode => $borrower->{categorycode},
1389
                        itemtype     => $item_object->effective_itemtype,
1389
                        itemtype     => $item_object->effective_itemtype,
1390
                        branchcode   => $branch
1390
                        branchcode   => $branchcode
1391
                    }
1391
                    }
1392
                );
1392
                );
1393
1393
Lines 1397-1403 sub AddIssue { Link Here
1397
            # Record in the database the fact that the book was issued.
1397
            # Record in the database the fact that the book was issued.
1398
            unless ($datedue) {
1398
            unless ($datedue) {
1399
                my $itype = $item_object->effective_itemtype;
1399
                my $itype = $item_object->effective_itemtype;
1400
                $datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower );
1400
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1401
1401
1402
            }
1402
            }
1403
            $datedue->truncate( to => 'minute' );
1403
            $datedue->truncate( to => 'minute' );
Lines 1497-1503 sub AddIssue { Link Here
1497
            # Send a checkout slip.
1497
            # Send a checkout slip.
1498
            my $circulation_alert = 'C4::ItemCirculationAlertPreference';
1498
            my $circulation_alert = 'C4::ItemCirculationAlertPreference';
1499
            my %conditions        = (
1499
            my %conditions        = (
1500
                branchcode   => $branch,
1500
                branchcode   => $branchcode,
1501
                categorycode => $borrower->{categorycode},
1501
                categorycode => $borrower->{categorycode},
1502
                item_type    => $item_object->effective_itemtype,
1502
                item_type    => $item_object->effective_itemtype,
1503
                notification => 'CHECKOUT',
1503
                notification => 'CHECKOUT',
Lines 1508-1514 sub AddIssue { Link Here
1508
                        type     => 'CHECKOUT',
1508
                        type     => 'CHECKOUT',
1509
                        item     => $item_object->unblessed,
1509
                        item     => $item_object->unblessed,
1510
                        borrower => $borrower,
1510
                        borrower => $borrower,
1511
                        branch   => $branch,
1511
                        branch   => $branchcode,
1512
                    }
1512
                    }
1513
                );
1513
                );
1514
            }
1514
            }
1515
- 

Return to bug 23586