Correct way to cancel an invoice that is uncollectible

Uncollectible invoice should not be credited. Normally you should have an dedicated account in your chart to move the debit of the party there.
I wrote a blueprint to automate the process Uncollectible debts