fix billable and general boolean recognition in ImportOfficeData
This commit is contained in:
parent
572061b3cf
commit
901e9a4868
@ -50,6 +50,7 @@ import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.lang.Boolean.parseBoolean;
|
||||
import static java.util.Arrays.stream;
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.toPostgresDateRange;
|
||||
@ -681,7 +682,7 @@ public class ImportOfficeData extends ContextBasedTest {
|
||||
.debitorNumberSuffix((byte) 0)
|
||||
.defaultPrefix(rec.getString("member_code").replace("hsh00-", ""))
|
||||
.partner(partner)
|
||||
.billable(rec.isEmpty("free"))
|
||||
.billable(rec.isEmpty("free") || rec.getString("free").equals("f"))
|
||||
.vatReverseCharge(rec.getBoolean("exempt_vat"))
|
||||
.vatBusiness("GROSS".equals(rec.getString("indicator_vat"))) // TODO: remove
|
||||
.vatId(rec.getString("uid_vat"))
|
||||
@ -888,7 +889,9 @@ public class ImportOfficeData extends ContextBasedTest {
|
||||
final var contractualMissing = new HashSet<Integer>();
|
||||
partners.forEach( (id, partner) -> {
|
||||
final var partnerPerson = partner.getPerson();
|
||||
if (relationships.values().stream().filter(rel -> rel.getRelHolder() == partnerPerson && rel.getRelType() == HsOfficeRelationshipType.REPRESENTATIVE).findFirst().isEmpty()) {
|
||||
if (relationships.values().stream()
|
||||
.filter(rel -> rel.getRelHolder() == partnerPerson && rel.getRelType() == HsOfficeRelationshipType.REPRESENTATIVE)
|
||||
.findFirst().isEmpty()) {
|
||||
addRelationship(partnerPerson, partnerPerson, partner.getContact(), HsOfficeRelationshipType.REPRESENTATIVE);
|
||||
contractualMissing.add(partner.getPartnerNumber());
|
||||
}
|
||||
@ -1145,7 +1148,8 @@ class Record {
|
||||
|
||||
boolean getBoolean(final String columnName) {
|
||||
final String value = getString(columnName);
|
||||
return isNotBlank(value) && Boolean.parseBoolean(value.trim());
|
||||
return isNotBlank(value) &&
|
||||
( parseBoolean(value.trim()) || value.trim().startsWith("t"));
|
||||
}
|
||||
|
||||
Integer getInteger(final String columnName) {
|
||||
|
Loading…
Reference in New Issue
Block a user