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

(-)a/C4/Letters.pm (+15 lines)
Lines 643-648 sub GetPreparedLetter { Link Here
643
        }
643
        }
644
    }
644
    }
645
645
646
    my $patron = Koha::Patrons->find($tables->{borrowers});
647
    my @guarantors;
648
    if ( $patron->guarantor_relationships->count ) {
649
            @guarantors = $patron->guarantor_relationships->guarantors;
650
    }
651
    my $guarantor = $guarantors[0];
652
    if ( $guarantor ) {
653
        $$tables{guarantor}=$guarantor->unblessed;
654
    } else {
655
        my ($firstname, $surname, $relationship) = $patron->non_patron_guarantor_info();
656
657
        $$tables{guarantor}->{firstname} = $firstname;
658
        $$tables{guarantor}->{surname} = $surname;
659
    }
660
646
    if (%$tables) {
661
    if (%$tables) {
647
        _substitute_tables( $letter, $tables );
662
        _substitute_tables( $letter, $tables );
648
    }
663
    }
(-)a/Koha/Patron.pm (-1 / +16 lines)
Lines 506-511 sub guarantee_relationships { Link Here
506
    );
506
    );
507
}
507
}
508
508
509
=head3 non_patron_guarantor_info
510
511
Returns ($contactfirstname, $contactname, $relationship) of this patron's non-patron guarantor
512
513
=cut
514
515
sub non_patron_guarantor_info {
516
    my ($self) = @_;
517
518
    my $contactfirstname = $self->_result->contactfirstname;
519
    my $contactname = $self->_result->contactname;
520
    my $relationship = $self->_result->relationship;
521
522
    return ($contactfirstname, $contactname, $relationship);
523
}
524
509
=head3 relationships_debt
525
=head3 relationships_debt
510
526
511
Returns the amount owed by the patron's guarantors *and* the other guarantees of those guarantors
527
Returns the amount owed by the patron's guarantors *and* the other guarantees of those guarantors
512
- 

Return to bug 28556