2 CREATE OR REPLACE FUNCTION toggleBankrecCleared(INTEGER, TEXT, INTEGER) RETURNS BOOLEAN AS $$
3 -- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
4 -- See www.xtuple.com/CPAL for the full text of the software license.
6 pBankrecid ALIAS FOR $1;
8 pSourceid ALIAS FOR $3;
11 RETURN toggleBankrecCleared(pBankrecid, pSource, pSourceid, NULL, NULL, NULL);
13 $$ LANGUAGE 'plpgsql';
15 CREATE OR REPLACE FUNCTION toggleBankrecCleared(INTEGER, TEXT, INTEGER, NUMERIC, NUMERIC, DATE) RETURNS BOOLEAN AS $$
16 -- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
17 -- See www.xtuple.com/CPAL for the full text of the software license.
19 pBankrecid ALIAS FOR $1;
21 pSourceid ALIAS FOR $3;
22 pCurrrate ALIAS FOR $4;
29 SELECT bankrecitem_id, bankrecitem_cleared INTO _r
31 WHERE ( (bankrecitem_bankrec_id=pBankrecid)
32 AND (bankrecitem_source=pSource)
33 AND (bankrecitem_source_id=pSourceid) );
36 INSERT INTO bankrecitem
37 (bankrecitem_bankrec_id, bankrecitem_source,
38 bankrecitem_source_id, bankrecitem_cleared,
39 bankrecitem_curr_rate, bankrecitem_amount,
48 DELETE FROM bankrecitem
49 WHERE bankrecitem_id = _r.bankrecitem_id;
54 $$ LANGUAGE 'plpgsql';