Excluded host resolutions payments

This commit is contained in:
Joaquin 2025-04-25 12:15:17 +02:00
parent 423457126f
commit ab6ea150a8
2 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,9 @@ with
select * from {{ ref("xero__credit_note_line_items") }}
),
xero__contacts as (select * from {{ ref("xero__contacts") }}),
stg_seed__accounting_aggregations as (
select * from {{ ref("stg_seed__accounting_aggregations") }}
),
fees_invoiced as (
select
cast(
@ -27,6 +30,10 @@ with
sum(cnli.line_amount_wo_taxes_in_gbp) as fees_credited
from xero__credit_note_line_items cnli
left join xero__contacts c on cnli.id_contact = c.id_contact
left join
stg_seed__accounting_aggregations aa
on aa.account_code = cnli.account_code
and aa.root_aggregation <> 'Host Resolutions Payments'
where cnli.credit_note_status in {{ relevant_document_statuses }}
group by date_trunc('month', cnli.credit_note_issued_at_utc), c.id_deal
)

View file

@ -38,3 +38,6 @@ account_code,root_aggregation,kpis_aggregation,financial_l1_aggregation,financia
"239",Resolution Process for Deposit Management Services,Accounting Resolutions,2-Deposit Management,21-Deposit Management Services,215-Resolution Process for Deposit Management Services
"240",Screen and Protect API,Invoiced API Revenue,1-Guest Screening and Protection,18-Screen and Protect API,181-Screen and Protect API
"301",Damage Host-Waiver Payments,Damage Host-Waiver Payments,5-Damage Host-Waiver Payments,51-Damage Host-Waiver Payments,511-Damage Host-Waiver Payments
"316",Host Resolutions Payments,Host Resolutions Payments,4-Mediation and Resolution,42-Host Resolutions,421-Host Resolutions
"323",Host Resolutions Payments,Host Resolutions Payments,4-Mediation and Resolution,43-E-Deposit Resolutions,431-E-Deposit Resolutions
"324",Host Resolutions Payments,Host Resolutions Payments,4-Mediation and Resolution,44-Check In Hero Resolutions,441-Check In Hero Resolutions
1 account_code root_aggregation kpis_aggregation financial_l1_aggregation financial_l2_aggregation financial_l3_aggregation
38 239 Resolution Process for Deposit Management Services Accounting Resolutions 2-Deposit Management 21-Deposit Management Services 215-Resolution Process for Deposit Management Services
39 240 Screen and Protect API Invoiced API Revenue 1-Guest Screening and Protection 18-Screen and Protect API 181-Screen and Protect API
40 301 Damage Host-Waiver Payments Damage Host-Waiver Payments 5-Damage Host-Waiver Payments 51-Damage Host-Waiver Payments 511-Damage Host-Waiver Payments
41 316 Host Resolutions Payments Host Resolutions Payments 4-Mediation and Resolution 42-Host Resolutions 421-Host Resolutions
42 323 Host Resolutions Payments Host Resolutions Payments 4-Mediation and Resolution 43-E-Deposit Resolutions 431-E-Deposit Resolutions
43 324 Host Resolutions Payments Host Resolutions Payments 4-Mediation and Resolution 44-Check In Hero Resolutions 441-Check In Hero Resolutions