Commit a8d52f5fa19b5b21a56a2cf34b1ed74498b94763

Authored by yeqianyong
1 parent 49ea1b0c

楚江erp:SQL补充

... ... @@ -1100,39 +1100,56 @@ CREATE TABLE `pending_delivery_order` (
1100 1100 alter table shipments_order_info add column delivery_time datetime default null comment '签收时间';
1101 1101 alter table shipments_plan add column auto_generate bool default true comment '是否系统自动生成';
1102 1102
1103   --- 应收款台账明细数据
1104   -create table if not exists receipt_ledger_info(
  1103 +create table if not exists base_data_customer_short(
1105 1104 id varchar(32) primary key comment 'ID',
1106   - customer_short_id varchar(32)comment '客户简称ID',
1107   - quota decimal(15,4) comment '额度',
1108   - settle_term varchar(32) comment '结算期限',
1109   - dept_id varchar(32) not null comment '办事处ID',
1110   - region varchar(32) comment '区域ID',
1111   - stock_up_company_id varchar(32) comment '备货单位ID',
  1105 + short_name varchar(32) not null comment '客户简称',
1112 1106 customer_id varchar(32) not null comment '客户ID',
1113   - factory_type varchar(20) comment '厂别',
1114   - shipment_date date default null comment '发货日期',
1115   - start_account_receivable decimal(15,4) default null comment '期初应收账款',
1116   - arrival_date date default null comment '到货日期',
1117   - processed_date date default null comment '应办理日期',
1118   - actual_returned_date date default null comment '实际回笼日期',
1119   - returned_amount decimal(15,4) default null comment '回笼金额',
1120   - end_account_receivable decimal(15,4) default null comment '期末应收账款',
1121   - debt_status varchar(20) comment '欠款状态',
1122   - apply_status varchar(20) comment '申请状态',
1123   - coordinate_date date default null comment '协调办理日期',
1124   - remark varchar(200) comment '备注',
1125   - second_coordinate_date date default null comment '二次协调日期',
1126   - third_coordinate_date date default null comment '三次协调日期',
1127   - fourth_coordinate_date date default null comment '四次协调日期',
1128   - fifth_coordinate_date date default null comment '五次协调日期',
1129   - description varchar(200) default null comment '说明',
1130   - del_flag bool not null default false comment '是否删除',
  1107 + type varchar(32) not null comment '客户类型',
  1108 + dept_id varchar(32) not null comment '办事处ID',
  1109 + region varchar(32) not null comment '区域ID',
1131 1110 create_by_id varchar(32) not null comment '创建人ID',
1132 1111 update_by_id varchar(32) not null comment '更新人ID',
1133 1112 create_time datetime default now() comment '创建时间',
1134 1113 update_time datetime default now() comment '更新时间'
1135   -) comment '应收款台账明细数据';
  1114 +) comment '客户简称';
  1115 +
  1116 +-- 应收款台账明细数据
  1117 +CREATE TABLE `receipt_ledger_info` (
  1118 + `id` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT 'ID',
  1119 + `customer_short_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '客户简称ID',
  1120 + `quota` decimal(15,4) DEFAULT NULL COMMENT '额度',
  1121 + `settle_term` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '结算期限',
  1122 + `dept_id` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '办事处ID',
  1123 + `region` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '区域',
  1124 + `stock_up_company_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备货单位ID',
  1125 + `customer_id` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '客户ID',
  1126 + `factory_type` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '厂别',
  1127 + `shipment_date` date DEFAULT NULL COMMENT '发货日期',
  1128 + `start_account_receivable` decimal(15,4) DEFAULT NULL COMMENT '期初应收账款',
  1129 + `arrival_date` date DEFAULT NULL COMMENT '到货日期',
  1130 + `processed_date` date DEFAULT NULL COMMENT '应办理日期',
  1131 + `actual_returned_date` date DEFAULT NULL COMMENT '实际回笼日期',
  1132 + `returned_amount` decimal(15,4) DEFAULT NULL COMMENT '回笼金额',
  1133 + `end_account_receivable` decimal(15,4) DEFAULT NULL COMMENT '期末应收账款',
  1134 + `apply_status` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '申请状态',
  1135 + `coordinate_date` date DEFAULT NULL COMMENT '协调办理日期',
  1136 + `remark` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '备注',
  1137 + `second_coordinate_date` date DEFAULT NULL COMMENT '二次协调日期',
  1138 + `third_coordinate_date` date DEFAULT NULL COMMENT '三次协调日期',
  1139 + `fourth_coordinate_date` date DEFAULT NULL COMMENT '四次协调日期',
  1140 + `fifth_coordinate_date` date DEFAULT NULL COMMENT '五次协调日期',
  1141 + `description` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '说明',
  1142 + `del_flag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  1143 + `create_by_id` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '创建人ID',
  1144 + `update_by_id` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '更新人ID',
  1145 + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  1146 + `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  1147 + `parent_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '父ID',
  1148 + `debt_status` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '欠款状态',
  1149 + `type` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '类型:INSIDE-内贸;OUTSIDE-外贸',
  1150 + `shipment_order_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货单id',
  1151 + PRIMARY KEY (`id`)
  1152 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='应收款台账号明细表'
1136 1153
1137 1154 alter table customer_develop_plan modify column monthly_usage varchar(50) comment '月用量';
1138 1155 alter table customer_develop_plan modify column target_quantity varchar(50) comment '目标量';
... ...