You need to provide more information so your situation can be understood. Post a screen shot of the sales invoice involved (the Edit screen, not the View). Obscure private information, if necessary. From what you have said, it is not clear why you have a problem, if indeed you do. Provide a detailed chronology of events.
Are you saying, for example, that the sales invoice was due 4/15/18, late payment fees were assessed on that date, but that you later entered a receipt for 4/13/18? If so, I can reproduce that behavior. While the balance due remains correct, it does seem unnecessary to show a zero-amount credit when a prior entry erases the fee. Businesses often could be behind on entering data.
I’m putting this into the Bugs category, not because there is any mistake, but because the performance of the program will raise questions with users and their customers alike.