|
@@ -288,12 +288,14 @@ class GCStruct:
|
|
|
self.json_result["struct_export"][s] = df_temp.to_dict(orient="records")
|
|
|
|
|
|
# {'accounts': {}, 'tree': {}, 'flat': {}, 'struct_export': {}, 'skr51_vars': {}}
|
|
|
+ return self.json_result
|
|
|
+
|
|
|
+ def export_structure_and_tree(self):
|
|
|
json.dump(
|
|
|
self.json_result,
|
|
|
open(f"{self.config['path2']}/{self.config['output']}", "w"),
|
|
|
indent=2,
|
|
|
)
|
|
|
- return self.json_result
|
|
|
|
|
|
def get_accounts(self, structure, id):
|
|
|
return [
|
|
@@ -792,6 +794,8 @@ def gcstruct_uebersetzung(base_dir=None):
|
|
|
# base_dir = 'P:/SKR51_GCStruct/'
|
|
|
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":
|
|
@@ -831,6 +835,7 @@ def gcstruct_uebersetzung(base_dir=None):
|
|
|
def dresen():
|
|
|
struct = GCStruct("c:/projekte/GCHRStruct_Hyundai_Export")
|
|
|
struct.get_structure_and_tree()
|
|
|
+ struct.export_structure_and_tree()
|
|
|
struct.export()
|
|
|
|
|
|
|
|
@@ -840,6 +845,7 @@ def reisacher():
|
|
|
base_dir = "/media/fileserver1/austausch/Robert/Planung Reisacher/GCStruct_neue_Struktur_Planung"
|
|
|
struct = GCStruct(base_dir)
|
|
|
struct.get_structure_and_tree()
|
|
|
+ struct.export_structure_and_tree()
|
|
|
# json.dump(res['flat'], open(f"{self.config['path2']}/{self.config['output']}", 'w'), indent=2)
|
|
|
|
|
|
|