code: @Override
    public final List<WarehouseEntry> retrieveEntriesFor(
      final Map<String, Object> pAddParam,
        final IDocWarehouse pEntity) throws Exception {
      String tblNm = WarehouseEntry.class.getSimpleName().toUpperCase();
      List<WarehouseEntry> result = null;
      if (pEntity instanceof IMakingWarehouseEntry) {
        //e.g. Manufacture
        String where = " where SOURCETYPE=" + pEntity.constTypeCode()
          + " and " + tblNm + ".IDDATABASEBIRTH=" + getSrvOrm().getIdDatabase()
            + " and SOURCEID=" + pEntity.getItsId();
        result = getSrvOrm().retrieveListWithConditions(pAddParam,
          WarehouseEntry.class, where);
      }
      if (pEntity.getLinesWarehouseType() != null) {
        //e.g. PurchaseInvoice
        if (result == null) {
          result = retrieveEntriesForOwner(pAddParam, pEntity.constTypeCode(),
            pEntity.getItsId());
        } else {
          result.addAll(retrieveEntriesForOwner(pAddParam,
            pEntity.constTypeCode(), pEntity.getItsId()));
        }
      }
      return result;
    }
docs: <p>Retrieve entries for document.</p>
  @param pAddParam additional param
  @param pEntity a document
  @return warehouse entries made by this document
  @throws Exception - an exception