Search in sources :

Example 6 with AnalyticDistributionTemplate

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;
}
Also used : AnalyticDistributionTemplate(com.axelor.apps.account.db.AnalyticDistributionTemplate) AccountManagement(com.axelor.apps.account.db.AccountManagement)

Aggregations

AnalyticDistributionTemplate (com.axelor.apps.account.db.AnalyticDistributionTemplate)6 AccountManagement (com.axelor.apps.account.db.AccountManagement)1 AnalyticMoveLine (com.axelor.apps.account.db.AnalyticMoveLine)1