It does get attached to the ""apply to invoice"" but it will not show up on the trial balance until the transaction date of the credit memo. The aging won't show the credit memo, it will simply reduce the balance of the original invoice on the aging after the date of the credit. The credit is never reflected in an earlier period. When the credit is reflected is always based on the transaction date or the posting date of the credit, not the original invoice.