@@ -1969,6 +1969,14 @@ test('native consolidated order retains both origins and consumes a single invoi
|
||||
expect(PurchaseOrder::query()->visibleTo($this->owner)->whereKey($order->id)->exists())->toBeTrue();
|
||||
$request->forceFill(['requester_id' => $this->head->id])->save();
|
||||
expect(PurchaseOrder::query()->visibleTo($this->owner)->whereKey($order->id)->exists())->toBeFalse();
|
||||
// The search must respect every consolidated origin after a current department change,
|
||||
// while keeping the native company-wide warehouse reader's receipt access.
|
||||
$otherDepartment = Department::query()->create(['tenant_id' => $this->tenant->id, 'name' => 'Outro departamento sintético']);
|
||||
$request->forceFill(['department_id' => $otherDepartment->id])->save();
|
||||
$this->actingAs($this->head)->get('/compras/pesquisa?q=GR-CONSOL-QA')->assertOk()
|
||||
->assertInertia(fn (Assert $page) => $page->where('groups.4.key', 'receipts')->where('groups.4.records.total', 0));
|
||||
$this->actingAs($receiver)->get('/compras/pesquisa?q=GR-CONSOL-QA')->assertOk()
|
||||
->assertInertia(fn (Assert $page) => $page->where('groups.4.key', 'receipts')->where('groups.4.records.total', 1));
|
||||
});
|
||||
|
||||
test('native partial-order cancellation uses independent Finance and preserves the unissued reservation and requisition', function () {
|
||||
|
||||
Reference in New Issue
Block a user