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

(-)a/Koha/Account/Line.pm (-2 / +14 lines)
Lines 145-150 Return the credit_offsets linked to this account line if some exist Link Here
145
145
146
sub credit_offsets {
146
sub credit_offsets {
147
    my ( $self, $cond, $attr ) = @_;
147
    my ( $self, $cond, $attr ) = @_;
148
149
    unless ( $self->is_credit ) {
150
        Koha::Exceptions::Account::IsNotCredit->throw(
151
            error => 'Account line ' . $self->id . ' is not a credit'
152
        );
153
    }
154
148
    my $rs = $self->_result->search_related( 'account_offsets_credits', $cond, $attr);
155
    my $rs = $self->_result->search_related( 'account_offsets_credits', $cond, $attr);
149
    return unless $rs;
156
    return unless $rs;
150
    return Koha::Account::Offsets->_new_from_dbic($rs);
157
    return Koha::Account::Offsets->_new_from_dbic($rs);
Lines 158-169 Return the debit_offsets linked to this account line if some exist Link Here
158
165
159
sub debit_offsets {
166
sub debit_offsets {
160
    my ( $self, $cond, $attr ) = @_;
167
    my ( $self, $cond, $attr ) = @_;
168
169
    unless ( $self->is_debit ) {
170
        Koha::Exceptions::Account::IsNotDebit->throw(
171
            error => 'Account line ' . $self->id . ' is not a debit'
172
        );
173
    }
174
161
    my $rs = $self->_result->search_related( 'account_offsets_debits', $cond, $attr);
175
    my $rs = $self->_result->search_related( 'account_offsets_debits', $cond, $attr);
162
    return unless $rs;
176
    return unless $rs;
163
    return Koha::Account::Offsets->_new_from_dbic($rs);
177
    return Koha::Account::Offsets->_new_from_dbic($rs);
164
}
178
}
165
179
166
167
=head3 credits
180
=head3 credits
168
181
169
  my $credits = $accountline->credits;
182
  my $credits = $accountline->credits;
170
- 

Return to bug 29139