Lines 2581-2586
sub AddRenewal {
Link Here
|
2581 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}", |
2581 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}", |
2582 |
'Rent', $charge, $itemnumber ); |
2582 |
'Rent', $charge, $itemnumber ); |
2583 |
} |
2583 |
} |
|
|
2584 |
|
2585 |
# Send a renewal slip according to checkout alert preference |
2586 |
my $borrower = C4::Members::GetMemberDetails( $borrowernumber, 0 ); |
2587 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
2588 |
my %conditions = ( |
2589 |
branchcode => $branch, |
2590 |
categorycode => $borrower->{categorycode}, |
2591 |
item_type => $item->{itype}, |
2592 |
notification => 'CHECKOUT', |
2593 |
); |
2594 |
if ($circulation_alert->is_enabled_for(\%conditions)) { |
2595 |
SendCirculationAlert({ |
2596 |
type => 'RENEWAL', |
2597 |
item => $item, |
2598 |
borrower => $borrower, |
2599 |
branch => $branch, |
2600 |
}); |
2601 |
} |
2602 |
|
2584 |
# Log the renewal |
2603 |
# Log the renewal |
2585 |
UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'}); |
2604 |
UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'}); |
2586 |
return $datedue; |
2605 |
return $datedue; |
Lines 2902-2913
sub SendCirculationAlert {
Link Here
|
2902 |
my %message_name = ( |
2921 |
my %message_name = ( |
2903 |
CHECKIN => 'Item_Check_in', |
2922 |
CHECKIN => 'Item_Check_in', |
2904 |
CHECKOUT => 'Item_Checkout', |
2923 |
CHECKOUT => 'Item_Checkout', |
|
|
2924 |
RENEWAL => 'Item_Checkout', |
2905 |
); |
2925 |
); |
2906 |
my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({ |
2926 |
my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({ |
2907 |
borrowernumber => $borrower->{borrowernumber}, |
2927 |
borrowernumber => $borrower->{borrowernumber}, |
2908 |
message_name => $message_name{$type}, |
2928 |
message_name => $message_name{$type}, |
2909 |
}); |
2929 |
}); |
2910 |
my $issues_table = ( $type eq 'CHECKOUT' ) ? 'issues' : 'old_issues'; |
2930 |
my $issues_table = ( $type eq 'CHECKOUT' || $type eq 'RENEWAL' ) ? 'issues' : 'old_issues'; |
2911 |
my $letter = C4::Letters::GetPreparedLetter ( |
2931 |
my $letter = C4::Letters::GetPreparedLetter ( |
2912 |
module => 'circulation', |
2932 |
module => 'circulation', |
2913 |
letter_code => $type, |
2933 |
letter_code => $type, |