change param to customer ID

This commit is contained in:
Florian Förster 2025-02-19 12:28:11 +01:00
parent c70bd1cdc6
commit b229794e6d

View File

@ -34,7 +34,7 @@ if TYPE_CHECKING:
def sales_per_customer( def sales_per_customer(
df: pd.DataFrame, df: pd.DataFrame,
kunde: int, customer_id: int,
min_num_data_points: int = 100, min_num_data_points: int = 100,
) -> FcResult: ) -> FcResult:
"""_summary_ """_summary_
@ -59,7 +59,9 @@ def sales_per_customer(
# TODO change away from nested DataFrames: just use "f_umsatz_fakt" # TODO change away from nested DataFrames: just use "f_umsatz_fakt"
# TODO with strong type checks # TODO with strong type checks
df = df.copy() df = df.copy()
df_firma = df[(df["firma_refid"] == kunde) & (df["beleg_typ"] == 1) & (df["betrag"] > 0)] df_firma = df[
(df["firma_refid"] == customer_id) & (df["beleg_typ"] == 1) & (df["betrag"] > 0)
]
for transaction in df_firma["vorgang_refid"].unique(): for transaction in df_firma["vorgang_refid"].unique():
cust_data.order.append(transaction) cust_data.order.append(transaction)