Skip to content

Comments

Add Australian Xero tenant support#45

Open
aschwartz91 wants to merge 2 commits intomainfrom
feature/au-support
Open

Add Australian Xero tenant support#45
aschwartz91 wants to merge 2 commits intomainfrom
feature/au-support

Conversation

@aschwartz91
Copy link
Collaborator

Summary

  • Fix tax rate matching for AU tenants: Filter tax rates by OUTPUT reportTaxType so Australian tenants select "GST on Income" (OUTPUT, 10%) instead of accidentally matching "GST on Purchases" (INPUT, 10%). Previously, matching was by effectiveRate alone, which is ambiguous when AU tenants have both INPUT and OUTPUT rates at the same percentage.
  • Fix hardcoded USD currency display: Product mapping table now reads item.price.currency dynamically (with USD fallback) instead of hardcoding en-US / USD. Australian products will display A$ correctly.
  • Fix Vercel deployment: Reduce sync-logs route maxDuration from 800 → 300 to comply with Vercel Pro plan limits.

Changes

SyncedTaxRates.service.ts (core fix)

  • Added OUTPUT_TAX_TYPES set covering all valid sales tax report types (OUTPUT, OUTPUT2, SALESOUTPUT, CAPITALSALESOUTPUT, USSALESTAX)
  • Tax rate lookup now filters by both effectiveRate AND isOutputTaxRate()
  • Uncommented reportTaxType: OUTPUT on tax rate creation payload so newly created rates are properly tagged
  • Renamed labels from "Assembly Sales Tax" → "Assembly Tax" (region-neutral)

ProductMappingTableRow.tsx (currency fix)

  • Replaced renderUSD() with formatCurrency() that reads item.price.currency || 'USD'
  • Uses Intl.NumberFormat(undefined, ...) so locale is auto-detected from browser

sync-logs/route.ts (deployment fix)

  • maxDuration 800 → 300

How to test

  1. Connect to an Australian Xero Demo Company (or any AU tenant)
  2. Tax rates: Trigger an invoice sync with a taxed line item. Verify:
    • The matched tax rate has reportTaxType: OUTPUT (e.g., "GST on Income"), NOT INPUT
    • If no OUTPUT match exists, a new "Assembly Tax - 10%" rate is created with reportTaxType: OUTPUT
  3. Currency: Go to Settings → Product Mapping. Verify AU products show A$ (AUD) formatting, not $ (USD)
  4. Regression: Repeat with a US tenant to confirm existing behavior is unchanged (US tax rates are all OUTPUT-type, so the filter is transparent)

🤖 Generated with Claude Code

aschwartz91 and others added 2 commits February 11, 2026 12:45
- Filter tax rate lookup by OUTPUT ReportTaxType to prevent matching
  INPUT (purchase) tax rates. AU Xero tenants have both GST on Income
  (OUTPUT) and GST on Purchases (INPUT) at 10%, so matching by
  effectiveRate alone could apply the wrong tax type to invoices.
- Explicitly set reportTaxType: OUTPUT when creating new tax rates.
- Rename tax labels from "Assembly Sales Tax" to "Assembly Tax" for
  region-neutral naming.
- Replace hardcoded USD currency formatting in ProductMappingTableRow
  with dynamic currency from the price object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
xero-integration Ready Ready Preview, Comment Feb 11, 2026 7:20pm

Request Review

@supabase
Copy link

supabase bot commented Feb 11, 2026

This pull request has been ignored for the connected project pkdwtcdqcefmlgxmcwmc because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant