Lines 286-292
subtest 'get() tests' => sub {
Link Here
|
286 |
|
286 |
|
287 |
subtest 'add() tests' => sub { |
287 |
subtest 'add() tests' => sub { |
288 |
|
288 |
|
289 |
plan tests => 17; |
289 |
plan tests => 27; |
290 |
|
290 |
|
291 |
$schema->storage->txn_begin; |
291 |
$schema->storage->txn_begin; |
292 |
|
292 |
|
Lines 369-374
subtest 'add() tests' => sub {
Link Here
|
369 |
} |
369 |
} |
370 |
qr/DBD::mysql::st execute failed: Duplicate entry '(.*)' for key '(aqorders\.)?PRIMARY'/; |
370 |
qr/DBD::mysql::st execute failed: Duplicate entry '(.*)' for key '(aqorders\.)?PRIMARY'/; |
371 |
|
371 |
|
|
|
372 |
# Check that prices are correctly populated |
373 |
my $order_without_prices = { |
374 |
basket_id => $order->{basket_id}, |
375 |
biblio_id => $order->{biblio_id}, |
376 |
fund_id => $order->{fund_id}, |
377 |
quantity => 1, |
378 |
tax_rate_on_ordering => '0.5', |
379 |
tax_rate_on_receiving => '0.5', |
380 |
unit_price => 4.20, |
381 |
rrp => 4.20, |
382 |
discount_rate => 0.10, |
383 |
}; |
384 |
|
385 |
$order_obj->basket->bookseller->listincgst(0)->invoiceincgst(0)->store(); |
386 |
$t->post_ok("//$auth_userid:$password@/api/v1/acquisitions/orders" => json => $order_without_prices) |
387 |
->status_is(201) |
388 |
->json_is('/tax_value_on_ordering', '2.1') |
389 |
->json_is('/tax_value_on_receiving', '2.1') |
390 |
->json_is('/rrp_tax_included', '6.3') |
391 |
->json_is('/rrp_tax_excluded', '4.2') |
392 |
->json_is('/unit_price_tax_included', '6.3') |
393 |
->json_is('/unit_price_tax_excluded', '4.2') |
394 |
->json_is('/ecost_tax_included', '5.67') |
395 |
->json_is('/ecost_tax_excluded', '3.78'); |
396 |
|
372 |
$schema->storage->txn_rollback; |
397 |
$schema->storage->txn_rollback; |
373 |
}; |
398 |
}; |
374 |
|
399 |
|
375 |
- |
|
|