import debitorPrefix, debitorSuffix, defaultPrefix etc. (WIP)
This commit is contained in:
parent
943dd48a2f
commit
036f28f492
@ -56,7 +56,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* which reads CSV files from the file system.
|
||||
*/
|
||||
|
||||
@Disabled
|
||||
@DataJpaTest
|
||||
@Import({ Context.class, JpaAttempt.class })
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
@ -106,15 +105,15 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
assertThat(contacts.toString()).isEqualTo("{}");
|
||||
assertThat(debitors.toString()).isEqualToIgnoringWhitespace("""
|
||||
{
|
||||
7=debitor(10007: null, null),
|
||||
10=debitor(10010: null, null),
|
||||
12=debitor(11012: null, null)}
|
||||
7=debitor(1000700: null, null),
|
||||
10=debitor(1001000: null, null),
|
||||
12=debitor(1101200: null, null)}
|
||||
""");
|
||||
assertThat(memberships.toString()).isEqualToIgnoringWhitespace("""
|
||||
{
|
||||
7=Membership(10007, null, null, 10007, [2000-12-06,), NONE),
|
||||
10=Membership(10010, null, null, 10010, [2000-12-06,2016-01-01), UNKNOWN),
|
||||
12=Membership(11012, null, null, 11012, [2021-04-01,), NONE)
|
||||
7=Membership(10007, null, null, 1000700, [2000-12-06,), NONE),
|
||||
10=Membership(10010, null, null, 1001000, [2000-12-06,2016-01-01), UNKNOWN),
|
||||
12=Membership(11012, null, null, 1101200, [2021-04-01,), NONE)
|
||||
}
|
||||
""");
|
||||
}
|
||||
@ -154,16 +153,16 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
""");
|
||||
assertThat(debitors.toString()).isEqualToIgnoringWhitespace("""
|
||||
{
|
||||
7=debitor(10007: Mellies, Michael),
|
||||
10=debitor(10010: JM e.K.),
|
||||
12=debitor(11012: Test PS)
|
||||
7=debitor(1000700: Mellies, Michael),
|
||||
10=debitor(1001000: JM e.K.),
|
||||
12=debitor(1101200: Test PS)
|
||||
}
|
||||
""");
|
||||
assertThat(memberships.toString()).isEqualToIgnoringWhitespace("""
|
||||
{
|
||||
7=Membership(10007, Mellies, Michael, 10007, [2000-12-06,), NONE),
|
||||
10=Membership(10010, JM e.K., 10010, [2000-12-06,2016-01-01), UNKNOWN),
|
||||
12=Membership(11012, Test PS, 11012, [2021-04-01,), NONE)
|
||||
7=Membership(10007, Mellies, Michael, 1000700, [2000-12-06,), NONE),
|
||||
10=Membership(10010, JM e.K., 1001000, [2000-12-06,2016-01-01), UNKNOWN),
|
||||
12=Membership(11012, Test PS, 1101200, [2021-04-01,), NONE)
|
||||
}
|
||||
""");
|
||||
}
|
||||
@ -313,6 +312,7 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
persons.put(rec.getInteger("bp_id"), person);
|
||||
|
||||
final var partner = HsOfficePartnerEntity.builder()
|
||||
.debitorNumberPrefix(rec.getInteger("member_id"))
|
||||
.details(HsOfficePartnerDetailsEntity.builder().build())
|
||||
.contact(HsOfficeContactEntity.builder().build())
|
||||
.person(person)
|
||||
@ -321,12 +321,12 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
|
||||
final var debitor = HsOfficeDebitorEntity.builder()
|
||||
.partner(partner)
|
||||
// .debitorNumberSuffix(rec.getByte("member_id"))
|
||||
// .defaultPrefix(rec.getString("member_code"))
|
||||
.debitorNumberSuffix((byte)0)
|
||||
.defaultPrefix(rec.getString("member_code"))
|
||||
.partner(partner)
|
||||
.billingContact(partner.getContact())
|
||||
.billable(rec.isEmpty("free"))
|
||||
// .vatExempt(toBool(rec.get("exempt_vat")) (reverse-charge) TODO: add as vat-reverse-charge to debitor
|
||||
.vatReverseCharge(rec.getBoolean("exempt_vat"))
|
||||
.vatBusiness("GROSS".equals(rec.getString("indicator_vat"))) // TODO: remove
|
||||
.vatId(rec.getString("uid_vat"))
|
||||
.build();
|
||||
@ -624,9 +624,14 @@ class Record {
|
||||
return isNotBlank(value) ? Byte.valueOf(value.trim()) : 0;
|
||||
}
|
||||
|
||||
boolean getBoolean(final String columnName) {
|
||||
final String value = getString(columnName);
|
||||
return isNotBlank(value) && Boolean.parseBoolean(value.trim());
|
||||
}
|
||||
|
||||
Integer getInteger(final String columnName) {
|
||||
final String value = getString(columnName);
|
||||
return isNotBlank(value) ? Integer.valueOf(value.trim()) : 0;
|
||||
return isNotBlank(value) ? Integer.parseInt(value.trim()) : 0;
|
||||
}
|
||||
|
||||
BigDecimal getBigDecimal(final String columnName) {
|
||||
|
Loading…
Reference in New Issue
Block a user