📄 c_payselectionline_trg.sql
字号:
CREATE OR REPLACE TRIGGER C_PaySelectionLine_Trg
AFTER DELETE OR INSERT OR UPDATE
ON C_PaySelectionLine
FOR EACH ROW
/*************************************************************************
* 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.
*************************************************************************
* $Id: C_PaySelectionLine_Trg.sql,v 1.2 2003/03/14 06:11:21 jjanke Exp $
***
* Title: Pay Selection Line changes
* Description:
* - Update PaySelection Amt
************************************************************************/
DECLARE
v_Amount C_PaySelection.TotalAmt%TYPE := 0;
v_ID C_PaySelection.C_PaySelection_ID%TYPE := 0;
BEGIN
IF (DELETING OR UPDATING) THEN
v_Amount := v_Amount - :old.PayAmt;
v_ID := :old.C_PaySelection_ID;
END IF;
IF (INSERTING OR UPDATING) THEN
v_Amount := v_Amount + :new.PayAmt;
v_ID := :new.C_PaySelection_ID;
END IF;
-- Update Header
UPDATE C_PaySelection
SET TotalAmt = TotalAmt + v_Amount
WHERE C_PaySelection_ID = v_ID;
END C_PaySelectionLine;
/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -