# `viw_ai_salsalesorder`（视图）


- **是否可更新：** NO
- **定义者：** `xlyprint@%`

## 字段

| # | 名称 | 类型 | 可空 |
|---|---|---|---|
| 1 | `sId` | `varchar(100)` | NO |
| 2 | `sBrandsId` | `varchar(100)` | NO |
| 3 | `sSubsidiaryId` | `varchar(100)` | NO |
| 4 | `tCreateDate` | `varchar(10)` | YES |
| 5 | `tUpdateDate` | `datetime` | NO |
| 6 | `sMakePerson` | `varchar(255)` | NO |
| 7 | `sBillNo` | `varchar(255)` | NO |
| 8 | `sCustomerNo` | `varchar(255)` | NO |
| 9 | `sCustomerName` | `varchar(255)` | NO |
| 10 | `sSalesManName` | `varchar(255)` | YES |
| 11 | `sDepartName` | `varchar(255)` | YES |
| 12 | `sGetPayName` | `varchar(255)` | YES |
| 13 | `sContacts` | `varchar(255)` | YES |
| 14 | `sPhone` | `varchar(255)` | YES |
| 15 | `tGetPayDate` | `datetime` | YES |
| 16 | `sConsignee` | `varchar(255)` | YES |
| 17 | `sConsigneeMobile` | `varchar(255)` | YES |
| 18 | `sProvince` | `varchar(255)` | YES |
| 19 | `sCity` | `varchar(255)` | YES |
| 20 | `sArea` | `varchar(255)` | YES |
| 21 | `sDeliverTo` | `varchar(255)` | NO |
| 22 | `sManualNo` | `varchar(255)` | YES |
| 23 | `sCustomerOrderNo` | `varchar(255)` | NO |
| 24 | `sMemo` | `text` | YES |
| 25 | `bCheck` | `bit(1)` | NO |
| 26 | `tCheckDate` | `datetime` | YES |
| 27 | `sCheckPerson` | `varchar(255)` | YES |
| 28 | `dAdvanceMoney` | `decimal(18,6)` | NO |
| 29 | `tAdvanceDate` | `datetime` | YES |
| 30 | `dRealAdvanceMoney` | `decimal(18,6)` | NO |
| 31 | `sCurrency` | `varchar(255)` | YES |
| 32 | `dCurrencyRate` | `decimal(18,6)` | YES |
| 33 | `sStatus` | `varchar(255)` | YES |
| 34 | `bInvalid` | `bit(1)` | NO |
| 35 | `sOrderType` | `varchar(255)` | NO |
| 36 | `bAdvanceComplete` | `bit(1)` | NO |
| 37 | `bBillComplete` | `bit(1)` | YES |
| 38 | `sSlaveId` | `varchar(100)` | NO |
| 39 | `sProductNo` | `varchar(50)` | NO |
| 40 | `sProductName` | `varchar(100)` | NO |
| 41 | `sProductStyle` | `varchar(50)` | NO |
| 42 | `sProductUnit` | `varchar(50)` | YES |
| 43 | `sProductSortName` | `varchar(100)` | YES |
| 44 | `dProductQty` | `decimal(18,6)` | NO |
| 45 | `dProductPrice` | `decimal(18,6)` | NO |
| 46 | `dProductMoney` | `decimal(18,6)` | NO |
| 47 | `sProductInfo` | `text` | YES |
| 48 | `sMaterialsMemo` | `text` | YES |
| 49 | `sProcessMemo` | `text` | YES |
| 50 | `sSrcSlaveId` | `varchar(100)` | NO |
| 51 | `sSrcId` | `varchar(100)` | NO |
| 52 | `sSrcNo` | `varchar(255)` | NO |
| 53 | `dSrcQty` | `decimal(18,6)` | YES |
| 54 | `dProductPQty` | `decimal(18,6)` | YES |
| 55 | `sWebOrderNo` | `varchar(255)` | NO |
| 56 | `sWorkOrderNo` | `varchar(100)` | NO |
| 57 | `bWorkOrderComplete` | `bit(1)` | NO |
| 58 | `dWorkOrderQty` | `decimal(18,6)` | NO |
| 59 | `sWorkOrderCompletePerson` | `varchar(255)` | NO |
| 60 | `tWorkOrderCompleteDate` | `datetime` | YES |
| 61 | `bDeliverComplete` | `bit(1)` | NO |
| 62 | `dDeliverQty` | `decimal(18,6)` | NO |
| 63 | `bDeliverNotifyComplete` | `bit(1)` | NO |
| 64 | `dDeliverNotifyQty` | `decimal(18,6)` | NO |
| 65 | `dCheckingQty` | `decimal(18,6)` | NO |
| 66 | `bCheckingComplete` | `bit(1)` | NO |
| 67 | `sQualityRequireMemo` | `text` | YES |
| 68 | `sPackRequireMemo` | `text` | YES |
| 69 | `sSlaveMemo` | `text` | YES |
| 70 | `sTaxId` | `varchar(100)` | YES |
| 71 | `dProductNoTaxPrice` | `decimal(18,6)` | YES |
| 72 | `dProductNoTaxMoney` | `decimal(18,6)` | YES |
| 73 | `dProductTaxMoney` | `decimal(18,6)` | YES |
| 74 | `dProductTaxForeignMoney` | `decimal(18,6)` | YES |
| 75 | `dProductForeignMoney` | `decimal(18,6)` | YES |
| 76 | `dReceiptMoney` | `decimal(18,6)` | NO |
| 77 | `bReceiptComplete` | `bit(1)` | NO |
| 78 | `dGiveQty` | `decimal(18,6)` | NO |
| 79 | `dPresentQty` | `decimal(18,6)` | NO |
| 80 | `sBarcode` | `varchar(255)` | YES |
| 81 | `dSortNum` | `decimal(18,6)` | NO |
| 82 | `dLeftSide` | `decimal(18,6)` | NO |
| 83 | `dSkip` | `decimal(18,6)` | NO |
| 84 | `sPaperDirection` | `varchar(255)` | NO |
| 85 | `dPaper` | `decimal(18,6)` | NO |
| 86 | `dMeters` | `decimal(18,6)` | NO |
| 87 | `bCutting` | `bit(1)` | NO |
| 88 | `dOutSideDiameter` | `decimal(18,6)` | NO |
| 89 | `dDiameter` | `decimal(18,6)` | NO |
| 90 | `tSlaveDeliverDate` | `datetime` | YES |
| 91 | `dMatchbillQty` | `decimal(18,6)` | NO |
| 92 | `dStockupQty` | `decimal(18,6)` | NO |
| 93 | `sMaterialsStyle` | `varchar(100)` | NO |
| 94 | `sAuxiliaryUnit` | `varchar(100)` | NO |
| 95 | `dMaterialsQty` | `decimal(18,6)` | NO |
| 96 | `dConversionQty` | `decimal(18,6)` | NO |
| 97 | `dProductForeignPrice` | `decimal(18,6)` | NO |
| 98 | `dQuotationMoney` | `decimal(18,6)` | NO |
| 99 | `sLogisticCode` | `varchar(100)` | NO |
| 100 | `bStockupComplete` | `bit(1)` | NO |
| 101 | `dTrunkQty` | `decimal(18,6)` | NO |
| 102 | `dReturnTrunkQty` | `decimal(18,6)` | NO |
| 103 | `sSlaveCustomerOrderNo` | `varchar(50)` | NO |
| 104 | `bSlaveComplete` | `bit(1)` | NO |
| 105 | `tDeliverCompleteDate` | `datetime` | YES |
| 106 | `sDeliverCompleteMemo` | `varchar(255)` | NO |
| 107 | `sDeliverCompleteType` | `varchar(255)` | NO |
| 108 | `bProductionOrder` | `bit(1)` | NO |
| 109 | `sProductionOrder` | `varchar(255)` | NO |
| 110 | `tProductionOrder` | `datetime` | YES |
| 111 | `sProductionOrderMemo` | `varchar(255)` | NO |
| 112 | `sFilePerson` | `varchar(255)` | NO |
| 113 | `tFileDate` | `datetime` | YES |
| 114 | `sBillType` | `varchar(255)` | YES |
| 115 | `bFile` | `bit(1)` | NO |
| 116 | `sItemNo` | `varchar(255)` | YES |
| 117 | `bOutSideMould` | `bit(1)` | NO |
| 118 | `bOutSideMouldComplete` | `bit(1)` | NO |
| 119 | `sProductTechnologyVer` | `varchar(255)` | NO |
| 120 | `sBomId` | `varchar(255)` | NO |
| 121 | `bPrepareMaterials` | `bit(1)` | YES |
| 122 | `dAuxiliaryQty` | `decimal(18,6)` | NO |
| 123 | `dDiffDate` | `int` | YES |

## 定义

```sql
select `xlyweberp_saas_ai`.`salsalesordermaster`.`sId` AS `sId`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sBrandsId` AS `sBrandsId`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sSubsidiaryId` AS `sSubsidiaryId`,date_format(`xlyweberp_saas_ai`.`salsalesordermaster`.`tCreateDate`,'%Y-%m-%d') AS `tCreateDate`,`xlyweberp_saas_ai`.`salsalesordermaster`.`tCreateDate` AS `tUpdateDate`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sMakePerson` AS `sMakePerson`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sBillNo` AS `sBillNo`,`xlyweberp_saas_ai`.`elecustomer`.`sCustomerNo` AS `sCustomerNo`,`xlyweberp_saas_ai`.`elecustomer`.`sCustomerName` AS `sCustomerName`,`xlyweberp_saas_ai`.`sissalesman`.`sName` AS `sSalesManName`,`xlyweberp_saas_ai`.`sisdepart`.`sName` AS `sDepartName`,`xlyweberp_saas_ai`.`sispayment`.`sName` AS `sGetPayName`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sContacts` AS `sContacts`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sPhone` AS `sPhone`,`xlyweberp_saas_ai`.`salsalesordermaster`.`tGetPayDate` AS `tGetPayDate`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sConsignee` AS `sConsignee`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sConsigneeMobile` AS `sConsigneeMobile`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sProvince` AS `sProvince`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sCity` AS `sCity`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sArea` AS `sArea`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sDeliverTo` AS `sDeliverTo`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sManualNo` AS `sManualNo`,ifnull(`xlyweberp_saas_ai`.`salsalesordermaster`.`sCustomerOrderNo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sCustomerOrderNo`) AS `sCustomerOrderNo`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sMemo` AS `sMemo`,`xlyweberp_saas_ai`.`salsalesordermaster`.`bCheck` AS `bCheck`,`xlyweberp_saas_ai`.`salsalesordermaster`.`tCheckDate` AS `tCheckDate`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sCheckPerson` AS `sCheckPerson`,`xlyweberp_saas_ai`.`salsalesordermaster`.`dAdvanceMoney` AS `dAdvanceMoney`,`xlyweberp_saas_ai`.`salsalesordermaster`.`tAdvanceDate` AS `tAdvanceDate`,`xlyweberp_saas_ai`.`salsalesordermaster`.`dRealAdvanceMoney` AS `dRealAdvanceMoney`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sCurrency` AS `sCurrency`,`xlyweberp_saas_ai`.`salsalesordermaster`.`dCurrencyRate` AS `dCurrencyRate`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sStatus` AS `sStatus`,`xlyweberp_saas_ai`.`salsalesordermaster`.`bInvalid` AS `bInvalid`,`xlyweberp_saas_ai`.`salsalesordermaster`.`sOrderType` AS `sOrderType`,`xlyweberp_saas_ai`.`salsalesordermaster`.`bAdvanceComplete` AS `bAdvanceComplete`,`xlyweberp_saas_ai`.`salsalesordermaster`.`bBillComplete` AS `bBillComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sId` AS `sSlaveId`,`xlyweberp_saas_ai`.`eleproduct`.`sProductNo` AS `sProductNo`,`xlyweberp_saas_ai`.`eleproduct`.`sProductName` AS `sProductName`,`xlyweberp_saas_ai`.`eleproduct`.`sProductStyle` AS `sProductStyle`,`xlyweberp_saas_ai`.`eleproduct`.`sProductUnit` AS `sProductUnit`,`xlyweberp_saas_ai`.`sisproductclassify`.`sName` AS `sProductSortName`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductQty` AS `dProductQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductPrice` AS `dProductPrice`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductMoney` AS `dProductMoney`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sProductInfo` AS `sProductInfo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sMaterialsMemo` AS `sMaterialsMemo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sProcessMemo` AS `sProcessMemo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sSrcSlaveId` AS `sSrcSlaveId`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sSrcId` AS `sSrcId`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sSrcNo` AS `sSrcNo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dSrcQty` AS `dSrcQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductPQty` AS `dProductPQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sWebOrderNo` AS `sWebOrderNo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sWorkOrderNo` AS `sWorkOrderNo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bWorkOrderComplete` AS `bWorkOrderComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dWorkOrderQty` AS `dWorkOrderQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sWorkOrderCompletePerson` AS `sWorkOrderCompletePerson`,`xlyweberp_saas_ai`.`salsalesorderslave`.`tWorkOrderCompleteDate` AS `tWorkOrderCompleteDate`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bDeliverComplete` AS `bDeliverComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dDeliverQty` AS `dDeliverQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bDeliverNotifyComplete` AS `bDeliverNotifyComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dDeliverNotifyQty` AS `dDeliverNotifyQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dCheckingQty` AS `dCheckingQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bCheckingComplete` AS `bCheckingComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sQualityRequireMemo` AS `sQualityRequireMemo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sPackRequireMemo` AS `sPackRequireMemo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sSlaveMemo` AS `sSlaveMemo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sTaxId` AS `sTaxId`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductNoTaxPrice` AS `dProductNoTaxPrice`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductNoTaxMoney` AS `dProductNoTaxMoney`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductTaxMoney` AS `dProductTaxMoney`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductTaxForeignMoney` AS `dProductTaxForeignMoney`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductForeignMoney` AS `dProductForeignMoney`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dReceiptMoney` AS `dReceiptMoney`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bReceiptComplete` AS `bReceiptComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dGiveQty` AS `dGiveQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dPresentQty` AS `dPresentQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sBarcode` AS `sBarcode`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dSortNum` AS `dSortNum`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dLeftSide` AS `dLeftSide`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dSkip` AS `dSkip`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sPaperDirection` AS `sPaperDirection`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dPaper` AS `dPaper`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dMeters` AS `dMeters`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bCutting` AS `bCutting`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dOutSideDiameter` AS `dOutSideDiameter`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dDiameter` AS `dDiameter`,`xlyweberp_saas_ai`.`salsalesorderslave`.`tDeliverDate` AS `tSlaveDeliverDate`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dMatchbillQty` AS `dMatchbillQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dStockupQty` AS `dStockupQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sMaterialsStyle` AS `sMaterialsStyle`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sAuxiliaryUnit` AS `sAuxiliaryUnit`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dMaterialsQty` AS `dMaterialsQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dConversionQty` AS `dConversionQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dProductForeignPrice` AS `dProductForeignPrice`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dQuotationMoney` AS `dQuotationMoney`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sLogisticCode` AS `sLogisticCode`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bStockupComplete` AS `bStockupComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dTrunkQty` AS `dTrunkQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dReturnTrunkQty` AS `dReturnTrunkQty`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sCustomerOrderNo` AS `sSlaveCustomerOrderNo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bSlaveComplete` AS `bSlaveComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`tDeliverCompleteDate` AS `tDeliverCompleteDate`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sDeliverCompleteMemo` AS `sDeliverCompleteMemo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sDeliverCompleteType` AS `sDeliverCompleteType`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bProductionOrder` AS `bProductionOrder`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sProductionOrder` AS `sProductionOrder`,`xlyweberp_saas_ai`.`salsalesorderslave`.`tProductionOrder` AS `tProductionOrder`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sProductionOrderMemo` AS `sProductionOrderMemo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sFilePerson` AS `sFilePerson`,`xlyweberp_saas_ai`.`salsalesorderslave`.`tFileDate` AS `tFileDate`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sBillType` AS `sBillType`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bFile` AS `bFile`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sItemNo` AS `sItemNo`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bOutSideMould` AS `bOutSideMould`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bOutSideMouldComplete` AS `bOutSideMouldComplete`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sProductTechnologyVer` AS `sProductTechnologyVer`,`xlyweberp_saas_ai`.`salsalesorderslave`.`sBomId` AS `sBomId`,`xlyweberp_saas_ai`.`salsalesorderslave`.`bPrepareMaterials` AS `bPrepareMaterials`,`xlyweberp_saas_ai`.`salsalesorderslave`.`dAuxiliaryQty` AS `dAuxiliaryQty`,if((`xlyweberp_saas_ai`.`salsalesorderslave`.`dDeliverQty` >= `xlyweberp_saas_ai`.`salsalesorderslave`.`dProductQty`),0,(to_days(now()) - to_days(`xlyweberp_saas_ai`.`salsalesorderslave`.`tDeliverDate`))) AS `dDiffDate` from (((((((`xlyweberp_saas_ai`.`salsalesordermaster` join `xlyweberp_saas_ai`.`salsalesorderslave` on((`xlyweberp_saas_ai`.`salsalesorderslave`.`sParentId` = `xlyweberp_saas_ai`.`salsalesordermaster`.`sId`))) join `xlyweberp_saas_ai`.`elecustomer` on((`xlyweberp_saas_ai`.`elecustomer`.`sId` = `xlyweberp_saas_ai`.`salsalesordermaster`.`sCustomerId`))) left join `xlyweberp_saas_ai`.`sissalesman` on((`xlyweberp_saas_ai`.`sissalesman`.`sId` = `xlyweberp_saas_ai`.`salsalesordermaster`.`sSalesManId`))) left join `xlyweberp_saas_ai`.`sisdepart` on((`xlyweberp_saas_ai`.`sisdepart`.`sId` = `xlyweberp_saas_ai`.`sissalesman`.`sDepartId`))) join `xlyweberp_saas_ai`.`eleproduct` on((`xlyweberp_saas_ai`.`eleproduct`.`sId` = `xlyweberp_saas_ai`.`salsalesorderslave`.`sProductId`))) left join `xlyweberp_saas_ai`.`sisproductclassify` on((`xlyweberp_saas_ai`.`sisproductclassify`.`sId` = `xlyweberp_saas_ai`.`eleproduct`.`sParentId`))) left join `xlyweberp_saas_ai`.`sispayment` on((`xlyweberp_saas_ai`.`sispayment`.`sId` = `xlyweberp_saas_ai`.`salsalesordermaster`.`sGetPayId`))) where (`xlyweberp_saas_ai`.`salsalesordermaster`.`sFormId` <> '101251240115017582447942720')
```

## 说明

_暂无人工说明。_
