Lines 1178-1184
sub CanBookBeReturned {
Link Here
|
1178 |
|
1178 |
|
1179 |
sub checkHighHolds { |
1179 |
sub checkHighHolds { |
1180 |
my ( $item, $borrower ) = @_; |
1180 |
my ( $item, $borrower ) = @_; |
1181 |
my $branch = _GetCircControlBranch( $item, $borrower ); |
1181 |
my $branchcode = _GetCircControlBranch( $item, $borrower ); |
1182 |
my $item_object = Koha::Items->find( $item->{itemnumber} ); |
1182 |
my $item_object = Koha::Items->find( $item->{itemnumber} ); |
1183 |
|
1183 |
|
1184 |
my $return_data = { |
1184 |
my $return_data = { |
Lines 1236-1245
sub checkHighHolds {
Link Here
|
1236 |
|
1236 |
|
1237 |
my $issuedate = DateTime->now( time_zone => C4::Context->tz() ); |
1237 |
my $issuedate = DateTime->now( time_zone => C4::Context->tz() ); |
1238 |
|
1238 |
|
1239 |
my $calendar = Koha::Calendar->new( branchcode => $branch ); |
1239 |
my $calendar = Koha::Calendar->new( branchcode => $branchcode ); |
1240 |
|
1240 |
|
1241 |
my $itype = $item_object->effective_itemtype; |
1241 |
my $itype = $item_object->effective_itemtype; |
1242 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
1242 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); |
1243 |
|
1243 |
|
1244 |
my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration'); |
1244 |
my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration'); |
1245 |
|
1245 |
|
Lines 1329-1335
sub AddIssue {
Link Here
|
1329 |
or return; # if we don't get an Item, abort. |
1329 |
or return; # if we don't get an Item, abort. |
1330 |
my $item_unblessed = $item_object->unblessed; |
1330 |
my $item_unblessed = $item_object->unblessed; |
1331 |
|
1331 |
|
1332 |
my $branch = _GetCircControlBranch( $item_unblessed, $borrower ); |
1332 |
my $branchcode = _GetCircControlBranch( $item_unblessed, $borrower ); |
1333 |
|
1333 |
|
1334 |
# get actual issuing if there is one |
1334 |
# get actual issuing if there is one |
1335 |
my $actualissue = $item_object->checkout; |
1335 |
my $actualissue = $item_object->checkout; |
Lines 1340-1346
sub AddIssue {
Link Here
|
1340 |
$datedue = AddRenewal( |
1340 |
$datedue = AddRenewal( |
1341 |
$borrower->{'borrowernumber'}, |
1341 |
$borrower->{'borrowernumber'}, |
1342 |
$item_object->itemnumber, |
1342 |
$item_object->itemnumber, |
1343 |
$branch, |
1343 |
$branchcode, |
1344 |
$datedue, |
1344 |
$datedue, |
1345 |
$issuedate, # here interpreted as the renewal date |
1345 |
$issuedate, # here interpreted as the renewal date |
1346 |
); |
1346 |
); |
Lines 1348-1360
sub AddIssue {
Link Here
|
1348 |
else { |
1348 |
else { |
1349 |
unless ($datedue) { |
1349 |
unless ($datedue) { |
1350 |
my $itype = $item_object->effective_itemtype; |
1350 |
my $itype = $item_object->effective_itemtype; |
1351 |
$datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
1351 |
$datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); |
1352 |
|
1352 |
|
1353 |
} |
1353 |
} |
1354 |
$datedue->truncate( to => 'minute' ); |
1354 |
$datedue->truncate( to => 'minute' ); |
1355 |
|
1355 |
|
1356 |
my $patron = Koha::Patrons->find( $borrower ); |
1356 |
my $patron = Koha::Patrons->find( $borrower ); |
1357 |
my $library = Koha::Libraries->find( $branch ); |
1357 |
my $library = Koha::Libraries->find( $branchcode ); |
1358 |
my $fees = Koha::Charges::Fees->new( |
1358 |
my $fees = Koha::Charges::Fees->new( |
1359 |
{ |
1359 |
{ |
1360 |
patron => $patron, |
1360 |
patron => $patron, |
Lines 1395-1401
sub AddIssue {
Link Here
|
1395 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
1395 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
1396 |
{ categorycode => $borrower->{categorycode}, |
1396 |
{ categorycode => $borrower->{categorycode}, |
1397 |
itemtype => $item_object->effective_itemtype, |
1397 |
itemtype => $item_object->effective_itemtype, |
1398 |
branchcode => $branch |
1398 |
branchcode => $branchcode |
1399 |
} |
1399 |
} |
1400 |
); |
1400 |
); |
1401 |
|
1401 |
|
Lines 1405-1411
sub AddIssue {
Link Here
|
1405 |
# Record in the database the fact that the book was issued. |
1405 |
# Record in the database the fact that the book was issued. |
1406 |
unless ($datedue) { |
1406 |
unless ($datedue) { |
1407 |
my $itype = $item_object->effective_itemtype; |
1407 |
my $itype = $item_object->effective_itemtype; |
1408 |
$datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
1408 |
$datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); |
1409 |
|
1409 |
|
1410 |
} |
1410 |
} |
1411 |
$datedue->truncate( to => 'minute' ); |
1411 |
$datedue->truncate( to => 'minute' ); |
Lines 1505-1511
sub AddIssue {
Link Here
|
1505 |
# Send a checkout slip. |
1505 |
# Send a checkout slip. |
1506 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
1506 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
1507 |
my %conditions = ( |
1507 |
my %conditions = ( |
1508 |
branchcode => $branch, |
1508 |
branchcode => $branchcode, |
1509 |
categorycode => $borrower->{categorycode}, |
1509 |
categorycode => $borrower->{categorycode}, |
1510 |
item_type => $item_object->effective_itemtype, |
1510 |
item_type => $item_object->effective_itemtype, |
1511 |
notification => 'CHECKOUT', |
1511 |
notification => 'CHECKOUT', |
Lines 1516-1522
sub AddIssue {
Link Here
|
1516 |
type => 'CHECKOUT', |
1516 |
type => 'CHECKOUT', |
1517 |
item => $item_object->unblessed, |
1517 |
item => $item_object->unblessed, |
1518 |
borrower => $borrower, |
1518 |
borrower => $borrower, |
1519 |
branch => $branch, |
1519 |
branch => $branchcode, |
1520 |
} |
1520 |
} |
1521 |
); |
1521 |
); |
1522 |
} |
1522 |
} |
1523 |
- |
|
|