How to handle Credit and Debit Note

Do you have any articles or flow charts related to how to handle the credit note and debit note? What are the scenarios that can happen on this?

What will be the flow-on using the excess payment due to the damaged item? How will you credit it as payment to other future Invoices?

Also, how is the credit note and debit note type of journal entry useful on this? why is it not the same with invoice that when you create a payment, a payment entry is automatically select?

I already read the ERPNext documentation on this, but still, i am confused since there is no available flowchart that can illustrate on how is the flow of the credit and debit note on the ERPNext.

Hi I did the instruction on this manual here on how to process a debit note.

It says to create the following: (This is for a scenario that I purchase something then decided to return/cancel the purchase)

  1. Create Purchase Invoice
  2. Create payment entry for the above Purchase Invoice.
  3. Create Debit Note to record a canceled paid purchase invoice.
  4. Create payment entry (as received type) on the original invoice.

So I smoothly did the steps. However, upon checking the debit note was floating as an open payment which should not because I already received the returned payment from the supplier.

How can I close the debit note? I am not sure if I did sometimes wrong?