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
)