|
Lines 371-398
subtest 'add() tests' => sub {
Link Here
|
| 371 |
|
371 |
|
| 372 |
# Check that prices are correctly populated |
372 |
# Check that prices are correctly populated |
| 373 |
my $order_without_prices = { |
373 |
my $order_without_prices = { |
| 374 |
basket_id => $order->{basket_id}, |
374 |
basket_id => $order->{basket_id}, |
| 375 |
biblio_id => $order->{biblio_id}, |
375 |
biblio_id => $order->{biblio_id}, |
| 376 |
fund_id => $order->{fund_id}, |
376 |
fund_id => $order->{fund_id}, |
| 377 |
quantity => 1, |
377 |
quantity => 1, |
| 378 |
tax_rate_on_ordering => '0.5', |
378 |
tax_rate_on_ordering => '0.5', |
| 379 |
tax_rate_on_receiving => '0.5', |
379 |
tax_rate_on_receiving => '0.5', |
| 380 |
unit_price => 4.20, |
380 |
unit_price => 4.20, |
| 381 |
rrp => 4.20, |
381 |
rrp => 4.20, |
| 382 |
discount_rate => 0.10, |
382 |
discount_rate => 0.10, |
| 383 |
}; |
383 |
}; |
| 384 |
|
384 |
|
| 385 |
$order_obj->basket->bookseller->listincgst(0)->invoiceincgst(0)->store(); |
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) |
386 |
$t->post_ok( "//$auth_userid:$password@/api/v1/acquisitions/orders" => json => $order_without_prices ) |
| 387 |
->status_is(201) |
387 |
->status_is(201)->json_is( '/tax_value_on_ordering', '2.1' )->json_is( '/tax_value_on_receiving', '2.1' ) |
| 388 |
->json_is('/tax_value_on_ordering', '2.1') |
388 |
->json_is( '/rrp_tax_included', '6.3' )->json_is( '/rrp_tax_excluded', '4.2' ) |
| 389 |
->json_is('/tax_value_on_receiving', '2.1') |
389 |
->json_is( '/unit_price_tax_included', '6.3' )->json_is( '/unit_price_tax_excluded', '4.2' ) |
| 390 |
->json_is('/rrp_tax_included', '6.3') |
390 |
->json_is( '/ecost_tax_included', '5.67' )->json_is( '/ecost_tax_excluded', '3.78' ); |
| 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 |
|
391 |
|
| 397 |
$schema->storage->txn_rollback; |
392 |
$schema->storage->txn_rollback; |
| 398 |
}; |
393 |
}; |
| 399 |
- |
|
|