@Override
    public List<List<String>> getSummary(String page, Object object) {
      List<List<String>> list = null;
      if (page.equals("viewOrganization.jsp")) {
        if (!(object instanceof Unit)) {
          return null;
        }

        Unit unit = (Unit) object;
        Person currentUser = UserView.getCurrentUser().getExpenditurePerson();
        if (!(unit.isResponsible(currentUser)
            || unit.getObserversSet().contains(currentUser)
            || UserView.getCurrentUser().hasRoleType(RoleType.MANAGER))) {
          return null;
        }

        list = new ArrayList<List<String>>();
        list.add(new ArrayList<String>());
        list.add(new ArrayList<String>());

        ReportViewerComponent projectSummary;
        Project project = getProjectFromID(unit.getExternalId());
        if (project != null) {
          String projectCode = project.getProjectCode();
          System.out.println(projectCode);

          projectSummary =
              new ReportViewerComponent(
                  "SELECT V.\"Orçamento\", V.\"Máximo Financiável\" AS \"Máx. Financiável\", V.\"Receita\", V.\"Transf. Parceiros\", V.\"Despesa\", V.\"Adiantamentos por Justificar\", V.\"Cabimentos por Executar\", V.\"Saldo Tesouraria\", V.\"Saldo Orçamental\" FROM V_RESPROJPROF V WHERE V.\"NºProj\"='"
                      + projectCode
                      + "'",
                  new NoBehaviourCustomTableFormatter());

          Table t = projectSummary.getTable();

          if (t.getItemIds().size() > 0) {
            for (Object a : t.getItemIds()) {
              Item item = t.getItem(a);

              for (Object column : item.getItemPropertyIds()) {
                String itemString =
                    ReportType.formatCurrency(item.getItemProperty(column).toString());
                list.get(0).add(t.getColumnHeader(column));
                list.get(1).add(itemString);
              }
            }
          }
        }
      }
      return list;
    }
Example #2
0
 public Set<ProcessFile> getStudentFilesForJobOfferCandidacy() {
   Student student = UserView.getCurrentUser().getPerson().getStudent();
   if (student == null) {
     return null;
   }
   return OfferCandidacy.getStudentFilesForJobOfferCandidacy(student, this);
 }
Example #3
0
 public boolean isCanCreateOfferCandidacy() {
   Student student = UserView.getCurrentUser().getPerson().getStudent();
   if (student == null) {
     return false;
   }
   return OfferCandidacy.canCreateOfferCandidacy(student, this);
 }
 @Override
 protected void process(final ActivityInformation<MissionProcess> activityInformation) {
   final User user = UserView.getCurrentUser();
   final Person person = user.getPerson();
   final MissionProcess missionProcess = activityInformation.getProcess();
   missionProcess.unAllocateFunds(person);
 }
  public CommitFundsActivityInformation(
      final RegularAcquisitionProcess process,
      final WorkflowActivity<? extends WorkflowProcess, ? extends ActivityInformation> activity) {
    super(process, activity);
    process.takeProcess();

    final User user = UserView.getCurrentUser();
    Person person = user.getExpenditurePerson();
    final AcquisitionRequest acquisitionRequest = process.getAcquisitionRequest();
    for (final Financer financer : acquisitionRequest.getFinancersSet()) {
      if (!financer.isCommitted() && financer.isAccountingEmployee(person)) {
        final CommitmentNumberBean bean = new CommitmentNumberBean(financer);
        commitmentNumberBeans.add(bean);
        if (bean.getCommitmentNumber() == null || bean.getCommitmentNumber().isEmpty()) {
          final MissionProcess missionProcess = process.getMissionProcess();
          if (missionProcess != null) {
            final MissionFinancer missionFinancer = findMissionFinance(missionProcess, financer);
            if (missionFinancer != null) {
              bean.setCommitmentNumber(missionFinancer.getCommitmentNumber());
            }
          }
        }
      }
    }
  }
Example #6
0
 public boolean getHasCandidacyForThisUser() {
   return getCandidacyForThisUser(UserView.getCurrentUser()) != null;
 }
Example #7
0
 public boolean getCanRemoveOfferCandidacy() {
   return !isExternalCandidacy()
       && isCandidancyPeriod()
       && getCandidacyForThisUser(UserView.getCurrentUser()) != null;
 }
Example #8
0
 public boolean canCreateOfferCandidacy() {
   return OfferCandidacy.canCreateOfferCandidacy(
       UserView.getCurrentUser().getPerson().getStudent(), this);
 }
    @Override
    public Map<String, String> getLinks(String page, Object object) {
      Map<String, String> map = null;
      if (page.equals("viewOrganization.jsp")) {
        if (!(object instanceof Unit)) {
          return null;
        }

        Unit unit = (Unit) object;
        final User user = UserView.getCurrentUser();
        Person currentUser = user.getExpenditurePerson();
        if (!(unit.isResponsible(currentUser)
            || unit.getObserversSet().contains(currentUser)
            || UserView.getCurrentUser().hasRoleType(RoleType.MANAGER)
            || unit.isProjectAccountingEmployee(currentUser)
            || ExpenditureTrackingSystem.isProjectAccountingManagerGroupMember(user)
            || ExpenditureTrackingSystem.isAcquisitionsProcessAuditorGroupMember(user))) {
          return null;
        }

        map = new HashMap<String, String>();
        String baseLink =
            "/vaadinContext.do?method=forwardToVaadin#projectsService?unit=" + unit.getExternalId();
        if (unit.isProject()) {
          map.put(
              getMessage("financialprojectsreports.infoProvider.cabimentos"),
              baseLink + "&reportType=" + ReportType.CABIMENTOS_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.adiantamentos"),
              baseLink + "&reportType=" + ReportType.ADIANTAMENTOS_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.revenue"),
              baseLink + "&reportType=" + ReportType.REVENUE_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.expenses"),
              baseLink + "&reportType=" + ReportType.EXPENSES_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.budgetaryBalance"),
              baseLink + "&reportType=" + ReportType.PROJECT_BUDGETARY_BALANCE_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.openingFile"),
              baseLink + "&reportType=" + ReportType.OPENING_PROJECT_FILE_STRING);
        } else {
          map.put(
              getMessage("financialprojectsreports.infoProvider.unitSummary"),
              baseLink + "&reportType=" + ReportType.UNIT_SUMMARY_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.generatedOverheads"),
              baseLink + "&reportType=" + ReportType.GENERATED_OVERHEADS_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.transferedOverheads"),
              baseLink + "&reportType=" + ReportType.TRANSFERED_OVERHEADS_STRING);
          map.put(
              getMessage("financialprojectsreports.infoProvider.overheadsSummary"),
              baseLink + "&reportType=" + ReportType.OVERHEADS_SUMMARY_STRING);
        }
      }
      if (page.equals("viewPerson.jsp")) {
        if (!(object instanceof Person)) {
          return null;
        }
        Person person = (Person) object;

        if (!(UserView.getCurrentUser().getExpenditurePerson().equals(person)
            || UserView.getCurrentUser().hasRoleType(RoleType.MANAGER))) {
          return null;
        }
        map = new HashMap<String, String>();
        map.put(
            getMessage("financialprojectsreports.infoProvider.coordinatorSummary"),
            "/vaadinContext.do?method=forwardToVaadin#projectsService?reportType="
                + ReportType.SUMMARY_STRING
                + "&user="
                + person.getUsername());
      }
      return map;
    }