Skip to content

Commit

Permalink
Pull request #12: CAD-1153 correct some method to recover the informa…
Browse files Browse the repository at this point in the history
…tion

Merge in SITC/adobe-reports from CAD-1153-p1-find-in-the-active-assets-reports-the-new-columns to master

Squashed commit of the following:

commit d47c243f742952c9fd4c7109938ec3cce0f35f0b
Author: David Franco <david.franco@cloublue.com>
Date:   Fri Aug 18 08:33:53 2023 +0200

    CAD-1153  correct some method to recover the information
  • Loading branch information
David Franco authored and David Franco committed Aug 18, 2023
1 parent ee5d33a commit 4395a6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion reports/requests/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def generate(client, parameters, progress_callback, renderer_type=None, extra_co

def _get_delta_str(item):
if (utils.get_basic_value(item, 'item_type') != 'PPU'
and utils.get_basic_value(item, 'quantity') != '0'):
and (utils.get_basic_value(item, 'quantity') != '0'
or utils.get_basic_value(item, 'old_quantity') != '0')
):
delta = 0
delta_str = '-'
if len(item['quantity']) > 0 and len(item['old_quantity']) > 0:
Expand Down
9 changes: 6 additions & 3 deletions reports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ 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 4395a6b

Please sign in to comment.