|
Lines 223-231
sub import_patrons {
Link Here
|
| 223 |
next LINE; |
223 |
next LINE; |
| 224 |
} |
224 |
} |
| 225 |
|
225 |
|
| 226 |
my $relationship = $borrower{relationship}; |
226 |
my $guarantor_relationship = $borrower{guarantor_relationship}; |
| 227 |
my $guarantor_id = $borrower{guarantor_id}; |
227 |
delete $borrower{guarantor_relationship}; |
| 228 |
delete $borrower{relationship}; |
228 |
my $guarantor_id = $borrower{guarantor_id}; |
| 229 |
delete $borrower{guarantor_id}; |
229 |
delete $borrower{guarantor_id}; |
| 230 |
|
230 |
|
| 231 |
# Remove warning for int datatype that cannot be null |
231 |
# Remove warning for int datatype that cannot be null |
|
Lines 354-359
sub import_patrons {
Link Here
|
| 354 |
Koha::Patron->new(\%borrower)->store; |
354 |
Koha::Patron->new(\%borrower)->store; |
| 355 |
}; |
355 |
}; |
| 356 |
unless ( $@ ) { |
356 |
unless ( $@ ) { |
|
|
357 |
$borrowernumber = $patron->id; |
| 357 |
|
358 |
|
| 358 |
if ( $patron->is_debarred ) { |
359 |
if ( $patron->is_debarred ) { |
| 359 |
AddDebarment( |
360 |
AddDebarment( |
|
Lines 406-418
sub import_patrons {
Link Here
|
| 406 |
|
407 |
|
| 407 |
# Add a guarantor if we are given a relationship |
408 |
# Add a guarantor if we are given a relationship |
| 408 |
if ( $guarantor_id ) { |
409 |
if ( $guarantor_id ) { |
| 409 |
Koha::Patron::Relationship->new( |
410 |
my $relationship = Koha::Patron::Relationships->find( |
| 410 |
{ |
411 |
{ |
| 411 |
guarantee_id => $borrowernumber, |
412 |
guarantee_id => $borrowernumber, |
| 412 |
relationship => $relationship, |
|
|
| 413 |
guarantor_id => $guarantor_id, |
413 |
guarantor_id => $guarantor_id, |
| 414 |
} |
414 |
} |
| 415 |
)->store(); |
415 |
); |
|
|
416 |
|
| 417 |
if ( $relationship ) { |
| 418 |
$relationship->relationship( $guarantor_relationship ); |
| 419 |
$relationship->store(); |
| 420 |
} |
| 421 |
else { |
| 422 |
Koha::Patron::Relationship->new( |
| 423 |
{ |
| 424 |
guarantee_id => $borrowernumber, |
| 425 |
relationship => $guarantor_relationship, |
| 426 |
guarantor_id => $guarantor_id, |
| 427 |
} |
| 428 |
)->store(); |
| 429 |
} |
| 416 |
} |
430 |
} |
| 417 |
} |
431 |
} |
| 418 |
|
432 |
|
|
Lines 488-493
sub set_column_keys {
Link Here
|
| 488 |
|
502 |
|
| 489 |
my @columnkeys = map { $_ ne 'borrowernumber' ? $_ : () } Koha::Patrons->columns(); |
503 |
my @columnkeys = map { $_ ne 'borrowernumber' ? $_ : () } Koha::Patrons->columns(); |
| 490 |
push( @columnkeys, 'patron_attributes' ) if $extended; |
504 |
push( @columnkeys, 'patron_attributes' ) if $extended; |
|
|
505 |
push( @columnkeys, qw( guarantor_relationship guarantor_id ) ); |
| 491 |
|
506 |
|
| 492 |
return @columnkeys; |
507 |
return @columnkeys; |
| 493 |
} |
508 |
} |