@@ -22,6 +22,12 @@ beforeEach(function () {
|
||||
$this->payload = receiptPayload($this->f);
|
||||
});
|
||||
|
||||
test('receipt preparation uses encrypted history without registering a receipt or stock movement', function () {
|
||||
$this->get($this->url)->assertOk()->assertViewHas('page', fn ($page) => $page['encryptHistory'] === true)
|
||||
->assertInertia(fn (Assert $page) => $page->component('receipts/order')->where('canConfirm', true));
|
||||
expect(GoodsReceipt::query()->count())->toBe(0)->and(StockMovement::query()->count())->toBe(0);
|
||||
});
|
||||
|
||||
test('partial then total receipts preserve pending quantities and credit only accepted stock', function () {
|
||||
$this->postJson($this->url, receiptPayload($this->f, '0.400'))->assertCreated()->assertJsonPath('status', 'partial');
|
||||
$first = GoodsReceipt::query()->firstOrFail();
|
||||
|
||||
Reference in New Issue
Block a user