Merge pull request #17245 from supabase/fix/eu-vat

fix: eu vat
This commit is contained in:
Kevin Grüneberg authored and GitHub committed 2023-09-07 19:07:39 +02:00
commit ba94edeee8
2 files changed
+2 -8

No files matched your search

@@ -188,7 +188,7 @@ const TaxID = () => {
<div className="w-full space-y-2">
{taxIdValues.map((taxId, idx: number) => {
const selectedTaxId = TAX_IDS.find(
(option) => option.code === taxId.type
(option) => option.name === taxId.name
)
return (
<div key={`tax-id-${idx}`} className="flex items-center space-x-2">
@@ -2,16 +2,10 @@ import { TaxIdValue } from 'data/organizations/organization-tax-ids-update-mutat
import { TAX_IDS } from './TaxID.constants'
import { isEqual, sortBy } from 'lodash'
/**
* Sanitize EU VAT ids so they get prepended with the country code
*
* Ex: Belgium's VAT ID should be BE0123456789 not 0123456789
* Only EU VAT ids are affected
*/
export const sanitizeTaxID = (taxId: TaxIdValue) => {
let newID = taxId
const selectedTaxId = TAX_IDS.find((option) => option.code === taxId.type)
const selectedTaxId = TAX_IDS.find((option) => option.name === taxId.name)
const vatIdPrefix = selectedTaxId?.vatPrefix