Разбираясь с чудесной работой элемента бразильского слоя был обнаружен сей код, который не нуждается, по моему, в комментариях. Код достаточно свеженький.
X++:
//<MSBS user="jjuni" woritem="Layout Danf" date="05/10/2012">
maskPhone = strreplace(eFiscalDocument.recipientPhone(), "-", "");
maskPhone = strreplace(eFiscalDocument.recipientPhone(), "(", "");
maskPhone = strreplace(eFiscalDocument.recipientPhone(), ")", "");
maskPhone = strreplace(eFiscalDocument.recipientPhone(), " ", "");
qtdChar = strlen(maskPhone);
switch(qtdChar)
{
case 10:
case 11:
maskPhone = "(" + substr(maskPhone, 1, 2) + ") " + substr(maskPhone, 3, 4) + "-" + substr(maskPhone, 7, 4);
break;
case 8:
maskPhone = substr(maskPhone, 1, 4) + "-" + substr(maskPhone, 5, 4);
break;
default:
maskPhone = eFiscalDocument.recipientPhone();
break;
}
return maskPhone;
//</MSBS>
С уважением, Дмитрий.