35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
ADVANCE_PAYMENT = "advance_payment"
|
|
ARRIVE_PAYMENT = "arrive_payment"
|
|
|
|
CLAUSE_LABELS = {
|
|
"volume_settlement": "按量结算",
|
|
"monthly_settlement": "月结",
|
|
"quarterly_settlement": "季结",
|
|
"other_settlement": "其他",
|
|
}
|
|
|
|
ADVANCE_CLAUSE = (
|
|
"款到发货。需方付款后安排发货,需方收到货物后,供方开具增值税专用发票。"
|
|
)
|
|
ARRIVE_CLAUSE = (
|
|
"货到付款,需方收到供方货物后,供方开具增值税专用发票,无异议后,以现汇方式月结。"
|
|
)
|
|
|
|
|
|
def default_settlement_clause(settlement_method: Optional[str]) -> str:
|
|
method = (settlement_method or "").strip() or ARRIVE_PAYMENT
|
|
if method == ADVANCE_PAYMENT:
|
|
return ADVANCE_CLAUSE
|
|
if method in CLAUSE_LABELS:
|
|
label = CLAUSE_LABELS[method]
|
|
return (
|
|
f"请根据双方约定的结算方式:{label}。"
|
|
"供方开具增值税专用发票,无异议后,以现汇方式月结。"
|
|
)
|
|
# arrive_payment 与未知值
|
|
return ARRIVE_CLAUSE
|