|
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 1735-1741
sub AddIssue {
Link Here
|
| 1735 |
); |
1736 |
); |
| 1736 |
} |
1737 |
} |
| 1737 |
$issue->discard_changes; |
1738 |
$issue->discard_changes; |
| 1738 |
$patron->update_lastseen('check_out'); |
1739 |
#Update borrowers.lastseen |
|
|
1740 |
try{ |
| 1741 |
$patron->update_lastseen('check_out'); |
| 1742 |
} |
| 1743 |
catch { |
| 1744 |
my $exception = $_; |
| 1745 |
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception"; |
| 1746 |
}; |
| 1739 |
if ( $item_object->location && $item_object->location eq 'CART' |
1747 |
if ( $item_object->location && $item_object->location eq 'CART' |
| 1740 |
&& ( !$item_object->permanent_location || $item_object->permanent_location ne 'CART' ) ) { |
1748 |
&& ( !$item_object->permanent_location || $item_object->permanent_location ne 'CART' ) ) { |
| 1741 |
## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart. |
1749 |
## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart. |
|
Lines 2493-2499
sub AddReturn {
Link Here
|
| 2493 |
if C4::Context->preference("ReturnLog"); |
2501 |
if C4::Context->preference("ReturnLog"); |
| 2494 |
|
2502 |
|
| 2495 |
#Update borrowers.lastseen |
2503 |
#Update borrowers.lastseen |
| 2496 |
$patron->update_lastseen('check_in'); |
2504 |
try{ |
|
|
2505 |
$patron->update_lastseen('check_in'); |
| 2506 |
} |
| 2507 |
catch { |
| 2508 |
my $exception = $_; |
| 2509 |
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception"; |
| 2510 |
$messages->{UpdateLastSeenError} = "$exception"; |
| 2511 |
}; |
| 2497 |
} |
2512 |
} |
| 2498 |
|
2513 |
|
| 2499 |
# Check if this item belongs to a biblio record that is attached to an |
2514 |
# Check if this item belongs to a biblio record that is attached to an |
|
Lines 3404-3410
sub AddRenewal {
Link Here
|
| 3404 |
} |
3419 |
} |
| 3405 |
); |
3420 |
); |
| 3406 |
#Update borrowers.lastseen |
3421 |
#Update borrowers.lastseen |
| 3407 |
$patron->update_lastseen('renewal'); |
3422 |
try{ |
|
|
3423 |
$patron->update_lastseen('renewal'); |
| 3424 |
} |
| 3425 |
catch { |
| 3426 |
my $exception = $_; |
| 3427 |
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception"; |
| 3428 |
}; |
| 3429 |
|
| 3408 |
|
3430 |
|
| 3409 |
#Log the renewal |
3431 |
#Log the renewal |
| 3410 |
logaction("CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber) if C4::Context->preference("RenewalLog"); |
3432 |
logaction("CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber) if C4::Context->preference("RenewalLog"); |