@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Tempo\Purchasing\Internal\InternalRequisitions;
|
||||
|
||||
require_once __DIR__.'/../../packages/purchasing/bootstrap.php';
|
||||
|
||||
test('browser estimate vectors match the authoritative requisition line amounts', function () {
|
||||
$vectors = json_decode(file_get_contents(__DIR__.'/../Fixtures/requisition-estimates.json'), true, flags: JSON_THROW_ON_ERROR);
|
||||
foreach ($vectors as $vector) {
|
||||
$total = 0;
|
||||
foreach ($vector['lines'] as $line) {
|
||||
$total += InternalRequisitions::line($line['quantity'], $line['unit_price'], $line['tax_rate'])['total_minor'];
|
||||
}
|
||||
expect((string) $total)->toBe($vector['minor']);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user