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

(-)a/C4/Circulation.pm (-1 / +21 lines)
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,
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +10 lines)
Lines 6299-6304 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6299
}
6299
}
6300
6300
6301
6301
6302
$DBversion = "XXXX";
6303
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6304
    $dbh->do(q{
6305
        INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
6306
        ('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>>.');
6307
    });
6308
    print "Upgrade to $DBversion done (Bug 9151 - Renewal notice according to patron alert preferences)\n";
6309
    SetVersion($DBversion);
6310
}
6311
6302
=head1 FUNCTIONS
6312
=head1 FUNCTIONS
6303
6313
6304
=head2 TableExists($table)
6314
=head2 TableExists($table)
6305
- 

Return to bug 9151