[BUG] Duplicate rows: Operating expenses appearing both mapped and unmapped (e.g., Advertising Expense) #20
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Several expense line items appear in both the mapped financial statements AND in the unmapped/residual section, creating duplicate rows in the UI.
Specific Example
Advertising Expense (
us-gaap:AdvertisingExpense) appears in the unmapped section despite potentially being relevant to operating expenses.Evidence
From
lib/server/financial-taxonomy.test.ts:741-842:Root Cause
The
AdvertisingExpenseUS-GAAP concept has no template definition inlib/server/financials/standard-template.ts. The income statement template only includes:selling_general_and_administrativeresearch_and_developmentsales_and_marketinggeneral_and_administrativeAdvertising expense should be mapped to one of these or have its own template row.
Impact
Proposed Fix
AdvertisingExpenseto the matchers forselling_general_and_administrativeor create a dedicatedadvertising_expenserowFiles Affected
lib/server/financials/standard-template.tslib/server/financials/surface.tsUpdate: Root Cause Analysis
The Rust sidecar IS being used and IS authoritative.
Data Flow Confirmed:
Finding for Advertising Expense:
The
AdvertisingExpenseconcept IS mapped inrust/taxonomy/fiscal/v1/core.income-bridge.json(line 123) as a component ofselling_general_and_administrative:However,
core.surface.jsondoesn't have anallowed_source_conceptsentry forAdvertisingExpensein theselling_general_and_administrativesurface. The mapping exists in the income-bridge but may not be propagating to the surface output.Fix Required:
us-gaap:AdvertisingExpensetoallowed_source_conceptsincore.surface.jsonfor the relevant operating expense surfacessurface_mapper.rscorrectly applies income-bridge concept groups to surface rowsFiles to Update:
rust/taxonomy/fiscal/v1/core.surface.json