调价后的新价格写入报价单;多段段前的货物带到各段,协同群不再把体积里的星号吃掉。海运字段齐了先核对再查价。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -243,6 +243,44 @@ class LandRouteOptionsTests(unittest.TestCase):
|
||||
valid = text.find("报价有效期:", text.find("费用合计:"))
|
||||
self.assertGreater(valid, text.find("费用合计:"))
|
||||
|
||||
def test_one_leg_detail_does_not_repeat_route_and_card_is_summary(self) -> None:
|
||||
"""一段陆运:目的站名里已有横杠,明细只写始发→目的;卡片引用条只留合计和项数。"""
|
||||
from agent.policy import inquiry_copy as copy
|
||||
|
||||
dest = "谅山Lạng Sơn-春疆货场Huu Nghi"
|
||||
quote = {
|
||||
"source": "TMS",
|
||||
"source_label": "TMS标准报价",
|
||||
"currency": "CNY",
|
||||
"valid_until": "2026-10-31",
|
||||
"landSegments": [
|
||||
{
|
||||
"segmentSequence": 1,
|
||||
"routeLegSequence": 1,
|
||||
"origin": "上海",
|
||||
"destination": dest,
|
||||
"costPrice": 7500,
|
||||
"currency": "CNY",
|
||||
"transitDays": "N+2",
|
||||
}
|
||||
],
|
||||
"fee_lines": [{"name": "运输费", "amount": "7500", "currency": "CNY"}],
|
||||
}
|
||||
projected = project_selected_route(quote, group_land_routes(quote)[0])
|
||||
text = copy.sea_quote_detail_text(
|
||||
work_order_no="WO202610030035",
|
||||
quote=projected,
|
||||
business_line="LAND",
|
||||
)
|
||||
self.assertNotIn(f"上海-{dest}", text)
|
||||
self.assertIn(f"上海 → {dest}", text)
|
||||
self.assertEqual(text.count(dest), 1)
|
||||
self.assertIn("运输费:CNY 7500", text)
|
||||
card = copy.quote_area_safe_text(projected, business_line="LAND")
|
||||
self.assertEqual(card, "费用合计:CNY 7500\n共1项费用,详见上一条明细")
|
||||
self.assertNotIn("运输费", card)
|
||||
self.assertNotIn(dest, card)
|
||||
|
||||
def test_land_detail_and_group_use_selected_route_valid_until(self) -> None:
|
||||
"""选定广西这条后:私聊明细和群 TMS 段同一套正文,不摊开没选的线路。"""
|
||||
from agent.policy import inquiry_copy as copy
|
||||
|
||||
Reference in New Issue
Block a user