Răsfoiți Sursa

Kontenrahmen_kombiniert auch mit mehreren Dateien

Robert Bedner 3 ani în urmă
părinte
comite
e7fd5f9fc5
3 a modificat fișierele cu 48 adăugiri și 5 ștergeri
  1. 0 1
      gcstruct/gchr.py
  2. 8 4
      gcstruct/gcstruct.py
  3. 40 0
      gcstruct/gcstruct_uebersetzung.spec

+ 0 - 1
gcstruct/gchr.py

@@ -81,7 +81,6 @@ def export_month():
     df['GW_Verkauf'] = (df['Konto_Nr'].str.match('^[78]')) & (df['Kostenstelle'].str.match('^2'))
     df['Kostenträger'] = np.where(df['GW_Verkauf'] == True, '52', df['Kostenträger'])
     df['Kostenträger'] = np.where((df['GW_Verkauf'] == True) & (df['Marke'] == '01'), '50', df['Kostenträger'])
-    
 
     from_label = ['Marke', 'Standort', 'Konto_Nr', 'Kostenstelle', 'Absatzkanal', 'Kostenträger']
     to_label = ['Make', 'Site', 'Account', 'Origin', 'SalesChannel', 'CostCarrier']

+ 8 - 4
gcstruct/gcstruct.py

@@ -280,7 +280,7 @@ class GCStruct():
             with open(f"{self.config['path']}/Xml/{s}_out.xml", 'w', encoding='utf-8') as f:
                 f.write(BeautifulSoup(ET.tostring(root), 'xml').prettify())
 
-    def skr51_translate(self, accounts_combined_file):
+    def skr51_translate(self, accounts_combined_files):
         df = self.accounts_from_csv(self.config['struct'])
 
         df_translate = {}
@@ -291,8 +291,12 @@ class GCStruct():
             df_translate[t_from] = df[df[last + '_Nr'] != ''][from_label].rename(columns=dict(zip(from_label, to_label)))
             # print(df_translate[t_to].head())
 
-        df_source = pd.read_csv(accounts_combined_file, decimal=',', sep=';', encoding='latin-1',
-                                converters={i: str for i in range(0, 200)})
+        df2 = []
+        for ac_file in accounts_combined_files:
+            df2.append(pd.read_csv(ac_file, decimal=',', sep=';', encoding='latin-1',
+                                   converters={i: str for i in range(0, 200)}))
+        df_source = pd.concat(df2)
+
         for t_from, t_to in self.translate.items():
             if t_to == 'SKR51':
                 df_source['SKR51'] = df_source['Konto_Nr']
@@ -472,7 +476,7 @@ def luchtenberg():
         import_dir = base_dir
 
     struct = GCStruct(str(base_dir.joinpath('GCStruct_Aufbereitung')))
-    struct.skr51_translate(str(import_dir.joinpath('Kontenrahmen_kombiniert.csv')))
+    struct.skr51_translate(import_dir.glob('Kontenrahmen_kombiniert*.csv'))
     # copyfile('c:/Projekte/Python/Gcstruct/Kontenrahmen_kombiniert.csv', base_dir + 'GCStruct_Modell/Export/Kontenrahmen_kombiniert.csv')
     struct2 = GCStruct(str(base_dir.joinpath('GCStruct_Modell')))
     struct2.skr51_translate2(str(base_dir.joinpath('GCStruct_Aufbereitung/Export/Kontenrahmen_kombiniert.csv')))

+ 40 - 0
gcstruct/gcstruct_uebersetzung.spec

@@ -0,0 +1,40 @@
+# -*- mode: python ; coding: utf-8 -*-
+
+
+block_cipher = None
+
+
+a = Analysis(['gcstruct.py'],
+             pathex=['P:\\Python_Projekte\\Python\\gcstruct'],
+             binaries=[],
+             datas=[],
+             hiddenimports=[],
+             hookspath=[],
+             hooksconfig={},
+             runtime_hooks=[],
+             excludes=[],
+             win_no_prefer_redirects=False,
+             win_private_assemblies=False,
+             cipher=block_cipher,
+             noarchive=False)
+pyz = PYZ(a.pure, a.zipped_data,
+             cipher=block_cipher)
+
+exe = EXE(pyz,
+          a.scripts,
+          a.binaries,
+          a.zipfiles,
+          a.datas,  
+          [],
+          name='gcstruct_uebersetzung',
+          debug=False,
+          bootloader_ignore_signals=False,
+          strip=False,
+          upx=True,
+          upx_exclude=[],
+          runtime_tmpdir=None,
+          console=True,
+          disable_windowed_traceback=False,
+          target_arch=None,
+          codesign_identity=None,
+          entitlements_file=None )