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.setPeriodUnit(dto.getPeriodUnit()); configuration.setDueDateUnitId(dto.getDueDateUnitId()); configuration.setDueDateValue(dto.getDueDateValue()); configuration.setDfFm(dto.getDfFm()); configuration.setOnlyRecurring(dto.getOnlyRecurring()); configuration.setInvoiceDateProcess(dto.getInvoiceDateProcess()); configuration.setAutoPaymentApplication(dto.getAutoPaymentApplication()); configuration.setMaximumPeriods(dto.getMaximumPeriods()); configuration.setLastDayOfMonth(dto.getLastDayOfMonth()); configuration.setProratingType(dto.getProratingType()); return configuration.getId(); }
public BillingProcessConfigurationDTO getDTO() { BillingProcessConfigurationDTO dto = new BillingProcessConfigurationDTO(); dto.setDaysForReport(configuration.getDaysForReport()); dto.setDaysForRetry(configuration.getDaysForRetry()); dto.setEntity(configuration.getEntity()); dto.setGenerateReport(configuration.getGenerateReport()); dto.setId(configuration.getId()); dto.setNextRunDate(configuration.getNextRunDate()); dto.setPeriodUnit(configuration.getPeriodUnit()); dto.setReviewStatus(configuration.getReviewStatus()); dto.setDueDateUnitId(configuration.getDueDateUnitId()); dto.setDueDateValue(configuration.getDueDateValue()); dto.setDfFm(configuration.getDfFm()); dto.setOnlyRecurring(configuration.getOnlyRecurring()); dto.setInvoiceDateProcess(configuration.getInvoiceDateProcess()); dto.setMaximumPeriods(configuration.getMaximumPeriods()); dto.setAutoPaymentApplication(configuration.getAutoPaymentApplication()); dto.setLastDayOfMonth(configuration.getLastDayOfMonth()); dto.setProratingType(configuration.getProratingType()); return dto; }