Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amazon_reports
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
common
amazon_reports
Commits
86d3e36f
Commit
86d3e36f
authored
Apr 12, 2025
by
邱阿朋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): 优化返点计算逻辑
- 引入多个可能的返点列名,按优先级顺序查找 - 在每个 sheet 中动态确定使用哪个列名- 提高了代码的灵活性和鲁棒性
parent
598b9169
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
spa.py
app/vc/spa.py
+13
-1
No files found.
app/vc/spa.py
View file @
86d3e36f
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment