update CUX_DOC_YSJH_HEADERS set amount= nvl(:header.amount_dis,:header.amount), base_amount = nvl(:header.base_amount_dis,:header.base_amount) where header_id=:header.header_id;
头块: POST-QUERY: SELECT nvl(SUM(AMOUNT),0),SUM(BASE_AMOUNT) INTO :HEADER.AMOUNT_dis,:HEADER.BASE_AMOUNT_dis FROM CUX_DOC_YSJH_LINES t WHERE t.header_id = :HEADER.header_id;
:HEADER.AMOUNT_dis_RTOT_DB:=:HEADER.AMOUNT_dis; :HEADER.BASE_AMOUNT_dis_RTOT_DB:=:HEADER.BASE_AMOUNT_dis; IF nvl(:PARAMETER.CUX_QUERY_ONLY,‘NO‘) = ‘YES‘ THEN set_block_property(‘header‘,QUERY_ALLOWED , PROPERTY_FALSE); END IF;
程序单元: PROCEDURE running_total(event VARCHAR2) IS BEGIN app_calculate.running_total(event,‘lines.amount_dis‘,‘header.amount_dis‘); app_calculate.running_total(event,‘lines.base_amount_dis‘,‘header.base_amount_dis‘); END running_total;
PROCEDURE CHECK_LINES_DATE IS L_CNT NUMBER; L_CNT_F NUMBER; --统计是否有<0的对应发票 L_TYPE_ID varchar2(50); BEGIN SELECT COUNT(1) into l_cnt FROM (SELECT cdl.type_id, COUNT(*) cnt --INTO l_type_id, l_cnt FROM cux_doc_ysjh_lines cdl, cux_doc_ysjh_headers cdh WHERE cdh.header_id = cdl.header_id AND nvl(cdl.attribute2, ‘Y‘) = ‘N‘ --是否允许新增标识 AND cdh.header_id = :header.header_id GROUP BY cdl.type_id having COUNT(*)>1);
IF L_CNT >= 1 THEN :HEADER.STATUS_DESC := ‘新建‘; :HEADER.STATUS :=‘INCOMPLETE‘; FND_MESSAGE.CLEAR; FND_MESSAGE.SET_STRING(‘付款编码不允许有重复行录入.‘); FND_MESSAGE.ERROR; RAISE FORM_TRIGGER_FAILURE; END IF;