What is the origin of the idiom 'Upset the Applecart'?

Origin: Originated from the 1800s whereby a farmer would bring his applecart loaded with neatly piled, fresh apples for sale. Along comes a clumsy oaf who knocks over the cart, spilling all the apples.The farmer's plan to sell the apples is spoiled.