|
@@ -98,15 +98,14 @@ class GCHR:
|
|
|
logging.info(df_translate[df_translate['duplicated']])
|
|
|
df_translate = df_translate[['Konto_Nr_Händler', 'Konto_Nr_SKR51', 'Marke',
|
|
|
'Marke_HBV', 'Standort', 'Standort_HBV']]
|
|
|
- row = {
|
|
|
- 'Konto_Nr_Händler': '01-01-0861-00-00-00',
|
|
|
- 'Konto_Nr_SKR51': '01-01-0861-00-00-00',
|
|
|
- 'Marke': '01',
|
|
|
- 'Marke_HBV': '',
|
|
|
- 'Standort': '01',
|
|
|
- 'Standort_HBV': ''
|
|
|
- }
|
|
|
+
|
|
|
+ row = df_translate[['Marke', 'Marke_HBV', 'Standort', 'Standort_HBV']] \
|
|
|
+ .drop_duplicates().sort_values(by=['Marke', 'Standort']).iloc[:1].to_dict(orient='records')[0]
|
|
|
+ row['Konto_Nr_Händler'] = '01-01-0861-00-00-00'
|
|
|
+ row['Konto_Nr_SKR51'] = '01-01-0861-00-00-00'
|
|
|
+
|
|
|
df_translate = pd.concat([df_translate, pd.DataFrame.from_records([row])])
|
|
|
+ # print(df_translate.tail())
|
|
|
# df_translate.drop(columns=['duplicated'], inplace=True)
|
|
|
df_translate.drop_duplicates(inplace=True)
|
|
|
df_translate.set_index('Konto_Nr_Händler')
|
|
@@ -148,11 +147,11 @@ class GCHR:
|
|
|
row = {
|
|
|
'Konto_Nr_Händler': '01-01-0861-00-00-00',
|
|
|
'Bookkeep Period': filter_opening,
|
|
|
- 'Debit Amount': opening_balance,
|
|
|
+ 'Debit Amount': opening_balance * -1,
|
|
|
'Credit Amount': 0,
|
|
|
'Debit Quantity': 0,
|
|
|
'Credit Quantity': 0,
|
|
|
- 'amount': opening_balance
|
|
|
+ 'amount': opening_balance * -1
|
|
|
}
|
|
|
df_opening_balance = pd.concat([df_opening_balance, pd.DataFrame.from_records([row])])
|
|
|
|
|
@@ -235,6 +234,9 @@ class GCHR:
|
|
|
df['GW_Verkauf_4'] = (df['Konto_Nr'].str.match(r'^[78]4')) & (df['Kostenstelle'].str.match(r'^[^4]\d'))
|
|
|
df['Kostenstelle'] = np.where(df['GW_Verkauf_4'] == True, '41', df['Kostenstelle'])
|
|
|
|
|
|
+ df['GW_Verkauf_x420'] = (df['Konto_Nr'].str.match(r'^[78]420'))
|
|
|
+ df['Kostenstelle'] = np.where(df['GW_Verkauf_x420'] == True, '42', df['Kostenstelle'])
|
|
|
+
|
|
|
df['GW_Verkauf_5'] = (df['Konto_Nr'].str.match(r'^[78]5')) & (df['Kostenstelle'].str.match(r'^[^5]\d'))
|
|
|
df['Kostenstelle'] = np.where(df['GW_Verkauf_5'] == True, '51', df['Kostenstelle'])
|
|
|
|