/** * <p>Retrieve owned list of entities for itsOwner. * E.g. invoices lines for invoice</p> * @param pAddParam additional param * @param pEntityItsOwner itsOwner * @return owned list of business objects * @throws Exception - an exception */ @Override public final List<AccountingEntry> retrieveOwnedList( final Map<String, Object> pAddParam, final AccountingEntries pEntityItsOwner) throws Exception { return retrieveOwnedListById(pAddParam, pEntityItsOwner.getItsId()); }
/** * <p>Create entity with its itsOwner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pEntityItsOwner itsOwner * @return entity instance * @throws Exception - an exception **/ @Override public final AccountingEntry createEntityWithOwner( final Map<String, Object> pAddParam, final AccountingEntries pEntityItsOwner) throws Exception { if (!pEntityItsOwner.getIdDatabaseBirth() .equals(getSrvOrm().getIdDatabase())) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_make_entry_for_foreign_src"); } AccountingEntry entity = new AccountingEntry(); entity.setIsNew(true); entity.setItsDate(new Date()); entity.setSourceId(pEntityItsOwner.getItsId()); entity.setSourceType(this.accountingEntriesTypeCode); addAccSettingsIntoAttrs(pAddParam); return entity; }
pRequestData.setAttribute("ownedListsMap", ownedListsMap); String where = "where SOURCETYPE=" + this.accountingEntriesTypeCode + " and SOURCEID=" + entity.getItsId(); List<AccountingEntry> entities = this.srvOrm .retrieveListWithConditions(pAddParam, AccountingEntry.class, where);
"select sum(DEBIT) as DEBIT, sum(CREDIT) as CREDIT from " + "ACCOUNTINGENTRY where SOURCETYPE=" + this.accountingEntriesTypeCode + " and SOURCEID=" + itsOwner.getItsId(); String[] columns = new String[]{"DEBIT", "CREDIT"}; Double[] totals = getSrvDatabase().evalDoubleResults(query, columns);
entity.setDescription(getSrvI18n().getMsg(AccountingEntries.class .getSimpleName() + "short") + " #" + doc.getIdDatabaseBirth() + "-" + doc.getItsId() + ", " + getDateFormatter().format(doc.getItsDate()) + ". " + doc.getDescription()); //only local allowed addAccSettingsIntoAttrs(pAddParam);
pEntity.setDescription(getSrvI18n().getMsg(AccountingEntries.class .getSimpleName() + "short", langDef) + " #" + doc.getIdDatabaseBirth() + "-" + doc.getItsId() + ", " + dateFormat.format(doc.getItsDate()) + ". " + docDescription); //only local allowed pEntity.setIsNew(true);
"select sum(DEBIT) as DEBIT, sum(CREDIT) as CREDIT from " + "ACCOUNTINGENTRY where SOURCETYPE=" + this.accountingEntriesTypeCode + " and SOURCEID=" + itsOwner.getItsId(); String[] columns = new String[]{"DEBIT", "CREDIT"}; Double[] totals = getSrvDatabase().evalDoubleResults(query, columns);
+ "," + entityPb.getIdDatabaseBirth()); entityPb.setSourceId(accountingEntries.getItsId());
+ "," + entityPb.getIdDatabaseBirth()); entityPb.setSourceId(accountingEntries.getItsId());
entity.setDescription(getSrvI18n().getMsg(AccountingEntries.class .getSimpleName() + "short", langDef) + " #" + doc.getIdDatabaseBirth() + "-" + doc.getItsId() + ", " + dateFormat.format(doc.getItsDate()) + ". " + docDescription); //only local allowed entity.setIsNew(true);