Browse Source

Fehler in Konten-Gruppierung, fehlende 882er-Konten

robert 1 year ago
parent
commit
df19338797
5 changed files with 157 additions and 1119 deletions
  1. 36 0
      data/NW_GW_Stk_Planung_AHR.csv
  2. 12 12
      export/accounts_2024.json
  3. 0 1002
      export/marketing_2024.json
  4. 94 94
      export/planning_2024.json
  5. 15 11
      webservice/csv_accounts.py

+ 36 - 0
data/NW_GW_Stk_Planung_AHR.csv

@@ -6342,3 +6342,39 @@
 202311;"55";"81020";1,000000000000000000
 202311;"55";"82700";1,000000000000000000
 202311;"55";"82720";3,000000000000000000
+202201;"10";"88200";638,000000000000000000
+202301;"10";"88200";615,000000000000000000
+202201;"30";"88200";1,000000000000000000
+202301;"30";"88200";0,000000000000000000
+202201;"40";"88200";1,000000000000000000
+202301;"40";"88200";1,000000000000000000
+202201;"50";"88200";1,000000000000000000
+202301;"50";"88200";0,000000000000000000
+202201;"55";"88200";0,000000000000000000
+202301;"55";"88200";0,000000000000000000
+202201;"82";"88200";3,000000000000000000
+202301;"82";"88200";3,000000000000000000
+202201;"10";"88203";25,000000000000000000
+202301;"10";"88203";42,000000000000000000
+202201;"30";"88203";0,000000000000000000
+202301;"30";"88203";0,000000000000000000
+202201;"40";"88203";0,000000000000000000
+202301;"40";"88203";1,000000000000000000
+202201;"50";"88203";0,000000000000000000
+202301;"50";"88203";0,000000000000000000
+202201;"55";"88203";0,000000000000000000
+202301;"55";"88203";0,000000000000000000
+202201;"82";"88203";0,000000000000000000
+202301;"82";"88203";1,000000000000000000
+202201;"10";"88270";15,000000000000000000
+202301;"10";"88270";8,000000000000000000
+202201;"30";"88270";0,000000000000000000
+202301;"30";"88270";0,000000000000000000
+202201;"40";"88270";0,000000000000000000
+202301;"40";"88270";0,000000000000000000
+202201;"50";"88270";0,000000000000000000
+202301;"50";"88270";0,000000000000000000
+202201;"55";"88270";0,000000000000000000
+202301;"55";"88270";0,000000000000000000
+202201;"82";"88270";0,000000000000000000
+202301;"82";"88270";0,000000000000000000

+ 12 - 12
export/accounts_2024.json

@@ -44955,13 +44955,13 @@
     "88200": {
       "10": [
         2766881.31,
-        0.0,
+        638.0,
         2699079.76,
-        0.0,
+        615.0,
         2575558.04,
-        0.0,
+        615.0,
         3090669.65,
-        0.0
+        738.0
       ],
       "40": [
         0.0,
@@ -44985,13 +44985,13 @@
       ],
       "82": [
         177926.49,
-        0.0,
+        3.0,
         145287.49,
-        0.0,
+        3.0,
         144670.35,
-        0.0,
+        3.0,
         173604.42,
-        0.0
+        3.6
       ]
     },
     "88201": {
@@ -45101,13 +45101,13 @@
     "88203": {
       "10": [
         60835.95,
-        0.0,
+        25.0,
         194490.66,
-        0.0,
+        42.0,
         188236.55,
-        0.0,
+        42.0,
         225883.86,
-        0.0
+        50.4
       ],
       "82": [
         5171.04,

+ 0 - 1002
export/marketing_2024.json

@@ -1,1004 +1,2 @@
 {
-  "48001": {
-    "10": [
-      3000.0,
-      0.0,
-      5500.0,
-      5500.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      500.0,
-      2500.0,
-      1000.0,
-      0.0
-    ]
-  },
-  "48005": {
-    "81": [
-      314.0,
-      544.0,
-      3964.0,
-      7044.0,
-      844.0,
-      544.0,
-      1344.0,
-      2464.0,
-      3844.0,
-      2364.0,
-      314.0,
-      314.0
-    ]
-  },
-  "48010": {
-    "10": [
-      0.0,
-      0.0,
-      1320.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      500.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "30": [
-      0.0,
-      0.0,
-      180.0,
-      120.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "40": [
-      0.0,
-      0.0,
-      1500.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "50": [
-      0.0,
-      0.0,
-      780.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "55": [
-      0.0,
-      0.0,
-      420.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "82": [
-      0.0,
-      0.0,
-      1140.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ]
-  },
-  "48011": {
-    "81": [
-      0.0,
-      0.0,
-      1000.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ]
-  },
-  "48015": {
-    "10": [
-      6986.0,
-      7076.0,
-      10516.0,
-      7611.0,
-      11526.0,
-      11388.0,
-      8188.0,
-      7388.0,
-      8976.0,
-      8156.0,
-      8826.0,
-      6626.0
-    ],
-    "30": [
-      671.0,
-      671.0,
-      1421.0,
-      1221.0,
-      1321.0,
-      1221.0,
-      1221.0,
-      671.0,
-      791.0,
-      731.0,
-      1171.0,
-      671.0
-    ],
-    "40": [
-      4033.0,
-      4033.0,
-      7783.0,
-      4033.0,
-      4233.0,
-      4445.0,
-      4445.0,
-      4445.0,
-      4033.0,
-      4533.0,
-      6403.0,
-      4033.0
-    ],
-    "50": [
-      1798.0,
-      2048.0,
-      5548.0,
-      1798.0,
-      3298.0,
-      9298.0,
-      1798.0,
-      1798.0,
-      2298.0,
-      8058.0,
-      1798.0,
-      2598.0
-    ],
-    "55": [
-      1513.0,
-      1813.0,
-      2563.0,
-      1513.0,
-      1513.0,
-      2413.0,
-      1513.0,
-      1813.0,
-      1513.0,
-      1653.0,
-      2328.0,
-      1513.0
-    ],
-    "82": [
-      4650.0,
-      7650.0,
-      9150.0,
-      4650.0,
-      5150.0,
-      5270.0,
-      4650.0,
-      4650.0,
-      10650.0,
-      11500.0,
-      6800.0,
-      4650.0
-    ]
-  },
-  "48016": {
-    "10": [
-      706.0,
-      706.0,
-      1256.0,
-      706.0,
-      706.0,
-      1366.0,
-      970.0,
-      1751.0,
-      706.0,
-      4658.0,
-      1256.0,
-      706.0
-    ],
-    "30": [
-      96.0,
-      96.0,
-      171.0,
-      96.0,
-      96.0,
-      186.0,
-      132.0,
-      239.0,
-      96.0,
-      171.0,
-      171.0,
-      96.0
-    ],
-    "40": [
-      802.0,
-      802.0,
-      1427.0,
-      802.0,
-      802.0,
-      1552.0,
-      1102.0,
-      1990.0,
-      802.0,
-      1427.0,
-      1427.0,
-      802.0
-    ],
-    "50": [
-      417.0,
-      417.0,
-      742.0,
-      417.0,
-      417.0,
-      807.0,
-      573.0,
-      1035.0,
-      417.0,
-      1942.0,
-      742.0,
-      417.0
-    ],
-    "55": [
-      225.0,
-      225.0,
-      400.0,
-      225.0,
-      225.0,
-      435.0,
-      309.0,
-      557.0,
-      225.0,
-      400.0,
-      650.0,
-      225.0
-    ],
-    "82": [
-      962.0,
-      962.0,
-      1712.0,
-      962.0,
-      962.0,
-      1862.0,
-      1226.0,
-      2388.0,
-      962.0,
-      4462.0,
-      1512.0,
-      962.0
-    ]
-  },
-  "48030": {
-    "10": [
-      0.0,
-      0.0,
-      1320.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "30": [
-      0.0,
-      0.0,
-      180.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "40": [
-      0.0,
-      0.0,
-      1500.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "50": [
-      0.0,
-      0.0,
-      780.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "55": [
-      0.0,
-      0.0,
-      420.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "82": [
-      0.0,
-      0.0,
-      1140.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ]
-  },
-  "48035": {
-    "81": [
-      0.0,
-      0.0,
-      1000.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ]
-  },
-  "48045": {
-    "81": [
-      1256.0,
-      1306.0,
-      1306.0,
-      1306.0,
-      1306.0,
-      1306.0,
-      1306.0,
-      1306.0,
-      1306.0,
-      1306.0,
-      1256.0,
-      1256.0
-    ]
-  },
-  "48050": {
-    "10": [
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0,
-      2430.0
-    ],
-    "30": [
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0,
-      635.0
-    ],
-    "40": [
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0,
-      2945.0
-    ],
-    "50": [
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0,
-      1525.0
-    ],
-    "55": [
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0,
-      815.0
-    ],
-    "82": [
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0,
-      3270.0
-    ]
-  },
-  "48060": {
-    "10": [
-      2390.0,
-      2570.0,
-      4740.0,
-      2330.0,
-      2970.0,
-      2220.0,
-      2190.0,
-      1940.0,
-      6360.0,
-      2570.0,
-      2490.0,
-      1590.0
-    ],
-    "30": [
-      525.0,
-      475.0,
-      875.0,
-      503.0,
-      775.0,
-      225.0,
-      525.0,
-      425.0,
-      853.0,
-      525.0,
-      585.0,
-      225.0
-    ],
-    "40": [
-      2084.0,
-      2284.0,
-      8634.0,
-      2809.0,
-      4004.0,
-      2004.0,
-      2854.0,
-      2354.0,
-      3959.0,
-      4154.0,
-      3204.0,
-      2004.0
-    ],
-    "50": [
-      2766.0,
-      2516.0,
-      3716.0,
-      2750.0,
-      3216.0,
-      2166.0,
-      2416.0,
-      2416.0,
-      6950.0,
-      2516.0,
-      2346.0,
-      2166.0
-    ],
-    "55": [
-      757.0,
-      1757.0,
-      2657.0,
-      1140.0,
-      2647.0,
-      1897.0,
-      1197.0,
-      997.0,
-      2490.0,
-      2197.0,
-      1307.0,
-      697.0
-    ],
-    "82": [
-      6075.0,
-      5475.0,
-      10827.0,
-      6577.0,
-      6525.0,
-      4725.0,
-      4775.0,
-      6975.0,
-      11127.0,
-      7877.0,
-      5775.0,
-      3975.0
-    ]
-  },
-  "48065": {
-    "10": [
-      1282.0,
-      1332.0,
-      3132.0,
-      1982.0,
-      1832.0,
-      1132.0,
-      782.0,
-      982.0,
-      2632.0,
-      1332.0,
-      1632.0,
-      782.0
-    ],
-    "40": [
-      682.0,
-      782.0,
-      2932.0,
-      2262.0,
-      1262.0,
-      1162.0,
-      1412.0,
-      762.0,
-      2062.0,
-      3412.0,
-      1112.0,
-      762.0
-    ],
-    "82": [
-      2494.0,
-      2594.0,
-      2394.0,
-      2727.0,
-      2979.0,
-      1827.0,
-      1327.0,
-      2452.0,
-      3152.0,
-      1727.0,
-      2479.0,
-      1327.0
-    ]
-  },
-  "48070": {
-    "10": [
-      0.0,
-      4600.0,
-      2100.0,
-      2250.0,
-      2250.0,
-      0.0,
-      1760.0,
-      0.0,
-      0.0,
-      2100.0,
-      4600.0,
-      0.0
-    ],
-    "30": [
-      0.0,
-      500.0,
-      1000.0,
-      0.0,
-      0.0,
-      0.0,
-      240.0,
-      0.0,
-      0.0,
-      1000.0,
-      500.0,
-      0.0
-    ],
-    "40": [
-      0.0,
-      3500.0,
-      3500.0,
-      0.0,
-      0.0,
-      0.0,
-      3200.0,
-      0.0,
-      0.0,
-      3500.0,
-      6000.0,
-      0.0
-    ],
-    "50": [
-      0.0,
-      1000.0,
-      4000.0,
-      0.0,
-      0.0,
-      0.0,
-      1040.0,
-      0.0,
-      0.0,
-      4000.0,
-      1000.0,
-      0.0
-    ],
-    "55": [
-      0.0,
-      1000.0,
-      2000.0,
-      0.0,
-      0.0,
-      0.0,
-      560.0,
-      0.0,
-      0.0,
-      2000.0,
-      1000.0,
-      0.0
-    ],
-    "82": [
-      0.0,
-      4000.0,
-      4400.0,
-      0.0,
-      1500.0,
-      0.0,
-      1200.0,
-      0.0,
-      3000.0,
-      9200.0,
-      12200.0,
-      0.0
-    ]
-  },
-  "48075": {
-    "10": [
-      0.0,
-      0.0,
-      1000.0,
-      1000.0,
-      0.0,
-      0.0,
-      2000.0,
-      2000.0,
-      1000.0,
-      1000.0,
-      1000.0,
-      0.0
-    ],
-    "40": [
-      0.0,
-      0.0,
-      1500.0,
-      1500.0,
-      0.0,
-      0.0,
-      2750.0,
-      2750.0,
-      0.0,
-      1500.0,
-      1500.0,
-      4000.0
-    ],
-    "82": [
-      0.0,
-      0.0,
-      1500.0,
-      4500.0,
-      0.0,
-      0.0,
-      2750.0,
-      2750.0,
-      0.0,
-      1500.0,
-      1500.0,
-      4000.0
-    ]
-  },
-  "48085": {
-    "81": [
-      667.0,
-      667.0,
-      5667.0,
-      667.0,
-      667.0,
-      667.0,
-      667.0,
-      667.0,
-      667.0,
-      1167.0,
-      667.0,
-      667.0
-    ]
-  },
-  "48090": {
-    "10": [
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      500.0,
-      8000.0,
-      8000.0,
-      4000.0,
-      0.0,
-      4000.0,
-      0.0,
-      0.0
-    ],
-    "30": [
-      0.0,
-      0.0,
-      0.0,
-      200.0,
-      200.0,
-      4000.0,
-      4000.0,
-      500.0,
-      200.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "40": [
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      2500.0,
-      2500.0,
-      3000.0,
-      0.0,
-      1500.0,
-      0.0,
-      0.0
-    ],
-    "50": [
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      500.0,
-      500.0,
-      500.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "55": [
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      1500.0,
-      1500.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ],
-    "82": [
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      2500.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0,
-      0.0
-    ]
-  },
-  "88205": {
-    "10": [
-      0.0,
-      0.0,
-      0.0,
-      -1750.0,
-      0.0,
-      0.0,
-      -1250.0,
-      0.0,
-      0.0,
-      0.0,
-      -1750.0,
-      0.0
-    ],
-    "40": [
-      0.0,
-      0.0,
-      0.0,
-      -1075.0,
-      0.0,
-      0.0,
-      -1095.0,
-      0.0,
-      0.0,
-      0.0,
-      -2975.0,
-      0.0
-    ],
-    "82": [
-      0.0,
-      0.0,
-      0.0,
-      -2500.0,
-      0.0,
-      0.0,
-      -2276.0,
-      0.0,
-      0.0,
-      0.0,
-      -3901.0,
-      0.0
-    ]
-  },
-  "88206": {
-    "10": [
-      0.0,
-      0.0,
-      0.0,
-      -2040.0,
-      0.0,
-      0.0,
-      -1325.0,
-      0.0,
-      0.0,
-      0.0,
-      -3075.0,
-      0.0
-    ],
-    "30": [
-      0.0,
-      0.0,
-      0.0,
-      -150.0,
-      0.0,
-      0.0,
-      -39.0,
-      0.0,
-      0.0,
-      0.0,
-      -69.0,
-      0.0
-    ],
-    "40": [
-      0.0,
-      0.0,
-      0.0,
-      -3250.0,
-      0.0,
-      0.0,
-      -1308.0,
-      0.0,
-      0.0,
-      0.0,
-      -3102.0,
-      0.0
-    ],
-    "50": [
-      0.0,
-      0.0,
-      0.0,
-      -2750.0,
-      0.0,
-      0.0,
-      -2100.0,
-      0.0,
-      0.0,
-      0.0,
-      -4500.0,
-      0.0
-    ],
-    "55": [
-      0.0,
-      0.0,
-      0.0,
-      -1550.0,
-      0.0,
-      0.0,
-      -1782.0,
-      0.0,
-      0.0,
-      0.0,
-      -2176.0,
-      0.0
-    ],
-    "82": [
-      0.0,
-      0.0,
-      0.0,
-      -7401.0,
-      0.0,
-      0.0,
-      -5426.0,
-      0.0,
-      0.0,
-      0.0,
-      -12377.0,
-      0.0
-    ]
-  }
 }

+ 94 - 94
export/planning_2024.json

@@ -14,7 +14,7 @@
         260.0
       ],
       "50": [
-        3568110.5990783414,
+        3568110.599078341,
         104.0
       ],
       "55": [
@@ -40,7 +40,7 @@
         75.0
       ],
       "50": [
-        1715585.5513307985,
+        1715585.5513307983,
         43.0
       ],
       "55": [
@@ -48,17 +48,17 @@
         18.0
       ],
       "82": [
-        2901292.7756653987,
+        2901292.775665399,
         80.0
       ]
     },
     "Umsatzerl\u00f6se;NA;NA BMW;2020 - 3er Reihe (inkl. M3, X3, iX3 (BEV));;;;;;": {
       "10": [
-        7416781.609195403,
+        7416781.609195402,
         132.0
       ],
       "30": [
-        945155.1724137929,
+        945155.172413793,
         18.0
       ],
       "40": [
@@ -70,7 +70,7 @@
         89.0
       ],
       "55": [
-        1426873.563218391,
+        1426873.5632183908,
         28.0
       ],
       "82": [
@@ -88,7 +88,7 @@
         8.0
       ],
       "40": [
-        4140810.8108108114,
+        4140810.810810811,
         70.0
       ],
       "50": [
@@ -132,7 +132,7 @@
     },
     "Umsatzerl\u00f6se;NA;NA BMW;2040 - 6er-Reihe (inkl. X6);;;;;;": {
       "10": [
-        655485.604606526,
+        655485.6046065259,
         8.0
       ],
       "30": [
@@ -152,7 +152,7 @@
         1.0
       ],
       "82": [
-        736222.6487523994,
+        736222.6487523993,
         8.0
       ]
     },
@@ -162,11 +162,11 @@
         6.0
       ],
       "30": [
-        179510.16456921585,
+        179510.16456921588,
         2.0
       ],
       "40": [
-        718040.6582768634,
+        718040.6582768635,
         8.0
       ],
       "50": [
@@ -174,7 +174,7 @@
         6.0
       ],
       "55": [
-        89755.08228460792,
+        89755.08228460794,
         1.0
       ],
       "82": [
@@ -240,7 +240,7 @@
         5.0
       ],
       "40": [
-        6097739.173228348,
+        6097739.173228347,
         207.0
       ],
       "50": [
@@ -248,7 +248,7 @@
         30.0
       ],
       "55": [
-        177962.59842519683,
+        177962.59842519686,
         7.0
       ],
       "82": [
@@ -262,7 +262,7 @@
         21.0
       ],
       "30": [
-        61428.015564202324,
+        61428.01556420233,
         2.0
       ],
       "40": [
@@ -284,7 +284,7 @@
     },
     "Umsatzerl\u00f6se;NA;NA MINI;2130 - MINI Countryman (inkl. SE, Clubman);;;;;;": {
       "10": [
-        779848.222862632,
+        779848.2228626321,
         22.0
       ],
       "30": [
@@ -322,7 +322,7 @@
         40.0
       ],
       "50": [
-        126727.35760971054,
+        126727.35760971055,
         5.0
       ],
       "55": [
@@ -452,11 +452,11 @@
         55.0
       ],
       "40": [
-        5671186.813186812,
+        5671186.813186813,
         180.0
       ],
       "50": [
-        5703824.1758241765,
+        5703824.175824176,
         180.0
       ],
       "55": [
@@ -470,28 +470,28 @@
     },
     "Umsatzerl\u00f6se;GA;GA BMW;3040 - BMW aus Leasingr\u00fccklauf;;;;;;": {
       "10": [
-        3178144.4444444445,
-        110.0
+        17624255.555555556,
+        610.0
       ],
       "30": [
-        136788.88888888888,
-        5.0
+        1231100.0,
+        45.0
       ],
       "40": [
-        1672800.0,
-        60.0
+        19516000.0,
+        700.0
       ],
       "50": [
-        431566.66666666657,
-        15.0
+        7480488.888888889,
+        260.0
       ],
       "55": [
-        293911.11111111107,
-        10.0
+        3967800.0,
+        135.0
       ],
       "82": [
-        2191111.111111111,
-        80.0
+        21911111.111111112,
+        800.0
       ]
     },
     "Umsatzerl\u00f6se;GA;GA BMW;3060 - BMW aus Zukauf;;;;;;": {
@@ -508,7 +508,7 @@
         54.0
       ],
       "50": [
-        1586842.1052631582,
+        1586842.105263158,
         60.0
       ],
       "55": [
@@ -522,28 +522,28 @@
     },
     "Umsatzerl\u00f6se;GA;GA BMW;3120 - BMW an Wiederverk\u00e4ufer;;;;;;": {
       "10": [
-        814285.7142857142,
-        40.0
+        3664285.714285714,
+        180.0
       ],
       "30": [
-        139378.02197802198,
-        6.0
+        952416.4835164835,
+        41.0
       ],
       "40": [
-        258593.40659340657,
-        20.0
+        3878901.0989010986,
+        300.0
       ],
       "50": [
-        527802.1978021978,
-        30.0
+        2463076.9230769225,
+        140.0
       ],
       "55": [
-        81485.71428571429,
-        4.0
+        814857.1428571428,
+        40.0
       ],
       "82": [
-        637793.4065934066,
-        36.0
+        7724386.813186813,
+        436.0
       ]
     },
     "Umsatzerl\u00f6se;GA;JGA MINI;3080 - MINI JGA;;;;;;": {
@@ -580,7 +580,7 @@
     },
     "Umsatzerl\u00f6se;GA;GA MINI;3084 - MINI aus Inzahlung/Zukauf;;;;;;": {
       "10": [
-        657822.2222222221,
+        657822.2222222222,
         40.0
       ],
       "30": [
@@ -658,7 +658,7 @@
         90.0
       ],
       "55": [
-        251456.52173913046,
+        251456.52173913043,
         20.0
       ],
       "82": [
@@ -1196,11 +1196,11 @@
         5597.52435
       ],
       "30": [
-        340000.00054049987,
+        340000.0005404999,
         1297.56135
       ],
       "40": [
-        2003000.0004636003,
+        2003000.0004636,
         8564.22097
       ],
       "50": [
@@ -1212,8 +1212,8 @@
         1.0
       ],
       "82": [
-        2299999.9994377997,
-        9632.297509999999
+        2299999.9994378,
+        9632.29751
       ]
     },
     "Umsatzerl\u00f6se;SC;Extern;Mechanik;6030 - BMW PKW mech.Arb.GL;;;;;": {
@@ -1238,22 +1238,22 @@
         1.0
       ],
       "82": [
-        459999.99941000005,
+        459999.99941,
         1926.4595
       ]
     },
     "Umsatzerl\u00f6se;SC;Extern;Mechanik;6036 - MINI PKW mech. Arb.ext.;;;;;": {
       "10": [
-        179999.99990496004,
+        179999.99990496002,
         819.149904
       ],
       "30": [
         14000.000005301,
-        53.428996700000006
+        53.4289967
       ],
       "40": [
-        409999.99887119996,
-        1753.0357399999998
+        409999.9988712,
+        1753.03574
       ],
       "50": [
         139999.99997915002,
@@ -1265,17 +1265,17 @@
       ],
       "82": [
         374999.9999862,
-        1570.4832900000001
+        1570.48329
       ]
     },
     "Umsatzerl\u00f6se;SC;Extern;Mechanik;6038 - MINI PKW mech. Arb.GL;;;;;": {
       "10": [
         13999.999992608,
-        63.71165920000001
+        63.7116592
       ],
       "40": [
-        36000.000049199996,
-        153.92508999999998
+        36000.0000492,
+        153.92509
       ],
       "50": [
         12000.00001133,
@@ -1297,7 +1297,7 @@
       ],
       "81": [
         292999.9991552,
-        1448.7737300000001
+        1448.77373
       ]
     },
     "Umsatzerl\u00f6se;SC;Extern;Mechanik;6190 - Motorrad mech.Arb. GWL;;;;;": {
@@ -1346,7 +1346,7 @@
         2522.66119
       ],
       "50": [
-        248000.00090749998,
+        248000.0009075,
         1080.37465
       ],
       "55": [
@@ -1361,7 +1361,7 @@
     "Umsatzerl\u00f6se;SC;Extern;Elektrik;6076 - MINI PKW elektr. Arb.ext.;;;;;": {
       "10": [
         19999.99998944,
-        91.01665600000001
+        91.016656
       ],
       "30": [
         1999.9999996343,
@@ -1369,7 +1369,7 @@
       ],
       "40": [
         27999.99993432,
-        119.71951399999999
+        119.719514
       ],
       "50": [
         15000.000002685,
@@ -1409,19 +1409,19 @@
     "Umsatzerl\u00f6se;SC;Extern;Karosserie;6090 - Karosseriearbeiten extern;;;;;": {
       "10": [
         329999.9989468,
-        1501.7748199999999
+        1501.77482
       ],
       "30": [
         83999.99997939999,
         320.57398
       ],
       "40": [
-        615000.0006455999,
+        615000.0006456,
         2629.55362
       ],
       "50": [
         265000.0010345,
-        1154.4325900000001
+        1154.43259
       ],
       "55": [
         80000.0,
@@ -1434,11 +1434,11 @@
     },
     "Umsatzerl\u00f6se;SC;Extern;Karosserie;6110 - Karosseriearbeiten GWL;;;;;": {
       "10": [
-        89999.99995248002,
+        89999.99995248001,
         409.574952
       ],
       "30": [
-        19999.999996343002,
+        19999.999996343,
         76.3271381
       ],
       "40": [
@@ -1461,7 +1461,7 @@
     "Umsatzerl\u00f6se;SC;Extern;Karosserie;6130 - Lackierarbeiten extern;;;;;": {
       "10": [
         6999.999996304,
-        31.855829600000003
+        31.8558296
       ],
       "30": [
         99.9999998507,
@@ -1497,10 +1497,10 @@
       ],
       "30": [
         75000.00005088,
-        422.91643200000004
+        422.916432
       ],
       "40": [
-        579999.9996814999,
+        579999.9996815,
         3038.71745
       ],
       "50": [
@@ -1518,7 +1518,7 @@
     },
     "Umsatzerl\u00f6se;SC;Intern;Mechanik;6180 - Motorrad mech.Arb. Innerbetr.;;;;;": {
       "81": [
-        89999.99999160002,
+        89999.99999160001,
         655.021834
       ]
     },
@@ -1551,10 +1551,10 @@
     "Umsatzerl\u00f6se;SC;Intern;Karosserie;6100 - Karosseriearb. innerbetr.;;;;;": {
       "10": [
         35000.00001536,
-        220.51411299999998
+        220.514113
       ],
       "30": [
-        7000.000001201999,
+        7000.000001202,
         39.4722003
       ],
       "40": [
@@ -1576,24 +1576,24 @@
     },
     "Umsatzerl\u00f6se;SC;Intern;Karosserie;6140 - Lackierarbeiten innerbetr.;;;;;": {
       "10": [
-        27999.999948799996,
-        176.41128999999998
+        27999.9999488,
+        176.41129
       ],
       "30": [
-        100.00000077719999,
+        100.0000007772,
         0.56388858
       ],
       "40": [
-        199.99999923200002,
+        199.999999232,
         1.0478336
       ],
       "50": [
         27999.99989675,
-        122.51148500000001
+        122.511485
       ],
       "82": [
         41999.9999432,
-        149.35988600000002
+        149.359886
       ]
     },
     "Umsatzerl\u00f6se;SC;Sonstige;6200 - Fremdleistungen f\u00fcr MOT;;;;;;": {
@@ -2218,27 +2218,27 @@
     },
     "Materialaufwand;GA;GA BMW;3040 - BMW aus Leasingr\u00fccklauf;;;;;;": {
       "10": [
-        2860330.0,
+        15861830.0,
         0.0
       ],
       "30": [
-        123110.0,
+        1107990.0,
         0.0
       ],
       "40": [
-        1505520.0,
+        17564400.0,
         0.0
       ],
       "50": [
-        388410.0,
+        6732440.0,
         0.0
       ],
       "55": [
-        264520.0,
+        3571020.0,
         0.0
       ],
       "82": [
-        1972000.0,
+        19720000.0,
         0.0
       ]
     },
@@ -2270,27 +2270,27 @@
     },
     "Materialaufwand;GA;GA BMW;3120 - BMW an Wiederverk\u00e4ufer;;;;;;": {
       "10": [
-        741000.0,
+        3334500.0,
         0.0
       ],
       "30": [
-        126834.0,
+        866699.0,
         0.0
       ],
       "40": [
-        235320.0,
+        3529800.0,
         0.0
       ],
       "50": [
-        480300.0,
+        2241400.0,
         0.0
       ],
       "55": [
-        74152.0,
+        741520.0,
         0.0
       ],
       "82": [
-        580392.0,
+        7029192.0,
         0.0
       ]
     },
@@ -3390,7 +3390,7 @@
     },
     "Verkaufsabh. Kosten;T&Z;5360 - Verkaufsabh\u00e4ngige Kosten TUZ;;;;;;;": {
       "10": [
-        33452.999999999985,
+        33452.99999999999,
         0.0
       ],
       "30": [
@@ -4032,7 +4032,7 @@
     },
     "Direkte Fixkosten;T&Z;5440 - Fracht- und Verpackungskosten;;;;;;;": {
       "10": [
-        33040.000000000015,
+        33040.00000000001,
         0.0
       ],
       "30": [

+ 15 - 11
webservice/csv_accounts.py

@@ -43,7 +43,8 @@ def actuals(period):
     df["FCQ"] = df["YTDQ"] * 12 / month_no
     df.drop(columns=["Menge", "Betrag"], inplace=True)
 
-    # df2 = pd.pivot_table(df, values='Betrag', index=['Konto Nr', 'Betrieb Nr'], columns=['Jahr'], aggfunc=np.sum, fill_value=0.0)
+    # df2 = pd.pivot_table(df, values='Betrag', index=['Konto Nr', 'Betrieb Nr'],
+    # columns=['Jahr'], aggfunc=np.sum, fill_value=0.0)
     df = df.groupby(["Konto_Nr", "Betrieb_Nr"]).sum()
     print(df.head())
 
@@ -68,8 +69,9 @@ def planning_prev(year):
         encoding="latin-1",
         dtype={"Betrieb Nr": str, "Bereich": str, "Zeile": str},
     )
-    df1["Wert"] = df1["Gesamt"]
-    df1 = df1[["Jahr", "Betrieb Nr", "Vstufe 1", "Bereich", "Zeile", "Konto", "Version", "Wert"]]
+    df1["Wert"] = np.where(df1["Vstufe 1"] == "Umsatzerlöse", df1["Gesamt"], df1["Gesamt"] * -1)
+    df1["Menge"] = 0
+    df1 = df1[["Jahr", "Betrieb Nr", "Vstufe 1", "Bereich", "Zeile", "Konto", "Version", "Wert", "Menge"]]
 
     df2 = pd.read_csv(
         base_dir / f"data/Planner_{year}_V1_Stk.csv",
@@ -78,26 +80,28 @@ def planning_prev(year):
         encoding="latin-1",
         dtype={"Betrieb Nr": str, "Bereich": str, "Zeile": str},
     )
-    df2["Menge"] = df2["Gesamt"]
+    df2.rename(columns={"Gesamt": "Menge"}, inplace=True)
+    df2["Wert"] = 0
     df2["Vstufe 1"] = "Umsatzerlöse"
-    df2 = df2[["Jahr", "Betrieb Nr", "Vstufe 1", "Bereich", "Zeile", "Konto", "Version", "Menge"]]
-    df = pd.merge(df1, df2, how="left", on=["Jahr", "Betrieb Nr", "Vstufe 1", "Bereich", "Zeile", "Konto", "Version"])
-    df["Menge"] = df["Menge"].fillna(0)
-    df["Wert"] = df["Wert"].fillna(0)
-    df["Wert"] = np.where(df["Vstufe 1"] == "Umsatzerlöse", df["Wert"], df["Wert"] * -1)
+    df2 = df2[["Jahr", "Betrieb Nr", "Vstufe 1", "Bereich", "Zeile", "Konto", "Version", "Wert", "Menge"]]
+
+    df = pd.concat([df1, df2])
 
     df["Bereich"] = df["Bereich"].fillna("NA").replace("VW (inkl. GF)", "?")
     df["regex"] = df["Vstufe 1"] + ";" + df["Bereich"] + ";.*" + df["Zeile"] + " - [^;]*;;"
-    df = df[df["Wert"] != 0]
 
     gcstruct = json.load(open(base_dir / "export/gcstruct.json", "r"))
     structure_ids = [s["id"] for s in gcstruct["flat"]["Struktur_FB"]]
 
     df["id"] = df["regex"].apply(lambda x: (list(filter(lambda y: match(x, y), structure_ids)) + [""])[0])
+    df["order_by"] = df.index
     df = df[df["id"] != ""]
 
+    df_grouped = df.groupby(by=["id", "Betrieb Nr"], sort=False).aggregate("sum").reset_index()
+    df_grouped = df_grouped[df_grouped["Wert"] != 0]  # .sort_values(by="order_by")
+
     res = {}
-    for item in df.to_dict(orient="records"):
+    for item in df_grouped.to_dict(orient="records"):
         if item["id"] not in res:
             res[item["id"]] = {}
         res[item["id"]][item["Betrieb Nr"]] = [item["Wert"], item["Menge"]]