Stock Ledger get_valuation_rate query question?

Hello All,

I’m confused reading through the get_valuation_rate method. I’m trying to understand why this method takes parameters voucher_type and voucher_no but the SQL condition is checking that the stock ledger does not equal the specified voucher_type and voucher no.

My thought when I read this method name is that it’s purpose is to get the valuation rate for the specified item for the specified voucher. But it does not, it ignores the voucher and just gets the last valuation rate for that item.

Basically I want to know why we want to ignore the specified voucher type and voucher no in the query?