Package org.projectforge.fibu.kost

Examples of org.projectforge.fibu.kost.BusinessAssessment


      }
    }
    rowRepeater.removeAll();
    int row = 0;
    final BusinessAssessmentTable businessAssessmentTable = currentReport.getChildBusinessAssessmentTable(true);
    final BusinessAssessment firstBusinessAssessment = businessAssessmentTable.getBusinessAssessmentList().get(0).getValue();
    for (final BusinessAssessmentRow firstBusinessAssessmentRow : firstBusinessAssessment.getRows()) { // First BusinessAssessment for
      // getting meta data of
      // BusinessAssessment.
      if (priority.ordinal() > firstBusinessAssessmentRow.getPriority().ordinal()) {
        // Don't show all business assessment rows (priority is here a kind of verbose level).
        continue;
      }
      final WebMarkupContainer rowContainer = new WebMarkupContainer(rowRepeater.newChildId());
      rowRepeater.add(rowContainer);
      rowContainer.add(AttributeModifier.replace("class", (row++ % 2 == 0) ? "even" : "odd"));
      rowContainer.add(new Label("zeileNo", firstBusinessAssessmentRow.getNo()));
      StringBuffer buf = new StringBuffer();
      for (int i = 0; i < firstBusinessAssessmentRow.getIndent(); i++) {
        buf.append("&nbsp;&nbsp;");
      }
      buf.append(HtmlHelper.escapeXml(firstBusinessAssessmentRow.getTitle()));
      rowContainer.add(new Label("description", buf.toString()).setEscapeModelStrings(false));
      final RepeatingView cellRepeater = new RepeatingView("cellRepeater");
      rowContainer.add(cellRepeater);
      int col = 0;
      for (final LabelValueBean<String, BusinessAssessment> lv : businessAssessmentTable.getBusinessAssessmentList()) {
        // So display the row for every BusinessAssessment:
        final String reportId = lv.getLabel();
        final BusinessAssessment businessAssessment = lv.getValue();
        final BusinessAssessmentRow businessAssessmentRow = businessAssessment.getRow(firstBusinessAssessmentRow.getId());
        final WebMarkupContainer item = new WebMarkupContainer(cellRepeater.newChildId());
        cellRepeater.add(item);
        buf = new StringBuffer();
        buf.append("text-align: right; white-space: nowrap;");
        if (col++ == 0) {
View Full Code Here


    final List<BuchungssatzDO> list = new ArrayList<BuchungssatzDO>();
    for (final ImportedElement< ? > element : sheet.getElements()) {
      final BuchungssatzDO satz = (BuchungssatzDO) element.getValue();
      list.add(satz);
    }
    final BusinessAssessment businessAssessment = new BusinessAssessment(AccountingConfig.getInstance().getBusinessAssessmentConfig(),
        (Integer) sheet.getProperty("year"), (Integer) sheet.getProperty("month"));
    form.setBusinessAssessment(businessAssessment);
    businessAssessment.setAccountRecords(list);
  }
View Full Code Here

   * Creates a new business assessment from the given buchungsSaetze and adds all lines of the resulting BusinessAssessment as parameters.
   * @see ReportBwaImpl#putBwaWerte(Map, BusinessAssessment)
   */
  public BusinessAssessment addBusinessAssessment(final List<BuchungssatzDO> buchungsSaetze)
  {
    final BusinessAssessment businessAssessment = new BusinessAssessment(AccountingConfig.getInstance().getBusinessAssessmentConfig(), buchungsSaetze);
    addBusinessAssessment(businessAssessment);
    return businessAssessment;
  }
View Full Code Here

  }

  public BusinessAssessment getBusinessAssessment()
  {
    if (this.businessAssessment == null) {
      this.businessAssessment = new BusinessAssessment(AccountingConfig.getInstance().getBusinessAssessmentConfig());
      this.businessAssessment.setReference(this);
      this.businessAssessment.setStoreAccountRecordsInRows(true);
      this.businessAssessment.setAccountRecords(this.buchungssaetze);
    }
    return this.businessAssessment;
View Full Code Here

    }.suppressLabelForWarning();
    fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
      @Override
      public String getObject()
      {
        final BusinessAssessment bwa = getBusinessAssessment();
        return fs.getString("fibu.businessAssessment.overallPerformance")
            + ": "
            + CurrencyFormatter.format(bwa != null ? bwa.getOverallPerformanceRowAmount() : BigDecimal.ZERO)
            + WebConstants.HTML_TEXT_DIVIDER;
      }
    }, TextStyle.BLUE));
    fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
      @Override
      public String getObject()
      {
        final BusinessAssessment bwa = getBusinessAssessment();
        return fs.getString("fibu.businessAssessment.merchandisePurchase")
            + ": "
            + CurrencyFormatter.format(bwa != null ? bwa.getMerchandisePurchaseRowAmount() : BigDecimal.ZERO)
            + WebConstants.HTML_TEXT_DIVIDER;
      }
    }));
    fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
      @Override
      public String getObject()
      {
        final BusinessAssessment bwa = getBusinessAssessment();
        return fs.getString("fibu.businessAssessment.preliminaryResult")
            + ": "
            + CurrencyFormatter.format(bwa != null ? bwa.getPreliminaryResultRowAmount() : BigDecimal.ZERO);
      }
    }));

    final RepeatingView repeater = new RepeatingView(FieldsetPanel.DESCRIPTION_SUFFIX_ID) {
      /**
       * @see org.apache.wicket.Component#isVisible()
       */
      @Override
      public boolean isVisible()
      {
        return getBusinessAssessment() != null;
      }
    };
    fs.setDescriptionSuffix(repeater);
    IconPanel icon = new IconPanel(repeater.newChildId(), IconType.PLUS_SIGN).setOnClick("javascript:showBusinessAssessment();");
    icon.setMarkupId("showBusinessAssessment").setOutputMarkupId(true);
    repeater.add(icon);
    icon = new IconPanel(repeater.newChildId(), IconType.MINUS_SIGN).setOnClick("javascript:hideBusinessAssessment();").appendAttribute(
        "style", "display: none;");
    icon.setMarkupId("hideBusinessAssessment").setOutputMarkupId(true);
    repeater.add(icon);

    gridBuilder.newGridPanel();
    final DivPanel businessAssessmentPanel = gridBuilder.getPanel();
    businessAssessmentPanel.setMarkupId("businessAssessment");
    businessAssessmentPanel.add(AttributeModifier.append("style", "display: none;"));
    final FieldsetPanel fieldset = new FieldsetPanel(businessAssessmentPanel, "").suppressLabelForWarning();
    final Label label = new Label(DivTextPanel.WICKET_ID, new Model<String>() {
      /**
       * @see org.apache.wicket.model.Model#getObject()
       */
      @Override
      public String getObject()
      {
        final BusinessAssessment businessAssessment = getBusinessAssessment();
        if (businessAssessment == null) {
          return "";
        }
        return businessAssessment.asHtml();
      }
    });
    label.setEscapeModelStrings(false);
    fieldset.add(new DivTextPanel(fieldset.newChildId(), label).setMarkupId("businessAssessment"));
  }
View Full Code Here

      list = super.buildList();
    }
    if (CollectionUtils.isEmpty(list) == true) {
      this.businessAssessment = null;
    } else {
      this.businessAssessment = new BusinessAssessment(AccountingConfig.getInstance().getBusinessAssessmentConfig());
      this.businessAssessment.setAccountRecords(list);
    }
    return list;
  }
View Full Code Here

TOP

Related Classes of org.projectforge.fibu.kost.BusinessAssessment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.