You are receiving the below error message when attempting to publish an invoice.
Error: Unable to cast object of type 'Intuit.Ipp.Data.AccountBasedExpenseLineDetail' to type 'Intuit.Ipp.Data.ItemBasedExpenseLineDetail'.
QuickBooks Online integrated companies.
This error typically occurs when a change has been made to your QuickBooks Online company's settings which has not been reflected in AutoEntry via a re-sync.
To clear the error, please do the following:
Navigate to the Integrate page, located on the left hand side of your company homepage.
You will then be prompted to connect the integration again. Once the company is reconnected to QuickBooks Online, scroll down to the 'Line Items on Purchases Invoices' heading on the Integrate page (shown below).
Change this setting to Prouct Codes/Services, click Save. Then change the setting back to Account Codes and click Save again.
Republish the affected invoice(s).