# `salsalesordermaster`

> 销售订单主表


- **Engine:** InnoDB
- **Collation:** utf8mb3_general_ci

## Columns

| # | Name | Type | Null | Key | Default | Extra | Comment |
|---|---|---|---|---|---|---|---|
| 1 | `iIncrement` | `int` | NO | PRI |  | auto_increment | 自增列 |
| 2 | `sId` | `varchar(100)` | NO | MUL |  |  | 标准Id |
| 3 | `sBrandsId` | `varchar(100)` | NO | MUL |  |  | 加工商Id |
| 4 | `sSubsidiaryId` | `varchar(100)` | NO |  |  |  | 子公司ID |
| 5 | `tCreateDate` | `datetime` | NO |  | CURRENT_TIMESTAMP | DEFAULT_GENERATED | 制单日期 |
| 6 | `sMakePerson` | `varchar(255)` | NO |  |  |  | 制单人 |
| 7 | `iOrder` | `int` | NO |  | 0 |  | 排序号 |
| 8 | `sFormId` | `varchar(100)` | NO |  |  |  | 窗体ID |
| 9 | `sBillNo` | `varchar(255)` | NO |  |  |  | 单据号 |
| 10 | `sCustomerId` | `varchar(100)` | YES | MUL |  |  | 客户Id |
| 11 | `sContacts` | `varchar(255)` | YES |  |  |  | 联系人 |
| 12 | `sPhone` | `varchar(255)` | YES |  |  |  | 电话 |
| 13 | `tProofingDate` | `datetime` | YES |  |  |  | 确认样稿日期 |
| 14 | `tDeliverDate` | `datetime` | YES |  |  |  | 交货日期 |
| 15 | `sSalesManId` | `varchar(100)` | YES |  |  |  | 销售员ID |
| 16 | `sGetPayId` | `varchar(100)` | YES |  |  |  | 结算方式Id |
| 17 | `tGetPayDate` | `datetime` | YES |  |  |  | 结算日期 |
| 18 | `sConsignee` | `varchar(255)` | YES |  |  |  | 收货人 |
| 19 | `sConsigneeMobile` | `varchar(255)` | YES |  |  |  | 收货人手机 |
| 20 | `sDeliverId` | `varchar(100)` | NO |  |  |  | 送货方式 |
| 21 | `sProvince` | `varchar(255)` | YES |  |  |  | 省 |
| 22 | `sCity` | `varchar(255)` | YES |  |  |  | 市 |
| 23 | `sArea` | `varchar(255)` | YES |  |  |  | 区 |
| 24 | `sDeliverTo` | `varchar(255)` | NO |  |  |  | 详细地址 |
| 25 | `sManualNo` | `varchar(255)` | YES |  |  |  | 手工单号 |
| 26 | `sCustomerOrderNo` | `varchar(255)` | YES | MUL |  |  | 客户订单号 |
| 27 | `sMemo` | `text` | YES |  |  |  | 备注 |
| 28 | `bCheck` | `bit(1)` | NO |  | b'0' |  | 是否审核 |
| 29 | `tCheckDate` | `datetime` | YES |  |  |  | 审核日期 |
| 30 | `sCheckPerson` | `varchar(255)` | YES |  |  |  | 审核人 |
| 31 | `bPrint` | `bit(1)` | NO |  | b'0' |  | 是否打印 |
| 32 | `bCopyLimit` | `bit(1)` | NO |  | b'0' |  | 禁止拷贝 |
| 33 | `dAdvanceMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 订金金额 |
| 34 | `tAdvanceDate` | `datetime` | YES |  |  |  | 收取订金日期 |
| 35 | `dRealAdvanceMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 订金反写金额 |
| 36 | `bAdvanceComplete` | `bit(1)` | NO |  | b'0' |  | 订金强制完工 |
| 37 | `sCurrency` | `varchar(255)` | YES |  |  |  | 币别 |
| 38 | `dCurrencyRate` | `decimal(18,6)` | YES |  |  |  | 汇率 |
| 39 | `sStatus` | `varchar(255)` | YES |  |  |  | 状态（未审核 已审核 作废 一到四级审核） |
| 40 | `bInvalid` | `bit(1)` | NO |  | b'0' |  | 是否作废 |
| 41 | `sMReserve1` | `varchar(255)` | YES |  |  |  | 预留字符1 |
| 42 | `sMReserve2` | `varchar(255)` | YES |  |  |  | 预留字符2 |
| 43 | `sMReserve3` | `varchar(255)` | YES |  |  |  | 预留字符3 |
| 44 | `sMReserve4` | `varchar(255)` | YES |  |  |  | 预留字符4 |
| 45 | `sMReserve5` | `varchar(255)` | YES |  |  |  | 预留字符5 |
| 46 | `sMReserve6` | `varchar(255)` | YES |  |  |  | 预留字符6 |
| 47 | `dMReserve1` | `decimal(18,6)` | YES |  |  |  | 预留数字1 |
| 48 | `dMReserve2` | `decimal(18,6)` | YES |  |  |  | 预留数字2 |
| 49 | `dMReserve3` | `decimal(18,6)` | YES |  |  |  | 预留数字3 |
| 50 | `iMReserve1` | `int` | YES |  |  |  | 预留整型1 |
| 51 | `iMReserve2` | `int` | YES |  |  |  | 预留整型2 |
| 52 | `iMReserve3` | `int` | YES |  |  |  | 预留整型3 |
| 53 | `tMReserve1` | `datetime` | YES |  |  |  | 预留日期1 |
| 54 | `tMReserve2` | `datetime` | YES |  |  |  | 预留日期2 |
| 55 | `sNoFormat` | `varchar(255)` | NO |  |  |  | 订单单据号生成类型 |
| 56 | `sOrderType` | `varchar(255)` | NO |  |  |  | 订单类型 |
| 57 | `sRip` | `varchar(255)` | NO |  | 单张合版 |  | 印刷流程 单张专版/单张合版/.. 来自线上 |
| 58 | `sRipTrue` | `varchar(255)` | NO |  | 未处理 |  | 处理状态 未处理/已拼版/拼版中/自动定稿中/分切中/合并中.... |
| 59 | `sProofing` | `varchar(255)` | NO |  | 未处理 |  | 预检 |
| 60 | `sProofingDetail` | `varchar(8000)` | YES |  |  |  | 预检明细 |
| 61 | `bManual` | `bit(1)` | NO |  | b'0' |  | 人工定稿 |
| 62 | `bCorrespondFile` | `bit(1)` | NO |  | b'0' |  | 关联文件 |
| 63 | `bLock` | `bit(1)` | NO |  | b'0' |  | 锁定文件 |
| 64 | `sCheck` | `varchar(255)` | YES |  |  |  | 定稿人员 |
| 65 | `tCheck` | `datetime` | YES |  |  |  | 定稿时间 |
| 66 | `iProofing` | `int` | NO |  | 0 |  | 预检数 |
| 67 | `sLockPerson` | `varchar(255)` | YES |  |  |  | 锁定文件人 |
| 68 | `sQuotationId` | `varchar(255)` | YES |  |  |  | 线上报价ID |
| 69 | `sOrderFilePath` | `longtext` | YES |  |  |  | 订单上传文件地址 |
| 70 | `sStockup` | `char(1)` | NO |  | 0 |  | 货物状态；0：未备货，1是备货  2是送货 3是收款 |
| 71 | `sSend` | `varchar(255)` | YES |  |  |  | 送货人 |
| 72 | `tSend` | `datetime` | YES |  |  |  | 送货时间 |
| 73 | `iMoveCount` | `int` | NO |  | 0 |  | 文件搬移次数 |
| 74 | `iSpicaled` | `int` | NO |  | 0 |  | 拼版数量 |
| 75 | `bChange` | `bit(1)` | NO |  | b'0' |  | 是否变更 |
| 76 | `tAppointDate` | `datetime` | YES |  | CURRENT_TIMESTAMP | DEFAULT_GENERATED | 指定日期 |
| 77 | `tBillCompleteDate` | `datetime` | YES |  | CURRENT_TIMESTAMP | DEFAULT_GENERATED |  |
| 78 | `tFileReturn` | `datetime` | YES |  | CURRENT_TIMESTAMP | DEFAULT_GENERATED | 原件返回时间 |
| 79 | `tNextDate` | `datetime` | YES |  | CURRENT_TIMESTAMP | DEFAULT_GENERATED | 统计日期 |
| 80 | `bApproved` | `bit(1)` | YES |  | b'0' |  | 是否特批 |
| 81 | `bBillComplete` | `bit(1)` | YES |  | b'0' |  | 完结 |
| 82 | `bTechnology` | `bit(1)` | YES |  | b'0' |  | 技术参与 |
| 83 | `iDemand` | `int` | YES |  | 0 |  | 需求类型，0：内部需求，1：客户需求 |
| 84 | `iNPD` | `int` | YES |  | 0 |  | NPD标识 |
| 85 | `iOldNew` | `int` | YES |  | 0 |  | 0：新，1：旧 |
| 86 | `sAccidentNo` | `varchar(50)` | YES |  |  |  | 质量事故单号 |
| 87 | `sAccordId` | `varchar(50)` | YES |  |  |  | 协议订单 |
| 88 | `sCompletePerson` | `varchar(255)` | YES |  |  |  |  |
| 89 | `sContractNo` | `varchar(100)` | YES |  |  |  | 合同号 |
| 90 | `sContractOrder` | `varchar(100)` | YES |  |  |  | 合同订单 |
| 91 | `sCustomerName` | `varchar(255)` | YES |  |  |  | 客户名称 |
| 92 | `sCustomerPO` | `varchar(255)` | YES |  |  |  | 客户PO |
| 93 | `sDeliverWay` | `varchar(50)` | YES |  |  |  | 交付方式 |
| 94 | `sFSC` | `varchar(50)` | YES |  |  |  | FSC |
| 95 | `sMerchandiserId` | `varchar(255)` | NO |  |  |  | 跟单员Id |
| 96 | `sNPDNo` | `varchar(255)` | YES |  |  |  |  |
| 97 | `sOldOrderNo` | `varchar(50)` | YES |  |  |  | 旧系统销售订单 |
| 98 | `sServiceName` | `varchar(255)` | YES |  |  |  |  |
| 99 | `sSettlementId` | `varchar(50)` | YES |  |  |  | 付款方式："cash": "现金", "bank": "银行" , "bill": "票据","cashbill":"现金+票据","bankbill":"银行+票据"  |
| 100 | `sSrcCustomerId` | `varchar(100)` | YES |  |  |  | 源头客户 |
| 101 | `sSrcType` | `varchar(50)` | YES |  | 0 |  | 内销/外销/转厂 |

## Indexes

| Name | Unique | Type | Columns |
|---|---|---|---|
| `IndexN_salsalesordermaster` |  | BTREE | `sId`, `sBrandsId`, `sSubsidiaryId`, `sCustomerId` |
| `IndexN_salsalesordermasterCustomerOrderNo` |  | BTREE | `sCustomerOrderNo` |
| `IndexN_salsalesordermastersCustomerId` |  | BTREE | `sCustomerId` |
| `IndexU_salsalesordermaster` | ✓ | BTREE | `sId`, `sBrandsId`, `sSubsidiaryId` |
| `IndexU_salsalesordermasterNo` | ✓ | BTREE | `sBrandsId`, `sSubsidiaryId`, `sFormId`, `sBillNo` |
| `PRIMARY` | ✓ | BTREE | `iIncrement` |

## Narrative

_No human-written narrative yet — when this table is exercised by a [vertical slice](../../slices/index.md), link from there back to this page._
