Examples of BuchungssatzDO


Examples of org.projectforge.fibu.kost.BuchungssatzDO

  private void reconcileBuchungsdaten(final ImportedSheet<BuchungssatzDO> sheet)
  {
    log.info("Reconcile Buchungsdaten called");
    for (final ImportedElement<BuchungssatzDO> el : sheet.getElements()) {
      final BuchungssatzDO satz = el.getValue();
      if (el.isFaulty() == true) {
        String kost = (String) el.getErrorProperty("kost1");
        if (kost != null) {
          final int[] vals = KostFormatter.splitKost(kost);
          final Kost1DO kost1 = kost1Dao.getKost1(vals[0], vals[1], vals[2], vals[3]);
          if (kost1 != null) {
            satz.setKost1(kost1);
            el.removeErrorProperty("kost1");
          }
        }
        kost = (String) el.getErrorProperty("kost2");
        if (kost != null) {
          final int[] vals = KostFormatter.splitKost(kost);
          final Kost2DO kost2 = kost2Dao.getKost2(vals[0], vals[1], vals[2], vals[3]);
          if (kost2 != null) {
            satz.setKost2(kost2);
            el.removeErrorProperty("kost2");
          }
        }
      }
      final BuchungssatzDO dbSatz = buchungssatzDao.getBuchungssatz(satz.getYear(), satz.getMonth(), satz.getSatznr());
      if (dbSatz != null) {
        el.setOldValue(dbSatz);
      }
    }
    sheet.setStatus(ImportStatus.RECONCILED);
View Full Code Here

Examples of org.projectforge.fibu.kost.BuchungssatzDO

  private int commitBuchungsdaten(final ImportedSheet<BuchungssatzDO> sheet)
  {
    log.info("Commit Buchungsdaten called");
    final Collection<BuchungssatzDO> col = new ArrayList<BuchungssatzDO>();
    for (final ImportedElement<BuchungssatzDO> el : sheet.getElements()) {
      final BuchungssatzDO satz = el.getValue();
      final BuchungssatzDO dbSatz = buchungssatzDao.getBuchungssatz(satz.getYear(), satz.getMonth(), satz.getSatznr());
      boolean addSatz = false;
      if (dbSatz != null) {
        satz.setId(dbSatz.getId());
        if (el.isSelected() == true) {
          addSatz = true;
        }
      } else if (el.isSelected() == true) {
        addSatz = true;
      }
      if (addSatz == true) {
        final BuchungssatzDO newSatz = new BuchungssatzDO();
        newSatz.copyValuesFrom(satz, "konto", "gegenKonto", "kost1", "kost2");
        newSatz.setKonto((KontoDO) get(KontoDO.class, satz.getKontoId()));
        newSatz.setGegenKonto((KontoDO) get(KontoDO.class, satz.getGegenKontoId()));
        newSatz.setKost1((Kost1DO) get(Kost1DO.class, satz.getKost1Id()));
        newSatz.setKost2((Kost2DO) get(Kost2DO.class, satz.getKost2Id()));
        col.add(newSatz);
      }
    }
    buchungssatzDao.internalSaveOrUpdate(buchungssatzDao, col, BUCHUNGSSATZ_INSERT_BLOCK_SIZE);
    return col.size();
View Full Code Here

Examples of org.projectforge.fibu.kost.BuchungssatzDO

      }
      if (element == null) {
        // Empty row:
        continue;
      }
      final BuchungssatzDO satz = element.getValue();
      final DateHolder date = new DateHolder(satz.getDatum(), DatePrecision.DAY, Locale.GERMAN);
      if (year == 0) {
        year = date.getYear();
      } else if (year != date.getYear()) {
        final String msg = "Not supported: Buchungssätze innerhalb eines Excel-Sheets liegen in verschiedenen Jahren: Im Blatt '" + sheet.getSheetName() + "', in Zeile " + (i + 2);
        actionLog.logError(msg);
        throw new UserException(msg);
      }
      if (date.getMonth() > month) {
        final String msg = "Buchungssätze können nicht in die Zukunft für den aktuellen Monat '"
            + KostFormatter.formatBuchungsmonat(year, date.getMonth())
            + " gebucht werden! "
            + satz;
        actionLog.logError(msg);
        throw new RuntimeException(msg);
      } else if (date.getMonth() < month) {
        final String msg = "Buchungssatz liegt vor Monat '" + KostFormatter.formatBuchungsmonat(year, month) + "' (OK): " + satz;
        actionLog.logInfo(msg);
      }
      satz.setYear(year);
      satz.setMonth(month);
      importedSheet.addElement(element);
      log.debug(satz);
    }
    importedSheet.setName(KostFormatter.formatBuchungsmonat(year, month));
    importedSheet.setProperty("year", year);
View Full Code Here

Examples of org.projectforge.fibu.kost.BuchungssatzDO

    if (row.isEmpty() == true) {
      return null;
    }
    final ImportedElement<BuchungssatzDO> element = new ImportedElement<BuchungssatzDO>(storage.nextVal(), BuchungssatzDO.class,
        DatevImportDao.BUCHUNGSSATZ_DIFF_PROPERTIES);
    final BuchungssatzDO satz = new BuchungssatzDO();
    element.setValue(satz);
    satz.setBeleg(row.beleg);
    satz.setBetrag(row.betrag);
    satz.setSH(row.sh);
    satz.setDatum(row.datum);
    satz.setSatznr(row.satzNr);
    satz.setText(StringUtils.replace(row.text, "^", ""));
    satz.setMenge(row.menge);
    satz.setComment(row.comment);
    KontoDO konto = kontoDao.getKonto(row.konto);
    if (konto != null) {
      satz.setKonto(konto);
    } else {
      element.putErrorProperty("konto", row.konto);
    }
    konto = kontoDao.getKonto(row.gegenkonto);
    if (konto != null) {
      satz.setGegenKonto(konto);
    } else {
      element.putErrorProperty("gegenkonto", row.gegenkonto);
    }
    int[] values = KostFormatter.splitKost(row.getKost1());
    final Kost1DO kost1 = kost1Dao.getKost1(values[0], values[1], values[2], values[3]);
    if (kost1 != null) {
      satz.setKost1(kost1);
    } else {
      element.putErrorProperty("kost1", KostFormatter.formatKost(row.kost1));
    }
    values = KostFormatter.splitKost(row.getKost2());
    final Kost2DO kost2 = kost2Dao.getKost2(values[0], values[1], values[2], values[3]);
    if (kost2 != null) {
      satz.setKost2(kost2);
    } else {
      element.putErrorProperty("kost2", KostFormatter.formatKost(row.kost2));
    }
    satz.calculate();
    return element;
  }
View Full Code Here

Examples of org.projectforge.fibu.kost.BuchungssatzDO

  {
    final ImportedSheet< ? > sheet = getStorage().getNamedSheet(sheetName);
    Validate.notNull(sheet);
    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);
View Full Code Here

Examples of org.projectforge.fibu.kost.BuchungssatzDO

  public void select(final List<BuchungssatzDO> list)
  {
    final Predicate regExpPredicate = new Predicate() {
      public boolean evaluate(final Object obj)
      {
        final BuchungssatzDO satz = (BuchungssatzDO) obj;
        final String kost1 = KostFormatter.format(satz.getKost1());
        final String kost2 = KostFormatter.format(satz.getKost2());

        // 1st of all the Blacklists
        if (match(reportObjective.getKost1ExcludeRegExpList(), kost1, false) == true) {
          return false;
        }
View Full Code Here

Examples of org.projectforge.fibu.kost.BuchungssatzDO

    if (getStorageType() == DatevImportDao.Type.KONTENPLAN) {
      final KontoDO konto = (KontoDO) element.getValue();
      addCell(cellRepeater, konto.getNummer(), style + " white-space: nowrap; text-align: right;");
      addCell(cellRepeater, konto.getBezeichnung(), style);
    } else {
      final BuchungssatzDO satz = (BuchungssatzDO) element.getValue();
      addCell(cellRepeater, satz.getSatznr(), style + " white-space: nowrap; text-align: right;");
      addCell(cellRepeater, DateTimeFormatter.instance().getFormattedDate(satz.getDatum()), style + " white-space: nowrap;");
      addCell(cellRepeater, CurrencyFormatter.format(satz.getBetrag()), style + " white-space: nowrap; text-align: right;");
      addCell(cellRepeater, satz.getText(), style);
      addCell(cellRepeater, satz.getKonto() != null ? satz.getKonto().getNummer() : null, style);
      addCell(cellRepeater, satz.getGegenKonto() != null ? satz.getGegenKonto().getNummer() : null, style);
      final Kost1DO kost1 = satz.getKost1();
      Component comp = addCell(cellRepeater, kost1 != null ? kost1.getShortDisplayName() : null, style);
      if (kost1 != null) {
        WicketUtils.addTooltip(comp, KostFormatter.formatToolTip(kost1));
      }
      final Kost2DO kost2 = satz.getKost2();
      comp = addCell(cellRepeater, kost2 != null ? kost2.getShortDisplayName() : null, style);
      if (kost2 != null) {
        WicketUtils.addTooltip(comp, KostFormatter.formatToolTip(kost2));
      }
    }
View Full Code Here

Examples of org.projectforge.fibu.kost.BuchungssatzDO

    final List<IColumn<BuchungssatzDO, String>> columns = new ArrayList<IColumn<BuchungssatzDO, String>>();
    final CellItemListener<BuchungssatzDO> cellItemListener = new CellItemListener<BuchungssatzDO>() {
      public void populateItem(final Item<ICellPopulator<BuchungssatzDO>> item, final String componentId,
          final IModel<BuchungssatzDO> rowModel)
      {
        final BuchungssatzDO satz = rowModel.getObject();
        appendCssClasses(item, satz.getId(), satz.isDeleted());
      }
    };
    columns.add(new CellItemListenerPropertyColumn<BuchungssatzDO>(new Model<String>(getString("fibu.buchungssatz.satznr")),
        "formattedSatzNummer", "formattedSatzNummer", cellItemListener) {
      @SuppressWarnings({ "unchecked", "rawtypes"})
      @Override
      public void populateItem(final Item item, final String componentId, final IModel rowModel)
      {
        final BuchungssatzDO satz = (BuchungssatzDO) rowModel.getObject();
        item.add(new ListSelectActionPanel(componentId, rowModel, AccountingRecordEditPage.class, satz.getId(),
            AccountingRecordListPage.this, String.valueOf(satz.getFormattedSatzNummer())));
        cellItemListener.populateItem(item, componentId, rowModel);
        addRowClick(item);
      }
    });
    columns.add(new CurrencyPropertyColumn<BuchungssatzDO>(getString("fibu.common.betrag"), "betrag", "betrag", cellItemListener));
    columns
    .add(new CellItemListenerPropertyColumn<BuchungssatzDO>(getString("fibu.buchungssatz.beleg"), "beleg", "beleg", cellItemListener));
    columns.add(new CellItemListenerPropertyColumn<BuchungssatzDO>(new Model<String>(getString("fibu.kost1")), getSortable(
        "kost1.shortDisplayName", sortable), "kost1.shortDisplayName", cellItemListener) {
      @Override
      public String getTooltip(final BuchungssatzDO satz)
      {
        final Kost1DO kost1 = satz != null ? satz.getKost1() : null;
        if (kost1 == null) {
          return null;
        } else {
          return KostFormatter.formatToolTip(kost1);
        }
      }
    });
    columns.add(new CellItemListenerPropertyColumn<BuchungssatzDO>(new Model<String>(getString("fibu.kost2")), getSortable(
        "kost2.shortDisplayName", sortable), "kost2.shortDisplayName", cellItemListener) {
      @Override
      public String getTooltip(final BuchungssatzDO satz)
      {
        final Kost2DO kost2 = satz != null ? satz.getKost2() : null;
        if (kost2 == null) {
          return null;
        } else {
          return KostFormatter.formatToolTip(kost2);
        }
      }
    });
    columns.add(new CellItemListenerPropertyColumn<BuchungssatzDO>(new Model<String>(getString("fibu.buchungssatz.konto")), getSortable(
        "konto.shortDisplayName", sortable), "konto.shortDisplayName", cellItemListener) {
      @Override
      public String getTooltip(final BuchungssatzDO satz)
      {
        final KontoDO konto = satz != null ? satz.getKonto() : null;
        if (konto == null) {
          return null;
        } else {
          return konto.getBezeichnung();
        }
      }
    });
    columns.add(new CellItemListenerPropertyColumn<BuchungssatzDO>(new Model<String>(getString("fibu.buchungssatz.gegenKonto")),
        getSortable("gegenKonto.shortDisplayName", sortable), "gegenKonto.shortDisplayName", cellItemListener) {
      @Override
      public String getTooltip(final BuchungssatzDO satz)
      {
        final KontoDO gegenKonto = satz != null ? satz.getGegenKonto() : null;
        if (gegenKonto == null) {
          return null;
        } else {
          return gegenKonto.getBezeichnung();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.