This can occur in 2 ways.
When a delivery price varies from a Purchase order price an automatic flag
Another way of raising a Credit note is for return of stock to supplier. This should accompany the goods when returned. The information should include the last inv number and price.
The Credit note should then be posted into the GL as a credit with the supplier and statements for that period should be paid on the balance owing minus the credit amount for that period.