Lines 2575-2580
sub AddRenewal {
Link Here
|
2575 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}", |
2575 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}", |
2576 |
'Rent', $charge, $itemnumber ); |
2576 |
'Rent', $charge, $itemnumber ); |
2577 |
} |
2577 |
} |
|
|
2578 |
|
2579 |
# Send a renewal slip according to checkout alert preference |
2580 |
my $borrower = C4::Members::GetMemberDetails( $borrowernumber, 0 ); |
2581 |
my $circulation_alert = 'C4::ItemCirculationAlertPreference'; |
2582 |
my %conditions = ( |
2583 |
branchcode => $branch, |
2584 |
categorycode => $borrower->{categorycode}, |
2585 |
item_type => $item->{itype}, |
2586 |
notification => 'CHECKOUT', |
2587 |
); |
2588 |
if ($circulation_alert->is_enabled_for(\%conditions)) { |
2589 |
SendCirculationAlert({ |
2590 |
type => 'RENEWAL', |
2591 |
item => $item, |
2592 |
borrower => $borrower, |
2593 |
branch => $branch, |
2594 |
}); |
2595 |
} |
2596 |
|
2578 |
# Log the renewal |
2597 |
# Log the renewal |
2579 |
UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'}); |
2598 |
UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'}); |
2580 |
return $datedue; |
2599 |
return $datedue; |
Lines 2896-2907
sub SendCirculationAlert {
Link Here
|
2896 |
my %message_name = ( |
2915 |
my %message_name = ( |
2897 |
CHECKIN => 'Item_Check_in', |
2916 |
CHECKIN => 'Item_Check_in', |
2898 |
CHECKOUT => 'Item_Checkout', |
2917 |
CHECKOUT => 'Item_Checkout', |
|
|
2918 |
RENEWAL => 'Item_Checkout', |
2899 |
); |
2919 |
); |
2900 |
my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({ |
2920 |
my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({ |
2901 |
borrowernumber => $borrower->{borrowernumber}, |
2921 |
borrowernumber => $borrower->{borrowernumber}, |
2902 |
message_name => $message_name{$type}, |
2922 |
message_name => $message_name{$type}, |
2903 |
}); |
2923 |
}); |
2904 |
my $issues_table = ( $type eq 'CHECKOUT' ) ? 'issues' : 'old_issues'; |
2924 |
my $issues_table = ( $type eq 'CHECKOUT' || $type eq 'RENEWAL' ) ? 'issues' : 'old_issues'; |
2905 |
my $letter = C4::Letters::GetPreparedLetter ( |
2925 |
my $letter = C4::Letters::GetPreparedLetter ( |
2906 |
module => 'circulation', |
2926 |
module => 'circulation', |
2907 |
letter_code => $type, |
2927 |
letter_code => $type, |