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

(-)a/C4/Acquisition.pm (-1 / +6 lines)
Lines 2644-2652 sub GetInvoiceDetails { Link Here
2644
    my $invoice = $sth->fetchrow_hashref;
2644
    my $invoice = $sth->fetchrow_hashref;
2645
2645
2646
    $query = q{
2646
    $query = q{
2647
        SELECT aqorders.*, biblio.*, aqbasket.basketname
2647
        SELECT aqorders.*,
2648
                biblio.*,
2649
                aqbasket.basketname,
2650
                aqbasketgroups.id AS basketgroupid,
2651
                aqbasketgroups.name AS basketgroupname
2648
        FROM aqorders
2652
        FROM aqorders
2649
          LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
2653
          LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
2654
          LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid = aqbasketgroups.id
2650
          LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
2655
          LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
2651
        WHERE invoiceid = ?
2656
        WHERE invoiceid = ?
2652
    };
2657
    };
(-)a/t/db_dependent/Acquisition/Invoices.t (-7 / +6 lines)
Lines 1-17 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
#
3
# This Koha test module is a stub!
4
# Add more tests here!!!
5
2
6
use strict;
3
use Modern::Perl;
7
use warnings;
8
4
9
use C4::Bookseller qw( GetBookSellerFromId );
5
use C4::Bookseller qw( GetBookSellerFromId );
10
use C4::Biblio qw( AddBiblio );
6
use C4::Biblio qw( AddBiblio );
11
7
12
use Koha::Acquisition::Order;
8
use Koha::Acquisition::Order;
13
9
14
use Test::More tests => 22;
10
use Test::More tests => 24;
15
11
16
BEGIN {
12
BEGIN {
17
    use_ok('C4::Acquisition');
13
    use_ok('C4::Acquisition');
Lines 134-139 my $invoice2 = GetInvoiceDetails($invoiceid2); Link Here
134
is(scalar @{$invoice1->{'orders'}}, 1, 'Invoice1 has only one order');
130
is(scalar @{$invoice1->{'orders'}}, 1, 'Invoice1 has only one order');
135
is(scalar @{$invoice2->{'orders'}}, 2, 'Invoice2 has only two orders');
131
is(scalar @{$invoice2->{'orders'}}, 2, 'Invoice2 has only two orders');
136
132
133
my $orders = $invoice1->{orders};
134
ok( exists( @$orders[0]->{basketgroupid} ), "GetInvoiceDetails: The basketgroupid key exists" );
135
ok( exists( @$orders[0]->{basketgroupname} ), "GetInvoiceDetails: The basketgroupname key exists" );
136
137
my @invoices = GetInvoices();
137
my @invoices = GetInvoices();
138
cmp_ok(scalar @invoices, '>=', 2, 'GetInvoices returns at least two invoices');
138
cmp_ok(scalar @invoices, '>=', 2, 'GetInvoices returns at least two invoices');
139
139
140
- 

Return to bug 13333