Does the system generated Sales Return on Invoice Cancellation and on what reference?

Suggestions:
Yes , System generates the Sales return when Invoice is cancelled via cancel button and a credit note is also created. Sales return gets generated with the return type as ‘Sales return’. Ref Inv Id reference sets the invoice number against which the Sales return is taken. The return option applicable sets a credit note. Full return is also set as yes. Customer code and customer details are set from the invoice which is cancelled. Sales return generated is also confirmed.