Details for any financial document are sorted by the system generated detail key (not visible to the user). As long as all the details are entered at the same time, it is likely they will show up in the same positions after the save. However, if a user inserts a detail in the middle of previously saved ones (by copying an existing row), the value of the key for the new row will be higher than the previously saved/entered details, causing the new detail to show up at the end of the document.

Click here to go to the Knowledge Center for the full article.