use of com.axelor.apps.account.db.AnalyticDistributionTemplate in project axelor-open-suite by axelor.
the class AccountManagementServiceAccountImpl method getAnalyticDistributionTemplate.
/**
* Get the product analytic distribution template
*
* @param product
* @param compan
* @param configObject Specify if we want get the tax from the product or its product family
* <li>1 : product
* <li>2 : product family
* @return
* @throws AxelorException
*/
protected AnalyticDistributionTemplate getAnalyticDistributionTemplate(Product product, Company company, int configObject) {
AccountManagement accountManagement = this.getAccountManagement(product, company, configObject);
AnalyticDistributionTemplate analyticDistributionTemplate = null;
if (accountManagement != null) {
analyticDistributionTemplate = accountManagement.getAnalyticDistributionTemplate();
}
if (analyticDistributionTemplate == null && configObject == CONFIG_OBJECT_PRODUCT) {
return getAnalyticDistributionTemplate(product, company, CONFIG_OBJECT_PRODUCT_FAMILY);
}
return analyticDistributionTemplate;
}
Aggregations