Results for “flag_arrenda”

18 results




AI-generated from documented ETRM metadata — verify critical details on the linked pages.

Overview

JE_ES_MODELO_347 is a valid Oracle E-Business Suite view owned by the APPS schema and delivered as part of the JE — European Localizations product family. Its name identifies it as the reporting model for the Spanish Modelo 347, the annual informational declaration through which Spanish-resident entities report operations with third parties that exceeded the statutory threshold (historically 3,005.06 EUR) during the calendar year. In EBS 12.1.1 and 12.2.2 the view functions as the presentation and security layer over the transaction table that stores the Modelo 347 declaration lines, exposing a denormalized, report-ready row set for each counterparty.

The view is not a base data-entry object. It is queried by the Spanish localization reporting programs and by ad hoc extract tools that generate the annual declaration files for submission to the Spanish tax authority (AEAT). Because it applies an operating-unit filter internally, it returns only the rows visible to the current application session context.

Underlying Base Objects

The view is defined over a single referenced base object, JE_ES_MODELO_347_ALL, which is documented in the ETRM metadata as a SYNONYM. The name suffix _ALL indicates that the underlying table is a multi-organization (multi-org) table partitioned by ORG_ID, consistent with the standard Oracle EBS multi-org architecture. The view text performs a filtered SELECT of all business columns from that synonym, applying an equality predicate on ORG_ID:

  • The predicate resolves ORG_ID against the organization identifier encoded in the USERENV('CLIENT_INFO') session context, using SUBSTRB to read the first ten characters and DECODE to treat a leading space as NULL.
  • Both sides of the comparison are wrapped in NVL(..., -99), so rows with a NULL ORG_ID are treated as belonging to the sentinel value -99 and are matched only when the session context also resolves to -99.
  • SET_OF_BOOKS_ID is also exposed, allowing the declaration to be segmented by ledger where multiple sets of books exist.

This design enforces operating-unit security at the view level rather than requiring each report to repeat the filter.

Key Columns

The view exposes eighteen columns that map directly to the individual fields of a Modelo 347 declaration record:

  • TIPO — the operation type code (for example, purchases, sales, or other categorized transactions) that determines how the amount is classified on the declaration.
  • IMPORTE — the reported amount for the counterparty and operation type, normally the annual aggregate subject to the threshold.
  • NOMBRE and NIF — the counterparty's legal name and Spanish tax identification number, the primary identification fields on the declaration.
  • SIGLA — the abbreviated or trade name associated with the counterparty.
  • MUNICIPIO, CODIGO_POSTAL, VIA_PUBLICA, NUMERO, ESCALERA, PISO, PUERTA, REF_CATASTRAL — the counterparty address components, structured to match the AEAT address format including staircase, floor, door, and cadastral reference.
  • FIN_IND — an indicator flag used to mark the final or closing record in the generated declaration sequence.
  • FLAG_ARRENDA — an indicator identifying operations related to urban property leasing, which carry distinct reporting treatment under the Modelo 347 rules.
  • COMENTARIO — free-text remarks carried through to the declaration output.
  • SET_OF_BOOKS_ID and ORG_ID — the ledger and operating unit identifiers that drive accounting and multi-org segmentation.

Common Use Cases and Queries

The principal use case is extraction of the annual Modelo 347 declaration for a given ledger and operating unit. A typical query aggregates amounts by counterparty and operation type and filters out records below the reporting threshold:

  • SELECT nif, nombre, tipo, SUM(importe) FROM apps.je_es_modelo_347 WHERE set_of_books_id = :ledger_id AND org_id = :org_id GROUP BY nif, nombre, tipo HAVING SUM(importe) > 3005.06 ORDER BY nif;
  • Address validation and correction: SELECT nif, nombre, municipio, codigo_postal, via_publica, numero, ref_catastral FROM apps.je_es_modelo_347 WHERE nif = :nif;
  • Lease-related reconciliation using the arrenda flag: SELECT nif, nombre, importe, comentario FROM apps.je_es_modelo_347 WHERE flag_arrenda = 'Y' AND set_of_books_id = :ledger_id;
  • Record-count and control-total checks before file generation, verifying that exactly one FIN_IND row exists per declaration batch.

Because the view enforces operating-unit security through USERENV('CLIENT_INFO'), callers must establish a valid application session context before querying; direct SQL from a tool that does not set CLIENT_INFO will resolve ORG_ID to -99 and return only rows whose ORG_ID is NULL or explicitly -99.