Commits

Jesus Garcia committed 738ddca

Starting point for LEC Electronic Invoice on 361_maintenance (as extension for 361, to be pluginized on iDempiere)

  • Participants
  • Parent commits 75d8c56
  • Branches 361_maintenance

Comments (0)

Files changed (8)

File org.globalqss.idempiere.LEC.electronicinvoice/.classpath

+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry combineaccessrules="false" kind="src" path="/LCO_360"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/patches_360"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/adempiere360lts"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

File org.globalqss.idempiere.LEC.electronicinvoice/.project

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.globalqss.idempiere.LEC.electronicinvoice</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

File org.globalqss.idempiere.LEC.electronicinvoice/src/org/compiere/model/I_I_SRI_AccessCode.java

+/******************************************************************************
+ * Product: Adempiere ERP & CRM Smart Business Solution                       *
+ * Copyright (C) 1999-2007 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   *
+ * by the Free Software Foundation. This program is distributed in the hope   *
+ * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
+ * See the GNU General Public License for more details.                       *
+ * You should have received a copy of the GNU General Public License along    *
+ * with this program, if not, write to the Free Software Foundation, Inc.,    *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
+ * For the text or an alternative of this public license, you may reach us    *
+ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
+ * or via info@compiere.org or http://www.compiere.org/license.html           *
+ *****************************************************************************/
+package org.compiere.model;
+
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import org.compiere.util.KeyNamePair;
+
+/** Generated Interface for I_SRI_AccessCode
+ *  @author Adempiere (generated) 
+ *  @version 3.6.1LTS.Final
+ */
+public interface I_I_SRI_AccessCode 
+{
+
+    /** TableName=I_SRI_AccessCode */
+    public static final String Table_Name = "I_SRI_AccessCode";
+
+    /** AD_Table_ID=1000134 */
+    public static final int Table_ID = MTable.getTable_ID(Table_Name);
+
+    KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
+
+    /** AccessLevel = 3 - Client - Org 
+     */
+    BigDecimal accessLevel = BigDecimal.valueOf(3);
+
+    /** Load Meta Data */
+
+    /** Column name AD_Client_ID */
+    public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
+
+	/** Get Client.
+	  * Client/Tenant for this installation.
+	  */
+	public int getAD_Client_ID();
+
+    /** Column name AD_Org_ID */
+    public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
+
+	/** Set Organization.
+	  * Organizational entity within client
+	  */
+	public void setAD_Org_ID (int AD_Org_ID);
+
+	/** Get Organization.
+	  * Organizational entity within client
+	  */
+	public int getAD_Org_ID();
+
+    /** Column name Created */
+    public static final String COLUMNNAME_Created = "Created";
+
+	/** Get Created.
+	  * Date this record was created
+	  */
+	public Timestamp getCreated();
+
+    /** Column name CreatedBy */
+    public static final String COLUMNNAME_CreatedBy = "CreatedBy";
+
+	/** Get Created By.
+	  * User who created this records
+	  */
+	public int getCreatedBy();
+
+    /** Column name I_ErrorMsg */
+    public static final String COLUMNNAME_I_ErrorMsg = "I_ErrorMsg";
+
+	/** Set Import Error Message.
+	  * Messages generated from import process
+	  */
+	public void setI_ErrorMsg (String I_ErrorMsg);
+
+	/** Get Import Error Message.
+	  * Messages generated from import process
+	  */
+	public String getI_ErrorMsg();
+
+    /** Column name I_IsImported */
+    public static final String COLUMNNAME_I_IsImported = "I_IsImported";
+
+	/** Set Imported.
+	  * Has this import been processed
+	  */
+	public void setI_IsImported (boolean I_IsImported);
+
+	/** Get Imported.
+	  * Has this import been processed
+	  */
+	public boolean isI_IsImported();
+
+    /** Column name I_SRI_AccessCode_ID */
+    public static final String COLUMNNAME_I_SRI_AccessCode_ID = "I_SRI_AccessCode_ID";
+
+	/** Set I_SRI_AccessCode	  */
+	public void setI_SRI_AccessCode_ID (int I_SRI_AccessCode_ID);
+
+	/** Get I_SRI_AccessCode	  */
+	public int getI_SRI_AccessCode_ID();
+
+    /** Column name IsActive */
+    public static final String COLUMNNAME_IsActive = "IsActive";
+
+	/** Set Active.
+	  * The record is active in the system
+	  */
+	public void setIsActive (boolean IsActive);
+
+	/** Get Active.
+	  * The record is active in the system
+	  */
+	public boolean isActive();
+
+    /** Column name Processed */
+    public static final String COLUMNNAME_Processed = "Processed";
+
+	/** Set Processed.
+	  * The document has been processed
+	  */
+	public void setProcessed (boolean Processed);
+
+	/** Get Processed.
+	  * The document has been processed
+	  */
+	public boolean isProcessed();
+
+    /** Column name Processing */
+    public static final String COLUMNNAME_Processing = "Processing";
+
+	/** Set Process Now	  */
+	public void setProcessing (boolean Processing);
+
+	/** Get Process Now	  */
+	public boolean isProcessing();
+
+    /** Column name Updated */
+    public static final String COLUMNNAME_Updated = "Updated";
+
+	/** Get Updated.
+	  * Date this record was updated
+	  */
+	public Timestamp getUpdated();
+
+    /** Column name UpdatedBy */
+    public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
+
+	/** Get Updated By.
+	  * User who updated this records
+	  */
+	public int getUpdatedBy();
+
+    /** Column name Value */
+    public static final String COLUMNNAME_Value = "Value";
+
+	/** Set Search Key.
+	  * Search key for the record in the format required - must be unique
+	  */
+	public void setValue (String Value);
+
+	/** Get Search Key.
+	  * Search key for the record in the format required - must be unique
+	  */
+	public String getValue();
+}

File org.globalqss.idempiere.LEC.electronicinvoice/src/org/compiere/model/I_SRI_AccessCode.java

+/******************************************************************************
+ * Product: Adempiere ERP & CRM Smart Business Solution                       *
+ * Copyright (C) 1999-2007 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   *
+ * by the Free Software Foundation. This program is distributed in the hope   *
+ * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
+ * See the GNU General Public License for more details.                       *
+ * You should have received a copy of the GNU General Public License along    *
+ * with this program, if not, write to the Free Software Foundation, Inc.,    *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
+ * For the text or an alternative of this public license, you may reach us    *
+ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
+ * or via info@compiere.org or http://www.compiere.org/license.html           *
+ *****************************************************************************/
+package org.compiere.model;
+
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import org.compiere.util.KeyNamePair;
+
+/** Generated Interface for SRI_AccessCode
+ *  @author Adempiere (generated) 
+ *  @version 3.6.1LTS.Final
+ */
+public interface I_SRI_AccessCode 
+{
+
+    /** TableName=SRI_AccessCode */
+    public static final String Table_Name = "SRI_AccessCode";
+
+    /** AD_Table_ID=1000135 */
+    public static final int Table_ID = MTable.getTable_ID(Table_Name);
+
+    KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
+
+    /** AccessLevel = 3 - Client - Org 
+     */
+    BigDecimal accessLevel = BigDecimal.valueOf(3);
+
+    /** Load Meta Data */
+
+    /** Column name AD_Client_ID */
+    public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
+
+	/** Get Client.
+	  * Client/Tenant for this installation.
+	  */
+	public int getAD_Client_ID();
+
+    /** Column name AD_Org_ID */
+    public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
+
+	/** Set Organization.
+	  * Organizational entity within client
+	  */
+	public void setAD_Org_ID (int AD_Org_ID);
+
+	/** Get Organization.
+	  * Organizational entity within client
+	  */
+	public int getAD_Org_ID();
+
+    /** Column name CodeAccessType */
+    public static final String COLUMNNAME_CodeAccessType = "CodeAccessType";
+
+	/** Set CodeAccessType	  */
+	public void setCodeAccessType (String CodeAccessType);
+
+	/** Get CodeAccessType	  */
+	public String getCodeAccessType();
+
+    /** Column name Created */
+    public static final String COLUMNNAME_Created = "Created";
+
+	/** Get Created.
+	  * Date this record was created
+	  */
+	public Timestamp getCreated();
+
+    /** Column name CreatedBy */
+    public static final String COLUMNNAME_CreatedBy = "CreatedBy";
+
+	/** Get Created By.
+	  * User who created this records
+	  */
+	public int getCreatedBy();
+
+    /** Column name EnvType */
+    public static final String COLUMNNAME_EnvType = "EnvType";
+
+	/** Set EnvType	  */
+	public void setEnvType (String EnvType);
+
+	/** Get EnvType	  */
+	public String getEnvType();
+
+    /** Column name IsActive */
+    public static final String COLUMNNAME_IsActive = "IsActive";
+
+	/** Set Active.
+	  * The record is active in the system
+	  */
+	public void setIsActive (boolean IsActive);
+
+	/** Get Active.
+	  * The record is active in the system
+	  */
+	public boolean isActive();
+
+    /** Column name IsUsed */
+    public static final String COLUMNNAME_IsUsed = "IsUsed";
+
+	/** Set IsUsed	  */
+	public void setIsUsed (boolean IsUsed);
+
+	/** Get IsUsed	  */
+	public boolean isUsed();
+
+    /** Column name OldValue */
+    public static final String COLUMNNAME_OldValue = "OldValue";
+
+	/** Set Old Value.
+	  * The old file data
+	  */
+	public void setOldValue (String OldValue);
+
+	/** Get Old Value.
+	  * The old file data
+	  */
+	public String getOldValue();
+
+    /** Column name SRI_AccessCode_ID */
+    public static final String COLUMNNAME_SRI_AccessCode_ID = "SRI_AccessCode_ID";
+
+	/** Set SRI_AccessCode	  */
+	public void setSRI_AccessCode_ID (int SRI_AccessCode_ID);
+
+	/** Get SRI_AccessCode	  */
+	public int getSRI_AccessCode_ID();
+
+    /** Column name SRI_ShortDocType */
+    public static final String COLUMNNAME_SRI_ShortDocType = "SRI_ShortDocType";
+
+	/** Set SRI_ShortDocType	  */
+	public void setSRI_ShortDocType (String SRI_ShortDocType);
+
+	/** Get SRI_ShortDocType	  */
+	public String getSRI_ShortDocType();
+
+    /** Column name Updated */
+    public static final String COLUMNNAME_Updated = "Updated";
+
+	/** Get Updated.
+	  * Date this record was updated
+	  */
+	public Timestamp getUpdated();
+
+    /** Column name UpdatedBy */
+    public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
+
+	/** Get Updated By.
+	  * User who updated this records
+	  */
+	public int getUpdatedBy();
+
+    /** Column name Value */
+    public static final String COLUMNNAME_Value = "Value";
+
+	/** Set Search Key.
+	  * Search key for the record in the format required - must be unique
+	  */
+	public void setValue (String Value);
+
+	/** Get Search Key.
+	  * Search key for the record in the format required - must be unique
+	  */
+	public String getValue();
+}

File org.globalqss.idempiere.LEC.electronicinvoice/src/org/compiere/model/X_I_SRI_AccessCode.java

+/******************************************************************************
+ * Product: Adempiere ERP & CRM Smart Business Solution                       *
+ * Copyright (C) 1999-2007 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   *
+ * by the Free Software Foundation. This program is distributed in the hope   *
+ * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
+ * See the GNU General Public License for more details.                       *
+ * You should have received a copy of the GNU General Public License along    *
+ * with this program, if not, write to the Free Software Foundation, Inc.,    *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
+ * For the text or an alternative of this public license, you may reach us    *
+ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
+ * or via info@compiere.org or http://www.compiere.org/license.html           *
+ *****************************************************************************/
+/** Generated Model - DO NOT CHANGE */
+package org.compiere.model;
+
+import java.sql.ResultSet;
+import java.util.Properties;
+
+/** Generated Model for I_SRI_AccessCode
+ *  @author Adempiere (generated) 
+ *  @version 3.6.1LTS.Final - $Id$ */
+public class X_I_SRI_AccessCode extends PO implements I_I_SRI_AccessCode, I_Persistent 
+{
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = 20140429L;
+
+    /** Standard Constructor */
+    public X_I_SRI_AccessCode (Properties ctx, int I_SRI_AccessCode_ID, String trxName)
+    {
+      super (ctx, I_SRI_AccessCode_ID, trxName);
+      /** if (I_SRI_AccessCode_ID == 0)
+        {
+			setI_IsImported (false);
+			setI_SRI_AccessCode_ID (0);
+        } */
+    }
+
+    /** Load Constructor */
+    public X_I_SRI_AccessCode (Properties ctx, ResultSet rs, String trxName)
+    {
+      super (ctx, rs, trxName);
+    }
+
+    /** AccessLevel
+      * @return 3 - Client - Org 
+      */
+    protected int get_AccessLevel()
+    {
+      return accessLevel.intValue();
+    }
+
+    /** Load Meta Data */
+    protected POInfo initPO (Properties ctx)
+    {
+      POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
+      return poi;
+    }
+
+    public String toString()
+    {
+      StringBuffer sb = new StringBuffer ("X_I_SRI_AccessCode[")
+        .append(get_ID()).append("]");
+      return sb.toString();
+    }
+
+	/** Set Import Error Message.
+		@param I_ErrorMsg 
+		Messages generated from import process
+	  */
+	public void setI_ErrorMsg (String I_ErrorMsg)
+	{
+		set_Value (COLUMNNAME_I_ErrorMsg, I_ErrorMsg);
+	}
+
+	/** Get Import Error Message.
+		@return Messages generated from import process
+	  */
+	public String getI_ErrorMsg () 
+	{
+		return (String)get_Value(COLUMNNAME_I_ErrorMsg);
+	}
+
+	/** Set Imported.
+		@param I_IsImported 
+		Has this import been processed
+	  */
+	public void setI_IsImported (boolean I_IsImported)
+	{
+		set_Value (COLUMNNAME_I_IsImported, Boolean.valueOf(I_IsImported));
+	}
+
+	/** Get Imported.
+		@return Has this import been processed
+	  */
+	public boolean isI_IsImported () 
+	{
+		Object oo = get_Value(COLUMNNAME_I_IsImported);
+		if (oo != null) 
+		{
+			 if (oo instanceof Boolean) 
+				 return ((Boolean)oo).booleanValue(); 
+			return "Y".equals(oo);
+		}
+		return false;
+	}
+
+	/** Set I_SRI_AccessCode.
+		@param I_SRI_AccessCode_ID I_SRI_AccessCode	  */
+	public void setI_SRI_AccessCode_ID (int I_SRI_AccessCode_ID)
+	{
+		if (I_SRI_AccessCode_ID < 1) 
+			set_ValueNoCheck (COLUMNNAME_I_SRI_AccessCode_ID, null);
+		else 
+			set_ValueNoCheck (COLUMNNAME_I_SRI_AccessCode_ID, Integer.valueOf(I_SRI_AccessCode_ID));
+	}
+
+	/** Get I_SRI_AccessCode.
+		@return I_SRI_AccessCode	  */
+	public int getI_SRI_AccessCode_ID () 
+	{
+		Integer ii = (Integer)get_Value(COLUMNNAME_I_SRI_AccessCode_ID);
+		if (ii == null)
+			 return 0;
+		return ii.intValue();
+	}
+
+	/** Set Processed.
+		@param Processed 
+		The document has been processed
+	  */
+	public void setProcessed (boolean Processed)
+	{
+		set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
+	}
+
+	/** Get Processed.
+		@return The document has been processed
+	  */
+	public boolean isProcessed () 
+	{
+		Object oo = get_Value(COLUMNNAME_Processed);
+		if (oo != null) 
+		{
+			 if (oo instanceof Boolean) 
+				 return ((Boolean)oo).booleanValue(); 
+			return "Y".equals(oo);
+		}
+		return false;
+	}
+
+	/** Set Process Now.
+		@param Processing Process Now	  */
+	public void setProcessing (boolean Processing)
+	{
+		set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
+	}
+
+	/** Get Process Now.
+		@return Process Now	  */
+	public boolean isProcessing () 
+	{
+		Object oo = get_Value(COLUMNNAME_Processing);
+		if (oo != null) 
+		{
+			 if (oo instanceof Boolean) 
+				 return ((Boolean)oo).booleanValue(); 
+			return "Y".equals(oo);
+		}
+		return false;
+	}
+
+	/** Set Search Key.
+		@param Value 
+		Search key for the record in the format required - must be unique
+	  */
+	public void setValue (String Value)
+	{
+		set_Value (COLUMNNAME_Value, Value);
+	}
+
+	/** Get Search Key.
+		@return Search key for the record in the format required - must be unique
+	  */
+	public String getValue () 
+	{
+		return (String)get_Value(COLUMNNAME_Value);
+	}
+}

File org.globalqss.idempiere.LEC.electronicinvoice/src/org/compiere/model/X_SRI_AccessCode.java

+/******************************************************************************
+ * Product: Adempiere ERP & CRM Smart Business Solution                       *
+ * Copyright (C) 1999-2007 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   *
+ * by the Free Software Foundation. This program is distributed in the hope   *
+ * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
+ * See the GNU General Public License for more details.                       *
+ * You should have received a copy of the GNU General Public License along    *
+ * with this program, if not, write to the Free Software Foundation, Inc.,    *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
+ * For the text or an alternative of this public license, you may reach us    *
+ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
+ * or via info@compiere.org or http://www.compiere.org/license.html           *
+ *****************************************************************************/
+/** Generated Model - DO NOT CHANGE */
+package org.compiere.model;
+
+import java.sql.ResultSet;
+import java.util.Properties;
+
+/** Generated Model for SRI_AccessCode
+ *  @author Adempiere (generated) 
+ *  @version 3.6.1LTS.Final - $Id$ */
+public class X_SRI_AccessCode extends PO implements I_SRI_AccessCode, I_Persistent 
+{
+
+	/**
+	 *
+	 */
+	private static final long serialVersionUID = 20140429L;
+
+    /** Standard Constructor */
+    public X_SRI_AccessCode (Properties ctx, int SRI_AccessCode_ID, String trxName)
+    {
+      super (ctx, SRI_AccessCode_ID, trxName);
+      /** if (SRI_AccessCode_ID == 0)
+        {
+			setCodeAccessType (null);
+			setEnvType (null);
+			setIsUsed (false);
+			setOldValue (null);
+			setSRI_AccessCode_ID (0);
+			setSRI_ShortDocType (null);
+			setValue (null);
+        } */
+    }
+
+    /** Load Constructor */
+    public X_SRI_AccessCode (Properties ctx, ResultSet rs, String trxName)
+    {
+      super (ctx, rs, trxName);
+    }
+
+    /** AccessLevel
+      * @return 3 - Client - Org 
+      */
+    protected int get_AccessLevel()
+    {
+      return accessLevel.intValue();
+    }
+
+    /** Load Meta Data */
+    protected POInfo initPO (Properties ctx)
+    {
+      POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
+      return poi;
+    }
+
+    public String toString()
+    {
+      StringBuffer sb = new StringBuffer ("X_SRI_AccessCode[")
+        .append(get_ID()).append("]");
+      return sb.toString();
+    }
+
+	/** CodeAccessType AD_Reference_ID=1000065 */
+	public static final int CODEACCESSTYPE_AD_Reference_ID=1000065;
+	/** Automatica = 1 */
+	public static final String CODEACCESSTYPE_Automatica = "1";
+	/** Contingencia = 2 */
+	public static final String CODEACCESSTYPE_Contingencia = "2";
+	/** Set CodeAccessType.
+		@param CodeAccessType CodeAccessType	  */
+	public void setCodeAccessType (String CodeAccessType)
+	{
+
+		set_Value (COLUMNNAME_CodeAccessType, CodeAccessType);
+	}
+
+	/** Get CodeAccessType.
+		@return CodeAccessType	  */
+	public String getCodeAccessType () 
+	{
+		return (String)get_Value(COLUMNNAME_CodeAccessType);
+	}
+
+	/** EnvType AD_Reference_ID=1000064 */
+	public static final int ENVTYPE_AD_Reference_ID=1000064;
+	/** Pruebas = 1 */
+	public static final String ENVTYPE_Pruebas = "1";
+	/** Producción = 2 */
+	public static final String ENVTYPE_Producción = "2";
+	/** Set EnvType.
+		@param EnvType EnvType	  */
+	public void setEnvType (String EnvType)
+	{
+
+		set_Value (COLUMNNAME_EnvType, EnvType);
+	}
+
+	/** Get EnvType.
+		@return EnvType	  */
+	public String getEnvType () 
+	{
+		return (String)get_Value(COLUMNNAME_EnvType);
+	}
+
+	/** Set IsUsed.
+		@param IsUsed IsUsed	  */
+	public void setIsUsed (boolean IsUsed)
+	{
+		set_Value (COLUMNNAME_IsUsed, Boolean.valueOf(IsUsed));
+	}
+
+	/** Get IsUsed.
+		@return IsUsed	  */
+	public boolean isUsed () 
+	{
+		Object oo = get_Value(COLUMNNAME_IsUsed);
+		if (oo != null) 
+		{
+			 if (oo instanceof Boolean) 
+				 return ((Boolean)oo).booleanValue(); 
+			return "Y".equals(oo);
+		}
+		return false;
+	}
+
+	/** Set Old Value.
+		@param OldValue 
+		The old file data
+	  */
+	public void setOldValue (String OldValue)
+	{
+		set_ValueNoCheck (COLUMNNAME_OldValue, OldValue);
+	}
+
+	/** Get Old Value.
+		@return The old file data
+	  */
+	public String getOldValue () 
+	{
+		return (String)get_Value(COLUMNNAME_OldValue);
+	}
+
+	/** Set SRI_AccessCode.
+		@param SRI_AccessCode_ID SRI_AccessCode	  */
+	public void setSRI_AccessCode_ID (int SRI_AccessCode_ID)
+	{
+		if (SRI_AccessCode_ID < 1) 
+			set_ValueNoCheck (COLUMNNAME_SRI_AccessCode_ID, null);
+		else 
+			set_ValueNoCheck (COLUMNNAME_SRI_AccessCode_ID, Integer.valueOf(SRI_AccessCode_ID));
+	}
+
+	/** Get SRI_AccessCode.
+		@return SRI_AccessCode	  */
+	public int getSRI_AccessCode_ID () 
+	{
+		Integer ii = (Integer)get_Value(COLUMNNAME_SRI_AccessCode_ID);
+		if (ii == null)
+			 return 0;
+		return ii.intValue();
+	}
+
+	/** SRI_ShortDocType AD_Reference_ID=1000066 */
+	public static final int SRI_SHORTDOCTYPE_AD_Reference_ID=1000066;
+	/** FACTURA = 01 */
+	public static final String SRI_SHORTDOCTYPE_FACTURA = "01";
+	/** NOTA DE CRÉDITO = 04 */
+	public static final String SRI_SHORTDOCTYPE_NOTADECRÉDITO = "04";
+	/** NOTA DE DÉBITO = 05 */
+	public static final String SRI_SHORTDOCTYPE_NOTADEDÉBITO = "05";
+	/** GUÍA DE REMISIÓN = 06 */
+	public static final String SRI_SHORTDOCTYPE_GUÍADEREMISIÓN = "06";
+	/** COMPROBANTE DE RETENCIÓN = 07 */
+	public static final String SRI_SHORTDOCTYPE_COMPROBANTEDERETENCIÓN = "07";
+	/** Set SRI_ShortDocType.
+		@param SRI_ShortDocType SRI_ShortDocType	  */
+	public void setSRI_ShortDocType (String SRI_ShortDocType)
+	{
+
+		set_Value (COLUMNNAME_SRI_ShortDocType, SRI_ShortDocType);
+	}
+
+	/** Get SRI_ShortDocType.
+		@return SRI_ShortDocType	  */
+	public String getSRI_ShortDocType () 
+	{
+		return (String)get_Value(COLUMNNAME_SRI_ShortDocType);
+	}
+
+	/** Set Search Key.
+		@param Value 
+		Search key for the record in the format required - must be unique
+	  */
+	public void setValue (String Value)
+	{
+		set_Value (COLUMNNAME_Value, Value);
+	}
+
+	/** Get Search Key.
+		@return Search key for the record in the format required - must be unique
+	  */
+	public String getValue () 
+	{
+		return (String)get_Value(COLUMNNAME_Value);
+	}
+}

File org.globalqss.idempiere.LEC.electronicinvoice/src/org/globalqss/model/LEC_FE_Validator.java

+/******************************************************************************
+ * 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   *
+ * by the Free Software Foundation. This program is distributed in the hope   *
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
+ * See the GNU General Public License for more details.                       *
+ * You should have received a copy of the GNU General Public License along    *
+ * with this program; if not, write to the Free Software Foundation, Inc.,    *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
+ * For the text or an alternative of this public license, you may reach us    *
+ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
+ * or via info@compiere.org or http://www.compiere.org/license.html           *
+ *****************************************************************************/
+package org.globalqss.model;
+
+
+import org.compiere.apps.ADialog;
+import org.compiere.model.MClient;
+import org.compiere.model.MInvoice;
+import org.compiere.model.ModelValidationEngine;
+import org.compiere.model.ModelValidator;
+import org.compiere.model.PO;
+import org.compiere.util.CLogger;
+import org.compiere.util.Env;
+
+
+/**
+ *	Validator or Localization Colombia (Withholdings)
+ *	
+ *  @author Carlos Ruiz - globalqss - Quality Systems & Solutions - http://globalqss.com 
+ *	@version $Id: LCO_Validator.java,v 1.4 2007/05/13 06:53:26 cruiz Exp $
+ */
+public class LEC_FE_Validator implements ModelValidator
+{
+	/**
+	 *	Constructor.
+	 *	The class is instantiated when logging in and client is selected/known
+	 */
+	public LEC_FE_Validator ()
+	{
+		super ();
+	}	//	MyValidator
+	
+	/**	Logger			*/
+	private static CLogger log = CLogger.getCLogger(LCO_Validator.class);
+	/** Client			*/
+	private int		m_AD_Client_ID = -1;
+	
+	/**
+	 *	Initialize Validation
+	 *	@param engine validation engine 
+	 *	@param client client
+	 */
+	public void initialize (ModelValidationEngine engine, MClient client)
+	{
+		//client = null for global validator
+		if (client != null) {	
+			m_AD_Client_ID = client.getAD_Client_ID();
+			log.info(client.toString());
+		}
+		else  {
+			log.info("Initializing global validator: "+this.toString());
+		}
+
+		//	Tables to be monitored
+		//engine.addModelChange(MInvoice.Table_Name, this);
+
+		//	Documents to be monitored
+		engine.addDocValidate(MInvoice.Table_Name, this);
+
+	}	//	initialize
+
+    /**
+     *	Model Change of a monitored Table.
+     *	Called after PO.beforeSave/PO.beforeDelete
+     *	when you called addModelChange for the table
+     *	@param po persistent object
+     *	@param type TYPE_
+     *	@return error message or null
+     *	@exception Exception if the recipient wishes the change to be not accept.
+     */
+	public String modelChange (PO po, int type) throws Exception
+	{
+		log.info(po.get_TableName() + " Type: "+type);
+		String msg;
+
+		if (po.get_TableName().equals(MInvoice.Table_Name) && type == ModelValidator.TYPE_BEFORE_CHANGE) {
+			msg = dummy((MInvoice) po);
+			if (msg != null)
+				return msg;
+		}
+
+		return null;
+	}	//	modelChange
+	
+
+	/**
+	 *	Validate Document.
+	 *	Called as first step of DocAction.prepareIt 
+     *	when you called addDocValidate for the table.
+     *	Note that totals, etc. may not be correct.
+	 *	@param po persistent object
+	 *	@param timing see TIMING_ constants
+     *	@return error message or null
+	 */
+	public String docValidate (PO po, int timing)
+	{
+		log.info(po.get_TableName() + " Timing: "+timing);
+		String msg;
+
+		// after completing invoice process electronic invoice
+		if (po.get_TableName().equals(MInvoice.Table_Name) && timing == TIMING_AFTER_COMPLETE) {
+			MInvoice invoice = (MInvoice)po;
+			if (invoice.isSOTrx()) {
+				//
+				msg = invoiceGenerateXml(invoice);
+				if (msg != null)
+					return msg;
+				//
+				msg = invoiceSignXml(invoice);
+				if (msg != null)
+					return msg;
+				//
+				msg = invoiceAuthoriseXml(invoice);
+				if (msg != null)
+					return msg;
+			}
+		}
+
+
+		return null;
+	}	//	docValidate
+
+
+	/**
+	 *	User Login.
+	 *	Called when preferences are set
+	 *	@param AD_Org_ID org
+	 *	@param AD_Role_ID role
+	 *	@param AD_User_ID user
+	 *	@return error message or null
+	 */
+	public String login (int AD_Org_ID, int AD_Role_ID, int AD_User_ID)
+	{
+		log.info("AD_User_ID=" + AD_User_ID);
+		return null;
+	}	//	login
+
+	
+	/**
+	 *	Get Client to be monitored
+	 *	@return AD_Client_ID client
+	 */
+	public int getAD_Client_ID()
+	{
+		return m_AD_Client_ID;
+	}	//	getAD_Client_ID
+
+	
+	/**
+	 * 	String Representation
+	 *	@return info
+	 */
+	public String toString ()
+	{
+		StringBuffer sb = new StringBuffer ("LEC_FE_Validator");
+		return sb.toString ();
+	}	//	toString
+	
+	
+
+	private String dummy (MInvoice inv) {
+		
+		return null;
+	}
+	
+	private String invoiceGenerateXml (MInvoice inv) {
+		
+		String msg = "Generando XML";
+		log.info("Invoice: " + inv);
+		if (!ADialog.ask(0, null, msg)) {
+			return "Canceled...";
+		}
+
+		return null;
+	}
+	
+	private String invoiceSignXml (MInvoice inv) {
+		
+		String msg = "Firmando XML";
+		log.info("Invoice: " + inv);
+		if (!ADialog.ask(0, null, msg)) {
+			return "Canceled...";
+		}
+		
+		return null;
+	}
+	
+	private String invoiceAuthoriseXml (MInvoice inv) {
+		
+		String msg = "Autorizando XML";
+		log.info("Invoice: " + inv);
+		if (!ADialog.ask(0, null, msg)) {
+			return "Canceled...";
+		}
+		
+
+		return "Processing..."; //null;
+	}
+	
+	
+}	//	LEC_FE_Validator

File org.globalqss.idempiere.LEC.electronicinvoice/src/org/globalqss/process/ImportSriAccessCode.java

+/**********************************************************************
+* This file is part of Adempiere ERP Bazaar                           *
+* http://www.adempiere.org                                            *
+*                                                                     *
+* Copyright (C) Contributors                                          *
+*                                                                     *
+* This program is free software; you can redistribute it and/or       *
+* modify it under the terms of the GNU General Public License         *
+* as published by the Free Software Foundation; either version 2      *
+* of the License, or (at your option) any later version.              *
+*                                                                     *
+* This program is distributed in the hope that it will be useful,     *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of      *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the        *
+* GNU General Public License for more details.                        *
+*                                                                     *
+* You should have received a copy of the GNU General Public License   *
+* along with this program; if not, write to the Free Software         *
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,          *
+* MA 02110-1301, USA.                                                 *
+*                                                                     *
+* Contributors:                                                       *
+* - Jesus Garcia - GlobalQSS Colombia                                 *
+* - Carlos Ruiz  - GlobalQSS Colombia                                 *
+**********************************************************************/
+package org.globalqss.process;
+
+import java.math.BigDecimal;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.logging.Level;
+
+import org.compiere.model.X_I_SRI_AccessCode;
+import org.compiere.model.X_SRI_AccessCode;
+import org.compiere.process.ProcessInfoParameter;
+import org.compiere.process.SvrProcess;
+import org.compiere.util.DB;
+
+/**
+ *	Import SRI Access Codes from I_SRI_AccessCode
+ *
+ * 	@author 	GlobalQSS/jjgq
+ */
+public class ImportSriAccessCode extends SvrProcess
+{
+	/**	Client to be imported to		*/
+	private int				m_AD_Client_ID = 0;
+	
+	/**	Delete old Imported				*/
+	private boolean			m_deleteOldImported = false;
+	/**	Environment to be imported to		*/
+	private String			m_SRI_ShortDocType = null;
+	/**
+	 *  Prepare - e.g., get Parameters.
+	 */
+	protected void prepare()
+	{
+		ProcessInfoParameter[] para = getParameter();
+		for (int i = 0; i < para.length; i++)
+		{
+			String name = para[i].getParameterName();
+			if (name.equals("SRI_ShortDocType"))
+				m_SRI_ShortDocType = para[i].getParameter().toString();
+			else if (name.equals("DeleteOldImported"))
+				m_deleteOldImported = "Y".equals(para[i].getParameter());
+			else
+				log.log(Level.SEVERE, "Unknown Parameter: " + name);
+		}
+		m_AD_Client_ID = getAD_Client_ID();
+	}	//	prepare
+
+
+	/**
+	 *  Perform process.
+	 *  @return Message
+	 *  @throws Exception
+	 */
+	protected String doIt() throws Exception
+	{
+		StringBuffer sql = null;
+		int no = 0;
+		String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID;
+		
+		//	****	Prepare	****
+
+		//	Delete Old Imported
+		if (m_deleteOldImported)
+		{
+			sql = new StringBuffer ("DELETE I_SRI_AccessCode "
+				+ "WHERE I_IsImported='Y'").append(clientCheck);
+			no = DB.executeUpdate(sql.toString(), get_TrxName());
+			log.info("Delete Old Imported =" + no);
+		}
+
+		//	Set Client, Org, IsActive, Created/Updated
+		sql = new StringBuffer ("UPDATE I_SRI_AccessCode "
+			+ "SET AD_Client_ID = COALESCE (AD_Client_ID, ").append(m_AD_Client_ID).append("),"
+			+ " AD_Org_ID = COALESCE (AD_Org_ID, 0),"	// TODO Reviewme
+			+ " IsActive = COALESCE (IsActive, 'Y'),"
+			+ " Created = COALESCE (Created, SysDate),"
+			+ " CreatedBy = COALESCE (CreatedBy, 0),"
+			+ " Updated = COALESCE (Updated, SysDate),"
+			+ " UpdatedBy = COALESCE (UpdatedBy, 0),"
+			+ " I_ErrorMsg = ' ',"
+			+ " I_IsImported = 'N' "
+			+ "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL");
+		no = DB.executeUpdate(sql.toString(), get_TrxName());
+		log.info("Reset=" + no);
+		
+		//	Mandatories
+		sql = new StringBuffer ("UPDATE I_SRI_AccessCode "
+			+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory Value,' "
+			+ "WHERE Value IS NULL"
+			+ " AND I_IsImported<>'Y'").append(clientCheck);
+		no = DB.executeUpdate(sql.toString(), get_TrxName());
+		if (no != 0)
+			log.warning("No Mandatory Value=" + no);
+		
+		//	Environment
+		sql = new StringBuffer ("UPDATE I_SRI_AccessCode "
+			+ "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Source File Environment differs' "
+			//+ "WHERE Value IS NOT NULL AND SUBSTR(Value,14,1) <> ").append(m_EnvType).append("::bpchar"
+			+ "WHERE Value IS NOT NULL AND SUBSTR(Value,14,1) NOT IN ('1', '2')"
+			+ " AND I_IsImported<>'Y'").append(clientCheck);
+		no = DB.executeUpdate(sql.toString(), get_TrxName());
+		if (no != 0)
+			log.warning("Source File Environment differs=" + no);
+		
+		commitEx();
+		
+		//Import Access Code
+		sql = new StringBuffer ("SELECT * FROM I_SRI_AccessCode WHERE I_IsImported='N'")
+			.append(clientCheck);
+		
+		int noInsert = 0;
+		PreparedStatement pstmt_setImported = null;
+		PreparedStatement pstmt = null;
+		ResultSet rs = null;
+		try
+		{
+			pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
+			rs = pstmt.executeQuery();
+			
+			while (rs.next())
+			{
+				X_I_SRI_AccessCode imp = new X_I_SRI_AccessCode(getCtx(), rs, get_TrxName());
+				
+				// New Access Code
+				X_SRI_AccessCode sri_accesscode = new X_SRI_AccessCode (getCtx(), 0, get_TrxName());
+				//sri_accesscode.setAD_ClientID(imp.getAD_Client_ID());
+				sri_accesscode.setAD_Org_ID(imp.getAD_Org_ID());
+				sri_accesscode.setValue(imp.getValue());
+				sri_accesscode.setOldValue(imp.getValue());
+				sri_accesscode.setEnvType("1");	// Pruebas // Before Save ?
+				sri_accesscode.setCodeAccessType("2"); // Contingencia Before Save ?
+				sri_accesscode.setSRI_ShortDocType(m_SRI_ShortDocType);
+				sri_accesscode.setIsUsed(false);
+				
+				// Save Access Code
+				if (sri_accesscode.save())
+				{
+					imp.setI_IsImported(true);
+					imp.setProcessed(true);
+					imp.saveEx();
+					noInsert++;
+
+				}
+			}
+			
+			//		Close database connection
+			rs.close();
+			pstmt.close();
+			rs = null;
+			pstmt = null;
+			
+		}
+
+		catch (SQLException e)
+		{
+			throw e;
+		}
+		finally
+		{
+			DB.close(rs, pstmt);
+			rs = null;
+			pstmt = null;
+			DB.close(pstmt_setImported);
+			pstmt_setImported = null;
+		}
+
+		//	Set Error to indicator to not imported
+		sql = new StringBuffer ("UPDATE I_SRI_AccessCode "
+			+ "SET I_IsImported='N', Updated=SysDate "
+			+ "WHERE I_IsImported<>'Y'").append(clientCheck);
+		no = DB.executeUpdate(sql.toString(), get_TrxName());
+		addLog (0, null, new BigDecimal (no), "@Errors@");
+		//
+		addLog (0, null, new BigDecimal (noInsert), "@SRI_AccessCode_ID@: @Inserted@");
+		return "";
+	}	//	doIt
+	
+
+}	//	ImportSriAccessCode