|
Lines 217-225
sub import_patrons {
Link Here
|
| 217 |
next LINE; |
217 |
next LINE; |
| 218 |
} |
218 |
} |
| 219 |
|
219 |
|
| 220 |
my $relationship = $borrower{relationship}; |
220 |
my $guarantor_relationship = $borrower{guarantor_relationship}; |
| 221 |
my $guarantor_id = $borrower{guarantor_id}; |
221 |
delete $borrower{guarantor_relationship}; |
| 222 |
delete $borrower{relationship}; |
222 |
my $guarantor_id = $borrower{guarantor_id}; |
| 223 |
delete $borrower{guarantor_id}; |
223 |
delete $borrower{guarantor_id}; |
| 224 |
|
224 |
|
| 225 |
# Remove warning for int datatype that cannot be null |
225 |
# Remove warning for int datatype that cannot be null |
|
Lines 320-325
sub import_patrons {
Link Here
|
| 320 |
Koha::Patron->new(\%borrower)->store; |
320 |
Koha::Patron->new(\%borrower)->store; |
| 321 |
}; |
321 |
}; |
| 322 |
unless ( $@ ) { |
322 |
unless ( $@ ) { |
|
|
323 |
$borrowernumber = $patron->id; |
| 323 |
|
324 |
|
| 324 |
if ( $patron->is_debarred ) { |
325 |
if ( $patron->is_debarred ) { |
| 325 |
AddDebarment( |
326 |
AddDebarment( |
|
Lines 370-382
sub import_patrons {
Link Here
|
| 370 |
|
371 |
|
| 371 |
# Add a guarantor if we are given a relationship |
372 |
# Add a guarantor if we are given a relationship |
| 372 |
if ( $guarantor_id ) { |
373 |
if ( $guarantor_id ) { |
| 373 |
Koha::Patron::Relationship->new( |
374 |
my $relationship = Koha::Patron::Relationships->find( |
| 374 |
{ |
375 |
{ |
| 375 |
guarantee_id => $borrowernumber, |
376 |
guarantee_id => $borrowernumber, |
| 376 |
relationship => $relationship, |
|
|
| 377 |
guarantor_id => $guarantor_id, |
377 |
guarantor_id => $guarantor_id, |
| 378 |
} |
378 |
} |
| 379 |
)->store(); |
379 |
); |
|
|
380 |
|
| 381 |
if ( $relationship ) { |
| 382 |
$relationship->relationship( $guarantor_relationship ); |
| 383 |
$relationship->store(); |
| 384 |
} |
| 385 |
else { |
| 386 |
Koha::Patron::Relationship->new( |
| 387 |
{ |
| 388 |
guarantee_id => $borrowernumber, |
| 389 |
relationship => $guarantor_relationship, |
| 390 |
guarantor_id => $guarantor_id, |
| 391 |
} |
| 392 |
)->store(); |
| 393 |
} |
| 380 |
} |
394 |
} |
| 381 |
} |
395 |
} |
| 382 |
|
396 |
|
|
Lines 452-457
sub set_column_keys {
Link Here
|
| 452 |
|
466 |
|
| 453 |
my @columnkeys = map { $_ ne 'borrowernumber' ? $_ : () } Koha::Patrons->columns(); |
467 |
my @columnkeys = map { $_ ne 'borrowernumber' ? $_ : () } Koha::Patrons->columns(); |
| 454 |
push( @columnkeys, 'patron_attributes' ) if $extended; |
468 |
push( @columnkeys, 'patron_attributes' ) if $extended; |
|
|
469 |
push( @columnkeys, qw( guarantor_relationship guarantor_id ) ); |
| 455 |
|
470 |
|
| 456 |
return @columnkeys; |
471 |
return @columnkeys; |
| 457 |
} |
472 |
} |