Skip to content

Commit

Permalink
CAD-760
Browse files Browse the repository at this point in the history
implement the correction for the pricelist
  • Loading branch information
David Franco committed Mar 16, 2023
1 parent 149bd02 commit 20fdd10
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions reports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ def get_base_currency_financials(financials_and_seats: dict, currency: dict) ->
def get_financials_from_product_per_marketplace(client, marketplace_id, asset_id):
listing = api_calls.request_listing(client, marketplace_id, asset_id)
price_list_points = []
if listing and listing['pricelist']:
price_list_version = api_calls.request_price_list(client, listing['pricelist']['id'])
price_list_points = api_calls.request_price_list_version_points(client, price_list_version['id'])

try:
if listing and listing['pricelist']:
price_list_version = api_calls.request_price_list(client, listing['pricelist']['id'])
price_list_points = api_calls.request_price_list_version_points(client, price_list_version['id'])
except:
return {}
return get_financials_from_price_list(price_list_points)

0 comments on commit 20fdd10

Please sign in to comment.