# Description Propagate account code and account name for Xero reporting models, specifically: * xero__credit_note_line_items * xero__invoice_line_items * xero__sales_denom_mart These are already available in intermediate models. This is independent from KPIs, but I feel like we should propagate this to reporting since are useful fields for accounting purposes. Happy to discuss if this needs to be reflected in PBI. # Checklist - [X] The edited models and dependants run properly with production data. - [X] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [NA] I have checked for DRY opportunities with other models and docs. - [NA] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #26531
24 lines
793 B
SQL
24 lines
793 B
SQL
with
|
|
int_xero__invoice_line_items as (
|
|
select * from {{ ref("int_xero__invoice_line_items") }}
|
|
)
|
|
|
|
select
|
|
id_invoice as id_invoice,
|
|
id_line_item as id_line_item,
|
|
id_item as id_item,
|
|
item_code as item_code,
|
|
account_code as account_code,
|
|
account_name as account_name,
|
|
quantity as quantity,
|
|
unit_amount as unit_amount,
|
|
line_amount_local_curr as line_amount_local_curr,
|
|
line_amount_in_gbp as line_amount_in_gbp,
|
|
line_amount_wo_taxes_local_curr,
|
|
line_amount_wo_taxes_in_gbp,
|
|
tax_amount_local_curr as tax_amount_local_curr,
|
|
tax_amount_in_gbp as tax_amount_in_gbp,
|
|
tax_type as tax_type,
|
|
invoice_currency_iso_4217 as invoice_currency_iso_4217,
|
|
line_description as line_description
|
|
from int_xero__invoice_line_items li
|