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; }
public boolean checkAccountingSituationList( List<AccountingSituation> accountingSituationList, Company company) { if (accountingSituationList != null) { for (AccountingSituation accountingSituation : accountingSituationList) { if (accountingSituation.getCompany().equals(company)) { return true; } } } return false; }
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; }