FR [ 2788074 ] ImportBPartner: add IsValidateOnly option

https://sourceforge.net/tracker/?func=detail&aid=2788074&group_id=176962&atid=879335
This commit is contained in:
teo_sarca 2009-05-07 09:05:34 +00:00
parent 5acf0b8d7b
commit b79597305a
3 changed files with 32 additions and 0 deletions

View File

@ -37,6 +37,10 @@ import org.compiere.util.DB;
*
* @author Jorg Janke
* @version $Id: ImportBPartner.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $
*
* @author Teo Sarca, www.arhipac.ro
* <li>FR [ 2788074 ] ImportBPartner: add IsValidateOnly option
* https://sourceforge.net/tracker/?func=detail&aid=2788074&group_id=176962&atid=879335
*/
public class ImportBPartner extends SvrProcess
{
@ -44,6 +48,8 @@ public class ImportBPartner extends SvrProcess
private int m_AD_Client_ID = 0;
/** Delete old Imported */
private boolean m_deleteOldImported = false;
/** Only validate, don't import */
private boolean p_IsValidateOnly = false;
/** Effective */
private Timestamp m_DateValue = null;
@ -61,6 +67,8 @@ public class ImportBPartner extends SvrProcess
m_AD_Client_ID = ((BigDecimal)para[i].getParameter()).intValue();
else if (name.equals("DeleteOldImported"))
m_deleteOldImported = "Y".equals(para[i].getParameter());
else if (name.equals("IsValidateOnly"))
p_IsValidateOnly = para[i].getParameterAsBoolean();
else
log.log(Level.SEVERE, "Unknown Parameter: " + name);
}
@ -258,6 +266,10 @@ public class ImportBPartner extends SvrProcess
log.config("Value is mandatory=" + no);
commit();
if (p_IsValidateOnly)
{
return "Validated";
}
// -------------------------------------------------------------------
int noInsert = 0;
int noUpdate = 0;

View File

@ -0,0 +1,10 @@
-- 06.05.2009 23:57:08 EEST
-- -
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,Updated,IsActive,Created,UpdatedBy,AD_Org_ID,CreatedBy,FieldLength,Name,IsCentrallyMaintained,IsRange,Description,AD_Process_ID,EntityType,ColumnName,IsMandatory,SeqNo,AD_Reference_ID,AD_Element_ID,DefaultValue) VALUES (53312,0,TO_DATE('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),'Y',TO_DATE('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),0,0,0,1,'Only Validate Data','Y','N','Validate the date and do not process',194,'D','IsValidateOnly','Y',30,20,2168,'N')
;
-- 06.05.2009 23:57:08 EEST
-- -
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Name,Description,Help, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Name,t.Description,t.Help, '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=53312 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)
;

View File

@ -0,0 +1,10 @@
-- 06.05.2009 23:57:08 EEST
-- -
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,Updated,IsActive,Created,UpdatedBy,AD_Org_ID,CreatedBy,FieldLength,Name,IsCentrallyMaintained,IsRange,Description,AD_Process_ID,EntityType,ColumnName,IsMandatory,SeqNo,AD_Reference_ID,AD_Element_ID,DefaultValue) VALUES (53312,0,TO_TIMESTAMP('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),'Y',TO_TIMESTAMP('2009-05-06 23:57:07','YYYY-MM-DD HH24:MI:SS'),0,0,0,1,'Only Validate Data','Y','N','Validate the date and do not process',194,'D','IsValidateOnly','Y',30,20,2168,'N')
;
-- 06.05.2009 23:57:08 EEST
-- -
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Name,Description,Help, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Name,t.Description,t.Help, '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=53312 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)
;