I work with many clients who purchase and return job materials all the time. I find the cleanest method for profit and loss is to apply the sale to the same account.
Example :
$100 Purchase at Lowes recorded as "Lowes" with classification "Job Materials and Supplies"
$40 Refund from Lowes recorded as "Lowes" with classification "Job Materials and Supplies"
When you go to your profit and loss if you click on all "Job Materials and Supplies" transactions you will see both transactions, one is creating an expense and one is crediting the expense account.