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

(-)a/Koha/Patrons/Import.pm (-7 / +5 lines)
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 293-308 sub import_patrons { Link Here
293
                    if ( $borrower{debarred} && ( ( $borrower{debarred} ne $member->{debarred} ) || ( $borrower{debarredcomment} ne $member->{debarredcomment} ) ) ) {
293
                    if ( $borrower{debarred} && ( ( $borrower{debarred} ne $member->{debarred} ) || ( $borrower{debarredcomment} ne $member->{debarredcomment} ) ) ) {
294
294
295
                        # Check to see if this debarment already exists
295
                        # Check to see if this debarment already exists
296
                        my $debarrments = GetDebarments(
296
                        my $restrictions = $patron->restrictions->search(
297
                            {
297
                            {
298
                                borrowernumber => $borrowernumber,
298
                                expiration => $borrower{debarred},
299
                                expiration     => $borrower{debarred},
299
                                comment    => $borrower{debarredcomment}
300
                                comment        => $borrower{debarredcomment}
301
                            }
300
                            }
302
                        );
301
                        );
303
302
304
                        # If it doesn't, then add it!
303
                        # If it doesn't, then add it!
305
                        unless (@$debarrments) {
304
                        unless ($restrictions->count) {
306
                            AddDebarment(
305
                            AddDebarment(
307
                                {
306
                                {
308
                                    borrowernumber => $borrowernumber,
307
                                    borrowernumber => $borrowernumber,
309
- 

Return to bug 31095