diff --git a/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal.sql b/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal.sql index 0f96158..73ce54a 100644 --- a/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal.sql +++ b/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal.sql @@ -154,7 +154,7 @@ select -- HOST (OPERATOR) REVENUE -- -- OLD DASH -- - invoiced_revenue.xero_booking_net_fees_in_gbp, + invoiced_revenue.xero_old_dashboard_booking_net_fees_in_gbp, invoiced_revenue.xero_listing_net_fees_in_gbp, invoiced_revenue.xero_verification_net_fees_in_gbp, -- NEW DASH -- diff --git a/models/intermediate/cross/int_mtd_aggregated_metrics.sql b/models/intermediate/cross/int_mtd_aggregated_metrics.sql index c8e9d11..820830b 100644 --- a/models/intermediate/cross/int_mtd_aggregated_metrics.sql +++ b/models/intermediate/cross/int_mtd_aggregated_metrics.sql @@ -424,10 +424,10 @@ }, { "order_by": 225, - "metric": "Invoiced Booking Fees Revenue", - "value": "xero_booking_net_fees_in_gbp", - "previous_year_value": "previous_year_xero_booking_net_fees_in_gbp", - "relative_increment": "relative_increment_xero_booking_net_fees_in_gbp", + "metric": "Invoiced Old Dashboard Booking Fees Revenue", + "value": "xero_old_dashboard_booking_net_fees_in_gbp", + "previous_year_value": "previous_year_xero_old_dashboard_booking_net_fees_in_gbp", + "relative_increment": "relative_increment_xero_old_dashboard_booking_net_fees_in_gbp", "number_format": "currency_gbp", "increment_sign_format": "positive", }, diff --git a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql index ba90886..3f9710c 100644 --- a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql +++ b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql @@ -240,7 +240,7 @@ with -- HOST (OPERATOR) REVENUE -- -- OLD DASH -- - invoiced_revenue.xero_booking_net_fees_in_gbp, + invoiced_revenue.xero_old_dashboard_booking_net_fees_in_gbp, invoiced_revenue.xero_listing_net_fees_in_gbp, invoiced_revenue.xero_verification_net_fees_in_gbp, -- NEW DASH -- @@ -521,7 +521,7 @@ select -- HOST (OPERATOR) REVENUE -- -- OLD DASH -- - {{ calculate_safe_relative_increment("xero_booking_net_fees_in_gbp") }}, + {{ calculate_safe_relative_increment("xero_old_dashboard_booking_net_fees_in_gbp") }}, {{ calculate_safe_relative_increment("xero_listing_net_fees_in_gbp") }}, {{ calculate_safe_relative_increment("xero_verification_net_fees_in_gbp") }}, -- NEW DASH -- diff --git a/models/intermediate/kpis/int_kpis__agg_monthly_invoiced_revenue.sql b/models/intermediate/kpis/int_kpis__agg_monthly_invoiced_revenue.sql index 8b6c1e7..675e30c 100644 --- a/models/intermediate/kpis/int_kpis__agg_monthly_invoiced_revenue.sql +++ b/models/intermediate/kpis/int_kpis__agg_monthly_invoiced_revenue.sql @@ -33,7 +33,9 @@ sum( xero_basic_screening_net_fees_in_gbp ) as xero_basic_screening_net_fees_in_gbp, - sum(xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp, + sum( + xero_old_dashboard_booking_net_fees_in_gbp + ) as xero_old_dashboard_booking_net_fees_in_gbp, sum(xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp, sum(xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp, sum(xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp, diff --git a/models/intermediate/kpis/int_kpis__agg_mtd_invoiced_revenue.sql b/models/intermediate/kpis/int_kpis__agg_mtd_invoiced_revenue.sql index a3fa1c0..09c967b 100644 --- a/models/intermediate/kpis/int_kpis__agg_mtd_invoiced_revenue.sql +++ b/models/intermediate/kpis/int_kpis__agg_mtd_invoiced_revenue.sql @@ -33,7 +33,9 @@ sum( xero_basic_screening_net_fees_in_gbp ) as xero_basic_screening_net_fees_in_gbp, - sum(xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp, + sum( + xero_old_dashboard_booking_net_fees_in_gbp + ) as xero_old_dashboard_booking_net_fees_in_gbp, sum(xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp, sum(xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp, sum(xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp, diff --git a/models/intermediate/kpis/int_kpis__metric_daily_invoiced_revenue.sql b/models/intermediate/kpis/int_kpis__metric_daily_invoiced_revenue.sql index 66f5d54..ea0da5a 100644 --- a/models/intermediate/kpis/int_kpis__metric_daily_invoiced_revenue.sql +++ b/models/intermediate/kpis/int_kpis__metric_daily_invoiced_revenue.sql @@ -96,11 +96,11 @@ select ) as xero_basic_screening_net_fees_in_gbp, sum( case - when ixsdm.accounting_root_aggregation = 'Booking Fees' + when ixsdm.accounting_root_aggregation = 'Old Dashboard Booking Fees' then ixsdm.line_amount_wo_taxes_in_gbp else 0 end - ) as xero_booking_net_fees_in_gbp, + ) as xero_old_dashboard_booking_net_fees_in_gbp, sum( case when ixsdm.accounting_root_aggregation = 'Listing Fees' diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql b/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql index 868f1aa..be2648a 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql @@ -38,7 +38,9 @@ select sum( ir.xero_basic_screening_net_fees_in_gbp ) as xero_basic_screening_net_fees_in_gbp, - sum(ir.xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp, + sum( + ir.xero_old_dashboard_booking_net_fees_in_gbp + ) as xero_old_dashboard_booking_net_fees_in_gbp, sum(ir.xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp, sum(ir.xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp, sum(ir.xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp, diff --git a/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql b/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql index bb8e5db..41058ac 100644 --- a/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql +++ b/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql @@ -38,7 +38,9 @@ select sum( ir.xero_basic_screening_net_fees_in_gbp ) as xero_basic_screening_net_fees_in_gbp, - sum(ir.xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp, + sum( + ir.xero_old_dashboard_booking_net_fees_in_gbp + ) as xero_old_dashboard_booking_net_fees_in_gbp, sum(ir.xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp, sum(ir.xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp, sum(ir.xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp, diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index 65886bc..7a6d50d 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -4401,10 +4401,10 @@ models: in a given date and per specified dimension. This is a New Dashboard service. - - name: xero_booking_net_fees_in_gbp + - name: xero_old_dashboard_booking_net_fees_in_gbp data_type: decimal description: | - Sum of daily Booking Net Fees, in GBP, without taxes + Sum of daily Old Dashboard Booking Net Fees, in GBP, without taxes in a given date and per specified dimension. - name: xero_listing_net_fees_in_gbp @@ -4603,10 +4603,10 @@ models: in a given month and per specified dimension. This is a New Dashboard service. - - name: xero_booking_net_fees_in_gbp + - name: xero_old_dashboard_booking_net_fees_in_gbp data_type: decimal description: | - Sum of accumulated Booking Net Fees, in GBP, without taxes + Sum of accumulated Old Dashboard Booking Net Fees, in GBP, without taxes in a given month and per specified dimension. - name: xero_listing_net_fees_in_gbp @@ -4798,10 +4798,10 @@ models: in a given month up to the given date and per specified dimension. This is a New Dashboard service. - - name: xero_booking_net_fees_in_gbp + - name: xero_old_dashboard_booking_net_fees_in_gbp data_type: decimal description: | - Sum of accumulated Booking Net Fees, in GBP, without taxes + Sum of accumulated Old Dashboard Booking Net Fees, in GBP, without taxes in a given month up to the given date and per specified dimension. - name: xero_listing_net_fees_in_gbp @@ -4904,7 +4904,7 @@ models: - xero_sex_offenders_check_net_fees_in_gbp - xero_protection_pro_net_fees_in_gbp - xero_basic_screening_net_fees_in_gbp - - xero_booking_net_fees_in_gbp + - xero_old_dashboard_booking_net_fees_in_gbp - xero_listing_net_fees_in_gbp - xero_verification_net_fees_in_gbp - xero_operator_net_fees_in_gbp @@ -4978,10 +4978,10 @@ models: for a given date, dimension and value. This is a New Dashboard service. - - name: xero_booking_net_fees_in_gbp + - name: xero_old_dashboard_booking_net_fees_in_gbp data_type: decimal description: | - The monthly Booking Net Fees, in GBP, without taxes + The monthly Old Dashboard Booking Net Fees, in GBP, without taxes for a given date, dimension and value. - name: xero_listing_net_fees_in_gbp @@ -5081,7 +5081,7 @@ models: - xero_sex_offenders_check_net_fees_in_gbp - xero_protection_pro_net_fees_in_gbp - xero_basic_screening_net_fees_in_gbp - - xero_booking_net_fees_in_gbp + - xero_old_dashboard_booking_net_fees_in_gbp - xero_listing_net_fees_in_gbp - xero_verification_net_fees_in_gbp - xero_operator_net_fees_in_gbp @@ -5156,10 +5156,10 @@ models: for a given date, dimension and value. This is a New Dashboard service. - - name: xero_booking_net_fees_in_gbp + - name: xero_old_dashboard_booking_net_fees_in_gbp data_type: decimal description: | - The month-to-date Booking Net Fees, in GBP, without taxes + The month-to-date Old Dashboard Booking Net Fees, in GBP, without taxes for a given date, dimension and value. - name: xero_listing_net_fees_in_gbp diff --git a/models/reporting/general/monthly_aggregated_metrics_history_by_deal.sql b/models/reporting/general/monthly_aggregated_metrics_history_by_deal.sql index 5226cd4..23d6929 100644 --- a/models/reporting/general/monthly_aggregated_metrics_history_by_deal.sql +++ b/models/reporting/general/monthly_aggregated_metrics_history_by_deal.sql @@ -95,7 +95,15 @@ select end as host_resolution_payment_per_created_booking_ratio, case when {{ is_date_before_20th_of_previous_month("date") }} - then xero_booking_net_fees_in_gbp + then xero_old_dashboard_booking_net_fees_in_gbp + else null + end as xero_old_dashboard_booking_net_fees_in_gbp, + -- Following line is a temporary handler to not break reporting. + -- We will need this line anyway for the combination of Old and New + -- Dash. + case + when {{ is_date_before_20th_of_previous_month("date") }} + then xero_old_dashboard_booking_net_fees_in_gbp else null end as xero_booking_net_fees_in_gbp, case diff --git a/seeds/schema.yml b/seeds/schema.yml index 8737db5..2ad2130 100644 --- a/seeds/schema.yml +++ b/seeds/schema.yml @@ -208,7 +208,7 @@ seeds: - Other Invoiced Revenue - Verification Fees - Listing Fees - - Booking Fees + - Old Dashboard Booking Fees - Athena API - E-Deposit API - Guesty Resolutions @@ -300,7 +300,7 @@ seeds: - 211-Deposit Fees - 131-Verification Fees - 121-Listing Fees - - 111-BookingFees + - 111-Booking Fees - 141-Athena API - 151-E-Deposit API - 411-Guesty Resolutions diff --git a/seeds/stg_seed__accounting_aggregations.csv b/seeds/stg_seed__accounting_aggregations.csv index 175e0cf..2af21a1 100644 --- a/seeds/stg_seed__accounting_aggregations.csv +++ b/seeds/stg_seed__accounting_aggregations.csv @@ -4,17 +4,17 @@ account_code,root_aggregation,kpis_aggregation,financial_l1_aggregation,financia "202",Deposit Fees,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,211-Deposit Fees "203",Verification Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,13-Verification Fees,131-Verification Fees "204",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees -"206",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees +"206",Old Dashboard Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-Booking Fees "207",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees -"208",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees +"208",Old Dashboard Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-Booking Fees "209",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees -"210",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees +"210",Old Dashboard Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-Booking Fees "211",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees -"212",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees +"212",Old Dashboard Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-Booking Fees "213",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees -"214",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees +"214",Old Dashboard Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-Booking Fees "215",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees -"216",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees +"216",Old Dashboard Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-Booking Fees "217",Deposit Fees,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,211-Deposit Fees "218",Damage Waiver Fees,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,210-Damage Waiver Fees "219",Athena API,Invoiced API Revenue,1-Guest Screening and Protection,14-Athena API,141-Athena API diff --git a/tests/kpis_additive_metrics_per_dimension_are_consistent.sql b/tests/kpis_additive_metrics_per_dimension_are_consistent.sql index 692a54a..8e3c7bf 100644 --- a/tests/kpis_additive_metrics_per_dimension_are_consistent.sql +++ b/tests/kpis_additive_metrics_per_dimension_are_consistent.sql @@ -40,7 +40,7 @@ than the value reported in the Global dimension. "Host Resolutions Payment Count", "Invoiced APIs Revenue", "Invoiced Athena Revenue", - "Invoiced Booking Fees Revenue", + "Invoiced Old Dashboard Booking Fees Revenue", "Invoiced E-Deposit Revenue", "Invoiced Listing Fees Revenue", "Invoiced Operator Revenue", diff --git a/tests/kpis_global_metrics_outlier_detection.sql b/tests/kpis_global_metrics_outlier_detection.sql index d8fc412..4f4d667 100644 --- a/tests/kpis_global_metrics_outlier_detection.sql +++ b/tests/kpis_global_metrics_outlier_detection.sql @@ -31,7 +31,7 @@ point it becomes too sensitive, just adapt the following parameters. "Host Resolutions Payment Count", "Invoiced APIs Revenue", "Invoiced Athena Revenue", - "Invoiced Booking Fees Revenue", + "Invoiced Old Dashboard Booking Fees Revenue", "Invoiced E-Deposit Revenue", "Invoiced Listing Fees Revenue", "Invoiced Operator Revenue",