Line 570... |
Line 570... |
570 |
String suffix = (this.achat ? "_ACHAT" : "");
|
570 |
String suffix = (this.achat ? "_ACHAT" : "");
|
571 |
SQLRowAccessor compteArticle = cacheForTableCompte.getRowFromId(article.getForeignID("ID_COMPTE_PCE" + suffix));
|
571 |
SQLRowAccessor compteArticle = cacheForTableCompte.getRowFromId(article.getForeignID("ID_COMPTE_PCE" + suffix));
|
572 |
if (compteArticle != null && !compteArticle.isUndefined()) {
|
572 |
if (compteArticle != null && !compteArticle.isUndefined()) {
|
573 |
cpt = compteArticle;
|
573 |
cpt = compteArticle;
|
574 |
} else {
|
574 |
} else {
|
- |
|
575 |
final SQLBackgroundTableCacheItem cacheForTableFamille = SQLBackgroundTableCache.getInstance().getCacheForTable(article.getTable().getForeignTable("ID_FAMILLE_ARTICLE"));
|
- |
|
576 |
|
575 |
SQLRowAccessor familleArticle = article.getForeign("ID_FAMILLE_ARTICLE");
|
577 |
SQLRowAccessor familleArticle = cacheForTableFamille.getRowFromId(article.getForeignID("ID_FAMILLE_ARTICLE"));
|
576 |
Set<SQLRowAccessor> unique = new HashSet<SQLRowAccessor>();
|
578 |
Set<SQLRowAccessor> unique = new HashSet<SQLRowAccessor>();
|
577 |
while (familleArticle != null && !familleArticle.isUndefined() && !unique.contains(familleArticle)) {
|
579 |
while (familleArticle != null && !familleArticle.isUndefined() && !unique.contains(familleArticle)) {
|
578 |
|
580 |
|
579 |
unique.add(familleArticle);
|
581 |
unique.add(familleArticle);
|
580 |
if (familleArticle.getObject("ID_COMPTE_PCE" + suffix) != null && !familleArticle.isForeignEmpty("ID_COMPTE_PCE" + suffix)) {
|
582 |
if (familleArticle.getObject("ID_COMPTE_PCE" + suffix) != null && !familleArticle.isForeignEmpty("ID_COMPTE_PCE" + suffix)) {
|
Line 582... |
Line 584... |
582 |
if (compteFamilleArticle != null && !compteFamilleArticle.isUndefined()) {
|
584 |
if (compteFamilleArticle != null && !compteFamilleArticle.isUndefined()) {
|
583 |
cpt = compteFamilleArticle;
|
585 |
cpt = compteFamilleArticle;
|
584 |
break;
|
586 |
break;
|
585 |
}
|
587 |
}
|
586 |
}
|
588 |
}
|
587 |
familleArticle = familleArticle.getForeign("ID_FAMILLE_ARTICLE_PERE");
|
589 |
familleArticle = cacheForTableFamille.getRowFromId(familleArticle.getForeignID("ID_FAMILLE_ARTICLE_PERE"));
|
588 |
}
|
590 |
}
|
589 |
}
|
591 |
}
|
590 |
} else {
|
592 |
} else {
|
591 |
cpt = cptCatComptable;
|
593 |
cpt = cptCatComptable;
|
592 |
}
|
594 |
}
|