From e1eeca0001774573d28baba0ebafdabfb943e7da Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Sun, 16 Aug 2026 15:03:05 +0800 Subject: [PATCH] feat(crm): use settlement clause helper in save_template Co-authored-by: Cursor --- backend/app/crud/crm/contract.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/app/crud/crm/contract.py b/backend/app/crud/crm/contract.py index 0a2ba54c5..a7cabd1cb 100644 --- a/backend/app/crud/crm/contract.py +++ b/backend/app/crud/crm/contract.py @@ -30,6 +30,7 @@ from app.crud.crm.contract_product import ( ) from app.crud.crm.customer import get_customer from app.crud.crm.invoice_info import list_invoice_info_by_customer +from app.services.crm_settlement_clause import default_settlement_clause from app.services.crm_supplier_hazard import assert_products_allowed_for_supplier from app.crud.crm.product import resolve_product_id_for_quote_item from app.crud.crm.quote import get_quote @@ -1661,12 +1662,10 @@ def save_template( drafts = settlement_clause_drafts if not (drafts or "").strip(): method = (entity.settlement_method or "").strip() or "arrive_payment" - default_clause = ( - "款到发货。需方付款后安排发货,需方收到货物后,供方开具13%增值税专用发票。" - if method == "advance_payment" - else "货到付款,需方收到供方货物后,供方开具13%增值税专用发票,无异议后,以现汇方式月结。" + drafts = json.dumps( + {method: default_settlement_clause(method)}, + ensure_ascii=False, ) - drafts = json.dumps({method: default_clause}, ensure_ascii=False) entity.template_content = template_content or "" entity.settlement_clause_drafts = drafts