| | |
| | | # 往来付款回款流水表 |
| | | # 客户往来取 party_type=1 and direction=1 作为「付款」列 |
| | | # 供应商往来取 party_type=2 and direction=2 作为「回款」列 |
| | | # 客户往来取 party_type=1 and direction=1 作为「回款」列(返回字段 receiptRecordAmount) |
| | | # 供应商往来取 party_type=2 and direction=2 作为「付款」列(返回字段 paymentRecordAmount) |
| | | # 注意:direction 取值按页面固定,不要按下面 §方向 的字面(1付款 2回款)去选 |
| | | # 合作商往来取 party_type=3 and direction=1 作为「已付款」列 |
| | | drop table if exists payment_record; |
| | | create table payment_record |
| | | ( |
| | | id bigint auto_increment primary key, |
| | | party_type tinyint not null comment '往来方类型 1客户 2供应商', |
| | | party_type tinyint not null comment '往来方类型 1客户 2供应商 3合作商', |
| | | party_id bigint not null comment '客户id或供应商id', |
| | | direction tinyint not null comment '方向 1付款 2回款', |
| | | amount decimal(18, 2) not null default 0 comment '金额', |