Lines 29-35
use C4::Letters qw( GetPreparedLetter EnqueueLetter );
Link Here
|
29 |
use Koha::Libraries; |
29 |
use Koha::Libraries; |
30 |
use Koha::Patrons; |
30 |
use Koha::Patrons; |
31 |
use Koha::Patron::Categories; |
31 |
use Koha::Patron::Categories; |
32 |
use Koha::Patron::Debarments qw( AddDebarment GetDebarments ); |
32 |
use Koha::Patron::Debarments qw( AddDebarment ); |
33 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
33 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
34 |
|
34 |
|
35 |
=head1 NAME |
35 |
=head1 NAME |
Lines 290-305
sub import_patrons {
Link Here
|
290 |
if ( $borrower{debarred} && ( ( $borrower{debarred} ne $member->{debarred} ) || ( $borrower{debarredcomment} ne $member->{debarredcomment} ) ) ) { |
290 |
if ( $borrower{debarred} && ( ( $borrower{debarred} ne $member->{debarred} ) || ( $borrower{debarredcomment} ne $member->{debarredcomment} ) ) ) { |
291 |
|
291 |
|
292 |
# Check to see if this debarment already exists |
292 |
# Check to see if this debarment already exists |
293 |
my $debarrments = GetDebarments( |
293 |
my $restrictions = $patron->restrictions->search( |
294 |
{ |
294 |
{ |
295 |
borrowernumber => $borrowernumber, |
295 |
expiration => $borrower{debarred}, |
296 |
expiration => $borrower{debarred}, |
296 |
comment => $borrower{debarredcomment} |
297 |
comment => $borrower{debarredcomment} |
|
|
298 |
} |
297 |
} |
299 |
); |
298 |
); |
300 |
|
299 |
|
301 |
# If it doesn't, then add it! |
300 |
# If it doesn't, then add it! |
302 |
unless (@$debarrments) { |
301 |
unless ($restrictions->count) { |
303 |
AddDebarment( |
302 |
AddDebarment( |
304 |
{ |
303 |
{ |
305 |
borrowernumber => $borrowernumber, |
304 |
borrowernumber => $borrowernumber, |
306 |
- |
|
|