Commit 074d87a5 authored by 邱阿朋's avatar 邱阿朋

fix(spa_search): 补充无报告信息发票的输出数据- 为没有报告信息的发票添加默认数据结构

-确保所有发票都有输出数据,避免因缺少信息而导致的错误- 优化日志警告信息,提醒用户某些发票缺少报告信息
parent 8dc775b3
......@@ -198,6 +198,22 @@ def main():
# 获取当前发票的 item 列表
item_dict = export_item_read_data(invoice_id)
if item_dict is None:
push_data = {
'ad_date': coop.get('Invoice date', ""), # spa费用数据日期
'erp_sku': "", # ERP SKU
'ad_amount': coop.get('Original balance', ""), # spa费用金额
'ad_amount_currency': "", # spa费用币制
'funding_type': coop.get('Funding Type', ""), # 资金类型
'transaction_type': "", # 交易类型
'group_name': "", # 组别 运营一组 运营二组
'group_code': "", # 组别 T1 T2
'asin': "", # ASIN
'shop_code': shop_code, # 店铺code
'type': 2, # 1 sheet1 2 其他sheet
'parent_id': "Sheet1",
'order_no': "", # 订单号
}
sheet_data.append([push_data])
log.warning(f"{invoice_id} 暂无报告信息")
continue
......@@ -394,6 +410,7 @@ def test(file_name, result_file_name):
# 保存排序后的数据到 result.xls
df.to_excel('result.xlsx', index=False)
if __name__ == '__main__':
try:
country = helper.get_input_with_default("国家(目前支持[DE,FR,JP,CA,UK,US])", "US")
......
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