refactor sanitize function
This commit is contained in:
parent
43f91bff65
commit
9e0dbfb18d
1 changed files with 9 additions and 9 deletions
|
@ -86,14 +86,14 @@ public static class VatUtils
|
||||||
|
|
||||||
private static string SanitizeVatNumber(string vatNumber)
|
private static string SanitizeVatNumber(string vatNumber)
|
||||||
{
|
{
|
||||||
var washing = vatNumber.Replace(" ", "").Replace("-", "").ToUpperInvariant();
|
vatNumber = vatNumber.ToUpperInvariant();
|
||||||
var result = washing.Replace("DK", "").Replace("NO", "").Replace("SE","") ;
|
return vatNumber
|
||||||
if (result.Contains("MVA"))
|
.Replace(" ", "")
|
||||||
result = result.Replace("MVA", "");
|
.Replace("-", "")
|
||||||
return result.Length switch
|
.Replace("DK", "")
|
||||||
{
|
.Replace("NO", "")
|
||||||
>= 10 => vatNumber[..10],
|
.Replace("SE","")
|
||||||
< 10 => result
|
.Replace("MVA", "");
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue