The problem known and old.
I find it difficult find a description of the problem in English
because I badly I know language
I hope for your understanding, I point out a link to an old article in Russian
<removed as rules violation>
From my experience in the implementation of accounting systems in the USA shows that the user can not accept your proposed solution
First, the cost of goods should not depend on the order in which the documents taken into account
Secondly, the procedure for recosting cost after violation of chronological order of costing can not be daunting
The first assertion.
Naturally, that procedure for accounting documents is important, but in view of the selected time interval. In the above article describes a situation in which this interval is equal to a month. This is the Russian version, is rarely used in the United States, which uses an interval - one day.
Ie average cost of sold units, and the end-day balance of goods in this day is the same. Average cost are calculated based on the balance of goods at the beginning of the day plus all the receipt of the goods at the day. Regardless of the chronological order accounting documents. And when the document was posted - the same day or later (the next day or next week)
The second assertion
Variant of reposting of documents is very complex
- You first need to determine what documents you need to repost
- after that determine the list of related documents, for example, deposit and payment, which will have to repost also
- then cancel post all these found documents in the correct order
- after that post all these documents in the correct order
Ideally, this is the system performs all necessary actions in underground mode without user intervention
At worst, he should be able to run a procedure that performs the necessary calculations and generate records accounting registers.