SuperAPI AI 工具集

load-lifecycle-patterns

办公与效率

查看项目

更新于 10-15 21:47

技能介绍

用途:为 laneweaverTMS 实现货运订单(load)状态流转、计费工作流、财务指标计算、取消与 TONU、承运商快速付款等业务逻辑时提供参考模式。

主要能力:

  1. 状态生命周期:uncovered → assigned → dispatched → at_origin → in_transit → at_destination → delivered,delivered 与 cancelled 为终态;给出各状态合法后继状态与触发条件(如承运商分配、发运确认、到达提货点、装货完成、交付完成等)。取消可从任意非终态发起,写入 load_cancellations 并通过触发器同步 loads.is_cancelled。
  2. 计费流程:delivered → POD 收到 → 承运商账单收到 → 发票就绪 → 客户开票 → 承运商付款。load_billing 表跟踪 pod_received、carrier_bill_received 及时间戳,invoice_ready 为生成列(pod_received AND carrier_bill_received)。
  3. 财务计算:grossProfit = customerRate - carrierRate;grossMarginPct = (grossProfit / customerRate) * 100;netProfit = (customerRate + customerAccessorials) - (carrierRate + carrierAccessorials)。示例视图 loads_with_financials 展示实现方式。
  4. TONU:承运商已分配后取消且非承运商过错时可能收取,金额记录在 load_cancellations.tonu_amount,向客户计费并向承运商付款。
  5. 快速付款:承运商发起,按账单金额百分比收取费用,净付款 = 账单金额 - 费用;carrier_bills 表含 quick_pay_requested、quick_pay_fee_pct、quick_pay_fee_amount 等字段。

使用方式:按资料中的状态转换表校验流转、用生成列判断发票就绪、用 NUMERIC(10,2) 存储金额、避免除零。

限制:资料未提供具体安装命令、收费、平台支持或效果数据;数据库模式实现细节需参考 laneweaver-database-design 技能。