Implement [ 1992542 ] Import Payment doesn't have DocAction parameter

This commit is contained in:
Carlos Ruiz 2008-06-13 01:56:07 +00:00
parent 3eaa98b04b
commit 499e03f066
3 changed files with 77 additions and 13 deletions

View File

@ -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. * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it * * 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 * * under the terms version 2 of the GNU General Public License as published *
@ -16,18 +16,27 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.process; package org.compiere.process;
import java.math.*; import java.math.BigDecimal;
import java.sql.*; import java.sql.PreparedStatement;
import java.util.*; import java.sql.ResultSet;
import java.util.logging.*; import java.util.Properties;
import org.compiere.model.*; import java.util.logging.Level;
import org.compiere.util.*;
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 * Import Payments
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id: ImportPayment.java,v 1.2 2006/07/30 00:51:01 jjanke Exp $ * @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 public class ImportPayment extends SvrProcess
{ {
@ -37,6 +46,8 @@ public class ImportPayment extends SvrProcess
private int p_C_BankAccount_ID = 0; private int p_C_BankAccount_ID = 0;
/** Delete old Imported */ /** Delete old Imported */
private boolean p_deleteOldImported = false; private boolean p_deleteOldImported = false;
/** Document Action */
private String m_docAction = null;
/** Properties */ /** Properties */
private Properties m_ctx; private Properties m_ctx;
@ -56,8 +67,8 @@ public class ImportPayment extends SvrProcess
p_C_BankAccount_ID = ((BigDecimal)para[i].getParameter()).intValue(); p_C_BankAccount_ID = ((BigDecimal)para[i].getParameter()).intValue();
else if (name.equals("DeleteOldImported")) else if (name.equals("DeleteOldImported"))
p_deleteOldImported = "Y".equals(para[i].getParameter()); p_deleteOldImported = "Y".equals(para[i].getParameter());
// else if (name.equals("DocAction")) else if (name.equals("DocAction"))
// m_docAction = (String)para[i].getParameter(); m_docAction = (String)para[i].getParameter();
else else
log.log(Level.SEVERE, "Unknown Parameter: " + name); log.log(Level.SEVERE, "Unknown Parameter: " + name);
} }
@ -65,7 +76,7 @@ public class ImportPayment extends SvrProcess
} // prepare } // prepare
/** /**
* Proccess * Process
* @return info * @return info
* @throws Exception * @throws Exception
*/ */
@ -402,9 +413,7 @@ public class ImportPayment extends SvrProcess
MBankAccount account = null; MBankAccount account = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
int lineNo = 10;
int noInsert = 0; int noInsert = 0;
int noInsertLine = 0;
try try
{ {
pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
@ -481,7 +490,7 @@ public class ImportPayment extends SvrProcess
payment.setOrig_TrxID(imp.getOrig_TrxID()); payment.setOrig_TrxID(imp.getOrig_TrxID());
payment.setVoiceAuthCode(imp.getVoiceAuthCode()); payment.setVoiceAuthCode(imp.getVoiceAuthCode());
// Save patment // Save payment
if (payment.save()) if (payment.save())
{ {
imp.setC_Payment_ID(payment.getC_Payment_ID()); imp.setC_Payment_ID(payment.getC_Payment_ID());
@ -489,6 +498,13 @@ public class ImportPayment extends SvrProcess
imp.setProcessed(true); imp.setProcessed(true);
imp.save(); imp.save();
noInsert++; noInsert++;
if (payment != null && m_docAction != null && m_docAction.length() > 0)
{
payment.setDocAction(m_docAction);
payment.processIt (m_docAction);
payment.save();
}
} }
} }

View File

@ -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
;

View File

@ -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
;