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); |