Prepaying merchandise or accounts payable does not affect the gain on sale of the business. You will owe tax on the gain on sale.
However, note that the amount that you received towards goodwill (presuming that this goodwill ie self generated) will be taxed as long term capital gain. hence the tax rate on the gain on the amount received towards good will be taxed at 15%(maximum). Balance gain will be taxed at higher rate depending on your overall tax bracket and depreciation claimed on assets. Note that in case of sale of inventory, only the gain on sale(after considering the cost of inventory) will be taxed. Normally the sale of inventory takes place at cost so the chances or having too much gain on sale of inventory is rare.
Let me know if you have any question.
Please note: This advice is provided with the understanding that all the relevant facts have been provided by you. Any change in facts might affect the advice given and hence may not be relied on in such cases. Nothing contained in this reply was intended or written to be used, can be used by any taxpayer, or may be relied upon or used by any taxpayer for the purposes of avoiding penalties that may be imposed on the taxpayer under the Internal Revenue Code of 1986, as amended.
You did it right.