Skip to content

Commit

Permalink
fix: Tax Details JE (#696)
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 Nov 20, 2024
1 parent 29e22fd commit 58b5445
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions apps/quickbooks_online/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json
import logging
from datetime import datetime, timedelta
from django.utils import timezone
from typing import Dict, List

import unidecode
from django.conf import settings
from fyle_accounting_mappings.models import DestinationAttribute, EmployeeMapping
from django.utils import timezone
from qbosdk import QuickbooksOnlineSDK
from qbosdk.exceptions import WrongParamsError

Expand All @@ -28,6 +27,7 @@
)
from apps.workspaces.models import QBOCredential, Workspace, WorkspaceGeneralSettings
from apps.workspaces.utils import round_amount
from fyle_accounting_mappings.models import DestinationAttribute, EmployeeMapping
from fyle_integrations_imports.models import ImportLog

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -1246,7 +1246,17 @@ def __construct_journal_entry(self, journal_entry: JournalEntry, journal_entry_l
tax_rate_refs.append(tax_rate_ref)

for tax_rate in tax_rate_refs:
journal_entry_payload['TxnTaxDetail']['TaxLine'].append({"Amount": 0, "DetailType": "TaxLineDetail", 'TaxLineDetail': {'TaxRateRef': tax_rate, "PercentBased": True, "NetAmountTaxable": 0}})
journal_entry_payload['TxnTaxDetail']['TaxLine'].append({
"Amount": 0,
"DetailType": "TaxLineDetail",
"TaxLineDetail": {
"TaxRateRef": {
"value": tax_rate['value']
},
"PercentBased": True,
"NetAmountTaxable": 0
}
})

logger.info("| Payload for Journal Entry creation | Content: {{WORKSPACE_ID: {} EXPENSE_GROUP_ID: {} JOURNAL_ENTRY_PAYLOAD: {}}}".format(self.workspace_id, journal_entry.expense_group.id, journal_entry_payload))
return journal_entry_payload
Expand Down

0 comments on commit 58b5445

Please sign in to comment.