Cancel Invoice in Xero with a Credit Note

How to cancel an Invoice in Xero with a Credit Note from EdgeCTP