mht_brerp10
.adempiere
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
cof_valormedioprod(numeric, numeric)
Parameters
Name
Type
Mode
product_id
numeric
IN
org_id
numeric
IN
Definition
DECLARE Price NUMERIC := 0; begin SELECT coalesce(sum(f.det_prod_vuncom*f.det_prod_qcom),0)/sum(det_prod_qcom) AS Price into Price from COF_TransacoesFiscais f left join m_storage s on s.m_product_id = product_id where f.m_product_id = product_id and f.ad_org_id = org_id and ide_tpnf = '0'; IF (Price IS NULL) THEN Price := 0; END IF; RETURN Price; END