The following where
clause does not do what you expect:
WHERE sh2.veh_id = veh_id AND sh2.status_date <= status_date
It is doing:
WHERE sh2.veh_id = sh2.veh_id AND sh2.status_date <= sh2.status_date
It is not plugging in the variables. This is because of the scoping rules of SQL, that first looks for matching column names before looking for variable names. The right fix is to prefix the parameters and variables with something that distinguishes them from column names.
CREATE OR REPLACE FUNCTION is_inventory (
v_veh_id NUMBER,
v_status_date DATE) RETURN NUMBER IS
v_cnt number;
BEGIN
. . .