Search in sources :

Example 26 with AccountingSituation

use of com.axelor.apps.account.db.AccountingSituation in project axelor-open-suite by axelor.

the class DebtRecoveryService method getDebtRecovery.

public DebtRecovery getDebtRecovery(Partner partner, Company company) throws AxelorException {
    AccountingSituationRepository accSituationRepo = Beans.get(AccountingSituationRepository.class);
    AccountingSituation accountingSituation = accSituationRepo.all().filter("self.partner = ?1 and self.company = ?2", partner, company).fetchOne();
    if (accountingSituation == null) {
        throw new AxelorException(accountingSituation, TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, "%s :\n" + I18n.get("Partner") + " %s, " + I18n.get("Company") + " %s : " + I18n.get(IExceptionMessage.DEBT_RECOVERY_1), I18n.get(com.axelor.apps.base.exceptions.IExceptionMessage.EXCEPTION), partner.getName(), company.getName());
    }
    return accountingSituation.getDebtRecovery();
}
Also used : AxelorException(com.axelor.exception.AxelorException) AccountingSituationRepository(com.axelor.apps.account.db.repo.AccountingSituationRepository) AccountingSituation(com.axelor.apps.account.db.AccountingSituation)

Aggregations

AccountingSituation (com.axelor.apps.account.db.AccountingSituation)26 Partner (com.axelor.apps.base.db.Partner)9 Company (com.axelor.apps.base.db.Company)8 AccountConfig (com.axelor.apps.account.db.AccountConfig)6 AxelorException (com.axelor.exception.AxelorException)6 AccountingSituationService (com.axelor.apps.account.service.AccountingSituationService)5 Transactional (com.google.inject.persist.Transactional)5 BankDetails (com.axelor.apps.base.db.BankDetails)4 BigDecimal (java.math.BigDecimal)4 Account (com.axelor.apps.account.db.Account)3 DebtRecovery (com.axelor.apps.account.db.DebtRecovery)3 Invoice (com.axelor.apps.account.db.Invoice)3 PaymentMode (com.axelor.apps.account.db.PaymentMode)3 AccountingSituationRepository (com.axelor.apps.account.db.repo.AccountingSituationRepository)3 InvoiceLine (com.axelor.apps.account.db.InvoiceLine)2 MoveLine (com.axelor.apps.account.db.MoveLine)2 InvoiceRepository (com.axelor.apps.account.db.repo.InvoiceRepository)2 AccountConfigService (com.axelor.apps.account.service.config.AccountConfigService)2 PaymentModeService (com.axelor.apps.account.service.payment.PaymentModeService)2 Address (com.axelor.apps.base.db.Address)2