Exclude Internal Purchase

This commit is contained in:
CIEF ACC1
2023-11-22 16:02:56 +00:00
parent d1108da3e5
commit 8ad1d143d0
@@ -5,20 +5,34 @@ WITH currency_rates AS (
-- LOGIC
-- Exclude service type 'Internal Purchase'
exclude_service_type AS (
SELECT
*
FROM currency_rates
WHERE service_id NOT IN (7) -- 7 : INTERNAL PURCHASE
),
currency_rates_rename AS (
SELECT
currency_rates.id AS currency_rate_id,
currency_rates.currency_id AS quote_currency_id,
currency_rates.selling AS base_to_quote_currency_exchange_rate,
currency_rates.payment_method_type AS payment_method,
currency_rates.service_id AS service_type,
currency_rates.deleted_at AS deleted_datetime,
currency_rates.created_at AS created_datetime,
currency_rates.updated_at AS updated_datetime,
exclude_service_type.id AS currency_rate_id,
exclude_service_type.currency_id AS quote_currency_id,
exclude_service_type.selling AS base_to_quote_currency_exchange_rate,
exclude_service_type.payment_method_type AS payment_method,
exclude_service_type.service_id AS service_type,
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 currency_rates
FROM exclude_service_type
),