public Integer createUpdate(Integer executorId, BillingProcessConfigurationDTO dto) {
    configuration = configurationDas.findByEntity(dto.getEntity());
    if (configuration != null) {

      if (!configuration.getGenerateReport().equals(dto.getGenerateReport())) {
        eLogger.audit(
            executorId,
            null,
            Constants.TABLE_BILLING_PROCESS_CONFIGURATION,
            configuration.getId(),
            EventLogger.MODULE_BILLING_PROCESS,
            EventLogger.ROW_UPDATED,
            new Integer(configuration.getGenerateReport()),
            null,
            null);
        configuration.setGenerateReport(dto.getGenerateReport());
        configuration.setReviewStatus(
            dto.getGenerateReport() == 1
                ? Constants.REVIEW_STATUS_GENERATED
                : Constants.REVIEW_STATUS_APPROVED);
      } else {
        eLogger.audit(
            executorId,
            null,
            Constants.TABLE_BILLING_PROCESS_CONFIGURATION,
            configuration.getId(),
            EventLogger.MODULE_BILLING_PROCESS,
            EventLogger.ROW_UPDATED,
            null,
            null,
            null);
      }

      configuration.setNextRunDate(dto.getNextRunDate());
    } else {
      configuration =
          configurationDas.create(dto.getEntity(), dto.getNextRunDate(), dto.getGenerateReport());
    }

    configuration.setDaysForReport(dto.getDaysForReport());
    configuration.setDaysForRetry(dto.getDaysForRetry());
    configuration.setRetries(dto.getRetries());
    configuration.setPeriodUnit(dto.getPeriodUnit());
    configuration.setPeriodValue(dto.getPeriodValue());
    configuration.setDueDateUnitId(dto.getDueDateUnitId());
    configuration.setDueDateValue(dto.getDueDateValue());
    configuration.setDfFm(dto.getDfFm());
    configuration.setOnlyRecurring(dto.getOnlyRecurring());
    configuration.setInvoiceDateProcess(dto.getInvoiceDateProcess());
    configuration.setAutoPayment(dto.getAutoPayment());
    configuration.setAutoPaymentApplication(dto.getAutoPaymentApplication());
    configuration.setMaximumPeriods(dto.getMaximumPeriods());

    return configuration.getId();
  }
 public void set(Integer entityId) {
   configuration = configurationDas.findByEntity(new CompanyDAS().find(entityId));
 }
 public ConfigurationBL(Integer entityId) {
   init();
   configuration = configurationDas.findByEntity(new CompanyDAS().find(entityId));
 }