feat(finance): P2 手动退款登记与成本异常闭环
- 迁移 112:order_refunds(订单项级退款,整单拆多条共享 batch_no,source/external_ref 预留平台 API)+ cost_exceptions.resolution_note - 新服务 order-refund-service:整单/指定商品退款、可退金额校验、撤销、全额退完同步 pay_status - 销售事实改为按有效退款记录冲减;无记录时仍兼容 pay_status=refunded 的历史全额退款 - 订单详情新增退款登记与退款记录表,商品明细显示收入/已退/可退 - 全额退款自动关闭该订单项成本异常并写处理备注;成本异常处理改为带备注弹窗 - 财务事件 UNION 接入退款记录,文档同步 P2 状态与 API
This commit is contained in:
@@ -69,3 +69,17 @@ export function generateConsignmentSubmissionNo(date: Date = new Date()): string
|
||||
const rand = Math.floor(1000 + Math.random() * 9000)
|
||||
return `SUB${yy}${mm}${dd}${hh}${min}${rand}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成退款单号,形如 `RF26102415301234`。
|
||||
* 整单退款按订单项拆成多条记录,共享同一个 batch_no(取首条单号)。
|
||||
*/
|
||||
export function generateRefundNo(date: Date = new Date()): string {
|
||||
const yy = String(date.getFullYear()).slice(-2)
|
||||
const mm = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const dd = String(date.getDate()).padStart(2, '0')
|
||||
const hh = String(date.getHours()).padStart(2, '0')
|
||||
const min = String(date.getMinutes()).padStart(2, '0')
|
||||
const rand = Math.floor(1000 + Math.random() * 9000)
|
||||
return `RF${yy}${mm}${dd}${hh}${min}${rand}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user