mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 04:14:00 +00:00
Exclude Internal Purchase
This commit is contained in:
@@ -5,29 +5,43 @@ WITH booking_arch_logs AS (
|
||||
|
||||
|
||||
-- LOGIC
|
||||
booking_arch_logs_rename AS (
|
||||
-- Exclude service type 'Internal Purchase'
|
||||
exclude_service_type AS (
|
||||
|
||||
SELECT
|
||||
booking_arch_logs.id AS booking_log_id,
|
||||
booking_arch_logs.booking_id,
|
||||
booking_arch_logs.company_id,
|
||||
booking_arch_logs.marking AS booking_marking_id,
|
||||
booking_arch_logs.service_id AS service_type,
|
||||
booking_arch_logs.bank_id,
|
||||
booking_arch_logs.fix_amount AS fix_value,
|
||||
booking_arch_logs.fix_currency_id,
|
||||
booking_arch_logs.convertible_currency_id AS quote_currency_id,
|
||||
booking_arch_logs.conversion_currency_id AS base_currency_id,
|
||||
booking_arch_logs.status,
|
||||
booking_arch_logs.deleted_at AS deleted_datetime,
|
||||
booking_arch_logs.created_at AS created_datetime,
|
||||
booking_arch_logs.updated_at As updated_datetime,
|
||||
'{{ modules.datetime.datetime.now(modules.pytz.timezone("Asia/Kuala_Lumpur")) }}' AS _dbt_ran_datetime
|
||||
*
|
||||
|
||||
FROM booking_arch_logs
|
||||
|
||||
WHERE service_id NOT IN (7) -- 7 : INTERNAL PURCHASE
|
||||
|
||||
),
|
||||
|
||||
booking_arch_logs_rename AS (
|
||||
|
||||
SELECT
|
||||
exclude_service_type.id AS booking_log_id,
|
||||
exclude_service_type.booking_id,
|
||||
exclude_service_type.company_id,
|
||||
exclude_service_type.marking AS booking_marking_id,
|
||||
exclude_service_type.service_id AS service_type,
|
||||
exclude_service_type.bank_id,
|
||||
exclude_service_type.fix_amount AS fix_value,
|
||||
exclude_service_type.fix_currency_id,
|
||||
exclude_service_type.convertible_currency_id AS quote_currency_id,
|
||||
exclude_service_type.conversion_currency_id AS base_currency_id,
|
||||
exclude_service_type.status,
|
||||
exclude_service_type.deleted_at AS deleted_datetime,
|
||||
exclude_service_type.created_at AS created_datetime,
|
||||
exclude_service_type.updated_at As updated_datetime,
|
||||
|
||||
'{{ modules.datetime.datetime.now(modules.pytz.timezone("Asia/Kuala_Lumpur")) }}' AS _dbt_ran_datetime
|
||||
|
||||
FROM exclude_service_type
|
||||
|
||||
),
|
||||
|
||||
|
||||
-- FINAL
|
||||
final_base_exchange__booking_arch_logs AS (
|
||||
|
||||
|
||||
Reference in New Issue
Block a user