|
@@ -1,4 +1,36 @@
|
|
|
-from gcstruct import gcstruct_uebersetzung
|
|
|
+from gcstruct.gcstruct import GCStruct
|
|
|
+from pathlib import Path
|
|
|
+
|
|
|
+
|
|
|
+def gcstruct_uebersetzung(base_dir=None):
|
|
|
+ if base_dir is None:
|
|
|
+ base_dir = Path(".").absolute()
|
|
|
+ else:
|
|
|
+ base_dir = Path(base_dir)
|
|
|
+ import_dir = base_dir
|
|
|
+ if base_dir.name == "scripts":
|
|
|
+ if base_dir.parent.parent.name == "Portal":
|
|
|
+ base_dir = base_dir.parent.parent.parent
|
|
|
+ import_dir = base_dir.joinpath("Portal/System/IQD/Belege/Kontenrahmen")
|
|
|
+ else:
|
|
|
+ base_dir = base_dir.parent.parent
|
|
|
+ import_dir = base_dir.joinpath("System/OPTIMA/Export")
|
|
|
+ elif not base_dir.joinpath("GCStruct_Aufbereitung").exists():
|
|
|
+ base_dir = Path("//192.168.2.21/verwaltung/Kunden/Luchtenberg/1 Umstellung SKR51/")
|
|
|
+ if not base_dir.exists():
|
|
|
+ base_dir = Path("//media/fileserver1/verwaltung/Kunden/Luchtenberg/1 Umstellung SKR51/")
|
|
|
+ import_dir = base_dir
|
|
|
+
|
|
|
+ struct = GCStruct(str(base_dir.joinpath("GCStruct_Aufbereitung")))
|
|
|
+ struct.skr51_translate(import_dir.glob("Kontenrahmen_kombiniert*.csv"))
|
|
|
+ print("Kontenrahmen_uebersetzt.csv erstellt.")
|
|
|
+
|
|
|
+
|
|
|
+ struct2 = GCStruct(str(base_dir.joinpath("GCStruct_Modell")))
|
|
|
+ struct2.skr51_translate2(str(base_dir.joinpath("GCStruct_Aufbereitung/Export/Kontenrahmen_uebersetzt.csv")))
|
|
|
+ print("SKR51_Uebersetzung.csv erstellt.")
|
|
|
+ struct2.skr51_vars()
|
|
|
+ print("SKR51_Struktur.csv erstellt.")
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|