Commit 86d3e36f authored by 邱阿朋's avatar 邱阿朋

feat(app): 优化返点计算逻辑

- 引入多个可能的返点列名,按优先级顺序查找
- 在每个 sheet 中动态确定使用哪个列名- 提高了代码的灵活性和鲁棒性
parent 598b9169
......@@ -214,8 +214,20 @@ class Spa(AutoInterface):
计算每个sheet总金额
"""
total_amount = 0
rebate_column = "Rebate In Agreement Currency"
# 定义可能的列名(按优先级顺序)
possible_columns = [
"Rebate In Agreement Currency",
"Vendor Funding In Agreement Currency"
]
for sheet_name, df in sheets.items():
# 确定要使用的列名
rebate_column = None
for col in possible_columns:
if col in df.columns:
rebate_column = col
break
# 找到第一个空行(NaN值)的索引
first_empty = df[rebate_column].isna().idxmax()
if pd.isna(first_empty) or first_empty == 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment