mht_brerp10
.adempiere
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
cof_linhassemfiscal(numeric)
Parameters
Name
Type
Mode
order_id
numeric
IN
Definition
DECLARE QtyLinhasSemFiscal NUMERIC := 0; begin SELECT SUM(CASE WHEN cof_qtyfiscal(ol.m_product_id, ol.m_warehouse_id)-ol.qtyentered < 0 THEN 1 ELSE 0 END) AS LinhasSemFiscal into QtyLinhasSemFiscal FROM c_order o LEFT JOIN c_orderline ol on ol.c_order_id = o.c_order_id WHERE o.c_order_id = order_id; IF (QtyLinhasSemFiscal IS NULL) THEN QtyLinhasSemFiscal := 0; END IF; RETURN QtyLinhasSemFiscal; END