fix #123, show the business as contact name if only that is filled

This commit is contained in:
tibbi 2018-04-10 22:55:13 +02:00
parent 8c0ca77ed2
commit 4f97fce695
1 changed files with 8 additions and 1 deletions

View File

@ -72,6 +72,13 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m
val lastPart = if (startWithSurname) firstName else surname
val suffixComma = if (suffix.isEmpty()) "" else ", $suffix"
return "$prefix $firstPart $lastPart$suffixComma".trim()
val fullName = "$prefix $firstPart $lastPart$suffixComma".trim()
return if (fullName.isEmpty()) {
var fullOrganization = if (organization.jobPosition.isEmpty()) "" else "${organization.jobPosition}, "
fullOrganization += organization.company
fullOrganization.trim().trimEnd(',')
} else {
fullName
}
}
}