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

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

Return to bug 28556