Skip to content

Commit

Permalink
Fix: Foreign Amount (#639)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
ruuushhh and GitHub Actions committed Sep 10, 2024
1 parent 3998b61 commit 83800bb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions apps/netsuite/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,8 +1650,17 @@ def construct_expense_report_lineitems(
lines = []

for line in expense_report_lineitems:
expense = Expense.objects.get(pk=line.expense_id)
expense: Expense = Expense.objects.get(pk=line.expense_id)
netsuite_custom_segments = line.netsuite_custom_segments

if expense.foreign_amount:
if expense.amount == 0:
foreign_amount = 0
else:
foreign_amount = expense.foreign_amount
else:
foreign_amount = None

if attachment_links and expense.expense_id in attachment_links:
netsuite_custom_segments.append(
{
Expand Down Expand Up @@ -1734,7 +1743,7 @@ def construct_expense_report_lineitems(
'exchangeRate': None,
'expenseDate': line.transaction_date,
'expMediaItem': None,
'foreignAmount': expense.foreign_amount if expense.foreign_amount else None,
'foreignAmount': foreign_amount,
'grossAmt': line.amount,
'isBillable': line.billable,
'isNonReimbursable': None,
Expand Down

0 comments on commit 83800bb

Please sign in to comment.