Improve converting customer name.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-09-21 09:55:59 +03:00
parent 679830ba20
commit 28cd003bcc

View File

@ -344,7 +344,25 @@ void VVITConverter::ConverCustomerNameToV0_4_0()
} }
QDomElement customer = createElement(strCustomer); QDomElement customer = createElement(strCustomer);
customer.appendChild(createTextNode(givenName + QLatin1Char(' ') + familyName));
QString customerName;
if (not givenName.isEmpty() && not familyName.isEmpty())
{
customerName = givenName + QLatin1Char(' ') + familyName;
}
else if (not givenName.isEmpty() && familyName.isEmpty())
{
customerName = givenName;
}
else if (givenName.isEmpty() && not familyName.isEmpty())
{
customerName = familyName;
}
if (not customerName.isEmpty())
{
customer.appendChild(createTextNode(customerName));
}
personal.insertBefore(customer, personal.firstChild()); personal.insertBefore(customer, personal.firstChild());
} }