how to use a credit note to pay a bill

SOLVED

hello all,

we have a credit note recorded for a vendor. So the vendor owes us cash and this is because we paid the same bill twice in error. I now have a new bill to pay for this vendor which i have recorded in the purchase journal as a bill to be paid in 30 days. 

now i need to record the payment but i want to use the credit note to do this since my balance in the vendor aged detailed report is a negative amount. 

how to I record this? 

any help is appreciated

thank you