Bugfix - Host Resolutions Payments not filtering credit notes relevant status
This commit is contained in:
parent
9cbb748b0f
commit
08678427ad
1 changed files with 6 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
{% set relevant_transaction_status = "('AUTHORISED')" %}
|
{% set relevant_bank_transaction_status = "('AUTHORISED')" %}
|
||||||
|
{% set relevant_credit_note_status = "('AUTHORISED','PAID')" %}
|
||||||
{% set resolutions_credited_documents = "('ACCRECCREDIT')" %}
|
{% set resolutions_credited_documents = "('ACCRECCREDIT')" %}
|
||||||
|
|
||||||
with
|
with
|
||||||
|
|
@ -40,7 +41,7 @@ from int_xero__bank_transactions bt
|
||||||
inner join
|
inner join
|
||||||
int_xero__bank_transaction_line_items blt
|
int_xero__bank_transaction_line_items blt
|
||||||
on bt.id_bank_transaction = blt.id_bank_transaction
|
on bt.id_bank_transaction = blt.id_bank_transaction
|
||||||
and upper(bt.transaction_status) in {{ relevant_transaction_status }}
|
and upper(bt.transaction_status) in {{ relevant_bank_transaction_status }}
|
||||||
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
|
||||||
inner join stg_seed__accounting_aggregations aa on aa.account_code = blt.account_code
|
inner join stg_seed__accounting_aggregations aa on aa.account_code = blt.account_code
|
||||||
union all
|
union all
|
||||||
|
|
@ -65,4 +66,6 @@ select
|
||||||
sdm.document_currency_iso_4217
|
sdm.document_currency_iso_4217
|
||||||
from int_xero__sales_denom_mart sdm
|
from int_xero__sales_denom_mart sdm
|
||||||
inner join stg_seed__accounting_aggregations aa on aa.account_code = sdm.account_code
|
inner join stg_seed__accounting_aggregations aa on aa.account_code = sdm.account_code
|
||||||
where sdm.document_type in {{ resolutions_credited_documents }}
|
where
|
||||||
|
sdm.document_type in {{ resolutions_credited_documents }}
|
||||||
|
and upper(sdm.document_status) in {{ relevant_credit_note_status }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue