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

(-)a/C4/Acquisition.pm (-1 lines)
Lines 1886-1892 cancelled. Link Here
1886
1886
1887
sub DelOrder {
1887
sub DelOrder {
1888
    my ( $bibnum, $ordernumber, $delete_biblio, $reason ) = @_;
1888
    my ( $bibnum, $ordernumber, $delete_biblio, $reason ) = @_;
1889
1890
    my $error;
1889
    my $error;
1891
    my $dbh = C4::Context->dbh;
1890
    my $dbh = C4::Context->dbh;
1892
    my $query = "
1891
    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 76-82 WHERE Link Here
76
    (quantity > quantityreceived OR quantityreceived IS NULL)
76
    (quantity > quantityreceived OR quantityreceived IS NULL)
77
    GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber,
77
    GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber,
78
             tleft,
78
             tleft,
79
             ecost, budgetdate, entrydate,
79
             ecost_tax_included, budgetdate, entrydate,
80
             aqbasket.booksellerid,
80
             aqbasket.booksellerid,
81
             aqbooksellers.name,
81
             aqbooksellers.name,
82
             itype,
82
             itype,
Lines 106-112 while ( my $data = $sth->fetchrow_hashref ) { Link Here
106
    }
106
    }
107
}
107
}
108
108
109
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $fund_id, closedate => undef, encumber_open => 1 }, { join => 'invoiceid' } );
109
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $fund_id, closedate => undef, encumber_open => 1 }, { prefetch => 'invoiceid' } );
110
while ( my $adj = $adjustments->next ){
110
while ( my $adj = $adjustments->next ){
111
    $total += $adj->adjustment;
111
    $total += $adj->adjustment;
112
}
112
}
(-)a/acqui/spent.pl (-2 / +2 lines)
Lines 92-98 WHERE Link Here
92
             aqorders.invoiceid,
92
             aqorders.invoiceid,
93
             aqinvoices.invoicenumber,
93
             aqinvoices.invoicenumber,
94
             quantityreceived,
94
             quantityreceived,
95
             unitprice,
95
             unitprice_tax_included,
96
             datereceived,
96
             datereceived,
97
             aqbooksellers.name
97
             aqbooksellers.name
98
98
Lines 134-140 while (my $data = $sth->fetchrow_hashref) { Link Here
134
}
134
}
135
$sth->finish;
135
$sth->finish;
136
136
137
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $bookfund, closedate => { '!=' => undef } }, { join => 'invoiceid' } );
137
my $adjustments = Koha::Acquisition::Invoice::Adjustments->search({budget_id => $bookfund, closedate => { '!=' => undef } }, { prefetch => 'invoiceid' },  );
138
while ( my $adj = $adjustments->next ){
138
while ( my $adj = $adjustments->next ){
139
    $total += $adj->adjustment;
139
    $total += $adj->adjustment;
140
}
140
}
(-)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