Lines 1953-1969
sub AddReturn {
Link Here
|
1953 |
|
1953 |
|
1954 |
# case of a return of document (deal with issues and holdingbranch) |
1954 |
# case of a return of document (deal with issues and holdingbranch) |
1955 |
if ($doreturn) { |
1955 |
if ($doreturn) { |
1956 |
my $is_overdue; |
|
|
1957 |
die "The item is not issed and cannot be returned" unless $issue; # Just in case... |
1956 |
die "The item is not issed and cannot be returned" unless $issue; # Just in case... |
1958 |
$patron or warn "AddReturn without current borrower"; |
1957 |
$patron or warn "AddReturn without current borrower"; |
1959 |
$is_overdue = $issue->is_overdue( $return_date ); |
|
|
1960 |
|
1958 |
|
1961 |
if ($patron) { |
1959 |
if ($patron) { |
1962 |
eval { |
1960 |
eval { |
1963 |
MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy ); |
1961 |
MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy ); |
1964 |
}; |
1962 |
}; |
1965 |
unless ( $@ ) { |
1963 |
unless ( $@ ) { |
1966 |
if ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue && !$item->itemlost ) { |
1964 |
if ( C4::Context->preference('CalculateFinesOnReturn') && !$item->itemlost ) { |
1967 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } ); |
1965 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } ); |
1968 |
} |
1966 |
} |
1969 |
} else { |
1967 |
} else { |
Lines 2890-2896
sub AddRenewal {
Link Here
|
2890 |
my $schema = Koha::Database->schema; |
2888 |
my $schema = Koha::Database->schema; |
2891 |
$schema->txn_do(sub{ |
2889 |
$schema->txn_do(sub{ |
2892 |
|
2890 |
|
2893 |
if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) { |
2891 |
if ( C4::Context->preference('CalculateFinesOnReturn') ) { |
2894 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } ); |
2892 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } ); |
2895 |
} |
2893 |
} |
2896 |
_FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' ); |
2894 |
_FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' ); |