⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datafixes.sql

📁 Java写的ERP系统
💻 SQL
字号:
/*************************************************************************
 * 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-2003 Jorg Janke, ComPiere, Inc. All Rights Reserved.
 *************************************************************************
 * $Id: datafixes.sql,v 1.2 2003/03/14 06:11:22 jjanke Exp $
 ***
 * Title:	Data Fixes
 * Description:
 ************************************************************************/

--	Set Receipt in Payment
UPDATE C_Payment p
  SET IsReceipt = (SELECT CASE DocBaseType WHEN 'ARR' THEN 'Y' ELSE 'N' END
	FROM C_DocType dt WHERE p.C_DocType_ID=dt.C_DocType_ID)
WHERE IsReceipt <> (SELECT	CASE DocBaseType WHEN 'ARR' THEN 'Y' ELSE 'N' END
	FROM C_DocType dt WHERE p.C_DocType_ID=dt.C_DocType_ID)
/
--	Set Default
UPDATE C_Payment
  SET OverUnderAmt = 0
WHERE OverUnderAmt IS NULL
/

--	Fix TotalAmount
UPDATE	C_PaySelection ps
  SET	TotalAmt = (SELECT COALESCE(SUM(PayAmt),0) FROM C_PaySelectionLine psl
	WHERE ps.C_PaySelection_ID = psl.C_PaySelection_ID)
/


COMMIT
/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -