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

(-)a/C4/Acquisition.pm (-1 lines)
Lines 1889-1895 cancelled. Link Here
1889
1889
1890
sub DelOrder {
1890
sub DelOrder {
1891
    my ( $bibnum, $ordernumber, $delete_biblio, $reason ) = @_;
1891
    my ( $bibnum, $ordernumber, $delete_biblio, $reason ) = @_;
1892
1893
    my $error;
1892
    my $error;
1894
    my $dbh = C4::Context->dbh;
1893
    my $dbh = C4::Context->dbh;
1895
    my $query = "
1894
    my $query = "
(-)a/Koha/Acquisition/Invoice/Adjustment.pm (+15 lines)
Lines 20-25 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
24
24
use base qw(Koha::Object);
25
use base qw(Koha::Object);
25
26
Lines 33-38 Koha::Acquisition::Invoice::Adjustment - Koha Invoice Adjustment class Link Here
33
34
34
=cut
35
=cut
35
36
37
=head3 invoice
38
39
my $invoice = $adjustment->invoice;
40
41
Return the invoice for this adjustment
42
43
=cut
44
45
sub invoice {
46
    my ( $self ) = @_;
47
    my $invoice_rs = $self->_result->invoiceid;
48
    return Koha::Acquisition::Invoice->_new_from_dbic( $invoice_rs );
49
}
50
36
=head3 type
51
=head3 type
37
52
38
=cut
53
=cut
(-)a/acqui/ordered.pl (-2 / +2 lines)
Lines 77-83 WHERE Link Here
77
    (quantity > quantityreceived OR quantityreceived IS NULL)
77
    (quantity > quantityreceived OR quantityreceived IS NULL)
78
    GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber,
78
    GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber,
79
             tleft,
79
             tleft,
80
             ecost, budgetdate, entrydate,
80
             ecost_tax_included, budgetdate, entrydate,
81
             aqbasket.booksellerid,
81
             aqbasket.booksellerid,
82
             aqbooksellers.name,
82
             aqbooksellers.name,
83
             itype,
83
             itype,
Lines 107-113 while ( my $data = $sth->fetchrow_hashref ) { Link Here
107
    }
107
    }
108
}
108
}
109
109
110
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $fund_id, closedate => undef, encumber_open => 1 }, { join => 'invoiceid' } );
110
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $fund_id, closedate => undef, encumber_open => 1 }, { prefetch => 'invoiceid' } );
111
while ( my $adj = $adjustments->next ){
111
while ( my $adj = $adjustments->next ){
112
    $total += $adj->adjustment;
112
    $total += $adj->adjustment;
113
}
113
}
(-)a/acqui/spent.pl (-2 / +2 lines)
Lines 93-99 WHERE Link Here
93
             aqorders.invoiceid,
93
             aqorders.invoiceid,
94
             aqinvoices.invoicenumber,
94
             aqinvoices.invoicenumber,
95
             quantityreceived,
95
             quantityreceived,
96
             unitprice,
96
             unitprice_tax_included,
97
             datereceived,
97
             datereceived,
98
             aqbooksellers.name
98
             aqbooksellers.name
99
99
Lines 135-141 while (my $data = $sth->fetchrow_hashref) { Link Here
135
}
135
}
136
$sth->finish;
136
$sth->finish;
137
137
138
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $bookfund, closedate => { '!=' => undef } }, { join => 'invoiceid' } );
138
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $bookfund, closedate => { '!=' => undef } }, { prefetch => 'invoiceid' },  );
139
while ( my $adj = $adjustments->next ){
139
while ( my $adj = $adjustments->next ){
140
    $total += $adj->adjustment;
140
    $total += $adj->adjustment;
141
}
141
}
(-)a/circ/ysearch.pl (+1 lines)
Lines 40-45 binmode STDOUT, ":encoding(UTF-8)"; Link Here
40
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
40
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
41
41
42
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '1' } );
42
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '1' } );
43
warn "$auth_status is what?";
43
if ( $auth_status ne "ok" ) {
44
if ( $auth_status ne "ok" ) {
44
    exit 0;
45
    exit 0;
45
}
46
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt (-1 / +5 lines)
Lines 77-83 Link Here
77
            [% FOREACH adjustment IN adjustments %]
77
            [% FOREACH adjustment IN adjustments %]
78
                <tr>
78
                <tr>
79
                    <td></td>
79
                    <td></td>
80
                    <td colspan="6">Adjustment cost for invoice [% adjustment.invoiceid | html %]</td>
80
                    <td colspan="6">Adjustment cost for invoice
81
                        <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% adjustment.invoiceid | uri %]">
82
                            [% adjustment.invoice.invoicenumber | html %]
83
                        </a>
84
                    </td>
81
                    <td class="data total">[% adjustment.adjustment | $Price %]</td>
85
                    <td class="data total">[% adjustment.adjustment | $Price %]</td>
82
                </tr>
86
                </tr>
83
            [% END %]
87
            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt (-2 / +10 lines)
Lines 87-93 Link Here
87
            [% FOREACH shipmentcost IN shipmentcosts %]
87
            [% FOREACH shipmentcost IN shipmentcosts %]
88
                <tr>
88
                <tr>
89
                    <td></td>
89
                    <td></td>
90
                    <td colspan="8">Shipping cost for invoice [% shipmentcost.invoicenumber | html %]</td>
90
                    <td colspan="8">Shipping cost for invoice
91
                        <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% shipmentcode.invoiceid | uri %]">
92
                             [% shipmentcost.invoicenumber | html %]
93
                        </a>
94
                    </td>
91
                    <td class="data total">[% shipmentcost.shipmentcost | $Price %]</td>
95
                    <td class="data total">[% shipmentcost.shipmentcost | $Price %]</td>
92
                </tr>
96
                </tr>
93
            [% END %]
97
            [% END %]
Lines 96-102 Link Here
96
            [% FOREACH adjustment IN adjustments %]
100
            [% FOREACH adjustment IN adjustments %]
97
                <tr>
101
                <tr>
98
                    <td></td>
102
                    <td></td>
99
                    <td colspan="8">Adjustment cost for invoice [% adjustment.invoiceid | html %]</td>
103
                    <td colspan="8">Adjustment cost for invoice
104
                        <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% adjustment.invoiceid | uri %]">
105
                            [% adjustment.invoice.invoicenumber | html %]
106
                        </a>
107
                    </td>
100
                    <td class="data total">[% adjustment.adjustment | $Price %]</td>
108
                    <td class="data total">[% adjustment.adjustment | $Price %]</td>
101
                </tr>
109
                </tr>
102
            [% END %]
110
            [% END %]
(-)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 => 6;
22
use Test::More tests => 7;
23
23
24
use Koha::Database;
24
use Koha::Database;
25
25
Lines 64-67 is( $retrieved_adj->reason, $new_adj->reason, 'Find an adjustment by id should r Link Here
64
$retrieved_adj->delete;
64
$retrieved_adj->delete;
65
is( Koha::Acquisition::Invoice::Adjustments->search->count, $nb_of_adjs + 1, 'Delete should have deleted the adjustment' );
65
is( Koha::Acquisition::Invoice::Adjustments->search->count, $nb_of_adjs + 1, 'Delete should have deleted the adjustment' );
66
66
67
subtest 'invoice' => sub {
68
    plan tests => 2;
69
70
    my $invoice = $retrieved_adj->invoice;
71
    is( ref( $invoice ), 'Koha::Acquisition::Invoice', 'Koha::Acquisition::Invoice::Adjustment->invoice should return a Koha::Acquisition::Invoice' );
72
    is( $invoice->invoiceid, $retrieved_adj->invoiceid, 'Koha::Acquisition::Invoice::Adjustment->invoice should return the correct invoice' );
73
};
74
67
$schema->storage->txn_rollback;
75
$schema->storage->txn_rollback;
68
- 

Return to bug 22541