Skip to content

Commit

Permalink
check for report in expenses (#86)
Browse files Browse the repository at this point in the history
* check for report in expenses

* fix report check
  • Loading branch information
Hrishabh17 authored Jul 11, 2024
1 parent 9d8e023 commit df79cbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __construct_expenses_objects(self, expenses: List[dict]) -> List[dict]:
'project_id': expense['project']['id'] if expense['project'] else None,
'expense_number': expense['seq_num'],
'org_id': expense['org_id'],
'claim_number': expense['report']['seq_num'] if expense['report'] else None,
'claim_number': expense['report']['seq_num'] if 'report' in expense and expense['report'] else None,
'amount': expense['amount'],
'tax_amount': expense['tax_amount'],
'tax_group_id': expense['tax_group_id'],
Expand All @@ -179,17 +179,17 @@ def __construct_expenses_objects(self, expenses: List[dict]) -> List[dict]:
'bank_transaction_id': matched_transaction['id'] if matched_transaction else None,
'purpose': expense['purpose'],
'report_id': expense['report_id'],
'report_title': expense['report']['title'],
'report_title': expense['report']['title'] if 'report' in expense and expense['report'] and 'title' in expense['report'] else None,
'file_ids': expense['file_ids'],
'spent_at': self.__format_date(expense['spent_at']),
'approved_at': self.__format_date(expense['report']['last_approved_at']) if expense['report'] else None,
'approved_at': self.__format_date(expense['report']['last_approved_at']) if 'report' in expense and expense['report'] else None,
'posted_at': self.__format_date(posted_at) if posted_at else None,
'expense_created_at': expense['created_at'],
'expense_updated_at': expense['updated_at'],
'source_account_type': expense['source_account']['type'],
'verified_at': self.__format_date(expense['last_verified_at']),
'custom_properties': custom_properties,
'payment_number': expense['report']['reimbursement_seq_num'] if 'reimbursement_seq_num' in expense['report'] and \
'payment_number': expense['report']['reimbursement_seq_num'] if 'report' in expense and expense['report'] and 'reimbursement_seq_num' in expense['report'] and \
expense['report']['reimbursement_seq_num'] else None
})

Expand Down
2 changes: 1 addition & 1 deletion connector/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='fyle-integrations-platform-connector',
version='1.38.3',
version='1.38.4',
author='Shwetabh Kumar',
author_email='[email protected]',
description='A common platform connector for all the Fyle Integrations to interact with Fyle Platform APIs',
Expand Down

0 comments on commit df79cbc

Please sign in to comment.