mht_brerp10
.adempiere
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
cof_qtyfiscalbyorg(numeric, numeric)
Parameters
Name
Type
Mode
product_id
numeric
IN
org_id
numeric
IN
Definition
DECLARE Quantity NUMERIC := 0; begin SELECT coalesce(sum(f.det_prod_qcom),0) AS QtyOnHand into Quantity 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 in (0, org_id) group by s.qtyonhand; IF (Quantity IS NULL) THEN Quantity := 0; END IF; RETURN Quantity; END