|
@@ -356,7 +356,9 @@ class GCStruct():
|
|
for t_from, t_to in self.translate.items():
|
|
for t_from, t_to in self.translate.items():
|
|
if t_from in ['Marke_HBV', 'Standort_HBV']:
|
|
if t_from in ['Marke_HBV', 'Standort_HBV']:
|
|
continue
|
|
continue
|
|
- if t_from != 'Konto_Nr':
|
|
|
|
|
|
+ if t_from == 'Konto_Nr':
|
|
|
|
+ df_source[t_to] = df_source[t_from]
|
|
|
|
+ else:
|
|
df_source[t_to] = t_to + '_' + df_source[t_from]
|
|
df_source[t_to] = t_to + '_' + df_source[t_from]
|
|
for e in cols:
|
|
for e in cols:
|
|
df_source = df_source.merge(df_translate, how='left', left_on=[t_to, e], right_on=['Konto_Nr', 'key'],
|
|
df_source = df_source.merge(df_translate, how='left', left_on=[t_to, e], right_on=['Konto_Nr', 'key'],
|
|
@@ -364,12 +366,12 @@ class GCStruct():
|
|
df_source[e] = np.where(df_source['value_' + t_to + '_' + e].notna(), df_source['value_' + t_to + '_' + e], df_source[e])
|
|
df_source[e] = np.where(df_source['value_' + t_to + '_' + e].notna(), df_source['value_' + t_to + '_' + e], df_source[e])
|
|
if df_source.shape[0] > rows:
|
|
if df_source.shape[0] > rows:
|
|
print(t_to + '_' + e + ': ' + str(df_source.shape[0]))
|
|
print(t_to + '_' + e + ': ' + str(df_source.shape[0]))
|
|
|
|
+ # df_source.to_csv(f"{self.config['path2']}/SKR51_Variablen2.csv", sep=';', encoding='latin-1', index=False)
|
|
# df_source[t_to + '_Nr'] = np.where(df_source[t_to + '_Nr'].isna(), df_source[t_from], df_source[t_to + '_Nr'])
|
|
# df_source[t_to + '_Nr'] = np.where(df_source[t_to + '_Nr'].isna(), df_source[t_from], df_source[t_to + '_Nr'])
|
|
for e in cols:
|
|
for e in cols:
|
|
df_source[e] = np.where(df_source[e].str.startswith('{'), df_source[e].str.extract(r'\/(.*)}', expand=False) +
|
|
df_source[e] = np.where(df_source[e].str.startswith('{'), df_source[e].str.extract(r'\/(.*)}', expand=False) +
|
|
' falsch', df_source[e]) # df_source[e].str.extract(r'/(.*)}') +
|
|
' falsch', df_source[e]) # df_source[e].str.extract(r'/(.*)}') +
|
|
df_source[e] = np.where(df_source[e] == '[KTR]', df_source['Kostenträger_Ebene'], df_source[e])
|
|
df_source[e] = np.where(df_source[e] == '[KTR]', df_source['Kostenträger_Ebene'], df_source[e])
|
|
-
|
|
|
|
# df_all[df_all['Ebene1'] == ]
|
|
# df_all[df_all['Ebene1'] == ]
|
|
# print(df_source.head())
|
|
# print(df_source.head())
|
|
df_source['Konto_neu'] = df_source['Marke'] + '-' + df_source['Standort'] + '-' + df_source['Konto_Nr'] + '-' + \
|
|
df_source['Konto_neu'] = df_source['Marke'] + '-' + df_source['Standort'] + '-' + df_source['Konto_Nr'] + '-' + \
|
|
@@ -454,9 +456,9 @@ class GCStruct():
|
|
df_amount['Ebene1'] = 'verkaufte Stückzahlen'
|
|
df_amount['Ebene1'] = 'verkaufte Stückzahlen'
|
|
df_main = pd.concat([df_main, df_amount])
|
|
df_main = pd.concat([df_main, df_amount])
|
|
|
|
|
|
- from_label = cols
|
|
|
|
- to_label = get_default_cols(9)
|
|
|
|
- df_main = df_main.rename(columns=dict(zip(from_label, to_label)))
|
|
|
|
|
|
+ # from_label = cols
|
|
|
|
+ to_label = cols # get_default_cols(9)
|
|
|
|
+ # df_main = df_main.rename(columns=dict(zip(from_label, to_label)))
|
|
df_main[to_label].to_csv(f"{self.config['path2']}/SKR51_Struktur.csv", sep=';', encoding='latin-1', index_label='Sortierung')
|
|
df_main[to_label].to_csv(f"{self.config['path2']}/SKR51_Struktur.csv", sep=';', encoding='latin-1', index_label='Sortierung')
|
|
|
|
|
|
|
|
|
|
@@ -472,7 +474,7 @@ def luchtenberg():
|
|
base_dir = base_dir.parent.parent
|
|
base_dir = base_dir.parent.parent
|
|
import_dir = base_dir.joinpath('System/OPTIMA/Export')
|
|
import_dir = base_dir.joinpath('System/OPTIMA/Export')
|
|
elif not base_dir.joinpath('GCStruct_Aufbereitung').exists():
|
|
elif not base_dir.joinpath('GCStruct_Aufbereitung').exists():
|
|
- base_dir = Path('/media/fileserver1/verwaltung/Kunden/Luchtenberg/1 Umstellung SKR51/')
|
|
|
|
|
|
+ base_dir = Path('//192.168.2.21/verwaltung/Kunden/Luchtenberg/1 Umstellung SKR51/')
|
|
import_dir = base_dir
|
|
import_dir = base_dir
|
|
|
|
|
|
struct = GCStruct(str(base_dir.joinpath('GCStruct_Aufbereitung')))
|
|
struct = GCStruct(str(base_dir.joinpath('GCStruct_Aufbereitung')))
|