Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Tax Details JE #696

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading