recordUse->execute(new StockUseData($stockItemId, StockQuantity::inputValue($quantityMilli), machineId: $machineId, orderLineId: $orderLineId), $userId); } catch (DomainException) { return false; } return true; } public function writeOff(int $stockItemId, int $quantityMilli, int $orderLineId, ?int $machineId, int $userId, string $reason): bool { try { $this->recordWriteOff->execute(new StockUseData( $stockItemId, StockQuantity::inputValue($quantityMilli), machineId: $machineId, orderLineId: $orderLineId, reason: __('sales.orders.reasons.'.$reason, [], 'fi'), ), $userId); } catch (DomainException) { return false; } return true; } }