Repository: dennisbakhuis/eboekhouden-python

Issue:
SOAP field LedenAdministratie should be LA
The method add_relatie cannot add a new lid to the ledenadministratie. They are always added to Relaties eventhough leden_administratie is set to 1.

The current SOAP documentation (version 5.7) says the field in the SAOP call is called 'LA' not 'LedenAdministratie'.

Hints from issue comments:

Solution patch:
diff --git a/eboekhouden_python/models/relatie.py b/eboekhouden_python/models/relatie.py
index f5e9108..ace413f 100644
--- a/eboekhouden_python/models/relatie.py
+++ b/eboekhouden_python/models/relatie.py
@@ -98,7 +98,7 @@ def from_zeep(
             def8=serialized_relation.get("Def8"),
             def9=serialized_relation.get("Def9"),
             def10=serialized_relation.get("Def10"),
-            leden_administratie=serialized_relation.get("LedenAdministratie"),
+            leden_administratie=serialized_relation.get("LA"),
             geen_email=serialized_relation.get("GeenEmail"),
             gb_id=serialized_relation.get("GBID"),
             nieuwsbrief_groepen_count=serialized_relation.get("NieuwsbriefGroepenCount"),
@@ -150,7 +150,7 @@ def export(self, additional_fields: bool = False):
                 Def8=self.def8 or ZeepXsdSkipValue,
                 Def9=self.def9 or ZeepXsdSkipValue,
                 Def10=self.def10 or ZeepXsdSkipValue,
-                LedenAdministratie=self.leden_administratie or ZeepXsdSkipValue,
+                LA=self.leden_administratie or ZeepXsdSkipValue,
             )
         return export_dict
 


Test patch:
diff --git a/tests/test_models_relatie.py b/tests/test_models_relatie.py
index 19dd326..7e05c5a 100644
--- a/tests/test_models_relatie.py
+++ b/tests/test_models_relatie.py
@@ -110,7 +110,7 @@ def test_relatie_partially_filled_additional_fields():
         Def8="1",
         Def9="1",
         Def10="1",
-        LedenAdministratie="1",
+        LA="1",
     )