reimbursementGuide.setCreationDate(Calendar.getInstance()); Integer reimbursementGuideNumber = ReimbursementGuide.generateReimbursementGuideNumber();
reimbursementGuide.setCreationDate(Calendar.getInstance());
    public Integer run(Integer guideId, String remarks, List infoReimbursementGuideEntries,            IUserView userView) throws FenixServiceException, ExcepcaoPersistencia {        Guide guide = rootDomainObject.readGuideByOID(guideId);        if (!guide.getActiveSituation().getSituation().equals(GuideState.PAYED)) {            throw new InvalidGuideSituationServiceException(                    "error.exception.masterDegree.invalidGuideSituation");        }        ReimbursementGuide reimbursementGuide = DomainFactory.makeReimbursementGuide();        for (InfoReimbursementGuideEntry infoReimbursementGuideEntry : (List<InfoReimbursementGuideEntry>) infoReimbursementGuideEntries) {            // check pre-conditions            if (infoReimbursementGuideEntry.getJustification().length() == 0)                throw new RequiredJustificationServiceException(                        "error.exception.masterDegree.requiredJustification");            GuideEntry guideEntry = rootDomainObject.readGuideEntryByOID(infoReimbursementGuideEntry                    .getInfoGuideEntry().getIdInternal());            if (checkReimbursementGuideEntriesSum(infoReimbursementGuideEntry, guideEntry) == false)                throw new InvalidReimbursementValueServiceException(                        "error.exception.masterDegree.invalidReimbursementValue");            if (guideEntry.getDocumentType().equals(DocumentType.INSURANCE)                    && !infoReimbursementGuideEntry.getValue().equals(guideEntry.getPrice())) {                throw new InvalidReimbursementValueServiceException(                        "error.exception.masterDegree.invalidInsuranceReimbursementValue");            }            // create new reimbursement entry            ReimbursementGuideEntry newReimbursementGuideEntry = DomainFactory                    .makeReimbursementGuideEntry();            newReimbursementGuideEntry.setGuideEntry(guideEntry);            newReimbursementGuideEntry.setJustification(infoReimbursementGuideEntry.getJustification());            newReimbursementGuideEntry.setReimbursementGuide(reimbursementGuide);            newReimbursementGuideEntry.setValue(infoReimbursementGuideEntry.getValue());        }        // reimbursement Guide        reimbursementGuide.setCreationDate(Calendar.getInstance());        Integer reimbursementGuideNumber = ReimbursementGuide.generateReimbursementGuideNumber();        reimbursementGuide.setNumber(reimbursementGuideNumber);        reimbursementGuide.setGuide(guide);        // reimbursement Guide Situation        ReimbursementGuideSituation reimbursementGuideSituation = DomainFactory                .makeReimbursementGuideSituation();        reimbursementGuideSituation.setEmployee(userView.getPerson().getEmployee());        reimbursementGuideSituation.setModificationDate(Calendar.getInstance());        reimbursementGuideSituation.setOfficialDate(Calendar.getInstance());        reimbursementGuideSituation.setReimbursementGuide(reimbursementGuide);        reimbursementGuideSituation.setReimbursementGuideState(ReimbursementGuideState.ISSUED);        reimbursementGuideSituation.setRemarks(remarks);        reimbursementGuideSituation.setState(new State(State.ACTIVE));        return reimbursementGuide.getIdInternal();    }