From 2232a7d2e659a9125f418bdbc2ec3753a1644999 Mon Sep 17 00:00:00 2001 From: "Matthew Bryant (mandatory)" Date: Sat, 4 Jan 2020 12:28:47 -0800 Subject: [PATCH] Fixed billing multiplier for third party AWS accounts --- api/server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/server.py b/api/server.py index 81e342307..1b594646d 100644 --- a/api/server.py +++ b/api/server.py @@ -2281,9 +2281,16 @@ def _get_sub_account_billing_data( account_id, account_type, start_date, end_dat "Elastic Compute Cloud", "EC2" ] + + markup_multiplier = 1 + ( int( os.environ.get( "mark_up_percent" ) ) / 100 ) # Markup multiplier - markup_multiplier = 1 + ( int( os.environ.get( "mark_up_percent" ) ) / 100 ) + if account_type == "THIRDPARTY": + # For the self-hosted (THIRDPARTY) accounts the multiplier is just 1 + # this is because we normally double the AWS pricing and pay half to AWS. + # In the THIRDPARTY situation, the customer pays AWS directly and we just + # take our cut off the top. + markup_multiplier = 1 # Check if this is the first billing month is_first_account_billing_month = is_organization_first_month(