commit14
This commit is contained in:
@@ -91,6 +91,8 @@ class InventoryReversals
|
||||
$receiptSource = null;
|
||||
if ($data['source_kind'] === 'operation') {
|
||||
$operation = StockOperation::query()->whereKey($data['source_operation_id'])->firstOrFail();
|
||||
$sourceMovementIds=StockMovement::query()->where('stock_operation_id',$operation->id)->pluck('id');
|
||||
$this->check(!StockMovement::query()->where('movement_type','workshop_return_in')->whereIn('snapshot->delivery_movement_id',$sourceMovementIds)->exists(),'action','A entrega já tem devolução física de excedente. Preserve o original e confira a correcção própria.');
|
||||
$this->check(in_array($operation->kind, ['issue', 'transfer', 'adjustment', 'supplier_return', 'write_off'], true), 'data.source_operation_id', 'Seleccione uma operação física; contagens e outros estornos não são estornados por este percurso.');
|
||||
$this->check(! $this->operationReversed($operation->id), 'action', 'Esta operação já tem estorno integral.');
|
||||
$movements = StockMovement::query()->where('stock_operation_id', $operation->id)->orderBy('id')->get();
|
||||
|
||||
Reference in New Issue
Block a user