data-dwh-dbt-project/models/reporting/xero/xero__invoices.sql

35 lines
1.5 KiB
MySQL
Raw Normal View History

2024-05-13 16:52:55 +02:00
with int_xero__invoices as (select * from {{ ref("int_xero__invoices") }})
select
id_invoice as id_invoice,
id_contact as id_contact,
reference as reference,
invoice_number as invoice_number,
invoice_issued_date_utc as invoice_issued_date_utc,
invoice_due_date_utc as invoice_due_date_utc,
was_fully_paid_on_date_utc as was_fully_paid_on_date_utc,
invoice_type as invoice_type,
invoice_currency_iso_4217 as invoice_currency_iso_4217,
exchange_rate_to_gbp as exchange_rate_to_gbp,
total_amount_local_curr as total_amount_local_curr,
total_amount_wo_tax_local_curr as total_amount_wo_tax_local_curr,
total_tax_local_curr as total_tax_local_curr,
total_due_local_curr as total_due_local_curr,
total_paid_local_curr as total_paid_local_curr,
invoice_status as invoice_status,
has_errors as has_errors,
is_discounted as is_discounted,
date_string as date_string,
due_date_string as due_date_string,
has_been_sent_to_contact as has_been_sent_to_contact,
total_discount as total_discount,
total_credited_local_curr as total_credited_local_curr,
has_attachments as has_attachments,
updated_at_utc as updated_at_utc,
updated_date_utc as updated_date_utc,
line_amount_tax_inclusiveness as line_amount_tax_inclusiveness,
payment_planned_date_utc as payment_planned_date_utc,
payment_expected_date_utc as payment_expected_date_utc,
dwh_extracted_at_utc as dwh_extracted_at_utc
from int_xero__invoices