Implementa regras de investimento por empresa com dupla aprovacao

This commit is contained in:
2026-10-28 16:57:45 +02:00
parent 153ba2c1af
commit 95dd2cc1ed
37 changed files with 1418 additions and 28 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ class ReceiptWorkflow
throw ValidationException::withMessages(['items' => 'Descreva as reservas, danos ou divergências de qualidade.']);
}
$stockItem = ! empty($input['stock_item_id']) ? StockItem::query()->lockForUpdate()->findOrFail($input['stock_item_id']) : null;
$physical = in_array($source->purchase_type, ['consumable', 'other', 'spare_part']);
$physical = in_array($source->purchase_type, ['consumable', 'other', 'spare_part', 'equipment']);
if ($source->purchase_type === 'spare_part') {
if (! $source->spare_part_id || ! $source->equipment_id) {
throw ValidationException::withMessages(['items' => 'Peça sem associação autorizada na ordem. A recepção está bloqueada.']);