Addressed comments
This commit is contained in:
parent
a405affdb4
commit
06031a2e79
2 changed files with 20 additions and 19 deletions
|
|
@ -3,13 +3,6 @@
|
||||||
{% set resolutions_credited_account_code = "('316')" %}
|
{% set resolutions_credited_account_code = "('316')" %}
|
||||||
{% set resolutions_credited_documents = "('ACCRECCREDIT')" %}
|
{% set resolutions_credited_documents = "('ACCRECCREDIT')" %}
|
||||||
|
|
||||||
{{
|
|
||||||
config(
|
|
||||||
materialized="table",
|
|
||||||
unique_key=["id_account", "account_code", "account_name", "line_description"],
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
|
|
||||||
with
|
with
|
||||||
int_xero__sales_denom_mart as (
|
int_xero__sales_denom_mart as (
|
||||||
select * from {{ ref("int_xero__sales_denom_mart") }}
|
select * from {{ ref("int_xero__sales_denom_mart") }}
|
||||||
|
|
@ -22,11 +15,12 @@ with
|
||||||
),
|
),
|
||||||
int_xero__contacts as (select * from {{ ref("int_xero__contacts") }})
|
int_xero__contacts as (select * from {{ ref("int_xero__contacts") }})
|
||||||
select
|
select
|
||||||
|
blt.id_line_item,
|
||||||
|
'bank transaction' as document_class,
|
||||||
blt.id_account,
|
blt.id_account,
|
||||||
blt.account_code,
|
blt.account_code,
|
||||||
blt.account_name,
|
blt.account_name,
|
||||||
blt.line_description,
|
blt.line_description,
|
||||||
'BANK_TRANSACTION' as document_type,
|
|
||||||
bt.transaction_date_utc,
|
bt.transaction_date_utc,
|
||||||
xc.id_deal,
|
xc.id_deal,
|
||||||
blt.quantity,
|
blt.quantity,
|
||||||
|
|
@ -47,13 +41,14 @@ inner join
|
||||||
left join int_xero__contacts xc on xc.id_contact = bt.id_contact
|
left join int_xero__contacts xc on xc.id_contact = bt.id_contact
|
||||||
union all
|
union all
|
||||||
select
|
select
|
||||||
|
sdm.id_line_item,
|
||||||
sdm.id_account,
|
sdm.id_account,
|
||||||
sdm.account_code,
|
sdm.account_code,
|
||||||
sdm.account_name,
|
sdm.account_name,
|
||||||
sdm.line_description,
|
sdm.line_description,
|
||||||
sdm.document_type,
|
sdm.document_class,
|
||||||
sdm.document_is_effective_at_end_of_month_utc,
|
sdm.document_is_effective_at_end_of_month_utc,
|
||||||
xc.id_deal,
|
sdm.id_deal,
|
||||||
sdm.quantity,
|
sdm.quantity,
|
||||||
sdm.unit_amount,
|
sdm.unit_amount,
|
||||||
sdm.line_amount_local_curr,
|
sdm.line_amount_local_curr,
|
||||||
|
|
@ -64,7 +59,6 @@ select
|
||||||
sdm.tax_amount_in_gbp,
|
sdm.tax_amount_in_gbp,
|
||||||
sdm.document_currency_iso_4217
|
sdm.document_currency_iso_4217
|
||||||
from int_xero__sales_denom_mart sdm
|
from int_xero__sales_denom_mart sdm
|
||||||
left join int_xero__contacts xc on xc.id_contact = sdm.id_contact
|
|
||||||
where
|
where
|
||||||
sdm.account_name in {{ resolutions_credited_account_code }}
|
sdm.account_name in {{ resolutions_credited_account_code }}
|
||||||
and sdm.document_type in {{ resolutions_credited_documents }}
|
and sdm.document_type in {{ resolutions_credited_documents }}
|
||||||
|
|
@ -454,19 +454,26 @@ models:
|
||||||
"Year-to-date (YTD) total of sales amount without taxes (GBP) from the start of the previous fiscal
|
"Year-to-date (YTD) total of sales amount without taxes (GBP) from the start of the previous fiscal
|
||||||
year up to the same month."
|
year up to the same month."
|
||||||
|
|
||||||
- name: int_xero__resolutions_payments
|
- name: int_xero__host_resolutions_payments
|
||||||
description: |
|
description: |
|
||||||
This model provides a view of transactions related to resolutions, including details
|
This model provides a view of transactions related to resolutions, including details
|
||||||
such as transaction date, associated account, and transaction amount.
|
such as transaction date, associated account, and transaction amount.
|
||||||
|
|
||||||
Previously, all resolution-related transaction data was stored in the `int_xerp__bank_transactions`
|
Previously, all resolution-related transaction data was stored in the `int_xero__bank_transactions`
|
||||||
model. However, some resolution transactions have been, and will continue to be, credited through
|
model. However, some resolution transactions have been, and will continue to be, credited through
|
||||||
the standard invoicing process — these are stored in the `int_xerp__sales_denom_mart` model.
|
the standard invoicing process — these are stored in the `int_xero__sales_denom_mart` model.
|
||||||
|
|
||||||
This model is built by joining the `int_xerp__bank_transactions` and `int_xerp__sales_denom_mart`
|
This model is built by joining the `int_xero__bank_transactions` and `int_xero__sales_denom_mart`
|
||||||
models to provide a unified view of resolution transactions.
|
models to provide a unified view of resolution transactions.
|
||||||
|
|
||||||
columns:
|
columns:
|
||||||
|
- name: id_line_item
|
||||||
|
data_type: text
|
||||||
|
description: "Unique identifier of the line item associated with the transaction."
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- unique
|
||||||
|
|
||||||
- name: id_account
|
- name: id_account
|
||||||
data_type: text
|
data_type: text
|
||||||
description: "Unique identifier of the account associated with the transaction."
|
description: "Unique identifier of the account associated with the transaction."
|
||||||
|
|
@ -489,15 +496,15 @@ models:
|
||||||
data_type: text
|
data_type: text
|
||||||
description: "Description of the transaction line item."
|
description: "Description of the transaction line item."
|
||||||
|
|
||||||
- name: document_type
|
- name: document_class
|
||||||
data_type: text
|
data_type: text
|
||||||
description: "The type of document associated with the transaction."
|
description: "Indicates whether the record belongs in an a credit note or a bank transaction."
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
- accepted_values:
|
- accepted_values:
|
||||||
values:
|
values:
|
||||||
- "ACCRECCREDIT"
|
- "credit note"
|
||||||
- "BANK_TRANSACTION"
|
- "bank transaction"
|
||||||
|
|
||||||
- name: transaction_date_utc
|
- name: transaction_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue