Include in trunk revision 2333 lost with changes in revision 2335.

Thanks Teo for noticing this.
This commit is contained in:
Carlos Ruiz 2007-05-12 18:41:41 +00:00
parent d75a3a5f7d
commit a51eb60084
1 changed files with 82 additions and 65 deletions

View File

@ -654,8 +654,26 @@ public final class Fact
MDistribution[] distributions = MDistribution.get (dLine.getAccount(),
m_postingType, m_doc.getC_DocType_ID());
// No Distribution for this line
//AZ Goodwill
//The above "get" only work in GL Journal because it's using ValidCombination Account
//Old:
//if (distributions == null || distributions.length == 0)
// continue;
//For other document, we try the followings (from FactLine):
//New:
if (distributions == null || distributions.length == 0)
continue;
{
distributions = MDistribution.get (dLine.getCtx(), dLine.getC_AcctSchema_ID(),
m_postingType, m_doc.getC_DocType_ID(),
dLine.getAD_Org_ID(), dLine.getAccount_ID(),
dLine.getM_Product_ID(), dLine.getC_BPartner_ID(), dLine.getC_Project_ID(),
dLine.getC_Campaign_ID(), dLine.getC_Activity_ID(), dLine.getAD_OrgTrx_ID(),
dLine.getC_SalesRegion_ID(), dLine.getC_LocTo_ID(), dLine.getC_LocFrom_ID(),
dLine.getUser1_ID(), dLine.getUser2_ID());
if (distributions == null || distributions.length == 0)
continue;
}
//end AZ
// Just the first
if (distributions.length > 1)
log.warning("More then one Distributiion for " + dLine.getAccount());
@ -705,7 +723,6 @@ public final class Fact
return true;
} // distribute
/**************************************************************************
* String representation
* @return String