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

(-)a/C4/Acquisition.pm (-22 / +22 lines)
Lines 31-36 use C4::Debug; Link Here
31
use C4::SQLHelper qw(InsertInTable UpdateInTable);
31
use C4::SQLHelper qw(InsertInTable UpdateInTable);
32
use C4::Bookseller qw(GetBookSellerFromId);
32
use C4::Bookseller qw(GetBookSellerFromId);
33
use C4::Templates qw(gettemplate);
33
use C4::Templates qw(gettemplate);
34
use Koha::DateUtils qw( dt_from_string output_pref );
34
35
35
use Time::localtime;
36
use Time::localtime;
36
use HTML::Entities;
37
use HTML::Entities;
Lines 1264-1276 The following keys are used: "biblionumber", "title", "basketno", "quantity", "o Link Here
1264
sub NewOrder {
1265
sub NewOrder {
1265
    my $orderinfo = shift;
1266
    my $orderinfo = shift;
1266
1267
1267
    my $dbh = C4::Context->dbh;
1268
    my @params;
1269
1270
1271
    # if these parameters are missing, we can't continue
1268
    # if these parameters are missing, we can't continue
1272
    for my $key (qw/basketno quantity biblionumber budget_id/) {
1269
    for my $key ( qw( basketno quantity biblionumber budget_id ) ) {
1273
        croak "Mandatory parameter $key missing" unless $orderinfo->{$key};
1270
        croak "Cannot insert order: Mandatory parameter $key is missing" unless $orderinfo->{$key};
1274
    }
1271
    }
1275
1272
1276
    if ( defined $orderinfo->{subscription} && $orderinfo->{'subscription'} eq 'yes' ) {
1273
    if ( defined $orderinfo->{subscription} && $orderinfo->{'subscription'} eq 'yes' ) {
Lines 1278-1302 sub NewOrder { Link Here
1278
    } else {
1275
    } else {
1279
        $orderinfo->{'subscription'} = 0;
1276
        $orderinfo->{'subscription'} = 0;
1280
    }
1277
    }
1281
    $orderinfo->{'entrydate'} ||= C4::Dates->new()->output("iso");
1282
    if (!$orderinfo->{quantityreceived}) {
1283
        $orderinfo->{quantityreceived} = 0;
1284
    }
1285
1278
1286
    my $ordernumber=InsertInTable("aqorders",$orderinfo);
1279
    $orderinfo->{entrydate} ||= output_pref({ dt => dt_from_string, dateformat => 'iso'});
1287
    if (not $orderinfo->{parent_ordernumber}) {
1280
1288
        my $sth = $dbh->prepare("
1281
    $orderinfo->{quantityreceived} ||= 0;
1289
            UPDATE aqorders
1282
1290
            SET parent_ordernumber = ordernumber
1283
    # get only the columns of Aqorder
1291
            WHERE ordernumber = ?
1284
    my $schema = Koha::Database->new()->schema;
1292
        ");
1285
    my $columns = ' '.join(' ', $schema->source('Aqorder')->columns).' ';
1293
        $sth->execute($ordernumber);
1286
    my $new_order = { map { $columns =~ / $_ / ? ($_ => $orderinfo->{$_}) : () } keys(%$orderinfo) };
1287
1288
    my $rs = $schema->resultset('Aqorder')->create($new_order);
1289
    my $ordernumber = $rs->id;
1290
1291
    unless ( $new_order->{parent_ordernumber} ) {
1292
        $rs->update({ parent_ordernumber => $ordernumber });
1294
    }
1293
    }
1295
    return ( $orderinfo->{'basketno'}, $ordernumber );
1294
1295
    return $ordernumber;
1296
}
1296
}
1297
1297
1298
1298
1299
1299
1300
1300
#------------------------------------------------------------#
1301
#------------------------------------------------------------#
1301
1302
1302
=head3 NewOrderItem
1303
=head3 NewOrderItem
Lines 1535-1542 q{SELECT * FROM aqorders WHERE biblionumber=? AND aqorders.ordernumber=?}, Link Here
1535
        $order->{'rrp'} = $rrp;
1536
        $order->{'rrp'} = $rrp;
1536
        $order->{ecost} = $ecost;
1537
        $order->{ecost} = $ecost;
1537
        $order->{'orderstatus'} = 'complete';
1538
        $order->{'orderstatus'} = 'complete';
1538
        my $basketno;
1539
        $new_ordernumber = NewOrder($order);
1539
        ( $basketno, $new_ordernumber ) = NewOrder($order);
1540
1540
1541
        if ($received_items) {
1541
        if ($received_items) {
1542
            foreach my $itemnumber (@$received_items) {
1542
            foreach my $itemnumber (@$received_items) {
Lines 1913-1919 sub TransferOrder { Link Here
1913
    delete $order->{parent_ordernumber};
1913
    delete $order->{parent_ordernumber};
1914
    $order->{'basketno'} = $basketno;
1914
    $order->{'basketno'} = $basketno;
1915
    my $newordernumber;
1915
    my $newordernumber;
1916
    (undef, $newordernumber) = NewOrder($order);
1916
    $newordernumber = NewOrder($order);
1917
1917
1918
    $query = q{
1918
    $query = q{
1919
        UPDATE aqorders_items
1919
        UPDATE aqorders_items
(-)a/acqui/addorder.pl (-1 / +1 lines)
Lines 275-281 if ( $orderinfo->{quantity} ne '0' ) { Link Here
275
        ModOrder( $orderinfo);
275
        ModOrder( $orderinfo);
276
    }
276
    }
277
    else { # else, it's a new line
277
    else { # else, it's a new line
278
        @$orderinfo{qw(basketno ordernumber )} = NewOrder($orderinfo);
278
        $orderinfo->{ordernumber} = NewOrder($orderinfo);
279
    }
279
    }
280
280
281
    # now, add items if applicable
281
    # now, add items if applicable
(-)a/acqui/addorderiso2709.pl (-1 / +1 lines)
Lines 256-262 if ($op eq ""){ Link Here
256
256
257
        # remove uncertainprice flag if we have found a price in the MARC record
257
        # remove uncertainprice flag if we have found a price in the MARC record
258
        $orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
258
        $orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
259
        my ( $basketno, $ordernumber ) = NewOrder( \%orderinfo );
259
        my $ordernumber = NewOrder( \%orderinfo );
260
260
261
        # 4th, add items if applicable
261
        # 4th, add items if applicable
262
        # parse the item sent by the form, and create an item just for the import_record_id we are dealing with
262
        # parse the item sent by the form, and create an item just for the import_record_id we are dealing with
(-)a/t/db_dependent/Acquisition.t (-5 / +5 lines)
Lines 151-160 my ( $biblionumber4, $biblioitemnumber4 ) = AddBiblio( MARC::Record->new, '' ); Link Here
151
my ( $mandatoryparams, $return_error, $basketnum );
151
my ( $mandatoryparams, $return_error, $basketnum );
152
152
153
# returns undef and croaks if basketno, quantity, biblionumber or budget_id is missing
153
# returns undef and croaks if basketno, quantity, biblionumber or budget_id is missing
154
eval { ( $basketnum, $ordernumbers[0] ) = C4::Acquisition::NewOrder() };
154
eval { $ordernumbers[0] = C4::Acquisition::NewOrder() };
155
$return_error = $@;
155
$return_error = $@;
156
ok(
156
ok(
157
    ( !( defined $basketnum || defined $ordernumbers[0] ) )
157
    ( ! defined $ordernumbers[0] )
158
      && ( defined $return_error ),
158
      && ( defined $return_error ),
159
    "NewOrder with no params returns undef and croaks"
159
    "NewOrder with no params returns undef and croaks"
160
);
160
);
Lines 170-180 foreach my $mandatoryparams_key (@mandatoryparams_keys) { Link Here
170
    my %test_missing_mandatoryparams = %$mandatoryparams;
170
    my %test_missing_mandatoryparams = %$mandatoryparams;
171
    delete $test_missing_mandatoryparams{$mandatoryparams_key};
171
    delete $test_missing_mandatoryparams{$mandatoryparams_key};
172
    eval {
172
    eval {
173
        ( $basketnum, $ordernumbers[0] ) =
173
        $ordernumbers[0] =
174
          C4::Acquisition::NewOrder( \%test_missing_mandatoryparams );
174
          C4::Acquisition::NewOrder( \%test_missing_mandatoryparams );
175
    };
175
    };
176
    $return_error = $@;
176
    $return_error = $@;
177
    my $expected_error = "Mandatory parameter $mandatoryparams_key missing";
177
    my $expected_error = "Cannot insert order: Mandatory parameter $mandatoryparams_key is missing";
178
    ok(
178
    ok(
179
        ( !( defined $basketnum || defined $ordernumbers[0] ) )
179
        ( !( defined $basketnum || defined $ordernumbers[0] ) )
180
          && ( index( $return_error, $expected_error ) >= 0 ),
180
          && ( index( $return_error, $expected_error ) >= 0 ),
Lines 283-289 for ( 0 .. 4 ) { Link Here
283
      values %{ $order_content[$_]->{num} };
283
      values %{ $order_content[$_]->{num} };
284
    @ocontent{ keys %{ $order_content[$_]->{str} } } =
284
    @ocontent{ keys %{ $order_content[$_]->{str} } } =
285
      values %{ $order_content[$_]->{str} };
285
      values %{ $order_content[$_]->{str} };
286
    ( undef, $ordernumbers[$_] ) = C4::Acquisition::NewOrder( \%ocontent );
286
    $ordernumbers[$_] = C4::Acquisition::NewOrder( \%ocontent );
287
    $order_content[$_]->{str}->{ordernumber} = $ordernumbers[$_];
287
    $order_content[$_]->{str}->{ordernumber} = $ordernumbers[$_];
288
}
288
}
289
289
(-)a/t/db_dependent/Acquisition/CancelReceipt.t (-2 / +2 lines)
Lines 44-50 my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, ''); Link Here
44
my $itemnumber = AddItem({}, $biblionumber);
44
my $itemnumber = AddItem({}, $biblionumber);
45
45
46
t::lib::Mocks::mock_preference('AcqCreateItem', 'receiving');
46
t::lib::Mocks::mock_preference('AcqCreateItem', 'receiving');
47
my ( undef, $ordernumber ) = C4::Acquisition::NewOrder(
47
my $ordernumber = C4::Acquisition::NewOrder(
48
    {
48
    {
49
        basketno => $basketno1,
49
        basketno => $basketno1,
50
        quantity => 2,
50
        quantity => 2,
Lines 70-76 my $order = GetOrder( $ordernumber ); Link Here
70
is(scalar GetItemnumbersFromOrder($order->{ordernumber}), 0, "Create items on receiving: 0 item exist after cancelling a receipt");
70
is(scalar GetItemnumbersFromOrder($order->{ordernumber}), 0, "Create items on receiving: 0 item exist after cancelling a receipt");
71
71
72
t::lib::Mocks::mock_preference('AcqCreateItem', 'ordering');
72
t::lib::Mocks::mock_preference('AcqCreateItem', 'ordering');
73
( undef, $ordernumber ) = C4::Acquisition::NewOrder(
73
$ordernumber = C4::Acquisition::NewOrder(
74
    {
74
    {
75
        basketno => $basketno1,
75
        basketno => $basketno1,
76
        quantity => 2,
76
        quantity => 2,
(-)a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t (-2 / +2 lines)
Lines 39-45 my ($biblionumber1, $biblioitemnumber1) = AddBiblio(MARC::Record->new, ''); Link Here
39
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
39
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
40
my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, '');
40
my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, '');
41
41
42
( undef, $ordernumber1 ) = C4::Acquisition::NewOrder(
42
$ordernumber1 = C4::Acquisition::NewOrder(
43
    {
43
    {
44
        basketno => $basketno,
44
        basketno => $basketno,
45
        quantity => 2,
45
        quantity => 2,
Lines 48-54 my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, ''); Link Here
48
    }
48
    }
49
);
49
);
50
50
51
( undef, $ordernumber2 ) = C4::Acquisition::NewOrder(
51
$ordernumber2 = C4::Acquisition::NewOrder(
52
    {
52
    {
53
        basketno => $basketno,
53
        basketno => $basketno,
54
        quantity => 4,
54
        quantity => 4,
(-)a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t (-3 / +3 lines)
Lines 39-45 my $budget = C4::Budgets::GetBudget( $budgetid ); Link Here
39
my ($ordernumber1, $ordernumber2, $ordernumber3);
39
my ($ordernumber1, $ordernumber2, $ordernumber3);
40
my ($biblionumber1, $biblioitemnumber1) = AddBiblio(MARC::Record->new, '');
40
my ($biblionumber1, $biblioitemnumber1) = AddBiblio(MARC::Record->new, '');
41
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
41
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
42
( undef, $ordernumber1 ) = C4::Acquisition::NewOrder(
42
$ordernumber1 = C4::Acquisition::NewOrder(
43
    {
43
    {
44
        basketno => $basketno,
44
        basketno => $basketno,
45
        quantity => 24,
45
        quantity => 24,
Lines 48-54 my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, ''); Link Here
48
    }
48
    }
49
);
49
);
50
50
51
( undef, $ordernumber2 ) = C4::Acquisition::NewOrder(
51
$ordernumber2 = C4::Acquisition::NewOrder(
52
    {
52
    {
53
        basketno => $basketno,
53
        basketno => $basketno,
54
        quantity => 42,
54
        quantity => 42,
Lines 57-63 my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, ''); Link Here
57
    }
57
    }
58
);
58
);
59
59
60
( undef, $ordernumber3 ) = C4::Acquisition::NewOrder(
60
$ordernumber3 = C4::Acquisition::NewOrder(
61
    {
61
    {
62
        basketno => $basketno,
62
        basketno => $basketno,
63
        quantity => 4,
63
        quantity => 4,
(-)a/t/db_dependent/Acquisition/Invoices.t (-3 / +3 lines)
Lines 53-59 $bibrec1->append_fields( Link Here
53
my ($biblionumber1, $biblioitemnumber1) = AddBiblio($bibrec1, '');
53
my ($biblionumber1, $biblioitemnumber1) = AddBiblio($bibrec1, '');
54
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
54
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
55
my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, '');
55
my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, '');
56
( undef, $ordernumber1 ) = C4::Acquisition::NewOrder(
56
$ordernumber1 = C4::Acquisition::NewOrder(
57
    {
57
    {
58
        basketno => $basketno,
58
        basketno => $basketno,
59
        quantity => 2,
59
        quantity => 2,
Lines 62-68 my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, ''); Link Here
62
    }
62
    }
63
);
63
);
64
64
65
( undef, $ordernumber2 ) = C4::Acquisition::NewOrder(
65
$ordernumber2 = C4::Acquisition::NewOrder(
66
    {
66
    {
67
        basketno => $basketno,
67
        basketno => $basketno,
68
        quantity => 1,
68
        quantity => 1,
Lines 71-77 my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, ''); Link Here
71
    }
71
    }
72
);
72
);
73
73
74
( undef, $ordernumber3 ) = C4::Acquisition::NewOrder(
74
$ordernumber3 = C4::Acquisition::NewOrder(
75
    {
75
    {
76
        basketno => $basketno,
76
        basketno => $basketno,
77
        quantity => 1,
77
        quantity => 1,
(-)a/t/db_dependent/Acquisition/OrderFromSubscription.t (-1 / +1 lines)
Lines 57-63 ok($basketno = NewBasket($booksellerid, 1), "NewBasket( $booksellerid , 1 ) re Link Here
57
my $cost = 42.00;
57
my $cost = 42.00;
58
my $subscription = GetSubscription( $subscriptionid );
58
my $subscription = GetSubscription( $subscriptionid );
59
my $ordernumber;
59
my $ordernumber;
60
( $basketno, $ordernumber ) = NewOrder({
60
$ordernumber = NewOrder({
61
    biblionumber => $subscription->{biblionumber},
61
    biblionumber => $subscription->{biblionumber},
62
    entrydate => '01-01-2013',
62
    entrydate => '01-01-2013',
63
    quantity => 1,
63
    quantity => 1,
(-)a/t/db_dependent/Acquisition/TransferOrder.t (-1 / +1 lines)
Lines 54-60 my $budget = C4::Budgets::GetBudget( $budgetid ); Link Here
54
my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, '');
54
my ($biblionumber, $biblioitemnumber) = AddBiblio(MARC::Record->new, '');
55
my $itemnumber = AddItem({}, $biblionumber);
55
my $itemnumber = AddItem({}, $biblionumber);
56
56
57
my ( undef, $ordernumber ) = C4::Acquisition::NewOrder(
57
my $ordernumber = C4::Acquisition::NewOrder(
58
    {
58
    {
59
        basketno => $basketno1,
59
        basketno => $basketno1,
60
        quantity => 2,
60
        quantity => 2,
(-)a/t/db_dependent/Acquisition/close_reopen_basket.t (-2 / +2 lines)
Lines 44-50 my ($biblionumber1, $biblioitemnumber1) = AddBiblio(MARC::Record->new, ''); Link Here
44
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
44
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, '');
45
45
46
my ($ordernumber1, $ordernumber2);
46
my ($ordernumber1, $ordernumber2);
47
( undef, $ordernumber1 ) = C4::Acquisition::NewOrder(
47
$ordernumber1 = C4::Acquisition::NewOrder(
48
    {
48
    {
49
        basketno => $basketno,
49
        basketno => $basketno,
50
        quantity => 24,
50
        quantity => 24,
Lines 53-59 my ($ordernumber1, $ordernumber2); Link Here
53
    }
53
    }
54
);
54
);
55
55
56
( undef, $ordernumber2 ) = C4::Acquisition::NewOrder(
56
$ordernumber2 = C4::Acquisition::NewOrder(
57
    {
57
    {
58
        basketno => $basketno,
58
        basketno => $basketno,
59
        quantity => 42,
59
        quantity => 42,
(-)a/t/db_dependent/Bookseller.t (-18 / +17 lines)
Lines 139-147 is_deeply( \@booksellers, \@tab, Link Here
139
my @bookseller1 = C4::Bookseller::GetBookSeller( $sample_supplier1->{name} );
139
my @bookseller1 = C4::Bookseller::GetBookSeller( $sample_supplier1->{name} );
140
#FIXME : if there is 0 basket, GetBookSeller returns 1 as basketcount
140
#FIXME : if there is 0 basket, GetBookSeller returns 1 as basketcount
141
#is( $bookseller1[0]->{basketcount}, 0, 'Supplier1 has 0 basket' );
141
#is( $bookseller1[0]->{basketcount}, 0, 'Supplier1 has 0 basket' );
142
my $sample_basket1 =
142
my $basketno1 =
143
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby1', 'basketname1' );
143
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby1', 'basketname1' );
144
my $sample_basket2 =
144
my $basketno2 =
145
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby2', 'basketname2' );
145
  C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby2', 'basketname2' );
146
@bookseller1 = C4::Bookseller::GetBookSeller( $sample_supplier1->{name} );
146
@bookseller1 = C4::Bookseller::GetBookSeller( $sample_supplier1->{name} );
147
is( $bookseller1[0]->{basketcount}, 2, 'Supplier1 has 2 baskets' );
147
is( $bookseller1[0]->{basketcount}, 2, 'Supplier1 has 2 baskets' );
Lines 323-344 my $id_supplier3 = C4::Bookseller::AddBookseller($sample_supplier3); Link Here
323
my $id_supplier4 = C4::Bookseller::AddBookseller($sample_supplier4);
323
my $id_supplier4 = C4::Bookseller::AddBookseller($sample_supplier4);
324
324
325
#Add 2 baskets
325
#Add 2 baskets
326
my $sample_basket3 =
326
my $basketno3 =
327
  C4::Acquisition::NewBasket( $id_supplier3, 'authorisedby3', 'basketname3',
327
  C4::Acquisition::NewBasket( $id_supplier3, 'authorisedby3', 'basketname3',
328
    'basketnote3' );
328
    'basketnote3' );
329
my $sample_basket4 =
329
my $basketno4 =
330
  C4::Acquisition::NewBasket( $id_supplier4, 'authorisedby4', 'basketname4',
330
  C4::Acquisition::NewBasket( $id_supplier4, 'authorisedby4', 'basketname4',
331
    'basketnote4' );
331
    'basketnote4' );
332
332
333
#Modify the basket to add a close date
333
#Modify the basket to add a close date
334
my $basket1info = {
334
my $basket1info = {
335
    basketno     => $sample_basket1,
335
    basketno     => $basketno1,
336
    closedate    => $today,
336
    closedate    => $today,
337
    booksellerid => $id_supplier1
337
    booksellerid => $id_supplier1
338
};
338
};
339
339
340
my $basket2info = {
340
my $basket2info = {
341
    basketno     => $sample_basket2,
341
    basketno     => $basketno2,
342
    closedate    => $daysago5,
342
    closedate    => $daysago5,
343
    booksellerid => $id_supplier2
343
    booksellerid => $id_supplier2
344
};
344
};
Lines 348-359 my $dur10 = DateTime::Duration->new( days => -10 ); Link Here
348
$dt_today2->add_duration($dur10);
348
$dt_today2->add_duration($dur10);
349
my $daysago10 = output_pref({ dt => $dt_today2, dateformat => 'iso', timeformat => '24hr', dateonly => 1 });
349
my $daysago10 = output_pref({ dt => $dt_today2, dateformat => 'iso', timeformat => '24hr', dateonly => 1 });
350
my $basket3info = {
350
my $basket3info = {
351
    basketno  => $sample_basket3,
351
    basketno  => $basketno3,
352
    closedate => $daysago10,
352
    closedate => $daysago10,
353
};
353
};
354
354
355
my $basket4info = {
355
my $basket4info = {
356
    basketno  => $sample_basket4,
356
    basketno  => $basketno4,
357
    closedate => $today,
357
    closedate => $today,
358
};
358
};
359
ModBasket($basket1info);
359
ModBasket($basket1info);
Lines 384-393 is(scalar(@subscriptions), 1, 'search for subscriptions by location'); Link Here
384
384
385
#Add 4 orders
385
#Add 4 orders
386
my ( $ordernumber1, $ordernumber2, $ordernumber3, $ordernumber4 );
386
my ( $ordernumber1, $ordernumber2, $ordernumber3, $ordernumber4 );
387
my ( $basketno1,    $basketno2,    $basketno3,    $basketno4 );
387
$ordernumber1 = C4::Acquisition::NewOrder(
388
( $basketno1, $ordernumber1 ) = C4::Acquisition::NewOrder(
389
    {
388
    {
390
        basketno         => $sample_basket1,
389
        basketno         => $basketno1,
391
        quantity         => 24,
390
        quantity         => 24,
392
        biblionumber     => $biblionumber,
391
        biblionumber     => $biblionumber,
393
        budget_id        => $id_budget,
392
        budget_id        => $id_budget,
Lines 403-411 my ( $basketno1, $basketno2, $basketno3, $basketno4 ); Link Here
403
        datereceived     => '01-06-2013'
402
        datereceived     => '01-06-2013'
404
    }
403
    }
405
);
404
);
406
( $basketno2, $ordernumber2 ) = C4::Acquisition::NewOrder(
405
$ordernumber2 = C4::Acquisition::NewOrder(
407
    {
406
    {
408
        basketno       => $sample_basket2,
407
        basketno       => $basketno2,
409
        quantity       => 20,
408
        quantity       => 20,
410
        biblionumber   => $biblionumber,
409
        biblionumber   => $biblionumber,
411
        budget_id      => $id_budget,
410
        budget_id      => $id_budget,
Lines 419-427 my ( $basketno1, $basketno2, $basketno3, $basketno4 ); Link Here
419
        ecost          => 10,
418
        ecost          => 10,
420
    }
419
    }
421
);
420
);
422
( $basketno3, $ordernumber3 ) = C4::Acquisition::NewOrder(
421
$ordernumber3 = C4::Acquisition::NewOrder(
423
    {
422
    {
424
        basketno       => $sample_basket3,
423
        basketno       => $basketno3,
425
        quantity       => 20,
424
        quantity       => 20,
426
        biblionumber   => $biblionumber,
425
        biblionumber   => $biblionumber,
427
        budget_id      => $id_budget,
426
        budget_id      => $id_budget,
Lines 435-443 my ( $basketno1, $basketno2, $basketno3, $basketno4 ); Link Here
435
        ecost          => 11,
434
        ecost          => 11,
436
    }
435
    }
437
);
436
);
438
( $basketno4, $ordernumber4 ) = C4::Acquisition::NewOrder(
437
$ordernumber4 = C4::Acquisition::NewOrder(
439
    {
438
    {
440
        basketno         => $sample_basket4,
439
        basketno         => $basketno4,
441
        quantity         => 20,
440
        quantity         => 20,
442
        biblionumber     => $biblionumber,
441
        biblionumber     => $biblionumber,
443
        budget_id        => $id_budget,
442
        budget_id        => $id_budget,
Lines 632-638 isnt( exists( $suppliers{$id_supplier4} ), 1, "Supplier4 hasnt late orders" ); Link Here
632
631
633
#Basket1 closedate -> $daysago10
632
#Basket1 closedate -> $daysago10
634
$basket1info = {
633
$basket1info = {
635
    basketno  => $sample_basket1,
634
    basketno  => $basketno1,
636
    closedate => $daysago10,
635
    closedate => $daysago10,
637
};
636
};
638
ModBasket($basket1info);
637
ModBasket($basket1info);
(-)a/t/db_dependent/Budgets.t (-3 / +2 lines)
Lines 304-310 my $item_quantity = 2; Link Here
304
my $number_of_orders_to_move = 0;
304
my $number_of_orders_to_move = 0;
305
for my $infos (@order_infos) {
305
for my $infos (@order_infos) {
306
    for ( 1 .. $infos->{pending_quantity} ) {
306
    for ( 1 .. $infos->{pending_quantity} ) {
307
        my ( undef, $ordernumber ) = C4::Acquisition::NewOrder(
307
        my $ordernumber = C4::Acquisition::NewOrder(
308
            {
308
            {
309
                basketno           => $basketno,
309
                basketno           => $basketno,
310
                biblionumber       => $biblionumber,
310
                biblionumber       => $biblionumber,
Lines 326-332 for my $infos (@order_infos) { Link Here
326
        $number_of_orders_to_move++;
326
        $number_of_orders_to_move++;
327
    }
327
    }
328
    for ( 1 .. $infos->{spent_quantity} ) {
328
    for ( 1 .. $infos->{spent_quantity} ) {
329
        my ( undef, $ordernumber ) = C4::Acquisition::NewOrder(
329
        my $ordernumber = C4::Acquisition::NewOrder(
330
            {
330
            {
331
                basketno           => $basketno,
331
                basketno           => $basketno,
332
                biblionumber       => $biblionumber,
332
                biblionumber       => $biblionumber,
333
- 

Return to bug 12826