コード例 #1
0
  public AccountingSituation createAccountingSituation(Company company) throws AxelorException {

    AccountConfig accountConfig = accountConfigService.getAccountConfig(company);

    AccountingSituation accountingSituation = new AccountingSituation();

    accountingSituation.setCompany(company);
    accountingSituation.setCustomerAccount(accountConfigService.getCustomerAccount(accountConfig));
    accountingSituation.setSupplierAccount(accountConfigService.getSupplierAccount(accountConfig));
    save(accountingSituation);

    return accountingSituation;
  }
コード例 #2
0
  public boolean checkAccountingSituationList(
      List<AccountingSituation> accountingSituationList, Company company) {

    if (accountingSituationList != null) {
      for (AccountingSituation accountingSituation : accountingSituationList) {

        if (accountingSituation.getCompany().equals(company)) {
          return true;
        }
      }
    }

    return false;
  }
コード例 #3
0
  public AccountingSituation getAccountingSituation(Partner partner, Company company) {

    if (partner.getAccountingSituationList() == null) {
      return null;
    }

    for (AccountingSituation accountingSituation : partner.getAccountingSituationList()) {

      if (accountingSituation.getCompany().equals(company)) {

        return accountingSituation;
      }
    }

    return null;
  }