# `viw_ai_salsalesorder` (view)


- **Updatable:** NO

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 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 |

## Definition

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

## Narrative

_No human-written narrative yet._
