fix: 清除采购单号多余的汉字和空格
This commit is contained in:
1 parent
89c8da2990
commit
2df9bdda0d
8 files changed
+99
-17
No files matched your search
@@ -16,6 +16,7 @@ from typing import Any
|
||||
from app import db
|
||||
from app.core.errors import NotFoundError, ValidationError
|
||||
from app.models import ContractPaymentContract, ContractPaymentEvent, ContractPaymentNode
|
||||
from app.services.contract_payment.erp_payment_service import normalize_purchase_order_no
|
||||
|
||||
_STAGE_TYPES = ("prepayment", "shipment", "acceptance", "warranty")
|
||||
_DATE_REQUIRED = {"prepayment", "shipment"}
|
||||
@@ -115,7 +116,7 @@ def _normalize_review(contract: ContractPaymentContract, payload: dict[str, Any]
|
||||
Raises:
|
||||
ValidationError: 任一进入台账的条件不满足。
|
||||
"""
|
||||
purchase_order_no = str(payload.get("purchase_order_no") or "").strip()
|
||||
purchase_order_no = normalize_purchase_order_no(payload.get("purchase_order_no"))
|
||||
if not purchase_order_no:
|
||||
raise ValidationError("请填写采购单号")
|
||||
if len(purchase_order_no) > 128:
|
||||
|
||||
Reference in new issue
Block a user