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

优化

parent 52b6c910
......@@ -7,13 +7,13 @@ from lxml import etree
def switch_domain(country):
domain = "https://vendorcentral.amazon.com/"
if country == "jp":
if country == "JP":
domain = "https://vendorcentral.amazon.co.jp/"
if country == "uk":
if country == "UK":
domain = "https://vendorcentral.amazon.co.uk/"
if country == "fr":
if country == "FR":
domain = "https://vendorcentral.amazon.fr/"
if country == "ca":
if country == "CA":
domain = "https://vendorcentral.amazon.ca/"
if country == "mx":
domain = "https://vendorcentral.amazon.com.mx/"
......
......@@ -251,7 +251,6 @@ def handle_data(detail_datum, vendor, deduction_points):
def main():
list_data = export_list_read_data()
excel.save_xls(list_data, "回款数据.xlsx", "Remittance payments")
log.info(f"共计:{len(list_data)} 订单")
all_normal_pay_data = []
......@@ -268,6 +267,7 @@ def main():
vendor = vendor_payment_terms['vendor']
deduction_points = int(vendor_payment_terms['payment_terms'])
if len(invoice_number) > 8:
last_two = invoice_number[-2:] # 取后两位
last_three = invoice_number[-3:] # 取后三位
# 检查后两位是否在测试列表中
......@@ -275,6 +275,7 @@ def main():
invoice_number = invoice_number[:-2] # 去掉后两位
if last_three == "PCR":
invoice_number = invoice_number[:-3] # 去掉最后三位
# 下载excel文件并读取数据
detail_data = export_details_read_data(invoice_number)
......@@ -319,8 +320,8 @@ def main():
if __name__ == '__main__':
try:
country = helper.get_input_with_default("国家(目前支持[usa,jp,uk,fr,ca])", "usa")
payeeCode = helper.get_input_with_default("payeeCode", "E8PFB")
country = helper.get_input_with_default("国家(目前支持[DE,FR,JP,CA,UK,US])", "US")
payeeCode = helper.get_input_with_default("payeeCode", "VECET")
domain.domain_page(page, country)
main()
page.close()
......
......@@ -105,7 +105,7 @@ def main():
if __name__ == '__main__':
try:
country = helper.get_input_with_default("国家(目前支持[usa,jp,uk,fr,ca])", "usa")
country = helper.get_input_with_default("国家(目前支持[DE,FR,JP,CA,UK,US])", "US")
domain.domain_page(page, country)
main()
page.close()
......
......@@ -196,7 +196,7 @@ def main():
if __name__ == '__main__':
try:
country = helper.get_input_with_default("国家(目前支持[usa,jp,uk,fr,ca])", "usa")
country = helper.get_input_with_default("国家(目前支持[DE,FR,JP,CA,UK,US])", "US")
domain.domain_page(page, country)
main()
page.close()
......
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