# `viw_purchaseordermaster_sideprocessmaster` (view)


- **Updatable:** NO

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 1 | `dTotalMoney` | `decimal(40,6)` | YES |
| 2 | `sSlaveId` | `varchar(100)` | YES |
| 3 | `iIncrement` | `int` | YES |
| 4 | `tCreateDate` | `varchar(24)` | YES |
| 5 | `sBillNo` | `varchar(255)` | YES |
| 6 | `sId` | `varchar(100)` | YES |
| 7 | `sSupplyId` | `varchar(100)` | YES |
| 8 | `sSupplyNo` | `varchar(100)` | YES |
| 9 | `sBrandsId` | `varchar(100)` | YES |
| 10 | `sSupplyName` | `varchar(100)` | YES |
| 11 | `sSubsidiaryId` | `varchar(100)` | YES |
| 12 | `sMakePerson` | `varchar(255)` | YES |
| 13 | `iOrder` | `int` | YES |
| 14 | `sContacts` | `varchar(255)` | YES |
| 15 | `sFormId` | `varchar(100)` | YES |
| 16 | `dAdvanceMoney` | `decimal(18,6)` | YES |
| 17 | `tAdvanceDate` | `varchar(24)` | YES |
| 18 | `sPhone` | `varchar(255)` | YES |
| 19 | `tDeliverDate` | `varchar(24)` | YES |
| 20 | `sPurchaseManId` | `varchar(100)` | YES |
| 21 | `sPurchaseManName` | `varchar(100)` | YES |
| 22 | `sGetPayName` | `varchar(100)` | YES |
| 23 | `sGetPayId` | `varchar(100)` | YES |
| 24 | `tGetPayDate` | `varchar(24)` | YES |
| 25 | `sConsignee` | `varchar(255)` | YES |
| 26 | `sConsigneeMobile` | `varchar(255)` | YES |
| 27 | `sDeliverId` | `varchar(100)` | YES |
| 28 | `sDeliverName` | `varchar(100)` | YES |
| 29 | `sProvince` | `varchar(255)` | YES |
| 30 | `sCity` | `varchar(255)` | YES |
| 31 | `sArea` | `varchar(255)` | YES |
| 32 | `sDeliverTo` | `varchar(255)` | YES |
| 33 | `sManualNo` | `varchar(255)` | YES |
| 34 | `sMemo` | `mediumtext` | YES |
| 35 | `bCheck` | `bit(1)` | YES |
| 36 | `tCheckDate` | `varchar(24)` | YES |
| 37 | `sCheckPerson` | `varchar(255)` | YES |
| 38 | `bPrint` | `bit(1)` | YES |
| 39 | `bCopyLimit` | `bit(1)` | YES |
| 40 | `dRealAdvanceMoney` | `decimal(18,6)` | YES |
| 41 | `sCurrencyName` | `varchar(255)` | YES |
| 42 | `sCurrency` | `varchar(255)` | YES |
| 43 | `dCurrencyRate` | `decimal(18,6)` | YES |
| 44 | `sStatus` | `varchar(255)` | YES |
| 45 | `bInvalid` | `bit(1)` | YES |
| 46 | `bAdvanceComplete` | `bit(1)` | YES |
| 47 | `dNoAdvnaceMoney` | `decimal(19,6)` | YES |
| 48 | `bAdvance` | `bigint` | NO |

## Definition

```sql
select (select sum(`s`.`dMaterialsMoney`) from `purpurchaseorderslave` `s` where (`s`.`sParentId` = `a`.`sId`)) AS `dTotalMoney`,`a`.`sId` AS `sSlaveId`,`a`.`iIncrement` AS `iIncrement`,date_format(`a`.`tCreateDate`,'%Y-%m-%d %H:%i:%s') AS `tCreateDate`,`a`.`sBillNo` AS `sBillNo`,`a`.`sId` AS `sId`,`a`.`sSupplyId` AS `sSupplyId`,`a`.`sSupplyId` AS `sSupplyNo`,`a`.`sBrandsId` AS `sBrandsId`,`a`.`sSupplyId` AS `sSupplyName`,`a`.`sSubsidiaryId` AS `sSubsidiaryId`,`a`.`sMakePerson` AS `sMakePerson`,`a`.`iOrder` AS `iOrder`,`a`.`sContacts` AS `sContacts`,`a`.`sFormId` AS `sFormId`,`a`.`dAdvanceMoney` AS `dAdvanceMoney`,date_format(`a`.`tAdvanceDate`,'%Y-%m-%d %H:%i:%s') AS `tAdvanceDate`,`a`.`sPhone` AS `sPhone`,date_format(`a`.`tDeliverDate`,'%Y-%m-%d %H:%i:%s') AS `tDeliverDate`,`a`.`sPurchaseManId` AS `sPurchaseManId`,`a`.`sPurchaseManId` AS `sPurchaseManName`,`a`.`sGetPayId` AS `sGetPayName`,`a`.`sGetPayId` AS `sGetPayId`,date_format(`a`.`tGetPayDate`,'%Y-%m-%d %H:%i:%s') AS `tGetPayDate`,`a`.`sConsignee` AS `sConsignee`,`a`.`sConsigneeMobile` AS `sConsigneeMobile`,`a`.`sDeliverId` AS `sDeliverId`,`a`.`sDeliverId` AS `sDeliverName`,`a`.`sProvince` AS `sProvince`,`a`.`sCity` AS `sCity`,`a`.`sArea` AS `sArea`,`a`.`sDeliverTo` AS `sDeliverTo`,`a`.`sManualNo` AS `sManualNo`,`a`.`sMemo` AS `sMemo`,`a`.`bCheck` AS `bCheck`,date_format(`a`.`tCheckDate`,'%Y-%m-%d %H:%i:%s') AS `tCheckDate`,`a`.`sCheckPerson` AS `sCheckPerson`,`a`.`bPrint` AS `bPrint`,`a`.`bCopyLimit` AS `bCopyLimit`,`a`.`dRealAdvanceMoney` AS `dRealAdvanceMoney`,`a`.`sCurrency` AS `sCurrencyName`,`a`.`sCurrency` AS `sCurrency`,`a`.`dCurrencyRate` AS `dCurrencyRate`,`a`.`sStatus` AS `sStatus`,`a`.`bInvalid` AS `bInvalid`,`a`.`bAdvanceComplete` AS `bAdvanceComplete`,(`a`.`dAdvanceMoney` - `a`.`dRealAdvanceMoney`) AS `dNoAdvnaceMoney`,1 AS `bAdvance` from `purpurchaseordermaster` `a` where ((`a`.`bCheck` = 1) and (`a`.`bInvalid` = 0) and (`a`.`bCopyLimit` = 0) and ((`a`.`dAdvanceMoney` - `a`.`dRealAdvanceMoney`) > 0)) union all select (select sum(`s`.`dMaterialsMoney`) from `purpurchaseorderslave` `s` where (`s`.`sParentId` = `a`.`sId`)) AS `dTotalMoney`,`a`.`sId` AS `sSlaveId`,`a`.`iIncrement` AS `iIncrement`,date_format(`a`.`tCreateDate`,'%Y-%m-%d %H:%i:%s') AS `tCreateDate`,`a`.`sBillNo` AS `sBillNo`,`a`.`sId` AS `sId`,`a`.`sSupplyId` AS `sSupplyId`,`a`.`sSupplyId` AS `sSupplyNo`,`a`.`sBrandsId` AS `sBrandsId`,`a`.`sSupplyId` AS `sSupplyName`,`a`.`sSubsidiaryId` AS `sSubsidiaryId`,`a`.`sMakePerson` AS `sMakePerson`,`a`.`iOrder` AS `iOrder`,`a`.`sContacts` AS `sContacts`,`a`.`sFormId` AS `sFormId`,`a`.`dAdvanceMoney` AS `dAdvanceMoney`,date_format(`a`.`tAdvanceDate`,'%Y-%m-%d %H:%i:%s') AS `tAdvanceDate`,`a`.`sPhone` AS `sPhone`,date_format(`a`.`tDeliverDate`,'%Y-%m-%d %H:%i:%s') AS `tDeliverDate`,`a`.`sPurchaseManId` AS `sPurchaseManId`,`a`.`sPurchaseManId` AS `sPurchaseManName`,`a`.`sGetPayId` AS `sGetPayName`,`a`.`sGetPayId` AS `sGetPayId`,date_format(`a`.`tGetPayDate`,'%Y-%m-%d %H:%i:%s') AS `tGetPayDate`,`a`.`sConsignee` AS `sConsignee`,`a`.`sConsigneeMobile` AS `sConsigneeMobile`,`a`.`sDeliverId` AS `sDeliverId`,`a`.`sDeliverId` AS `sDeliverName`,`a`.`sProvince` AS `sProvince`,`a`.`sCity` AS `sCity`,`a`.`sArea` AS `sArea`,`a`.`sDeliverTo` AS `sDeliverTo`,`a`.`sManualNo` AS `sManualNo`,`a`.`sMemo` AS `sMemo`,`a`.`bCheck` AS `bCheck`,date_format(`a`.`tCheckDate`,'%Y-%m-%d %H:%i:%s') AS `tCheckDate`,`a`.`sCheckPerson` AS `sCheckPerson`,`a`.`bPrint` AS `bPrint`,`a`.`bCopyLimit` AS `bCopyLimit`,`a`.`dRealAdvanceMoney` AS `dRealAdvanceMoney`,`a`.`sCurrency` AS `sCurrencyName`,`a`.`sCurrency` AS `sCurrency`,`a`.`dCurrencyRate` AS `dCurrencyRate`,`a`.`sStatus` AS `sStatus`,`a`.`bInvalid` AS `bInvalid`,`a`.`bAdvanceComplete` AS `bAdvanceComplete`,(`a`.`dAdvanceMoney` - `a`.`dRealAdvanceMoney`) AS `dNoAdvnaceMoney`,1 AS `bAdvance` from `opsoutsideprocessmaster` `a` where ((`a`.`bCheck` = 1) and (`a`.`bInvalid` = 0) and (`a`.`bCopyLimit` = 0) and ((`a`.`dAdvanceMoney` - `a`.`dRealAdvanceMoney`) > 0)) order by `tCreateDate` desc
```

## Narrative

_No human-written narrative yet._
