# `viw_salsalesordermaterials` (view)


- **Updatable:** YES

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 1 | `iIncrement` | `int` | NO |
| 2 | `sId` | `varchar(100)` | NO |
| 3 | `sBrandsId` | `varchar(100)` | NO |
| 4 | `sSubsidiaryId` | `varchar(100)` | NO |
| 5 | `tCreateDate` | `datetime` | NO |
| 6 | `sMakePerson` | `varchar(255)` | NO |
| 7 | `sCheckPerson` | `varchar(255)` | YES |
| 8 | `tCheckDate` | `datetime` | YES |
| 9 | `bCheck` | `bit(1)` | NO |
| 10 | `sStatus` | `varchar(255)` | YES |
| 11 | `iOrder` | `int` | NO |
| 12 | `sFormId` | `varchar(100)` | NO |
| 13 | `sBillNo` | `varchar(255)` | NO |
| 14 | `sCustomerId` | `varchar(100)` | YES |
| 15 | `bInvalid` | `bit(1)` | NO |
| 16 | `sSlaveId` | `varchar(100)` | NO |
| 17 | `iSlaveOrder` | `int` | NO |
| 18 | `sParentId` | `varchar(100)` | NO |
| 19 | `dProductQty` | `decimal(18,6)` | NO |
| 20 | `sProductId` | `varchar(100)` | NO |
| 21 | `iSucceed` | `int` | YES |
| 22 | `sMaterialsId` | `varchar(255)` | YES |
| 23 | `sSucceed` | `varchar(1)` | NO |
| 24 | `iDateDay` | `int` | YES |
| 25 | `sMemo` | `text` | YES |

## Definition

```sql
select `salsalesordermaster`.`iIncrement` AS `iIncrement`,`salsalesordermaster`.`sId` AS `sId`,`salsalesordermaster`.`sBrandsId` AS `sBrandsId`,`salsalesordermaster`.`sSubsidiaryId` AS `sSubsidiaryId`,`salsalesordermaster`.`tCreateDate` AS `tCreateDate`,`salsalesordermaster`.`sMakePerson` AS `sMakePerson`,`salsalesordermaster`.`sCheckPerson` AS `sCheckPerson`,`salsalesordermaster`.`tCheckDate` AS `tCheckDate`,`salsalesordermaster`.`bCheck` AS `bCheck`,`salsalesordermaster`.`sStatus` AS `sStatus`,`salsalesordermaster`.`iOrder` AS `iOrder`,`salsalesordermaster`.`sFormId` AS `sFormId`,`salsalesordermaster`.`sBillNo` AS `sBillNo`,`salsalesordermaster`.`sCustomerId` AS `sCustomerId`,`salsalesordermaster`.`bInvalid` AS `bInvalid`,`salsalesorderslave`.`sId` AS `sSlaveId`,`salsalesorderslave`.`iOrder` AS `iSlaveOrder`,`salsalesorderslave`.`sParentId` AS `sParentId`,`salsalesorderslave`.`dProductQty` AS `dProductQty`,`salsalesorderslave`.`sProductId` AS `sProductId`,`salsalesorderslave`.`iSucceed` AS `iSucceed`,`salsalesorderslave`.`sMaterialsId` AS `sMaterialsId`,(case `salsalesorderslave`.`iSucceed` when 0 then '' when 1 then '是' else '否' end) AS `sSucceed`,((case when (`mftmaterialstest`.`tFeedBack3Date` is null) then to_days(now()) else to_days(`mftmaterialstest`.`tFeedBack3Date`) end) - to_days(`salsalesordermaster`.`tCreateDate`)) AS `iDateDay`,`salsalesordermaster`.`sMemo` AS `sMemo` from ((`salsalesordermaster` join `salsalesorderslave` on((`salsalesorderslave`.`sParentId` = `salsalesordermaster`.`sId`))) join `mftmaterialstest` on((`salsalesorderslave`.`sId` = `mftmaterialstest`.`sMOrderSlaveId`))) where (`salsalesordermaster`.`sOrderType` = 5)
```

## Narrative

_No human-written narrative yet._
