fix
This commit is contained in:
@@ -81,13 +81,16 @@ def create_accounting_entries(data: List[Dict[str, Any]], exchange_rate: float)
|
||||
order_num = order["OrderNum"]
|
||||
account_name = order["AccountName"]
|
||||
|
||||
# 当orderNum为空时,摘要固定为"美金收款"
|
||||
summary = "美金收款" if not order_num else f"美金收款-{order_num}"
|
||||
|
||||
entry_debit = {
|
||||
"到账金额": received_amount,
|
||||
"手续费": handling_fee,
|
||||
"订单号": order_num,
|
||||
"应收账款": "",
|
||||
"金蝶名称": account_name,
|
||||
"摘要": f"美金收款-{order_num}",
|
||||
"摘要": summary,
|
||||
"借/贷": "借",
|
||||
"科目代码(*)": "1002.02",
|
||||
"科目名称(*)": "银行存款 - 中行USD",
|
||||
@@ -107,13 +110,16 @@ def create_accounting_entries(data: List[Dict[str, Any]], exchange_rate: float)
|
||||
# 获取第一个订单号用于摘要
|
||||
first_order_num = orders[0]["OrderNum"] if orders else ""
|
||||
|
||||
# 当orderNum为空时,摘要固定为"美金收款"
|
||||
summary = "美金收款" if not first_order_num else f"美金收款-{first_order_num}"
|
||||
|
||||
entry_fee = {
|
||||
"到账金额": received_amount,
|
||||
"手续费": handling_fee,
|
||||
"订单号": first_order_num,
|
||||
"应收账款": "",
|
||||
"金蝶名称": "",
|
||||
"摘要": f"美金收款-{first_order_num}",
|
||||
"摘要": summary,
|
||||
"借/贷": "借",
|
||||
"科目代码(*)": "5603.03",
|
||||
"科目名称(*)": "财务费用-手续费",
|
||||
@@ -137,13 +143,16 @@ def create_accounting_entries(data: List[Dict[str, Any]], exchange_rate: float)
|
||||
if amount is None:
|
||||
continue
|
||||
|
||||
# 当orderNum为空时,摘要固定为"美金收款"
|
||||
summary = "美金收款" if not order_num else f"美金收款-{order_num}"
|
||||
|
||||
entry_order = {
|
||||
"到账金额": received_amount,
|
||||
"手续费": handling_fee,
|
||||
"订单号": order_num,
|
||||
"应收账款": amount, # 填入Order的Amount金额
|
||||
"金蝶名称": account_name,
|
||||
"摘要": f"美金收款-{order_num}",
|
||||
"摘要": summary,
|
||||
"借/贷": "贷",
|
||||
"科目代码(*)": "1122",
|
||||
"科目名称(*)": "应收账款",
|
||||
|
||||
Reference in New Issue
Block a user