Files
shanxia2.0/docs/sql/migrations/2026-11-05-reimburse-payment.sql
T
wuzilongandCursor e7f942b399 feat(bx): 报销支付按未结清余额分次冲抵和发放。
冲抵后的余额不再自动记成发放,发放和冲抵分开提交,未结清单据继续留在待处理。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-05 21:14:09 +08:00

26 lines
1.5 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 报销发放明细:同一张报销单可以分多次发放,每次单独记账。
-- MySQL 5.7。可重复执行。
SET NAMES utf8mb4;
CREATE TABLE IF NOT EXISTS `bx_reimburse_payment` (
`id` varchar(64) NOT NULL COMMENT '主键ID(UUID)',
`reimburse_id` varchar(64) NOT NULL COMMENT '报销申请单ID',
`pay_amount` decimal(14,2) NOT NULL COMMENT '本次发放金额',
`pay_time` datetime NOT NULL COMMENT '发放时间',
`pay_user_id` varchar(64) NOT NULL COMMENT '发放操作人ID',
`pay_user_name` varchar(64) DEFAULT NULL COMMENT '发放操作人姓名',
`pay_remark` varchar(512) DEFAULT NULL COMMENT '发放备注',
`tenant_no` varchar(64) NOT NULL DEFAULT 'shanxia2.0' COMMENT '租户编号',
`order_num` int(11) DEFAULT NULL COMMENT '排序号(公共)',
`remark` varchar(512) DEFAULT NULL COMMENT '备注',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人',
`create_dept_id` varchar(64) NOT NULL DEFAULT '' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`del_flag` smallint(6) NOT NULL DEFAULT '0' COMMENT '删除标记:0-正常 1-已删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_reimburse_payment_reimburse_id` (`reimburse_id`) USING BTREE,
KEY `idx_reimburse_payment_tenant_no` (`tenant_no`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='报销-发放明细';