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

优化

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