Use the price at your chosen selling point, not an assumed universal price. Include the time and cost of getting the goods there.
For production, value your own crops as inputs: using them means giving up the money you could have earned by selling them.
Enter each recipe’s quantities and cycle count from your save. The production tool calculates the margin before building purchase costs and unlisted byproducts.