Bug Fix #1713850 GL Distribution only works for Accounts

This commit is contained in:
armenrz 2007-05-09 09:26:38 +00:00
parent 42b7a6438b
commit 02f3e7226c
1 changed files with 837 additions and 819 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)
{
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());