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

(-)a/C4/Acquisition.pm (-1 / +6 lines)
Lines 2657-2665 sub GetInvoiceDetails { Link Here
2657
    my $invoice = $sth->fetchrow_hashref;
2657
    my $invoice = $sth->fetchrow_hashref;
2658
2658
2659
    $query = q{
2659
    $query = q{
2660
        SELECT aqorders.*, biblio.*, aqbasket.basketname
2660
        SELECT aqorders.*,
2661
                biblio.*,
2662
                aqbasket.basketname,
2663
                aqbasketgroups.id AS basketgroupid,
2664
                aqbasketgroups.name AS basketgroupname
2661
        FROM aqorders
2665
        FROM aqorders
2662
          LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
2666
          LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
2667
          LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid = aqbasketgroups.id
2663
          LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
2668
          LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
2664
        WHERE invoiceid = ?
2669
        WHERE invoiceid = ?
2665
    };
2670
    };
(-)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