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

(-)a/Koha/Acquisition/Fund.pm (+16 lines)
Lines 17-22 package Koha::Acquisition::Fund; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Acquisition::Budgets;
20
use Koha::Database;
21
use Koha::Database;
21
22
22
use base qw(Koha::Object);
23
use base qw(Koha::Object);
Lines 29-34 Koha::Acquisition::Fund object class Link Here
29
30
30
=head2 Class methods
31
=head2 Class methods
31
32
33
=head3 budget
34
35
    my $budget = $fund->budget;
36
37
Returns the I<Koha::Acquisition::Budget> object for the budget (aqbudgetperiods)
38
associated to the fund.
39
40
=cut
41
42
sub budget {
43
    my ( $self )  = @_;
44
    my $budget_rs = $self->_result->budget;
45
    return Koha::Acquisition::Budget->_new_from_dbic( $budget_rs );
46
}
47
32
=head3 to_api
48
=head3 to_api
33
49
34
    my $json = $fund->to_api;
50
    my $json = $fund->to_api;
(-)a/admin/columns_settings.yml (+2 lines)
Lines 60-65 modules: Link Here
60
            -
60
            -
61
              columnname: library
61
              columnname: library
62
            -
62
            -
63
              columnname: budget
64
            -
63
              columnname: fund
65
              columnname: fund
64
            -
66
            -
65
              columnname: claims_count
67
              columnname: claims_count
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt (-2 / +3 lines)
Lines 67-72 Link Here
67
            <th>Basket</th>
67
            <th>Basket</th>
68
            <th>Basket group</th>
68
            <th>Basket group</th>
69
            <th>Library</th>
69
            <th>Library</th>
70
            <th>Budget</th>
70
            <th>Fund</th>
71
            <th>Fund</th>
71
            <th>Claims count</th>
72
            <th>Claims count</th>
72
            <th class="title-string">Claimed date</th>
73
            <th class="title-string">Claimed date</th>
Lines 131-138 Link Here
131
            </td>
132
            </td>
132
            <td>[% Branches.GetName( lateorder.basket.authorizer.branchcode ) | html %]
133
            <td>[% Branches.GetName( lateorder.basket.authorizer.branchcode ) | html %]
133
            </td>
134
            </td>
134
            <td>[% lateorder.fund.budget_name | html %]
135
            <td>[% lateorder.fund.budget.budget_period_description | html %]</td>
135
            </td>
136
            <td>[% lateorder.fund.budget_name | html %]</td>
136
            <td>[% lateorder.claims.count | html %]</td>
137
            <td>[% lateorder.claims.count | html %]</td>
137
            <td>
138
            <td>
138
                [% FOR claim IN lateorder.claims %]
139
                [% FOR claim IN lateorder.claims %]
(-)a/t/db_dependent/Koha/Acquisition/Fund.t (-2 / +18 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 1;
22
use Test::More tests => 2;
23
23
24
use t::lib::TestBuilder;
24
use t::lib::TestBuilder;
25
25
Lines 42-44 subtest 'to_api() tests' => sub { Link Here
42
42
43
    $schema->storage->txn_rollback;
43
    $schema->storage->txn_rollback;
44
};
44
};
45
- 
45
46
subtest 'budget' => sub {
47
    plan tests => 1;
48
49
    $schema->storage->txn_begin;
50
    my $f = $builder->build_object(
51
        {
52
            class => 'Koha::Acquisition::Funds',
53
        }
54
    );
55
56
    my $fund = Koha::Acquisition::Funds->find( $f->budget_id );
57
    is( ref( $fund->budget ),
58
        'Koha::Acquisition::Budget',
59
        '->fund should return a Koha::Acquisition::Budget object' );
60
    $schema->storage->txn_rollback;
61
};

Return to bug 15329