Added a coalesce for the booking_fee_in_gbp calculation for old cases where there is no preferred currency for the user_guest
This commit is contained in:
parent
25e657014a
commit
02ddac3167
1 changed files with 5 additions and 2 deletions
|
|
@ -8,7 +8,8 @@ with
|
|||
select * from {{ ref("int_core__duplicate_bookings") }}
|
||||
),
|
||||
int_core__unified_user as (select * from {{ ref("int_core__unified_user") }}),
|
||||
int_simple_exchange_rates as (select * from {{ ref("int_simple_exchange_rates") }})
|
||||
int_simple_exchange_rates as (select * from {{ ref("int_simple_exchange_rates") }}),
|
||||
stg_core__country as (select * from {{ ref("stg_core__country") }}),
|
||||
select
|
||||
b.id_booking,
|
||||
b.id_user_guest,
|
||||
|
|
@ -18,7 +19,9 @@ select
|
|||
coalesce(db.is_duplicate_booking, false) as is_duplicate_booking,
|
||||
bce.booking_fee_local,
|
||||
uu.account_currency_iso4217,
|
||||
ser.rate * bce.booking_fee_local as booking_fee_in_gbp,
|
||||
coalesce(
|
||||
ser.rate * bce.booking_fee_local, bce.booking_fee_local
|
||||
) as booking_fee_in_gbp,
|
||||
bce.booking_fee_charge_at_utc,
|
||||
bce.booking_fee_charge_date_utc
|
||||
from stg_core__booking b
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue