|
Lines 22-27
use Modern::Perl;
Link Here
|
| 22 |
use DateTime; |
22 |
use DateTime; |
| 23 |
use POSIX qw( floor ); |
23 |
use POSIX qw( floor ); |
| 24 |
use Encode; |
24 |
use Encode; |
|
|
25 |
use Try::Tiny; |
| 25 |
|
26 |
|
| 26 |
use C4::Context; |
27 |
use C4::Context; |
| 27 |
use C4::Stats qw( UpdateStats ); |
28 |
use C4::Stats qw( UpdateStats ); |
|
Lines 1778-1784
sub AddIssue {
Link Here
|
| 1778 |
); |
1779 |
); |
| 1779 |
} |
1780 |
} |
| 1780 |
$issue->discard_changes; |
1781 |
$issue->discard_changes; |
| 1781 |
$patron->update_lastseen('check_out'); |
1782 |
#Update borrowers.lastseen |
|
|
1783 |
try{ |
| 1784 |
$patron->update_lastseen('check_out'); |
| 1785 |
} |
| 1786 |
catch { |
| 1787 |
my $exception = $_; |
| 1788 |
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception"; |
| 1789 |
}; |
| 1782 |
if ( $item_object->location |
1790 |
if ( $item_object->location |
| 1783 |
&& $item_object->location eq 'CART' |
1791 |
&& $item_object->location eq 'CART' |
| 1784 |
&& ( !$item_object->permanent_location || $item_object->permanent_location ne 'CART' ) ) |
1792 |
&& ( !$item_object->permanent_location || $item_object->permanent_location ne 'CART' ) ) |
|
Lines 2571-2577
sub AddReturn {
Link Here
|
| 2571 |
if C4::Context->preference("ReturnLog"); |
2579 |
if C4::Context->preference("ReturnLog"); |
| 2572 |
|
2580 |
|
| 2573 |
#Update borrowers.lastseen |
2581 |
#Update borrowers.lastseen |
| 2574 |
$patron->update_lastseen('check_in'); |
2582 |
try{ |
|
|
2583 |
$patron->update_lastseen('check_in'); |
| 2584 |
} |
| 2585 |
catch { |
| 2586 |
my $exception = $_; |
| 2587 |
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception"; |
| 2588 |
$messages->{UpdateLastSeenError} = "$exception"; |
| 2589 |
}; |
| 2575 |
} |
2590 |
} |
| 2576 |
|
2591 |
|
| 2577 |
# Check if this item belongs to a biblio record that is attached to an |
2592 |
# Check if this item belongs to a biblio record that is attached to an |
|
Lines 3519-3525
sub AddRenewal {
Link Here
|
| 3519 |
); |
3534 |
); |
| 3520 |
|
3535 |
|
| 3521 |
#Update borrowers.lastseen |
3536 |
#Update borrowers.lastseen |
| 3522 |
$patron->update_lastseen('renewal'); |
3537 |
try{ |
|
|
3538 |
$patron->update_lastseen('renewal'); |
| 3539 |
} |
| 3540 |
catch { |
| 3541 |
my $exception = $_; |
| 3542 |
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception"; |
| 3543 |
}; |
| 3523 |
|
3544 |
|
| 3524 |
#Log the renewal |
3545 |
#Log the renewal |
| 3525 |
logaction( "CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber ) |
3546 |
logaction( "CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber ) |