Skip to content

Commit

Permalink
Merge pull request #508 from refinery-labs/third-party-billing-change
Browse files Browse the repository at this point in the history
Fixed billing multiplier for third party AWS accounts
  • Loading branch information
mandatoryprogrammer authored Jan 4, 2020
2 parents 85203e3 + 2232a7d commit 96d7dbf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2282,9 +2282,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(
Expand Down

0 comments on commit 96d7dbf

Please sign in to comment.