## Step 1: Define the symbolic variables
Let's define the symbolic variables for the problem:
- $x_1$ represents the number of furniture
- $x_2$ represents the number of carpet

## Step 2: Formulate the objective function
The objective function is to maximize profit. The profit per furniture sold is $40 and the profit per carpet sold is $30. Therefore, the objective function can be represented as:
\[ \max 40x_1 + 30x_2 \]

## 3: Define the constraints
1. Space constraint: Each furniture takes 12 square feet of space, and each carpet takes 7 square feet of space. The company has 1200 square feet of space available.
\[ 12x_1 + 7x_2 \leq 1200 \]

2. Budget constraint: Buying a furniture costs $300 and buying a carpet costs $80. The company has a budget of $30000.
\[ 300x_1 + 80x_2 \leq 30000 \]

3. Furniture percentage constraint: At least 20% of items in stock have to be furniture.
\[ x_1 \geq 0.2(x_1 + x_2) \]
\[ 0.8x_1 \geq 0.2x_2 \]
\[ 0.8x_1 - 0.2x_2 \geq 0 \]
\[ 4x_1 - x_2 \geq 0 \]

4. Non-negativity constraint: The number of furniture and carpet cannot be negative.
\[ x_1 \geq 0, x_2 \geq 0 \]

## 4: Symbolic representation of the problem
```json
{
'sym_variables': [('x1', 'furniture'), ('x2', 'carpet')],
'objective_function': '40*x1 + 30*x2',
'constraints': [
'12*x1 + 7*x2 <= 1200',
'300*x1 + 80*x2 <= 30000',
'4*x1 - x2 >= 0',
'x1 >= 0',
'x2 >= 0'
]
}
```

## 5: Gurobi code
```python
import gurobi

def solve_optimization_problem():
    # Create a new model
    model = gurobi.Model()

    # Define the variables
    x1 = model.addVar(name="furniture", lb=0, vtype=gurobi.GRB.INTEGER)
    x2 = model.addVar(name="carpet", lb=0, vtype=gurobi.GRB.INTEGER)

    # Define the objective function
    model.setObjective(40*x1 + 30*x2, gurobi.GRB.MAXIMIZE)

    # Add constraints
    model.addConstr(12*x1 + 7*x2 <= 1200, name="space_constraint")
    model.addConstr(300*x1 + 80*x2 <= 30000, name="budget_constraint")
    model.addConstr(4*x1 - x2 >= 0, name="furniture_percentage_constraint")

    # Optimize the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal solution found.")
        print(f"Number of furniture: {x1.varValue}")
        print(f"Number of carpet: {x2.varValue}")
        print(f"Max profit: {model.objVal}")
    else:
        print("No optimal solution found.")

solve_optimization_problem()
```