use of com.axelor.apps.account.db.DebtRecoveryConfigLine in project axelor-open-suite by axelor.
the class DebtRecoverySessionService method getDebtRecoveryMethod.
/**
* Fonction permettant de récupérer une méthode de relance en fonction de la categorie du tiers et
* d'une société
*
* @param debtRecovery Une relance
* @return
*/
public DebtRecoveryMethod getDebtRecoveryMethod(DebtRecovery debtRecovery) {
AccountingSituation accountingSituation = debtRecovery.getTradingName() == null ? debtRecovery.getAccountingSituation() : debtRecovery.getTradingNameAccountingSituation();
Company company = accountingSituation.getCompany();
Partner partner = accountingSituation.getPartner();
List<DebtRecoveryConfigLine> debtRecoveryConfigLines = company.getAccountConfig().getDebtRecoveryConfigLineList();
for (DebtRecoveryConfigLine debtRecoveryConfigLine : debtRecoveryConfigLines) {
if (debtRecoveryConfigLine.getPartnerCategory().equals(partner.getPartnerCategory())) {
log.debug("méthode de relance determinée ");
return debtRecoveryConfigLine.getDebtRecoveryMethod();
}
}
log.debug("méthode de relance non determinée ");
return null;
}
Aggregations