This can occur in 2 ways.
When a delivery price varies from a Purchase order price an automatic flag should be raised at Goods Inward stage asking whether a credit note needs to be raised for that item. This credit note should state the supplier, PO number, delivery date and supplier invoice number.
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.