protected B2BBudgetData populateB2BBudgetDataFromForm(final B2BBudgetForm b2BBudgetForm) throws ParseException { final B2BBudgetData b2BBudgetData = new B2BBudgetData(); b2BBudgetData.setOriginalCode(b2BBudgetForm.getOriginalCode()); b2BBudgetData.setCode(b2BBudgetForm.getCode()); b2BBudgetData.setName(b2BBudgetForm.getName()); b2BBudgetData.setUnit(companyB2BCommerceFacade.getUnitForUid(b2BBudgetForm.getParentB2BUnit())); final CurrencyData currencyData = new CurrencyData(); currencyData.setIsocode(b2BBudgetForm.getCurrency()); b2BBudgetData.setCurrency(currencyData); b2BBudgetData.setStartDate(b2BBudgetForm.getStartDate()); b2BBudgetData.setEndDate(b2BBudgetForm.getEndDate()); b2BBudgetData.setBudget( BigDecimal.valueOf( formatFactory.createNumberFormat().parse(b2BBudgetForm.getBudget()).doubleValue())); return b2BBudgetData; }
protected boolean checkEndDateIsBeforeStartDateForBudget(final B2BBudgetForm b2BBudgetForm) { final Date startDate = b2BBudgetForm.getStartDate(); final Date endDate = b2BBudgetForm.getEndDate(); return endDate.before(startDate); }