keep getting "Improper Statement" errors

keep getting "Improper Statement" errors

I've spent hours trying to do a simple IF statement and I keep getting errors. I'm on the trial version and attempting to setup a quick demo for a customer so that they can decide if Zoho works for them.

It's a simple Commission tracking application. There are Sales Reps, Expense Categories, Customers and Invoices.
On the Invoice, there are multiple Expenses (subform). Based on the Expense Category of the Expense, I need to pull in the Rate_Type and calculate the amount of the expense. 

It seems that everything I do I get an "Improper Statement" error.

expense_row  =  Expense_Categories  [ID == Invoice_Expenses.Expense_Category];
if(expense_row.Rate_Type == "Variable" )
{Invoice_Expenses.Quantity == input.Quantity};
else if(expense_row.Rate_Type == "Fixed" )
{Invoice_Expenses.Quantity = 1};
else if(expense_row.Rate_Type == "Formula" )
{Invoice_Expenses.Quantity = input.Quantity};