mht_brerp10
.adempiere
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
invoiceduedates(numeric)
Parameters
Name
Type
Mode
p_c_invoice_id
numeric
IN
Definition
/************************************************************************* * The contents of this file are subject to the Compiere License. You may * obtain a copy of the License at http://www.compiere.org/license.html * Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either * express or implied. See the License for details. Code: Compiere ERP+CRM * Copyright (C) 1999-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved. * * converted to postgreSQL by Karsten Thiemann (Schaeffer AG), * kthiemann@adempiere.org ************************************************************************* *** * Title: Get Invoice Due Dates in a text * Description: * - Get Invoice Due Dates in a text * Test: * select invoiceduedates(someinvoice) from ad_system; => 0 ************************************************************************/ DECLARE v_DueDates TEXT; BEGIN SELECT array_to_string(array_agg(to_char(oi.DueDate, 'dd/MM/yyyy')),', ') INTO v_DueDates FROM (SELECT C_Invoice_ID,DueDate FROM rv_openitem oi2 WHERE oi2.C_Invoice_ID = p_c_invoice_id AND IsSOTrx='Y' ORDER BY oi2.DueDate) oi GROUP BY oi.c_invoice_id; RETURN v_DueDates; EXCEPTION WHEN OTHERS THEN RETURN NULL; END;