Hint on debugging sales order posting voucher amount mismatch issue
To debug sales order posting voucher amount mismatch issue, add an info method like below on addTrans method of LedgerVoucherObject. Then will get the infolog as shown below, which helps on finding the item price which is getting posted. Recently I got an issue when Item price was changed after packing slip posting and that resulted in voucher amount mismatch error and this helped.