View | Details | Raw Unified | Return to bug 9151
Collapse All | Expand All

(-)a/C4/Circulation.pm (-1 / +21 lines)
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,
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +10 lines)
Lines 6083-6088 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6083
    SetVersion($DBversion);
6083
    SetVersion($DBversion);
6084
}
6084
}
6085
6085
6086
$DBversion = "XXXX";
6087
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6088
    $dbh->do(q{
6089
        INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
6090
        ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
6091
    });
6092
    print "Upgrade to $DBversion done (Bug 9151 - Renewal notice according to patron alert preferences)\n";
6093
    SetVersion($DBversion);
6094
}
6095
6086
=head1 FUNCTIONS
6096
=head1 FUNCTIONS
6087
6097
6088
=head2 TableExists($table)
6098
=head2 TableExists($table)
6089
- 

Return to bug 9151