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

(-)a/Koha/Acquisition/Invoice/Adjustment.pm (-1 / +17 lines)
Lines 20-26 use Modern::Perl; Link Here
20
use Carp;
20
use Carp;
21
21
22
use Koha::Database;
22
use Koha::Database;
23
use Koha::Acquisition::Invoice;
23
use Koha::Acquisition::Invoices;
24
use Koha::Acquisition::Funds;
24
25
25
use base qw(Koha::Object);
26
use base qw(Koha::Object);
26
27
Lines 48-53 sub invoice { Link Here
48
    return Koha::Acquisition::Invoice->_new_from_dbic( $invoice_rs );
49
    return Koha::Acquisition::Invoice->_new_from_dbic( $invoice_rs );
49
}
50
}
50
51
52
=head3 fund
53
54
my $fund = $adjustment->fund;
55
56
Return the fund for this adjustment
57
58
=cut
59
60
sub fund {
61
    my ( $self ) = @_;
62
    my $fund_rs = $self->_result->budget;
63
    return unless $fund_rs;
64
    return Koha::Acquisition::Fund->_new_from_dbic( $fund_rs );
65
}
66
51
=head3 type
67
=head3 type
52
68
53
=cut
69
=cut
(-)a/t/db_dependent/Koha/Acquisition/Invoice/Adjustments.t (-2 / +9 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 7;
22
use Test::More tests => 8;
23
23
24
use Koha::Database;
24
use Koha::Database;
25
25
Lines 72-75 subtest 'invoice' => sub { Link Here
72
    is( $invoice->invoiceid, $retrieved_adj->invoiceid, 'Koha::Acquisition::Invoice::Adjustment->invoice should return the correct invoice' );
72
    is( $invoice->invoiceid, $retrieved_adj->invoiceid, 'Koha::Acquisition::Invoice::Adjustment->invoice should return the correct invoice' );
73
};
73
};
74
74
75
subtest 'fund' => sub {
76
    plan tests => 2;
77
78
    my $fund = $retrieved_adj->fund;
79
    is( ref( $fund ), 'Koha::Acquisition::Fund', 'Koha::Acquisition::Invoice::Adjustment->fund should return a Koha::Acquisition::Fund' );
80
    is( $fund->budget_id, $retrieved_adj->budget_id, 'Koha::Acquisition::Invoice::Adjustment->fund should return the correct fund ' );
81
};
82
75
$schema->storage->txn_rollback;
83
$schema->storage->txn_rollback;
76
- 

Return to bug 24157