IDEMPIERE-539 Import GL Window does not allow Key Values for Activity, Campaign, Sales Region

This commit is contained in:
Thomas Bayen 2012-12-26 02:50:26 +01:00
parent 57c646c552
commit 81c60eba4c
3 changed files with 127 additions and 1 deletions

View File

@ -461,6 +461,56 @@ public class ImportGLJournal extends SvrProcess
if (no != 0) if (no != 0)
log.warning ("Invalid Project=" + no); log.warning ("Invalid Project=" + no);
// tbayen: IDEMPIERE-539 Import GL Window does not allow Key Values for Activity, Campaign, Sales Region
// Set Campaign
sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET C_Campaign_ID=(SELECT p.C_Campaign_ID FROM C_Campaign p")
.append(" WHERE p.Value=i.CampaignValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) ")
.append("WHERE C_Campaign_ID IS NULL AND CampaignValue IS NOT NULL")
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("Set Campaign from Value=" + no);
sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Campaign, '")
.append("WHERE C_Campaign_ID IS NULL AND CampaignValue IS NOT NULL")
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
if (no != 0)
log.warning ("Invalid Campaign=" + no);
// Set Activity
sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET C_Activity_ID=(SELECT p.C_Activity_ID FROM C_Activity p")
.append(" WHERE p.Value=i.ActivityValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) ")
.append("WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL")
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("Set Activity from Value=" + no);
sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Activity, '")
.append("WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL")
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
if (no != 0)
log.warning ("Invalid Activity=" + no);
// Set SalesRegion
sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET C_SalesRegion_ID=(SELECT p.C_SalesRegion_ID FROM C_SalesRegion p")
.append(" WHERE p.Value=i.SalesRegionValue AND p.IsSummary='N' AND i.AD_Client_ID=p.AD_Client_ID) ")
.append("WHERE C_SalesRegion_ID IS NULL AND SalesRegionValue IS NOT NULL")
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("Set SalesRegion from Value=" + no);
sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid SalesRegion, '")
.append("WHERE C_SalesRegion_ID IS NULL AND SalesRegionValue IS NOT NULL")
.append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
if (no != 0)
log.warning ("Invalid SalesRegion=" + no);
// Set TrxOrg // Set TrxOrg
sql = new StringBuilder ("UPDATE I_GLJournal i ") sql = new StringBuilder ("UPDATE I_GLJournal i ")
.append("SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o") .append("SET AD_OrgTrx_ID=(SELECT o.AD_Org_ID FROM AD_Org o")

View File

@ -82,6 +82,15 @@ public interface I_I_GLJournal
*/ */
public String getAcctSchemaName(); public String getAcctSchemaName();
/** Column name ActivityValue */
public static final String COLUMNNAME_ActivityValue = "ActivityValue";
/** Set Activity Value */
public void setActivityValue (String ActivityValue);
/** Get Activity Value */
public String getActivityValue();
/** Column name AD_Client_ID */ /** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
@ -250,6 +259,15 @@ public interface I_I_GLJournal
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException; public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
/** Column name CampaignValue */
public static final String COLUMNNAME_CampaignValue = "CampaignValue";
/** Set CampaignValue */
public void setCampaignValue (String CampaignValue);
/** Get CampaignValue */
public String getCampaignValue();
/** Column name CategoryName */ /** Column name CategoryName */
public static final String COLUMNNAME_CategoryName = "CategoryName"; public static final String COLUMNNAME_CategoryName = "CategoryName";
@ -853,6 +871,19 @@ public interface I_I_GLJournal
*/ */
public BigDecimal getQty(); public BigDecimal getQty();
/** Column name SalesRegionValue */
public static final String COLUMNNAME_SalesRegionValue = "SalesRegionValue";
/** Set Sales Region Value.
* Key of the Sales Region
*/
public void setSalesRegionValue (String SalesRegionValue);
/** Get Sales Region Value.
* Key of the Sales Region
*/
public String getSalesRegionValue();
/** Column name SKU */ /** Column name SKU */
public static final String COLUMNNAME_SKU = "SKU"; public static final String COLUMNNAME_SKU = "SKU";

View File

@ -33,7 +33,7 @@ public class X_I_GLJournal extends PO implements I_I_GLJournal, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20121031L; private static final long serialVersionUID = 20121226L;
/** Standard Constructor */ /** Standard Constructor */
public X_I_GLJournal (Properties ctx, int I_GLJournal_ID, String trxName) public X_I_GLJournal (Properties ctx, int I_GLJournal_ID, String trxName)
@ -136,6 +136,20 @@ public class X_I_GLJournal extends PO implements I_I_GLJournal, I_Persistent
return (String)get_Value(COLUMNNAME_AcctSchemaName); return (String)get_Value(COLUMNNAME_AcctSchemaName);
} }
/** Set Activity Value.
@param ActivityValue Activity Value */
public void setActivityValue (String ActivityValue)
{
set_Value (COLUMNNAME_ActivityValue, ActivityValue);
}
/** Get Activity Value.
@return Activity Value */
public String getActivityValue ()
{
return (String)get_Value(COLUMNNAME_ActivityValue);
}
/** Set Document Org. /** Set Document Org.
@param AD_OrgDoc_ID @param AD_OrgDoc_ID
Document Organization (independent from account organization) Document Organization (independent from account organization)
@ -369,6 +383,20 @@ public class X_I_GLJournal extends PO implements I_I_GLJournal, I_Persistent
return ii.intValue(); return ii.intValue();
} }
/** Set CampaignValue.
@param CampaignValue CampaignValue */
public void setCampaignValue (String CampaignValue)
{
set_Value (COLUMNNAME_CampaignValue, CampaignValue);
}
/** Get CampaignValue.
@return CampaignValue */
public String getCampaignValue ()
{
return (String)get_Value(COLUMNNAME_CampaignValue);
}
/** Set Category Name. /** Set Category Name.
@param CategoryName @param CategoryName
Name of the Category Name of the Category
@ -1346,6 +1374,23 @@ public class X_I_GLJournal extends PO implements I_I_GLJournal, I_Persistent
return bd; return bd;
} }
/** Set Sales Region Value.
@param SalesRegionValue
Key of the Sales Region
*/
public void setSalesRegionValue (String SalesRegionValue)
{
set_Value (COLUMNNAME_SalesRegionValue, SalesRegionValue);
}
/** Get Sales Region Value.
@return Key of the Sales Region
*/
public String getSalesRegionValue ()
{
return (String)get_Value(COLUMNNAME_SalesRegionValue);
}
/** Set SKU. /** Set SKU.
@param SKU @param SKU
Stock Keeping Unit Stock Keeping Unit