Discount and margin (cost price manipulations)

Hi everyone, is there any way cost price (CP) can be manipulated in the margin and discount?

For example; We buy an item from our supplier say for 60 € (CP) and sell it for 100 € (SP) to our customer, hence achieving the margin amount of 40€.

Now after a period of time, we buy the same used item from our customer for 20€ (CP) and sell it for 80€ (SP) to another customer with a 60€ margin.

The cost price 60 and 20€ varies in both the situations. Is there any way this variations in CP can be shown in the ERPNext for the same item in discount and margins? This would help us to have a clear picture of the whole process.

Thanks a lot.

In this instance I would probably list the used item as a different item number.

1 x new Item xyz from supplier A sold to customer 1.
Customer 1 (who now becomes a supplier as well as a customer incidentally) sells you back item xyz.
To prevent the used item getting mixed up with new stock you give it a new item number xyz-used and perhaps a different location.
You can now sell this used item to a new customer. Everything is traceable and your stock control is clear. The cost price of your new stock does not get confused. You can produce a price list showing new and used items for sale.