From 499e03f0660748a13d264ed9e89f53da25cb48f6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 13 Jun 2008 01:56:07 +0000 Subject: [PATCH] Implement [ 1992542 ] Import Payment doesn't have DocAction parameter --- .../org/compiere/process/ImportPayment.java | 42 +++++++++++++------ migration/351a-trunk/201_FR1992542.sql | 24 +++++++++++ .../351a-trunk/postgresql/201_FR1992542.sql | 24 +++++++++++ 3 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 migration/351a-trunk/201_FR1992542.sql create mode 100644 migration/351a-trunk/postgresql/201_FR1992542.sql diff --git a/base/src/org/compiere/process/ImportPayment.java b/base/src/org/compiere/process/ImportPayment.java index 0d377c800c..97df1ffaa6 100644 --- a/base/src/org/compiere/process/ImportPayment.java +++ b/base/src/org/compiere/process/ImportPayment.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * + * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * @@ -16,18 +16,27 @@ *****************************************************************************/ package org.compiere.process; -import java.math.*; -import java.sql.*; -import java.util.*; -import java.util.logging.*; -import org.compiere.model.*; -import org.compiere.util.*; +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.model.MBankAccount; +import org.compiere.model.MPayment; +import org.compiere.model.X_I_Payment; +import org.compiere.util.AdempiereUserError; +import org.compiere.util.DB; +import org.compiere.util.Env; /** * Import Payments * * @author Jorg Janke * @version $Id: ImportPayment.java,v 1.2 2006/07/30 00:51:01 jjanke Exp $ + * + * Contributor(s): + * Carlos Ruiz - globalqss - FR [ 1992542 ] Import Payment doesn't have DocAction parameter */ public class ImportPayment extends SvrProcess { @@ -37,6 +46,8 @@ public class ImportPayment extends SvrProcess private int p_C_BankAccount_ID = 0; /** Delete old Imported */ private boolean p_deleteOldImported = false; + /** Document Action */ + private String m_docAction = null; /** Properties */ private Properties m_ctx; @@ -56,8 +67,8 @@ public class ImportPayment extends SvrProcess p_C_BankAccount_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("DeleteOldImported")) p_deleteOldImported = "Y".equals(para[i].getParameter()); - // else if (name.equals("DocAction")) - // m_docAction = (String)para[i].getParameter(); + else if (name.equals("DocAction")) + m_docAction = (String)para[i].getParameter(); else log.log(Level.SEVERE, "Unknown Parameter: " + name); } @@ -65,7 +76,7 @@ public class ImportPayment extends SvrProcess } // prepare /** - * Proccess + * Process * @return info * @throws Exception */ @@ -402,9 +413,7 @@ public class ImportPayment extends SvrProcess MBankAccount account = null; PreparedStatement pstmt = null; - int lineNo = 10; int noInsert = 0; - int noInsertLine = 0; try { pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); @@ -481,7 +490,7 @@ public class ImportPayment extends SvrProcess payment.setOrig_TrxID(imp.getOrig_TrxID()); payment.setVoiceAuthCode(imp.getVoiceAuthCode()); - // Save patment + // Save payment if (payment.save()) { imp.setC_Payment_ID(payment.getC_Payment_ID()); @@ -489,6 +498,13 @@ public class ImportPayment extends SvrProcess imp.setProcessed(true); imp.save(); noInsert++; + + if (payment != null && m_docAction != null && m_docAction.length() > 0) + { + payment.setDocAction(m_docAction); + payment.processIt (m_docAction); + payment.save(); + } } } diff --git a/migration/351a-trunk/201_FR1992542.sql b/migration/351a-trunk/201_FR1992542.sql new file mode 100644 index 0000000000..69132f4ef0 --- /dev/null +++ b/migration/351a-trunk/201_FR1992542.sql @@ -0,0 +1,24 @@ +-- Jun 12, 2008 7:57:23 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +UPDATE AD_Process_Para SET SeqNo=40,Updated=TO_DATE('2008-06-12 19:57:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=712 +; + +-- Jun 12, 2008 7:58:40 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +INSERT INTO AD_Process_Para (FieldLength,UpdatedBy,ColumnName,AD_Org_ID,AD_Process_Para_ID,SeqNo,Updated,Help,DefaultValue,Created,IsCentrallyMaintained,AD_Process_ID,AD_Client_ID,IsRange,AD_Reference_ID,EntityType,AD_Val_Rule_ID,Name,CreatedBy,IsMandatory,AD_Reference_Value_ID,IsActive,AD_Element_ID,Description) VALUES (1,100,'DocAction',0,53177,30,TO_DATE('2008-06-12 19:58:39','YYYY-MM-DD HH24:MI:SS'),'You find the current status in the Document Status field. The options are listed in a popup','PR',TO_DATE('2008-06-12 19:58:39','YYYY-MM-DD HH24:MI:SS'),'Y',343,0,'N',17,'D',219,'Document Action',100,'N',135,'Y',287,'The targeted status of the document') +; + +-- Jun 12, 2008 7:58:40 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53177 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID) +; + +-- Jun 12, 2008 8:32:52 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +INSERT INTO AD_Val_Rule (UpdatedBy,Code,AD_Org_ID,Updated,Type,Created,AD_Client_ID,EntityType,AD_Val_Rule_ID,Name,CreatedBy,IsActive) VALUES (100,'AD_Ref_List.Value IN (''CO'')',0,TO_DATE('2008-06-12 20:32:50','YYYY-MM-DD HH24:MI:SS'),'S',TO_DATE('2008-06-12 20:32:50','YYYY-MM-DD HH24:MI:SS'),0,'D',52027,'List - DocAction - Complete',100,'Y') +; + +-- Jun 12, 2008 8:33:09 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +UPDATE AD_Process_Para SET DefaultValue=NULL, AD_Val_Rule_ID=52027,Updated=TO_DATE('2008-06-12 20:33:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53177 +; diff --git a/migration/351a-trunk/postgresql/201_FR1992542.sql b/migration/351a-trunk/postgresql/201_FR1992542.sql new file mode 100644 index 0000000000..3c6e9bfd12 --- /dev/null +++ b/migration/351a-trunk/postgresql/201_FR1992542.sql @@ -0,0 +1,24 @@ +-- Jun 12, 2008 7:57:23 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +UPDATE AD_Process_Para SET SeqNo=40,Updated=TO_TIMESTAMP('2008-06-12 19:57:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=712 +; + +-- Jun 12, 2008 7:58:40 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +INSERT INTO AD_Process_Para (FieldLength,UpdatedBy,ColumnName,AD_Org_ID,AD_Process_Para_ID,SeqNo,Updated,Help,DefaultValue,Created,IsCentrallyMaintained,AD_Process_ID,AD_Client_ID,IsRange,AD_Reference_ID,EntityType,AD_Val_Rule_ID,Name,CreatedBy,IsMandatory,AD_Reference_Value_ID,IsActive,AD_Element_ID,Description) VALUES (1,100,'DocAction',0,53177,30,TO_TIMESTAMP('2008-06-12 19:58:39','YYYY-MM-DD HH24:MI:SS'),'You find the current status in the Document Status field. The options are listed in a popup','PR',TO_TIMESTAMP('2008-06-12 19:58:39','YYYY-MM-DD HH24:MI:SS'),'Y',343,0,'N',17,'D',219,'Document Action',100,'N',135,'Y',287,'The targeted status of the document') +; + +-- Jun 12, 2008 7:58:40 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53177 AND EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_Para_ID!=t.AD_Process_Para_ID) +; + +-- Jun 12, 2008 8:32:52 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +INSERT INTO AD_Val_Rule (UpdatedBy,Code,AD_Org_ID,Updated,Type,Created,AD_Client_ID,EntityType,AD_Val_Rule_ID,Name,CreatedBy,IsActive) VALUES (100,'AD_Ref_List.Value IN (''CO'')',0,TO_TIMESTAMP('2008-06-12 20:32:50','YYYY-MM-DD HH24:MI:SS'),'S',TO_TIMESTAMP('2008-06-12 20:32:50','YYYY-MM-DD HH24:MI:SS'),0,'D',52027,'List - DocAction - Complete',100,'Y') +; + +-- Jun 12, 2008 8:33:09 PM COT +-- FR 1992542 - Import Payment doesn't have DocAction parameter +UPDATE AD_Process_Para SET DefaultValue=NULL, AD_Val_Rule_ID=52027,Updated=TO_TIMESTAMP('2008-06-12 20:33:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53177 +;