Commit de519bda authored by 邱阿朋's avatar 邱阿朋

refactor(gui): 注释掉回款查询功能

refactor(payment): 调整回款查询逻辑,适应新的表格格式
- 修改表头定位逻辑
- 优化数据读取范围计算

refactor(payment_push): 更新支付推送功能,适应新格式
- 移除不必要的变量和计算
- 直接使用空行列表计算数据读取范围
parent 732b69e1
......@@ -56,9 +56,9 @@ class Payment(AutoInterface):
# 定位表头与数据的分隔
first_header_start = empty_rows[1] + 1 # 第一个表头开始的行
second_header_start = empty_rows[2] + 4 # 第二个表头开始的行
second_header_start = empty_rows[3] + 1 # 第二个表头开始的行
first_df = pd.read_excel(file_name, skiprows=first_header_start, nrows=second_header_start - 7)
first_df = pd.read_excel(file_name, skiprows=first_header_start, nrows=empty_rows[2] - 4)
second_df = pd.read_excel(file_name, skiprows=second_header_start)
# 定义正则表达式模式,匹配包含 'Price' 或 'PCR' 或 'XXXXXXXX/XXXX/' 的描述
......
......@@ -10,7 +10,7 @@ from app.vc.interface import AutoInterface
class PaymentPush(AutoInterface):
def __init__(self,logger: Logger, country: str, shop_code: str):
def __init__(self, logger: Logger, country: str, shop_code: str):
self.logger = logger
self.country = country
self.shop_code = shop_code
......@@ -29,11 +29,9 @@ class PaymentPush(AutoInterface):
# 计算第一个表格的结束位置(第二个标题前的空行)
empty_lines = df.index[df.isnull().all(axis=1)].tolist()
separator = max([x for x in empty_lines if pay_header < x < inv_title], default=inv_title - 1)
# 读取并清理数据
test = separator - pay_header - 1
payments = pd.read_excel(file_name, header=pay_header, nrows=test).dropna(how='all')
payments = pd.read_excel(file_name, header=pay_header, nrows=empty_lines[2] - 4).dropna(how='all')
invoices = pd.read_excel(file_name, header=inv_header).dropna(how='all')
return [payments, invoices]
......
......@@ -104,7 +104,7 @@ class VCManagerGUI(ttk.Window):
actions = [
("SPA查询", "spa"),
("退货查询", "return"),
("回款查询", "payment"),
# ("回款查询", "payment"),
("ERP回款", "payment_erp")
]
for i, (text, value) in enumerate(actions):
......
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