Item valuation rate

Hi guys,

Is there a easy way in ERPNext code to get current Item valuation rate ?
I have checked but it still seems quite complicated.

My situation is that sometimes, the Customer have Sales Return of defect products.
These does not go to any warehouse but rather will be discarded.
Therefore, what will record is only a Credit Note and I need to get the Item Valuation to generate that.

Many Thanks

please check at Bin table …
see this thread Valuation ratelocation in database

Thank you! Actually in there is a get_valuation_rate function I think I can use that as well