fix: handle risk explanation standard adjustment
This commit is contained in:
@@ -72,7 +72,11 @@ class ExpenseClaimPolicyReviewMixin:
|
||||
limit_config=item_limit,
|
||||
reason_text="\n".join(
|
||||
part
|
||||
for part in [reason_corpus, str(item.item_reason or "").strip()]
|
||||
for part in [
|
||||
reason_corpus,
|
||||
str(item.item_reason or "").strip(),
|
||||
str(item.item_note or "").strip(),
|
||||
]
|
||||
if part
|
||||
),
|
||||
)
|
||||
@@ -333,7 +337,12 @@ class ExpenseClaimPolicyReviewMixin:
|
||||
f"{band_label} 职级在{standard_label}的住宿标准为 {cap} 元/晚,"
|
||||
f"当前酒店识别金额约 {nightly_amount} 元/晚。"
|
||||
)
|
||||
item_reason = str(context["item"].item_reason or "").strip()
|
||||
item_reason = " ".join(
|
||||
[
|
||||
str(context["item"].item_reason or "").strip(),
|
||||
str(context["item"].item_note or "").strip(),
|
||||
]
|
||||
).strip()
|
||||
item_has_exception = self._text_contains_keywords(item_reason, policy.standard_exception_keywords)
|
||||
if has_standard_exception or item_has_exception:
|
||||
flags.append(
|
||||
@@ -368,7 +377,12 @@ class ExpenseClaimPolicyReviewMixin:
|
||||
if allowed_level is None or class_level <= allowed_level:
|
||||
continue
|
||||
|
||||
item_reason = str(context["item"].item_reason or "").strip()
|
||||
item_reason = " ".join(
|
||||
[
|
||||
str(context["item"].item_reason or "").strip(),
|
||||
str(context["item"].item_note or "").strip(),
|
||||
]
|
||||
).strip()
|
||||
item_has_exception = self._text_contains_keywords(item_reason, policy.standard_exception_keywords)
|
||||
message = f"{band_label} 职级当前默认不可报销 {class_label}。"
|
||||
if has_standard_exception or item_has_exception:
|
||||
@@ -463,6 +477,7 @@ class ExpenseClaimPolicyReviewMixin:
|
||||
parts = [str(claim.reason or "").strip(), str(claim.location or "").strip()]
|
||||
for item in claim.items:
|
||||
parts.append(str(item.item_reason or "").strip())
|
||||
parts.append(str(item.item_note or "").strip())
|
||||
parts.append(str(item.item_location or "").strip())
|
||||
return "\n".join(part for part in parts if part)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user