/** * Formats the account as string: "[nummer] [title]", e. g. "11000 Micromata GmbH" * * @param konto */ public static String formatKonto(final KontoDO konto) { return String.valueOf(konto.getNummer()) + " " + konto.getBezeichnung(); }
public Integer getId() { return konto.getId(); }
private KontoDO convertKonto(final KontenplanExcelRow row) throws Exception { final KontoDO konto = new KontoDO(); konto.setNummer(row.konto); konto.setBezeichnung(row.bezeichnung); return konto; } }
mapping.add(AccountsCol.NUMBER, konto.getNummer()); mapping.add(AccountsCol.NAME, konto.getBezeichnung()); mapping.add(AccountsCol.DATE_OF_LAST_MODIFICATION, konto.getLastUpdate()); mapping.add(AccountsCol.DATE_OF_CREATION, konto.getCreated()); String status = ""; if (konto.isDeleted() == true) { status = ThreadLocalUserContext.getLocalizedString("deleted"); } else if (konto.getStatus() != null) { status = ThreadLocalUserContext.getLocalizedString(konto.getStatus().getI18nKey()); mapping.add(AccountsCol.DESCRIPTION, konto.getDescription()); sheet.addRow(mapping.getMapping(), 0);
private void setExpectedTimeOfPayment(final LiquidityEntry entry, final EingangsrechnungDO invoice) { Date dateOfInvoice = invoice.getDatum(); if (dateOfInvoice == null) { dateOfInvoice = new DayHolder().getSQLDate(); } final KontoDO account = invoice.getKonto(); if (account != null && setExpectedDateOfCreditorPayment(entry, dateOfInvoice, "account#" + account.getId(), "" + account.getNummer() + " - " + account.getBezeichnung()) == true) { return; } String creditorText = invoice.getKreditor(); if (creditorText != null) { creditorText = creditorText.toLowerCase(); if (setExpectedDateOfCreditorPayment(entry, dateOfInvoice, "creditor:" + creditorText, creditorText) == true) { return; } if (creditorText.length() > 5) { creditorText = creditorText.substring(0, 5); } if (setExpectedDateOfCreditorPayment(entry, dateOfInvoice, "shortCreditor:" + creditorText, creditorText) == true) { return; } } }
public Integer getNummer() { return konto.getNummer(); } }
@Override protected void onSaveOrModify(final KontoDO obj) { if (obj.getNummer() != null && obj.getNummer() > 0) { KontoDO existingAccount = getKonto(obj.getNummer()); //Insert case if (existingAccount != null && (obj.getId() == null || obj.getId().equals(existingAccount.getId()) == false)) { throw new UserException("fibu.konto.validate.duplicate"); } } } }
private int commitKontenplan(final ImportedSheet<KontoDO> sheet) { log.info("Commit Kontenplan called"); final Collection<KontoDO> col = new ArrayList<KontoDO>(); for (final ImportedElement<KontoDO> el : sheet.getElements()) { final KontoDO konto = el.getValue(); final KontoDO dbKonto = kontoDao.getKonto(konto.getNummer()); if (dbKonto != null) { konto.setId(dbKonto.getId()); if (el.isSelected() == true) { col.add(konto); } } else if (el.isSelected() == true) { col.add(konto); } } kontoDao.internalSaveOrUpdate(kontoDao, col, KONTO_INSERT_BLOCK_SIZE); return col.size(); }
public String getBezeichnung() { return konto.getBezeichnung(); }
@Override protected String formatValue(final KontoDO konto) { if (konto == null) { return ""; } return konto.formatKonto(); }
@Override protected List<KontoDO> getChoices(final String input) { final BaseSearchFilter filter = new BaseSearchFilter(); filter.setSearchFields("nummer", "bezeichnung", "description"); filter.setSearchString(input); final List<KontoDO> list = kontoDao.getList(filter); if (kontoNumberRanges != null && list != null) { final List<KontoDO> result = new ArrayList<KontoDO>(); for (final KontoDO konto : list) { if (konto.getStatus() == KontoStatus.NONACTIVE) { continue; } if (kontoNumberRanges.doesMatch(konto.getNummer()) == true) { result.add(konto); } } return result; } return list; }
@Override public KontoDO newInstance() { return new KontoDO(); }
&& setExpectedDateOfPayment(entry, dateOfInvoice, "account#" + account.getId(), "" + account.getNummer() + " - " + account.getBezeichnung()) == true) { return;
/** * @see org.projectforge.web.wicket.CellItemListenerPropertyColumn#populateItem(org.apache.wicket.markup.repeater.Item, * java.lang.String, org.apache.wicket.model.IModel) */ @Override public void populateItem(final Item<ICellPopulator<KontoDO>> item, final String componentId, final IModel<KontoDO> rowModel) { final KontoDO konto = rowModel.getObject(); if (isSelectMode() == false) { item.add(new ListSelectActionPanel(componentId, rowModel, KontoEditPage.class, konto.getId(), returnToPage, String.valueOf(konto .getNummer()))); } else { item.add(new ListSelectActionPanel(componentId, rowModel, caller, selectProperty, konto.getId(), String.valueOf(konto.getNummer()))); } cellItemListener.populateItem(item, componentId, rowModel); addRowClick(item); } });
@Override public String getTooltip(final BuchungssatzDO satz) { final KontoDO konto = satz != null ? satz.getKonto() : null; if (konto == null) { return null; } else { return konto.getBezeichnung(); } } });
@Override protected String formatLabel(final KontoDO konto) { if (konto == null) { return ""; } return konto.formatKonto(); }
@Override protected String formatLabel(final KontoDO value) { if (value == null) { return ""; } return String.valueOf(value.getNummer()) + " - " + value.getBezeichnung(); }