| AllocationRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | NUMBER(10) | |
| WorkcentreId | NUMBER(10) | |
| SourceMaterialId | NUMBER(10) | |
| GroupId | NUMBER(10) | |
| OrderNo | NUMBER(10) | |
| Dividend | DoubleFloat | |
| Divisor | DoubleFloat | |
| SummaryFields | VARCHAR2(4000 char) | |
| CommentLink | VARCHAR2(4000 char) |
| ArchivedForecastRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| GroupId | Identity | |
| DateFrom | Date | |
| SystemForecast | Float | |
| CustomerForecast | Float | |
| FinalForecast | Float | |
| IsWorking | Integer | |
| ForecastStatusId | Integer |
| DDQ_Confirm_Reply_H_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| HeaderCode | VARCHAR2(40) | Inquiry header number |
| LineList | DDQ_Confirm_Reply_L_List_T | List of lines |
| DDQ_Confirm_Reply_L_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| LineCode | VARCHAR2(80) | Line number |
| OldLineCode | VARCHAR2(80) | Old line number |
| SolutionNumber | NUMBER(2) | Number of solution |
| ReturnCode | VARCHAR2(20) | Return message |
| DDQ_Confirm_Reply_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| RequestId | VARCHAR2(40) | Request confirmation ID |
| Recipient | VARCHAR2(40) | The sender of the request |
| HeaderList | DDQ_Confirm_Reply_H_List_T | The list of headers |
| DDQ_Confirm_Request_H_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| HeaderCode | VARCHAR2(40) | Inquiry header number |
| OldHeaderCode | VARCHAR2(40) | Inquiry old header number |
| LineList | DDQ_Confirm_Request_L_List_T | List of lines |
| DDQ_Confirm_Request_L_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| LineCode | VARCHAR2(80) | Inquiry line number |
| OldLineCode | VARCHAR2(80) | Inquiry old line number |
| SolutionNumber | NUMBER(2) | Number of solution |
| Status | VARCHAR2(20) | COMMIT/ROLLBACK |
| DDQ_Confirm_Request_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| RequestId | VARCHAR2(40) | Confirmation identifier |
| Sender | VARCHAR2(40) | Unique identifier of the client |
| HeaderList | DDQ_Confirm_Request_H_List_T | The list of headers |
| DDQ_OperationRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| StageNo | NUMBER(10) | |
| MaterialRunId | NUMBER(10) | |
| WorkCentreId | NUMBER(10) | |
| Weight | NUMBER(23,4) | |
| OperationTypeId | NUMBER(10) |
| DDQ_OrderRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| Type | VARCHAR2(40) | |
| OrderType | VARCHAR2(40) | |
| Weight | NUMBER(23,4) | |
| SiteId | NUMBER(10) | |
| WorkCentreId | NUMBER(10) | |
| StockWorkCentreId | NUMBER(10) | |
| DeliveryDate | DATE | |
| DespatchDate | DATE | |
| JourneyId | NUMBER(10) | |
| ConsignmentLocationId | NUMBER(10) | |
| Status | VARCHAR2(40) | |
| IsConfirmed | NUMBER(1) | |
| OperationList | DDQ_OperationArray | List of operation |
| DDQ_Schedule_Reply_H_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| HeaderCode | VARCHAR2(40) | Inquiry header number |
| LineList | DDQ_Schedule_Reply_L_List_T | The list of lines |
| DDQ_Schedule_Reply_L_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| LineCode | VARCHAR2(80) | Line code |
| SolutionNumber | NUMBER(2) | Solution number |
| Status | VARCHAR2(20) | Confirmed/Information/Reservation |
| DeliveryDate | DATE | Delivery date |
| DispatchDate | DATE | Dispatch date |
| Quantity | NUMBER(23,4) | Quantity |
| Unit | VARCHAR2(80) | Unit name |
| Weight | NUMBER(23,4) | Weight |
| ProductCode | VARCHAR2(80) | Product code |
| WareHouseCode | VARCHAR2(80) | Stock warehouse code |
| InitialPaperMachine | VARCHAR2(80) | Initial paper machine ( The one that was selected by the DDQ engine) |
| ReturnStatus | VARCHAR2(20) | Failure/Success/Partial Success |
| ReturnCode | VARCHAR2(40) | Return error code |
| OperationList | DDQ_Schedule_Reply_O_List_T | List of operations |
| JourneyCode | VARCHAR2(80) | Code of Journey |
| ConsignmentLocation | VARCHAR2(40) | To indicate the consignment location code, if consignment stock is used by the search |
| DDQ_Schedule_Reply_O_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| OperationNumber | NUMBER(2) | Source number, if multiple sources used |
| WorkCentreCode | VARCHAR2(80) | Workcentre code |
| ReservationCode | VARCHAR2(40) | Reservation order code, if Confirmed=FALSE; order number otherwise |
| RunEndDate | DATE | The date when the run finished |
| BlockCode | VARCHAR2(40) | Block code |
| RunCode | VARCHAR2(255) | Run code |
| SFGProductCode | VARCHAR2(80) | The code of the SFG product to use |
| Quantity | NUMBER(23,4) | Quantity of the request |
| Unit | VARCHAR2(80) | The name of unit |
| DDQ_Schedule_Reply_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| RequestId | VARCHAR2(40) | Return the RequestID |
| Recipient | VARCHAR2(40) | Return the Sender |
| HeaderList | DDQ_Schedule_Reply_H_List_T | List of headers |
| DDQ_Schedule_Request_H_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| HeaderCode | VARCHAR2(40) | Inquiry header code |
| OldHeaderCode | VARCHAR2(40) | Header number of the old order (Which is to be deleted when requoting) |
| autoCreate | NUMBER(1) | Create orders instead of inquiry reservations |
| autoConfirm | NUMBER(1) | Auto confirm |
| LineList | DDQ_Schedule_Request_L_List_T | The list of lines |
| DDQ_Schedule_Request_H_T_Ext | OBJECT |
|---|
| name | type | description |
|---|---|---|
| HeaderCode | VARCHAR2(40) | Inquiry header number |
| OldHeaderCode | VARCHAR2(40) | Header number of old Order to be deleted with requote |
| autoCreate | NUMBER(1) | Create 'Orders' instead of inquiry reservations |
| autoConfirm | NUMBER(1) | Auto confirm |
| LineList | DDQ_Schedule_Request_L_Ext_T | List of lines |
| DDQ_Schedule_Request_L_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| LineCode | VARCHAR2(80) | Inquiry line number |
| OldLineCode | VARCHAR2(80) | Inquiry old line number |
| LocationCode | VARCHAR2(40) | I-Plan's unique code of the customer |
| MultiLine | NUMBER(1) | A flag (Y/N) - Joined delivery |
| ProductCode | VARCHAR2(80) | I-Plan's product code |
| EndCustomerCode | VARCHAR2(40) | I-Plan's unique code of the endcustomer |
| EndUseCode | VARCHAR2(40) | I-Plan's unique code of the enduse |
| SFGProductCode | VARCHAR2(80) | I-Plan's SFG product code to use |
| RequestDate | DATE | The date, that the customer requested (can be empty) |
| LateDays | NUMBER(3) | The number of days of delay, after which the customer will still accept the order |
| InquiryMethodCode | VARCHAR2(40) | Inquiry method code (JIT, JITP, ASAP) |
| Quantity | NUMBER(23,4) | Quantity of the request |
| Unit | VARCHAR2(80) | The name of unit |
| TransportMethod | VARCHAR2(80) | The code of transport method |
| TypeOfDelivery | VARCHAR2(1) | A switch: E/A (ex-mill/arrival) |
| ExpiryDate | DATE | The date, after which order reservation expires |
| CheckAllocationMethod | VARCHAR2(10) | A switch: can be Strict (fail immediately), None or Warn (continue but response will be a partial failure) |
| TransportAreaCode | VARCHAR2(40) | Ovveride for the transport area against the location |
| SourceWarehouseCode | VARCHAR2(40) | Defines warehouse source. Blank or valid warehouse code |
| FixSourceAssignment | VARCHAR2(80) | The order has to be sourced from the specified source (PM) |
| SourceTypes | NUMBER(1) | Defines, which types of sources to check |
| OrderSplit | NUMBER(1) | A flag (Y/N) - is it allowed to split an order to parts? |
| SingleSourcing | NUMBER(1) | A flag (Y/N) - if an order is split, is it allowed to source order parts from different paper machines? |
| FinishingLock | NUMBER(1) | A flag (Y/N) - no logic should be applied, but information has to be passed through |
| UseOpportunisticRuns | NUMBER(1) | A flag (Y/N) - is it allowed to use opportunistic runs? |
| PartialDelivery | NUMBER(1) | A flag (Y/N) - is it allowed to generate partial deliveries? |
| Quality | NUMBER(1) | Useup second choice |
| StartNotBefore | DATE | Starting date for source search |
| LoggingLevel | NUMBER(3) | Determines the level of DDQ process logging. (0-255) 255 - the most extensive logging |
| DisregardAllocation | NUMBER(1) | A flag: 1 (On) allows to use PM sources, which do not have any allocation, if normal PM sources search failed |
| RequestType | NUMBER(1) | A switch: type of request (0-New, 1-Requote, 2-Delete, 3-Resend, 4-Amend, 5-Accept, 6-Rollback) |
| JourneyCode | VARCHAR2(80) | Code of Journey |
| ConsignmentParameters | NUMBER(4) | Is required to indicate if consignment stock should be used, and preferences |
| ConsignmentLocation | VARCHAR2(40) | Parameter is required to optionally specify a customer’s location code |
| ReplaceConsignment | NUMBER(3) | Possible value 000,100,102,110,111,112 |
| ConsignmentOrder | NUMBER(3) | This indicates that the order will produce consignment inventory. |
| AllowLateOrders | NUMBER(1) | A flag (Y/N) - Allow Late Orders |
| UseInventory | NUMBER(1) | |
| UseProjectedInventory | NUMBER(1) | |
| UseConsignmenmtInventory | NUMBER(1) | |
| UseProduction | NUMBER(1) | |
| ReATPRequired | NUMBER(1) | |
| SourcingCategories | VARCHAR2(255) | |
| AlternateProducts | VARCHAR2(4000) |
| DDQ_Schedule_Request_L_T_Ext | OBJECT |
|---|
| name | type | description |
|---|---|---|
| LineCode | VARCHAR2(40) | Inquiry line number |
| OldLineCode | VARCHAR2(40) | Inquiry old line number |
| LocationCode | VARCHAR2(40) | I-Plan's unique code of the customer |
| MultiLine | NUMBER(1) | A flag (Y/N) - Joined delivery |
| ProductCode | VARCHAR2(80) | I-Plan's product code |
| EndCustomerCode | VARCHAR2(40) | I-Plan's unique code of the endcustomer |
| EndUseCode | VARCHAR2(40) | I-Plan's unique code of the enduse |
| SFGProductCode | VARCHAR2(80) | I-Plan's SFG product code to use |
| RequestDate | DATE | The date, that the customer requested (can be empty) |
| LateDays | NUMBER(3) | The number of days of delay, after which the customer will still accept the order |
| InquiryMethodCode | VARCHAR2(40) | Inquiry method code (JIT, JITP, ASAP) |
| Quantity | NUMBER(23,4) | Quantity of the request |
| Unit | VARCHAR2(80) | The name of unit |
| TransportMethod | VARCHAR2(80) | The code of transport method |
| TypeOfDelivery | VARCHAR2(1) | A switch: E/A (ex-mill/arrival) |
| ExpiryDate | DATE | The date, after which order reservation expires |
| CheckAllocationMethod | VARCHAR2(10) | A switch: can be Strict (fail immediately), None or Warn (continue but response will be a partial failure) |
| TransportAreaCode | VARCHAR2(40) | Ovveride for the transport area against the location |
| FixSourceAssignment | VARCHAR2(80) | The order has to be sourced from the specified source (PM) |
| SourceTypes | NUMBER(1) | Defines, which types of sources to check |
| OrderSplit | NUMBER(1) | A flag (Y/N) - is it allowed to split an order to parts? |
| SingleSourcing | NUMBER(1) | A flag (Y/N) - if an order is split, is it allowed to source order parts from different paper machines? |
| FinishingLock | NUMBER(1) | A flag (Y/N) - no logic should be applied, but information has to be passed through |
| UseOpportunisticRuns | NUMBER(1) | A flag (Y/N) - is it allowed to use opportunistic runs? |
| PartialDelivery | NUMBER(1) | A flag (Y/N) - is it allowed to generate partial deliveries? |
| Quality | NUMBER(1) | Useup second choice |
| StartNotBefore | DATE | Starting date for source search |
| LoggingLevel | NUMBER(3) | Determines the level of DDQ process logging. (0-255) 255 - the most extensive logging |
| DisregardAllocation | NUMBER(1) | A flag: 1 (On) allows to use PM sources, which do not have any allocation, if normal PM sources search failed |
| RequestType | NUMBER(1) | A switch: type of request (0-New, 1-Requote, 2-Delete, 3-Resend, 4-Amend, 5-Accept, 6-Rollback) |
| ReferReasonCode | VARCHAR2(80) | Reason code |
| ReferReasonDescription | VARCHAR2(255) | Reason description |
| SalesPerson | VARCHAR2(40) | Sales person |
| AvailableDate | DATE | Available date |
| DDQ_Schedule_Request_T | OBJECT |
|---|
| name | type | description |
|---|---|---|
| RequestId | VARCHAR2(40) | Request identifier |
| Sender | VARCHAR2(40) | Unique indentifier of the client |
| HeaderList | DDQ_Schedule_Request_H_List_T | The list of headers |
| DDQ_Schedule_Request_T_Ext | OBJECT |
|---|
| name | type | description |
|---|---|---|
| RequestId | VARCHAR2(40) | Request identifier |
| Sender | VARCHAR2(40) | Client's unique identifier |
| HeaderList | DDQ_Schedule_Request_H_Ext_T | List of headers |
| ForecastCollaborationRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| GroupId | Identity | |
| DateFrom | Date | |
| SystemForecast | Float | |
| CustomerForecast | Float | |
| FinalForecast | Float | |
| ForecastAllocation | Float | |
| IsWorking | Integer | |
| ForecastStatusId | Integer | |
| EditablePriceFlag | Integer | |
| Revenue | Float | |
| TotalCost | DoubleFloat | |
| TotalValueAdd | Float | |
| NominalCost | DoubleFloat | |
| ValueAdd | Float | |
| SystemPrice | Float | |
| ForecastedPrice | Float | |
| NominalCostAdjustment | Float | |
| ValueAddAdjustment | Float | |
| OriginalNCAdjustment | Float | |
| OriginalVAAdjustment | Float | |
| OriginalPrice | Float |
| ForecastEntryRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | Identity | |
| ForecastStatusId | Identity | |
| CurrencyId | Identity | |
| CalendarId | Identity | |
| Dividend | DoubleFloat | |
| Divisor | DoubleFloat |
| ForecastItemObject | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | Identity | |
| Dividend | Float | |
| Divisor | Float |
| ForecastSnapshotRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| GroupId | Identity | |
| DateFrom | Date | |
| FinalForecast | Float | |
| Unallocated | Float | |
| ForecastStatusId | Integer | |
| EditablePriceFlag | Integer | |
| Revenue | Float | |
| UnallocatedRevenue | Float | |
| TotalCost | DoubleFloat | |
| UnallocatedTotalCost | Float | |
| TotalValueAdd | Float | |
| UnallocatedValueAdd | Float | |
| NominalCost | DoubleFloat | |
| ValueAdd | Float | |
| SystemPrice | Float | |
| ForecastedPrice | Float | |
| NominalCostAdjustment | Float | |
| ValueAddAdjustment | Float | |
| OriginalNCAdjustment | Float | |
| OriginalVAAdjustment | Float | |
| OriginalPrice | Float |
| myConsignmentSkuRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | NUMBER(10) | |
| ConsignmentLocationId | NUMBER(10) |
| myDateDemandRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| GroupId | NUMBER(10) | |
| DateFrom | DATE | |
| DateFromMonth | DATE | |
| PlacedDateFrom | DATE | |
| PlacedDateFromMonth | DATE |
| myForecastRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | NUMBER(10) | |
| ForecastStatusId | NUMBER(10) | |
| GroupId | NUMBER(10) | |
| CurrencyId | NUMBER(10) | |
| CommentLink | VARCHAR2(4000) | |
| Dividend | NUMBER(23,8) | |
| Divisor | NUMBER(23,8) | |
| Status | NUMBER(5) |
| myForecastValueAddRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | NUMBER(10) | |
| GroupId | NUMBER(10) | |
| ErrorLevelGroupId | NUMBER(10) | |
| SummaryFields | VARCHAR2(4000) | |
| Dividend | NUMBER(23,8) | |
| Divisor | NUMBER(23,8) |
| myFullSkuRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | NUMBER(10) | |
| ConsignmentLocationId | NUMBER(10) | |
| OrderNo | NUMBER(10) | |
| Dividend | NUMBER(23,8) | |
| Divisor | NUMBER(23,8) |
| myIdentityFloatRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| Id | NUMBER(10) | |
| Dividend | NUMBER(23,8) | |
| Divisor | NUMBER(23,8) |
| myIdentityGroupedRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| Id | NUMBER(10) | |
| GroupId | NUMBER(10) | |
| Dividend | NUMBER(23,8) | |
| Divisor | NUMBER(23,8) |
| myMovementRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| Id | NUMBER(10) | Delivery or order line id |
| Key | VARCHAR2(80) | delivery or order line |
| SkuKey | VARCHAR2(80) | delivery or order line |
| SourceSkuKey | VARCHAR2(80) | delivery or order line |
| DateFrom | Date | |
| OrdersIn | NUMBER(23,4) | |
| OrdersOut | NUMBER(23,4) | |
| MovementType | VARCHAR2(80) | delivery or order line |
| IsFirm | NUMBER(1) | Tentative or firm orders |
| myOnHandInventoryRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SkuKey | VARCHAR2(80) | Sku Key |
| DateFrom | Date | |
| Opening | Float | |
| ActualIn | Float | incoming production updates and incoming delivered deliveries |
| ActualOut | Float | outgoing InTransit and Delivered deliveries |
| OnHandStock | Float | Available on-hand stock |
| OrdersIn | Float | |
| OrdersOut | Float | |
| AllocatedStock | Float | |
| Closing | Float | |
| MinClosing | Float |
| myOnHandMovementRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SkuKey | VARCHAR2(80) | SkuKey |
| DateFrom | Date | |
| Opening | NUMBER(23,4) | |
| OrdersIn | NUMBER(23,4) | Planned firm incoming orders and deliveries |
| OrdersOut | NUMBER(23,4) | Planned firm outgoing order and deliveries |
| AllocatedStock | NUMBER(23,4) | Allocated stock to orders |
| MovementId | NUMBER(10) | Delivery/orderLine/OrderOperation/ProductionUpdate id |
| MovementType | VARCHAR2(80) | Opening/AllocatedStock/Delivery/orderLine/OrderOperation/ProductionUpdate |
| MovementStatus | ShortString | Can be: Actual - for production updates and in-transit and delivered deliveries, or Firm or Tentative |
| OrderLineId | NUMBER(10) | Order Line Id |
| DeliveryId | NUMBER(10) | Delivery Id |
| OrderOperationId | NUMBER(10) | Order Operation Id |
| Comments | VARCHAR2(2000) | Comments |
| myReportFieldRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| Name | VARCHAR2(80) | |
| Value | VARCHAR2(80) | |
| DataType | VARCHAR2(80) | |
| Category | VARCHAR2(80) |
| myRunInventoryMovementRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteId | NUMBER(10) | |
| GradeId | NUMBER(10) | |
| DateFrom | Date | |
| Opening | NUMBER(23,4) | |
| SafetyStock | NUMBER(23,4) | |
| Demand | NUMBER(23,4) | |
| Capacity | NUMBER(23,4) | |
| MovementId | NUMBER(10) | |
| MovementType | VARCHAR2(80) |
| myRunInventoryRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| DateFrom | Date | |
| Opening | Float | |
| Demand | Float | |
| Capacity | Float | |
| Closing | Float | |
| SafetyStock | Float |
| mySiteWorkcentreRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| MaterialId | NUMBER(10) | |
| WorkCentreId | NUMBER(10) | |
| GroupId | NUMBER(10) | |
| OrderNo | NUMBER(10) | |
| SummaryFields | HugeString | |
| Dividend | DoubleFloat | |
| Divisor | DoubleFloat |
| mySkuRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | Identity | |
| EndUseId | Identity | |
| LocationId | Identity | |
| MaterialId | Identity |
| mySourcingAllocationRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SnpItemId | Identity | |
| CoProductId | Identity | |
| SourcePropertyValueId | Identity | |
| WorkcentreId | Identity | |
| SiteId | Identity | |
| LocationId | Identity | |
| Id | Identity | |
| SummaryFields | HugeString |
| myToolsStockRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | Identity | Sku Key |
| DateFrom | Date | |
| Opening | Float | |
| Available | Float | incoming production updates and incoming delivered deliveries |
| Closing | Float | outgoing InTransit and Delivered deliveries |
| OrdersIn | Float | |
| OrdersOut | Float |
| myTripleRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| Id1 | NUMBER(10) | |
| Id2 | NUMBER(10) | |
| Id3 | NUMBER(10) | |
| String | VARCHAR2(4000) | |
| Dividend | NUMBER(23,8) | |
| Divisor | NUMBER(23,8) |
| myUnitRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| UnitId | Identity | |
| Dividend | DoubleFloat | |
| Divisor | DoubleFloat |
| PurgeEntityRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| RowNumber | Identity | |
| TableName | LongString | |
| PKeyColumns | LongestString | |
| PKeyConstraint | LongString | |
| FKeyConstraint | LongString | |
| ParentPKeyConstraint | LongString | |
| Lvl | Identity | |
| FKeyColumns | LongestString | |
| ValueQueries | HugeString | |
| Value | myLongestStringArray |
| SnoItemRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SnoItemId | Identity | |
| SummaryFields | VARCHAR2(4000) | |
| GroupId | Identity |
| SourcingDemandRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SnpItemId | Identity | |
| CoProductId | Identity | |
| WorkCentreId | Identity | |
| Fields | VARCHAR2(4000) | |
| LocationCode | VARCHAR2(80) | |
| LocationName | VARCHAR2(255) | |
| ProductCode | VARCHAR2(80) | |
| ProductName | VARCHAR2(255) | |
| EndUseCode | VARCHAR2(80) | |
| EndUseName | VARCHAR2(255) | |
| EndCustomerCode | VARCHAR2(80) | |
| EndCustomerName | VARCHAR2(255) |
| StockMonitoringRecord | OBJECT |
|---|
| name | type | description |
|---|---|---|
| SiteMaterialUsageId | NUMBER(10) | |
| ConsignmentLocationId | NUMBER(10) | |
| LocationId | NUMBER(10) | |
| IsSubstituted | NUMBER(5) | |
| SkuKey | VARCHAR2(4000) | |
| OrderNo | NUMBER(10) | |
| Dividend | NUMBER(23,8) | |
| Divisor | NUMBER(23,8) | |
| Replenished | NUMBER(10) |
| AccessWorkCentres | Core Core |
The table stores infomation about workcentres assignment to users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| UserId | Identity | no | User ID | |
| WorkCentreId | Identity | no | Workcentre ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Actions | Core Access rights |
The table stores actions defined in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ActionName | String | no | Action name | |
| ActionDescription | LongestString | no | Action description | |
| ActionHint | LongString | yes | Action hint (explanation) | |
| Title | LongString | yes | Action title | |
| GridName | LongString | yes | Grid name | |
| GridColumnName | LongestString | yes | Grid column name | |
| GridAction | String | no | Grid action - none, page, row | |
| IsDefault | Integer | no | A flag: is this a default action? | |
| MultiSelect | Integer | no | A flag: action allowed for several rows in the grid | |
| PageId | Identity | yes | Page ID | |
| Icon | String | yes | Icon name | |
| GroupName | LongString | yes | Group name for actions in toolbar | |
| OverrideActionId | Identity | yes | OverrideActionId | |
| ParentActionId | Identity | yes | Parent ActionId | |
| IsVisible | Integer | no | A flag: is this a visible action? | |
| IsDevMode | Integer | no | A flag: is this a dev mode action? | |
| IsEtc | Integer | no | A flag: is this an "et cetera" action? (shown in a dropdown) | |
| IsConfigurable | Integer | no | Whether the action can be configured through Page Parameters | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AdditionalProperties | Replenishment Replenishment |
The table stores information additional properties for product type or product |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialTypeId | Identity | yes | Material type ID | |
| MaterialId | Identity | yes | Material ID | |
| Type | String | no | ||
| Code | ShortString | no | ||
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AdjustedConsignmentOrdersData | Replenishment Replenishment |
The table is used for storing Adjusted Consignment Orders |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | A reference to the Users table | |
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| WorkcentreId | Identity | yes | Workcentre ID of the paper machine | |
| SiteId | Identity | yes | Site Id of the paper machine | |
| DateFrom | Date | no | Date from | |
| Opening | Float | no | Opening forecasted weight |
| AllocationBodies | Master Planning Master Planning |
The table stores weekly allocations for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DeliveryWeek | Date | yes | Delivery Week | |
| DeliveryMonth | Date | yes | Delivery Month | |
| SourceWeek | Date | yes | Source Week | |
| SourceMonth | Date | yes | Source Month | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| WorkcentreId | Identity | no | A reference to Workcentres | |
| NonMoveableWeight | Float | no | Non-moveable Orders Weight | |
| System | Float | no | Forecast value generated by system | |
| Customer | Float | no | Forecast value edited by customer | |
| AllocationId | Identity | yes | Allocation Id (to link stages of the same multi-stage allocation chain) | |
| StageNo | Integer | no | Stage No | |
| SeqNo | Integer | no | Sequence No | |
| IsLastStage | Integer | no | Is Last Stage | |
| OperationTypeId | Identity | yes | Operation Type ID | |
| NextOperationTypeId | Identity | yes | Operation Type ID of the next stage (if present) | |
| ProductRouteId | Identity | yes | Product Route ID | |
| ConversionFactor | Float | no | Production rate conversion factor | |
| SourceMaterialId | Identity | no | Source material ID (from BOM) or SKU material id | |
| MasterRouteId | Identity | yes | Master Route Id | |
| IsWorking | Integer | no | A switch. Possible values: 0 - forecast state unchanged, or the forecast released; 1 - the forecast has been carried from the previous forecast, 2 - the forecast has been modified (edited) ) | |
| AllocationChangeId | Identity | yes | Allocation Change ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AllocationBodies2 | Master Planning Master Planning |
The table stores weekly allocation for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SourceWeek | Date | yes | Source Week | |
| MaterialId | Identity | no | A reference to the corresponding SKU | |
| WorkCentreId | Identity | no | A reference to Workcentres | |
| Orders | Float | no | orders | |
| System | Float | no | Forecast value generated by system | |
| Customer | Float | no | Forecast value edited by customer | |
| AllocationId | Identity | yes | Allocation Id (links stages) | |
| StageNo | Integer | no | Stage No | |
| IsLastStage | Integer | no | Is Last Stage | |
| OperationTypeId | Identity | yes | Flag | |
| ProductRouteId | Identity | yes | Flag | |
| ConversionFactor | Float | no | Production rate conversion factor | |
| SourceMaterialId | Identity | yes | Source material (from BOM) | |
| MasterRouteId | Identity | yes | Master Route Id | |
| ReplenishmentFlag | Integer | no | Flag | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AllocationChangeDetails | Master Planning Allocations |
The table stores detailed set of property values for each allocation edit action. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| AllocationChangeId | Identity | no | Edit action Id (reference to AllocationChanges.Id | |
| FieldName | String | no | Field from filter | |
| Operation | String | no | Comparison operation | |
| Value | String | yes | Value, can be null for isnull operations |
| AllocationChanges | Master Planning Allocations |
The table stores the list of allocation changes (edits) and comments |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PeriodRange | String | no | Period range - Week or Month | |
| Period | String | no | Period - Source or Delivery | |
| DeliveryMonth | Date | yes | delivery month | |
| DeliveryWeek | Date | yes | delivery week | |
| SourceMonth | Date | yes | source month | |
| SourceWeek | Date | yes | source week | |
| ReasonId | Identity | yes | A reference to Reasons | |
| UnitId | Identity | no | The unit in which the edit has been made (A reference to Units) | |
| IsDisplayComment | Identity | no | A flag: is this record a forecast comment? | |
| IsHidden | Integer | no | A flag: used for revised allocations | |
| InitValue | Float | no | Forecast value before modification | |
| LastValue | Float | no | Forecast value after modification | |
| AllocationComment | LongestString | yes | Allocation comment | |
| CommentLink | HugeString | yes | Complex link to this comment from matrix or collaboration screen | |
| IsSent | Integer | no | Was this allocation edit sent to an external system | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AllocationSnapshotBodies | Master Planning Master Planning |
The table stores weekly allocation for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| AllocationSnapshotId | Identity | no | A reference to the corresponding SKU | |
| DeliveryWeek | Date | yes | Delivery Week | |
| DeliveryMonth | Date | yes | Delivery Month | |
| SourceWeek | Date | yes | Source Week | |
| SourceMonth | Date | yes | Source Month | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| WorkcentreId | Identity | no | A reference to Workcentres | |
| Allocation | Float | no | Allocation value | |
| AllocationId | Identity | yes | Allocation Id (links stages) | |
| StageNo | Integer | no | Stage No | |
| SeqNo | Integer | no | Stage Sequence No | |
| IsLastStage | Integer | no | Is Last Stage | |
| OperationTypeId | Identity | yes | Operation Type ID for this stage | |
| NextOperationTypeId | Identity | yes | Operation Type ID for the next stage (if present) | |
| ProductRouteId | Identity | yes | Flag | |
| ConversionFactor | Float | no | Production rate conversion factor | |
| SourceMaterialId | Identity | yes | Source material (from BOM) | |
| MasterRouteId | Identity | yes | Master Route ID | |
| IsWorking | Integer | no | A switch. Possible values: 0 - forecast state unchanged, or the forecast released; 1 - the forecast has been carried from the previous forecast, 2 - the forecast has been modified (edited) ) | |
| AllocationChangeId | Identity | yes | Allocation Change id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AllocationSnapshots | Master Planning |
The table stores the list of forecasts existing in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| StartDate | Date | no | The first month after the forecast horizon | |
| FinishDate | Date | no | The first month after the forecast horizon | |
| Name | String | no | Forecast snapshot name | |
| Description | String | no | Forecast snapshot description | |
| UserId | Identity | no | Snapshot owner identifier | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AlternateMaterials | Core Core |
The table stores the list of alternative material names. Each company can have its own set of material names |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| LocationId | Identity | yes | A reference to Locations table | |
| MaterialId | Identity | no | A reference to Materials table | |
| MaterialName | LongString | no | Alternative name of the material | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| AlternateRunsData | Block Scheduling Temporary |
Keeps the list of alternate runs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Reference to MaterialRuns table | |
| WorkCentreId | Identity | no | Reference to Workcentres table | |
| RunCode | LongestString | yes | Material run code | |
| StartDate | Date | yes | Start date of material run | |
| FinishDate | Date | yes | Finish date of material run | |
| Quantity | Float | yes | Capacity of material run | |
| AvailableCapacity | Float | yes | Available capacity of material run | |
| Duration | Float | no | Duration of material run | |
| AvailableDuration | Float | no | Available duration of material run | |
| IsValid | Integer | yes | 0 - is not valid run; 1 - is valid run | |
| UserId | Identity | no | User identificator |
| AmendInventories | Due date quoting Temporary table |
The table contains information about inventories by modification order |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to the SKU | |
| Quantity | Float | no | Used quantity | |
| InventoryDate | Date | no | Inventory date | |
| OrderLineId | Identity | no | A reference to the order line | |
| ConsignmentLocationId | Identity | yes | A reference to Locations |
| AmendInventoryProfilesData | Due date quoting Temporary table |
The table contains information that is used when recalculating real inventory profile due to requests of Amend type |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SiteMaterialUsageId | Identity | yes | A reference to the site material usage | |
| DateFrom | Date | no | Date of result calculation | |
| Opening | Float | no | Opening value on the date | |
| OrdersIn | Float | yes | Incoming orders on the date | |
| OrdersOut | Float | yes | Outgoing orders on the date | |
| Closing | Float | yes | Closing value on the date | |
| MinOpening | Float | yes | MinOpening value on the date | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| Delivered | Float | no | Delivered movements | |
| OnHandInventory | Float | no | Delivered movements | |
| OnHandMinOpening | Float | no | Delivered movements |
| AmendRuns | Due date quoting Temporary table |
The table contains information about runs by modification order |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunId | Identity | yes | A reference to the material run | |
| Quantity | Float | no | Used quantity | |
| Duration | Float | no | Used duration | |
| OrderLineId | Identity | no | A reference to the order line |
| ArchivedAllocationBodies | Master Planning Master Planning |
The table stores archived weekly allocations for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| UniqueId | String | no | Identity | |
| Stamp | TimeStamp | no | Time Stamp | |
| DeliveryWeek | Date | yes | Delivery Week | |
| DeliveryMonth | Date | yes | Delivery Month | |
| SourceWeek | Date | yes | Source Week | |
| SourceMonth | Date | yes | Source Month | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| WorkcentreId | Identity | no | A reference to Workcentres | |
| NonMoveableWeight | Float | no | Non-moveable orders | |
| System | Float | no | Forecast value generated by system | |
| Customer | Float | no | Forecast value edited by customer | |
| AllocationId | Identity | yes | Allocation Id (links different stages of the same multi-stage allocation chain) | |
| StageNo | Integer | no | Stage No | |
| IsLastStage | Integer | no | Is Last Stage | |
| OperationTypeId | Identity | yes | Operation Type ID | |
| ProductRouteId | Identity | yes | Production Route ID | |
| ConversionFactor | Float | no | Production rate conversion factor | |
| MasterRouteId | Identity | yes | Master Route ID | |
| IsWorking | Integer | no | A switch. Possible values: 0 - forecast state unchanged, or the forecast released; 1 - the forecast has been carried from the previous forecast, 2 - the forecast has been modified (edited) ) | |
| AllocationChangeId | Identity | yes | Allocation Change ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ArchivedForecastBodies | Forecasting Forecasting |
The table stores the archive of previous forecasts |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| DateFrom | Date | no | Month | |
| ForecastId | Identity | no | A reference to Forecasts | |
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| OriginalSystem | Float | no | Forecast value generated by system at firts pass of generation | |
| System | Float | no | Forecast value generated by system | |
| Customer | Float | no | Forecast value edited by customer | |
| Final | Float | no | Final forecast value | |
| ForecastAllocation | Float | no | Forecasr allocation | |
| Upper | Float | yes | Upper percentile generated by ForecastPro | |
| Lower | Float | yes | Lower percentile generated by ForecastPro | |
| IsWorking | Integer | no | ||
| SafetyStock | Float | yes | Safety Stock generated by ForecastPro | |
| EditGroupId | Identity | yes | forecast changes id | |
| EditGroupFinalId | Identity | yes | forecast changes id | |
| WeeklyEdited | Integer | yes | A flag | |
| SystemPriceCurrencyId | Identity | no | Currency id for system price | |
| PriceCurrencyId | Identity | no | Currency id for forecasted price | |
| SystemPrice | Float | no | System Price | |
| ForecastedPrice | Float | no | Forecasted Price | |
| CostCurrencyId | Identity | no | Cost Currency Id | |
| NominalCost | DoubleFloat | no | Nominal Cost | |
| NominalCostAdjustment | Float | no | Nominal Cost adjustment | |
| ValueAddAdjustment | Float | no | Nominal Cost adjustment | |
| SystemWeeklyCoefId | Identity | yes | System weekyl coef id | |
| CustomerWeeklyCoefId | Identity | yes | System weekyl coef id | |
| FinalWeeklyCoefId | Identity | yes | System weekyl coef id | |
| DeletedFlag | Integer | no | A flag | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ArchivedForecastData | Forecasting Forecasting |
A temporary table for Archived forecast collaboration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| DateFrom | Date | yes | date | |
| SystemTotal | Float | no | ||
| CustomerTotal | Float | no | ||
| FinalTotal | Float | no | ||
| System | Float | no | ||
| Customer | Float | no | ||
| Final | Float | no | ||
| IsWorking | Integer | no | ||
| ForecastStatusId | Integer | no | ||
| DeletedFlag | Integer | no | ||
| EditGroupId | Identity | yes | ||
| EditGroupFinalId | Identity | yes |
| ArchivedRebalancedOrderLines | Replenishment Replenishment |
The table archived stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProcessId | Identity | no | Process Id for rebalance orders and available onhandstock | |
| OrderLineId | Identity | no | Original order line for rebalance | |
| SiteMaterialUsageId | Identity | no | ||
| ConsignmentLocationId | Identity | yes | ||
| FinalWeight | Float | no | ||
| DispatchedWeight | Float | no | ||
| AllocatedStockWeight | Float | no | ||
| RemainingOperationWeight | Float | no | ||
| RemainingWeight | Float | no | ||
| NewAllocatedStockWeight | Float | yes | ||
| ReturnedAllocatedStockWeight | Float | yes | ||
| RequestedDate | Date | no | Requested date | |
| ConfirmedDate | Date | no | Confirmed date | |
| InsertDate | Date | no | Confirmed date | |
| Priority | Integer | no | Confirmed date | |
| OrderNo | Integer | no | Order for balancing | |
| Comments | LongString | no | Comment for order | |
| IsSent | Integer | no | Order for balancing | |
| TimeStamp | TimeStamp | no | When record was addeed or updated |
| ArchivedRebalancedStock | Replenishment Replenishment |
The table archived stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProcessId | Identity | no | Process Id for rebalance orders and available onhandstock | |
| SiteMaterialUsageId | Identity | no | ||
| ConsignmentLocationId | Identity | yes | ||
| PreviousStock | Float | no | ||
| OnHandStock | Float | no |
| AverageExpandedPrices | Forecasting Forecasting |
The table stores prices calculated from history or/and order records for each SKU |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Day from | |
| DateTo | Date | no | Day toMonth | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| Price | Float | no | Price for SKU | |
| CurrencyId | Identity | yes | A reference to the corresponding currencies | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| BOM | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| BomCode | String | no | Weight of rule | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was inserted? |
| BOMMaterials | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| BomId | Identity | no | BOM identity | |
| MaterialId | Identity | no | Weight of rule | |
| OperationTypeId | Identity | yes | Operation type | |
| InputUnitId | Identity | no | Weight of rule | |
| OutputUnitId | Identity | no | Weight of rule | |
| Multiplier | Float | no | Site | |
| Divider | Float | no | Who inserted the record? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| BomMaterialSnapshots | Master Planning Master Planning |
The table contains detailed information about grades/paper machines per SNP period |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ||
| BomCode | String | no | ||
| BomId | Identity | no | ||
| MaterialId | Identity | no | ||
| PropertyValueId | Identity | no | ||
| GradeId | Identity | no | ||
| Replenished | Integer | no | Is product replenished somewhere | |
| InputUnitId | Identity | no | input unit | |
| OutputUnitId | Identity | no | output unit | |
| Multiplier | Float | no | Multiplier | |
| Divider | Float | no | Divider |
| BSOAllocationData | Block Scheduling Block Scheduling |
The table stores allocations as input for BSO engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre | |
| OperationTypeId | Identity | no | Operation type | |
| GroupLevel | Identity | no | Grouping Level | |
| DateFrom | Date | no | ||
| GradeId | Identity | no | ||
| FinishingId | Identity | yes | ||
| OriginalWeight | Float | no | ||
| Weight | Float | no | ||
| Duration | Float | no | ||
| TotalDuration | Float | no | ||
| ReducedTotalDuration | Float | no | Run Status Name | |
| RemainingDuration | Float | no | Who inserted the record? | |
| Coef | DoubleFloat | no | When the record was inserted? | |
| Priority | Integer | no | ||
| Rate | Float | no | ||
| IsLiveRun | Integer | no | LiveRun: 1 - production run, 0 - optimized run | |
| NextWorkcentreId | Identity | yes | Next Workcentre in Chain | |
| NextOperationTypeId | Identity | yes | Next Operation type in Chain | |
| NextSourcePeriod | Date | yes | Source period for next operation | |
| NextWeight | Float | yes | Allocation for next operation | |
| NextCoef | Float | yes | Coef for next operation | |
| OperatorUserId | Identity | no | User identity |
| BSOCampaignBatchUpdateData | Block Scheduling Block Scheduling |
The table stores runs for workcentres for batch update |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkCentreId | Identity | no | Workcentre identity | |
| RunId | Identity | no | Run identity | |
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) |
| BSOGradeProperties | Block Scheduling Block Scheduling |
The table stores block schedule optimiser Grade properties. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| GradeId | Identity | no | BSO Grade Id | |
| PropertyId | Identity | no | Property Id | |
| Code | String | no | Code |
| BSOIndicativeData | Block Scheduling Block Scheduling |
The table stores Indicatives |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre | |
| GroupLevel | Identity | no | Grouping Level | |
| DateFrom | Date | no | ||
| GradeId | Identity | no | ||
| OperationTypeId | Identity | no | Operation type | |
| Weight | Float | no | ||
| Duration | Float | no | ||
| TotalDuration | Float | no | ||
| ReducedTotalDuration | Float | no | Run Status Name | |
| RemainingDuration | Float | no | Who inserted the record? | |
| Coef | DoubleFloat | no | When the record was inserted? | |
| Priority | Integer | no | ||
| Rate | Float | no | ||
| IsLiveRun | Integer | no | LiveRun: 1 - production run, 0 - optimized run | |
| OperatorUserId | Identity | no | User identity |
| BSOInputData | Block Scheduling Block Scheduling |
The table stores allocations as input for BSO engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| WorkcentreId | Identity | no | Workcentre | |
| OperationTypeId | Identity | no | Operation type | |
| DateFrom | Date | no | ||
| GradeId | Identity | no | ||
| FinishingId | Identity | yes | ||
| Weight | Float | no | ||
| Duration | Float | no | ||
| Priority | Integer | no | ||
| OrderLineId | Identity | no | ||
| Rate | Float | yes | ||
| IsLiveRun | Integer | no | LiveRun: 1 - production run, 0 - optimized run | |
| NextWorkcentreId | Identity | yes | Next Workcentre in Chain | |
| NextOperationTypeId | Identity | yes | Next Workcentre in Chain | |
| NextSourcePeriod | Date | yes | Source period for next operation | |
| NextWeight | Float | yes | Allocation for next operation | |
| NextCoef | Float | yes | Coef for next operation | |
| SourceRunId | Identity | yes | Optimized source Run (used as demand) | |
| SourceAllocationId | Identity | yes | REference to BSOInput as input allocation |
| BSOOrdersData | Block Scheduling Block Scheduling |
The table stores allocations as input for BSO engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre | |
| OperationTypeId | Identity | no | Operation type | |
| GroupLevel | Identity | no | Grouping Level | |
| OrderLineId | Identity | no | Order Line | |
| DateFrom | Date | no | ||
| GradeId | Identity | no | ||
| FinishingId | Identity | yes | ||
| NextWorkcentreId | Identity | yes | ||
| NextOperationTypeId | Identity | yes | ||
| Weight | Float | no | ||
| Duration | Float | no | ||
| Priority | Integer | no | ||
| Rate | Float | yes | ||
| IsLiveRun | Integer | no | LiveRun: 1 - production run, 0 - optimized run | |
| OperatorUserId | Identity | no | User identity |
| BSOProgramGrades | Block Scheduling Block Scheduling |
BSO program grades |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Run Identity |
| BSOProgramId | Identity | no | BSO Program Id | |
| BSOProgramTemplateId | Identity | no | BSO Program Template Id | |
| BSOTemplateGradeId | Identity | no | BSO Template Grade Id | |
| SequenceNo | Identity | no | Sequence number of grade in template | |
| GradeId | Identity | yes | Reference to GradeProperties.GradeId | |
| Mandatory | Integer | no | Is mandatory grade? (1 - yes, 0 - no) | |
| Duration | Float | no | Nominal duration | |
| MinDuration | Float | no | Minimum allowed run length | |
| MaxDuration | Float | no | Maximum allowed run length | |
| RunProperties | LongString | yes | Run properties |
| BSOProgramRunsData | Block Scheduling Block Scheduling |
The table stores BSO program runs for workcentre |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| BSOProgramId | Identity | no | BSO program identity | |
| BSOProgramSequenceNo | Identity | no | BSO program sequence no | |
| BSOProgramStartDate | Date | no | Start date BSO program | |
| RunFinishDate | Date | yes | Finish date run | |
| BSOProgramGradeId | Identity | no | BSO Program grade identity | |
| GradeId | Identity | no | Grade identity | |
| BSOTemplateGradesequenceNo | Identity | no | BSO grade sequence no | |
| TemplateDuration | Float | no | Template duration | |
| DemandDuration | Float | no | Demand duration | |
| RunDuration | Float | no | Run duration | |
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) |
| BSOPrograms | Block Scheduling Block Scheduling |
The table stores block schedule optimiser programs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkcentreId | Identity | no | Workcentre Id | |
| ProgramTemplateId | Identity | no | Program Template Id | |
| SequenceNo | Integer | no | Sequence Number | |
| StartDate | Date | yes | The date and time that the start of the template is assigned to | |
| StartRunId | Identity | yes | Run identity | |
| FinishDate | Date | yes | The date and time that the finish of the template is assigned to | |
| OppRunLength | Identity | no | Opp.Run length | |
| FixOppRuns | Identity | no | Defines whether the opp.run of the Program Tem-pate Assignment to the workcentre should not be recalculated based on forecast | |
| DurationAdj | Identity | no | Duration adjusted by user | |
| ShutLength | Identity | no | The length of 'floating' shut to be added at the end of the template | |
| AllowIdleForShut | Identity | no | Allow idle time for shut | |
| EarlyFixedPenalty | Float | no | Early fixed penalty | |
| DailyEarlyPenalty | Float | no | Daily early penalty | |
| LateFixedPenalty | Float | no | Late fixed penalty | |
| DailyLatePenalty | Float | no | Daily late penalty | |
| FirstGradeNo | Identity | no | First BSO Grade SequenceNo | |
| LastGradeNo | Identity | no | Last BSO Grade Sequence No | |
| FirstRunMandatory | Identity | yes | Allows to override the first run’s mandatory flag | |
| LastRunMandatory | Identity | yes | Allows to override the last run’s mandatory flag |
| BSOProgramTemplates | Block Scheduling Block Scheduling |
The table stores the list of templates for the selected workcentre type |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkCentreTypeId | Identity | no | Workcentre type Id | |
| ProgramName | String | no | Program name | |
| OppRunLength | Float | no | Duration of the default opp.run to be created for this template | |
| FixOppRuns | Integer | no | Defines whether the opp.run of the Program Template should not be recalculated based on forecast | |
| RunsAssigned | Integer | yes | Number of runs from the template which are as-signed to this workcentre | |
| FirstRunProperties | LongString | yes | First run properties | |
| LastRunProperties | LongString | yes | Last run properties | |
| Workcentres | LongString | yes | Workcentres that used this BSO Program Template | |
| AutoSizeRunDuration | Integer | no | Option to allow template runs to be autosized (1 - yes; 0 - no) | |
| TemplateDuration | Float | no | Template duration | |
| IsWeightUse | Integer | no | Option to allow template runs to be weight (1 - yes; 0 - no) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| BSORunsData | Block Scheduling Block Scheduling |
The table stores allocations as input for BSO engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre | |
| GroupLevel | Identity | no | Grouping Level | |
| DateFrom | Date | no | ||
| GradeId | Identity | no | ||
| Weight | Float | no | ||
| Duration | Float | no | ||
| IsLiveRun | Integer | no | LiveRun: 1 - production run, 0 - optimized run | |
| OperatorUserId | Identity | no | User identity |
| BSOTemplateGrades | Block Scheduling Block Scheduling |
BSO template grades |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProgramTemplateId | Identity | no | Program Template Id | |
| GradeId | Identity | yes | Reference to GradeProperties.GradeId | |
| OperationTypeId | Identity | yes | Reference to OperationTypes | |
| RunProperties | LongString | yes | Run properties | |
| SequenceNo | Identity | no | Sequence number of grade in template | |
| Mandatory | Integer | no | Is mandatory grade? (1 - yes, 0 - no) | |
| Duration | Float | no | Nominal duration | |
| MinDuration | Float | no | Minimum allowed run length | |
| MaxDuration | Float | no | Maximum allowed run length |
| BSOWorkcentreData | Block Scheduling Temporary |
The list of workcentres to be processed in BSO per user. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre Id | |
| BSOStartDate | Date | yes | BSO Start Date for optimization | |
| BSOFrozenPeriodEnd | Date | yes | BSO Frozen Period End | |
| Required | Integer | yes | Required for calculation | |
| GenerateBSODate | Date | yes | Genetate date BSO input for optimization | |
| OperatorUserId | Identity | no | Who inserted the line? |
| Bundles | Core Configuration |
The table stores system parameter values |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | String | no | Identity | |
| TableName | String | yes | Source table | |
| Condition | HugeString | yes | Condition | |
| FieldKey | String | yes | Key source field | |
| FieldValue | String | yes | Value source field | |
| FieldDescription | String | yes | Value source field | |
| FieldOrderBy | String | yes | Value source field | |
| IncludeNone | Integer | no | Include None as value? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| BundleValues | Core Configuration |
The table stores system parameter values |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| BundleId | Identity | no | Key | |
| Key | String | yes | Key | |
| Value | LongString | yes | Parameter value | |
| OrderNo | Integer | no | Ordinal number in the list of parameter values. | |
| Description | HugeString | yes | Description of the parameter value. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CalculatedOppBlocks | Block Scheduling Block Scheduling |
After the Run Optimiser engine has generated campaigns, it is possible to calculate opportunistic blocks based on the information from forecast statistics of actual materials being produced each week. This calculation is done for each week of the campaign. The table contains calculated opportunistic blocks by ISO weeks. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | A reference to workcentres.Id | |
| DateFromIW | Date | no | ISO week | |
| Duration | Float | yes | Duration of opportunistic block for the specified week, hours | |
| OperatorUserId | Identity | no | Operator user ID |
| CalendarRules | Core Calendars |
The table stores rules for calendars. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CalendarId | Identity | no | A reference to calender | |
| CalendarRuleNo | String | no | Rule type | |
| Day | Integer | yes | Day of month | |
| DayOfWeek | Integer | yes | Day of week | |
| NumOfWeek | Integer | yes | Number of week | |
| Month | Integer | yes | Month | |
| Year | Integer | yes | Year | |
| IsWorkingDay | Integer | no | A flag: is it a working day? | |
| IsReceivingDay | Integer | no | A flag: is it a receiving day? | |
| Description | LongString | no | Rule description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Calendars | Core Calendars |
In this table calendars are stored. A calendar defines when customer can receive orders, and when customer is expected to have consumption. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CalendarName | String | no | Calendar name | |
| GeneralCalendarId | Identity | yes | Parent calendar | |
| LastGeneratedDate | Date | yes | When schedule was last time regenerated. | |
| LastExistingDate | Date | yes | Schedule last existing date. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CalendarSources | Core Calendars |
The table stores detailed information on each day of calendars. Calendar rules are expanded into this table. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| CalendarId | Identity | no | A reference to calendar | |
| DateFrom | Date | no | Date | |
| DateFromIW | Date | no | Date IW | |
| DateFromMonth | Date | no | Date Month | |
| IsWorkingDay | Integer | yes | A flag: is it a working day? | |
| IsReceivingDay | Integer | yes | A flag: is it a receiving day? | |
| WeekSum | Integer | yes | A flag: is it a receiving day? | |
| WeekMonthCoef | Float | no | Week month coef | |
| Description | LongString | yes | Description (copied from rule) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| CalendarTradingDays | Core Calendars |
The table stores sparse monthly working-day counts for requested calendars. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| CalendarId | Identity | no | A reference to calendar | |
| DateFromMonth | Date | no | First day of month | |
| WorkingDaysQty | Integer | no | Number of effective working days in month | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| CampaignChangesData | Block Scheduling Block Scheduling |
Temporary table for storing campaign changes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateChanges | Date | yes | Date | |
| WorkCentreId | Identity | no | WorkCentre Id | |
| OrderNo | Identity | no | OrderNo | |
| UndoAction | String | no | Action | |
| UndoParams | LongestString | no | Parameters | |
| RedoAction | String | no | Action | |
| RedoParams | LongestString | no | Parameters | |
| UserId | Identity | no | User ID |
| CampaignGraphData | Replenishment Temporary |
This table store data for creation of campaign graph. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunId | Identity | no | Reference to MaterialRuns table | |
| RunCode | LongString | no | Block code from MaterialBlocks + run code from MaterialRuns | |
| MaterialBlockId | Identity | no | Reference to MaterialBlocks table | |
| WorkCentreId | Identity | no | Reference to WorkCentres table | |
| WorkCentreName | String | no | Work centre name | |
| PropertyValue | LongString | no | Property value | |
| StartDate | Date | yes | Start date of run | |
| FinishDate | Date | yes | Finish date of run | |
| Capacity | Float | yes | Quntity of run | |
| AllocationQuantity | Float | yes | Allocation quantity for preset values PropertyValueId and HierarchyId | |
| AllocationOther | Float | yes | AllocationAll - AllocationQuantity | |
| AllocationAll | Float | yes | All allocation | |
| TentativeQuantity | Float | yes | Quantity tentative orders for preset values PropertyValueId and HierarchyId | |
| TentativeAll | Float | yes | Quantity all tentative orders | |
| TentativeOther | Float | yes | TentativeAll - TentativeQuantity | |
| FirmQuantity | Float | yes | Quantity firm orders for preset values PropertyValueId and HierarchyId | |
| FirmOther | Float | yes | FirmAll - FirmQuantity | |
| FirmAll | Float | yes | Quantity all firm orders | |
| Native | Integer | yes | Native runs | |
| PropertyValueId | Identity | yes | Reference to PropertyValues table | |
| OperatorUserId | Identity | no | User which insert line |
| CarryForecastData | Forecasting Temporary |
Temp table for storing forecast data for carrying forecast |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | SMU Id | |
| DateFrom | Date | no | date (month) | |
| IsWorking | Integer | no | Is working flag | |
| Final | Float | no | Final forecast value | |
| WeeklyEdited | Integer | yes | flag | |
| EditGroupId | Identity | yes | Group Id | |
| EditGroupFinalId | Identity | yes | Group Id | |
| CustomerHash | HugeString | yes | Customer edits hash | |
| FinalHash | HugeString | yes | final edits hash | |
| OperatorUserId | Identity | no | User Id |
| ChangeOverProperties | Block Scheduling Block Scheduling |
The table stores changeover properties |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ChangeOverId | Identity | no | A reference to WorkcentreChangeOvers.Id | |
| PropertyId | Identity | no | A reference to Properties.Id | |
| CodeFrom | String | no | Source code | |
| CodeTo | String | no | Destination code | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Characteristics | Core Core |
The table stores characteristics |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | PriceRuleId, SupercessionId, etc. | |
| FieldName | String | no | Entity | |
| EntityType | String | yes | Entity | |
| Value | String | no | Value | |
| ExpandedValues | HugeString | yes | Value | |
| FieldViewName | String | yes | Entity |
| ChartLines | Core Configuration |
The table contains the list columns of grids |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ChartId | Identity | no | Grid Id | |
| MarkedForDelete | Integer | no | Temporary field for handling in messages | |
| orderNo | Identity | no | Grid Id | |
| Caption | ShortString | no | Column name | |
| FieldName | ShortString | no | Field name | |
| Type | ShortString | no | Type: (Decimal, Integer, String, Date, DateTime, bool) | |
| ControlType | ShortString | no | Control Type (CheckBox, ComboBox, TextBox, DatePicker, MonthPicker, WeekPicker) | |
| IsEditable | Integer | no | Is editable (yes/no) | |
| IsShowTotal | Integer | no | Is show total (yes/no) | |
| State | ShortString | no | State = (normal, fixed, hidden) | |
| DataForColumn | String | yes | this column will place into column cell data object | |
| colorColumn | String | yes | ||
| BackgroundColorColumn | String | yes | ||
| dataColumns | String | yes | ||
| dataColumnsMapping | LongestString | yes | ||
| editableColumn | String | yes | ||
| tooltipColumn | String | yes | ||
| classColumn | String | yes | ||
| Color | ShortString | yes | Default chart serie colour | |
| Pattern | ShortString | yes | Default chart line pattern (e.g. "3,3" is dotted etc) | |
| IsResizable | Integer | no | (yes/no) | |
| IsTransformColumn | Integer | no | (yes/no) | |
| IsTransformable | Integer | no | (yes/no) | |
| TransformFormat | String | yes | format for transformation | |
| IsShowToolTip | Integer | no | (yes/no) | |
| IsConfigurable | Integer | no | (yes/no) | |
| MaxWidth | Integer | no | Max width for multi-line column | |
| MinWidth | Integer | no | Min width for multi-line column | |
| Style | String | yes | (string) | |
| Format | String | yes | (string) | |
| Sort | Integer | no | (yes/no) | |
| Filter | ShortString | yes | (text/select) |
| Charts | Core Configuration |
The table contains the list of charts |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | ShortString | no | Grid name | |
| Description | String | no | Grid description | |
| PageId | Identity | yes | Page | |
| Type | ShortString | yes | (serial/stock) | |
| Configuration | String | yes | json config |
| CheckData | Core Temporary |
Temporary table for data checks |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| OperatorUserId | Identity | no | OperatorUserId | |
| Description | LongString | yes | Description for data check |
| CheckDDQFGInventoryData | Due date quoting Temporary table |
The table stores temporary results of an FG search. The table is filled when searching for FG, and is cleared after DDQ process finished |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| SiteMaterialUsageId | Identity | no | SKU ID | |
| WarehouseId | Identity | no | Warehouse ID | |
| WHLocationId | Identity | yes | location ID on the warehouse | |
| DespatchDate | Date | no | Despatch date from the warehouse | |
| DeliveryDate | Date | no | Delivery date to the destination area | |
| Success | Identity | no | A flag: was the full quantity found? (0, 1) | |
| Quantity | Float | no | Rounded Found quantity | |
| OriginalQuantity | Float | no | Original Found quantity | |
| QuantityWholeUnit | Float | no | Quantity Whole Unit | |
| SourcePriority | Identity | no | Source Priority for the SKU | |
| JourneyId | Identity | yes | Journey Id | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| OrderBy | Integer | yes | Order of select | |
| OnHandStock | Integer | no | OnHandStock | |
| ProductId | Identity | no | Product ID | |
| ProductPriority | Identity | no | Product Priority | |
| OneUnitWeight | Float | no | One Unit Weight |
| CheckDDQFLRunsData | Due date quoting Temporary table |
Temporary data of the FL runs search is stored in the table. It is filled when searching for FL runs, and is cleared after ddq request processed. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| SourceWorkCentreId | Identity | yes | Paper machine ID | |
| FGWarehouseId | Identity | yes | FG warehouse ID on the site | |
| FGWHLocationId | Identity | yes | Location of the FG warehouse on the site | |
| SiteId | Identity | yes | Site ID of the paper machine | |
| TransportRouteId | Identity | yes | Transport route ID | |
| TransportMethodId | Identity | yes | Transport method ID | |
| JourneyId | Identity | yes | Journey ID | |
| DespatchDate | Date | yes | Despatch date from the FG warehouse | |
| DeliveryDate | Date | yes | Delivery date to the destination area | |
| FLWorkCentreId | Identity | no | FL workcentre ID | |
| FLMaterialBlockId | Identity | yes | Material block ID | |
| FLMaterialRunId | Identity | yes | Material run ID | |
| FLOppRunId | Identity | yes | Opportunistic run ID | |
| StartRunDate | Date | yes | Run start date | |
| FinishRunDate | Date | yes | Run end date | |
| EnabledQuantity | Float | no | Found quantity on the run | |
| OppQuantity | Float | no | Found quantity on the opportunistic run | |
| SFGWorkCentreId | Identity | yes | SFG warehouse ID | |
| SFGMaterialId | Identity | yes | SFG material ID | |
| SFGQuantity | Float | no | Found SFG quantity | |
| Success | Identity | no | A flag: was the full quantity found? (0, 1) | |
| Loss | Float | no | Losses on the wirkcentre | |
| PMMaterialRunId | Identity | yes | Run ID for PM |
| CheckDDQPMRunsData | Due date quoting Temporary table |
The table stores temporary data of a PM run search. It is filled when searching for PM runs, and is cleared after ddq request processed. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| ProductPriority | Identity | yes | Product Priority | |
| MaterialId | Identity | yes | A reference to Materials | |
| SourceWorkCentreId | Identity | yes | A reference to PaperMachines | |
| FLMaterialRunId | Identity | yes | A reference to FL Material run ID | |
| PMMaterialBlockId | Identity | yes | A reference to PM material block ID | |
| PMMaterialRunId | Identity | yes | A reference to PM material run ID | |
| OppRunId | Identity | yes | A reference to opportunistic run ID | |
| OppQuantity | Float | no | Opportunistic quantity found | |
| StartRunDate | Date | no | PM run start date | |
| FinishRunDate | Date | no | PM run end date | |
| EnabledQuantity | Float | no | Quantity found on the run | |
| Temp | Identity | no | A flag: is the record temporary? (1, 0) | |
| Success | Identity | no | A flag: was the full quantity found? (0, 1) | |
| Loss | Float | no | Losses on the paper machine | |
| DespatchDateSS | Date | yes | Despatch date from the FG warehouse (used for Single Stage branch) | |
| DeliveryDateSS | Date | yes | Delivery date to the destination area (used for Single Stage branch) | |
| WorkcentreWHid | Identity | yes | A reference to the FG warehouse on the site (used for SingleStage branch) | |
| LocationWHid | Identity | yes | A reference to the location of the FG Warehouse on the site (used for Single Stage branch) | |
| SiteId | Identity | yes | Site ID of the paper machine | |
| TransportMethodIdSS | Identity | yes | A reference to the transport method (used for Single Stage branch) | |
| TransportRouteIdSS | Identity | yes | A reference to the transport route (used for Single Stage branch) | |
| JourneyIdSS | Identity | yes | A reference to the transport route (used for Single Stage branch) | |
| OneUnitWeight | Float | no | One Unit Weight | |
| StageNo | Integer | no |
| CheckDDQSFGInventoryData | Due date quoting Temporary table |
The table stores intermediate data (results of the SFG search) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| WorkCentreId | Identity | no | A reference to the workcentre | |
| SiteId | Identity | yes | Site ID of the paper machine | |
| MaterialId | Identity | no | A reference to the material | |
| Quantity | Float | no | Found quantity | |
| SourceWorkCentreId | Identity | yes | A reference to the paper machine | |
| InventoryDate | Date | no | Inventory date |
| CollaborationData | Forecasting Forecasting |
A temporary table for forecast collaboration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| History1 | Float | no | History1 | |
| History2 | Float | no | History2 | |
| History3 | Float | no | History3 | |
| History4 | Float | no | History4 | |
| History5 | Float | no | History5 | |
| History6 | Float | no | History6 | |
| History7 | Float | no | History7 | |
| History8 | Float | no | History8 | |
| ForecastStatusId | Integer | no | ||
| IsWorking | Integer | no | ||
| CurrentForecast | Float | no | ||
| MTD | Float | no | ||
| SystemTotal | Float | no | ||
| CustomerTotal | Float | no | ||
| FinalTotal | Float | no | ||
| ForecastAllocationTotal | Float | no | ||
| OrdersTotal | Float | no | ||
| AllocationsTotal | Float | no | ||
| BudgetTotal | Float | no | ||
| NominalCostTotal | Float | no | ||
| ValueAddTotal | Float | no | ||
| RevenueTotal | Float | no | ||
| TotalEditableCustomer | Integer | no | ||
| TotalEditableFinal | Integer | no | ||
| TotalEditForecastAllocation | Integer | no | ||
| TotalCustomerCssClass | String | yes | ||
| TotalFinalCssClass | String | yes | ||
| TotalToolTip | String | yes | ||
| WarningCssClass | String | yes |
| CollaborationGraphData | Forecasting Temporary |
Temporary table for data for Serial Graph screen and History screen |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date (month) | |
| Usage | Float | yes | total usage | |
| AdjustedUsage | Float | yes | total usage | |
| AllUsage | Float | yes | all usage with superceded history | |
| FittedUsage | Float | yes | all fitted usage with superceded history | |
| System | Float | yes | system forecast value | |
| Customer | Float | yes | customer forecast value | |
| Final | Float | yes | final forecast value | |
| Upper | Float | yes | upper limit | |
| Lower | Float | yes | lower limit | |
| Trend | Float | yes | trend | |
| Budget | Float | yes | budget value | |
| Snapshot1 | Float | yes | Snapshot 1 value | |
| Snapshot2 | Float | yes | Snapshot 2 value | |
| Snapshot3 | Float | yes | Snapshot 3 value | |
| Snapshot4 | Float | yes | Snapshot 4 value | |
| Snapshot5 | Float | yes | Snapshot 5 value | |
| Snapshot6 | Float | yes | Snapshot 6 value | |
| Snapshot7 | Float | yes | Snapshot 7 value | |
| Snapshot8 | Float | yes | Snapshot 8 value | |
| Snapshot9 | Float | yes | Snapshot 9 value | |
| Snapshot10 | Float | yes | Snapshot 10 value | |
| Snapshot11 | Float | yes | Snapshot 11 value | |
| Snapshot12 | Float | yes | Snapshot 12 value | |
| Snapshot13 | Float | yes | Snapshot 13 value | |
| Snapshot14 | Float | yes | Snapshot 14 value | |
| Snapshot15 | Float | yes | Snapshot 15 value | |
| FinalForecastComment | String | yes | final comment | |
| CustomerForecastComment | String | yes | customer comment | |
| OperatorUserId | Identity | no | user id |
| CombinedRunCapacity | Replenishment Order generation |
The table stores data about available runs and material which when can produce for allocation based replenishment process |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | no | A reference to MaterialRuns | |
| WorkcentreId | Identity | no | A reference to MaterialRuns | |
| MaterialId | Identity | no | Material identity | |
| Capacity | Float | no | Calculate production cost for combination Material/Paper Machine | |
| Rate | Float | no | Calculate production cost for combination Material/Paper Machine |
| Companies | Core Core |
The table stores the list of companies registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CompanyName | String | no | Company name | |
| CompanyCode | ShortString | no | Company external code | |
| CustomerRankId | Identity | yes | Company rank | |
| Internal | Integer | no | A flag: is the company internal? (i.e. I-Plan system owner) | |
| SafetyStockMethodId | Identity | yes | Default safety stock method | |
| GroupReplenishedLocations | Integer | yes | Group Replenished locations | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ConfigurationSnapshots | Master Planning Master Planning |
The table contains detailed information about grades/paper machines per SNP period |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| Id | Identity | no | ||
| ProductionConfigurationId | Identity | no | Reference configuration Id | |
| IsIdentical | Integer | no | Is configuration identical to any other configuration | |
| ProductRouteId | Identity | no | ||
| OperationTypeId | Identity | no | ||
| MaterialId | Identity | no | ||
| PropertyValueId | Identity | no | material property value | |
| BomId | Identity | yes | ||
| CoProductPriceList | HugeString | yes | semicolon separated list in format: CoProductId:Percentage:PricePercentage | |
| CycleTypeId | Identity | yes | for initial source rules | |
| ValidSources | HugeString | yes | ||
| PrimaryValidSources | HugeString | yes | ||
| Multiplier | Float | no | ||
| Divider | Float | no | ||
| ConfigurationHash | HugeString | no | ||
| IsLastCoProductStage | Integer | no | Is Last coproduct stage | |
| IsLastStage | Integer | no | Is Last stage | |
| StageOrderNo | Integer | no | stage order no from prod. route | |
| IsCoProductStage | Integer | no | stage order no from prod. route | |
| CoProductPercentage | Float | no | sum of percentage of coproducts |
| ConsignmentOrderForSendData | Replenishment Temporary |
A temporary table for Consignment Orders for send (ticket 51626) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OrderLineID | Identity | yes | Order Line ID | |
| Action | String | yes | ||
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) |
| ConsignmentOrdersData | Replenishment Temporary |
A temporary table for Consignment Orders (ticket 51626) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Unique identifier of the record |
| OrderLineID | Identity | yes | ||
| OrderCode | String | yes | ||
| LineCode | String | yes | ||
| DeliveryID | Identity | yes | ||
| DeliveryCode | String | yes | ||
| AlternateCode2 | String | yes | ||
| MovementDate | Date | no | ||
| StockLevel | Float | yes | ||
| Incoming | Float | yes | ||
| Outgoing | Float | yes | ||
| Source_Destination | String | yes | ||
| StatusCode | String | yes | ||
| DeliveryDate | Date | yes | Critical date | |
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ConsignmentParameters | Core Core |
The table stores the list of SKU parameters |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SiteMaterialUsageId | Identity | no | Warehouse SKU | |
| CustomerId | Identity | no | Customer Location Id | |
| Replenished | Integer | no | A flag: is the SKU replenished? (0 - not replenished, 1 - replenished) | |
| ReplenishmentStartDate | Date | yes | Replenishment start date | |
| ReplenishmentFinishDate | Date | yes | Replenishment start date | |
| ReplenishmentFrequency | Identity | no | Frequency of warehouse replenishment | |
| MaxReplenishmentFrequency | Identity | no | Frequency of warehouse replenishment | |
| MinOrderQuantity | Float | yes | Minimal order quantity | |
| OrderUnitId | Identity | yes | A reference to Units | |
| MaxCapacity | Float | yes | Capacity of the warehouse | |
| DaysOfSupply | Integer | no | Days of supply (delivery time) | |
| MaxDaysOfSupply | Integer | no | Days of supply (delivery time) | |
| HighQuantity | Float | no | Maximal quantity | |
| LowQuantity | Float | no | Minimal quantity | |
| UpperPercentile | Float | yes | Upper percentile | |
| LowerPercentile | Float | yes | Lower percentile | |
| SafetyStockMethodId | Identity | yes | ID of the SafetyStock calculation method | |
| MaxSafetyStockMethodId | Identity | yes | ID of the SafetyStock calculation method | |
| LastInventoryDate | Date | yes | Last known inventory date | |
| GroupKey | String | yes | Group key for grouping in replenishment | |
| AlternateProduct | String | yes | Alternate Product | |
| ExistingAlternateProduct | String | yes | Alternate Product | |
| SkuKey | String | no | Destination SKU Code - SKU-CS. | |
| SafetyStockPercentWarning | Float | yes | Safety stock percent warning | |
| ReplenishmentHorizon | Integer | yes | Replenishment horizon | |
| LeadTimeDays | Float | yes | Raw material lead time, in days | |
| InsertUserId | Identity | no | Who inserted the record? | |
| UpperPercentileMethod | String | no | Method for upper percentile | |
| UpperPercentileMonths | Integer | no | Method for upper percentile | |
| IsActiveSku | Integer | no | Is suck sku have inventory or movements | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ConsumptionHistories | Forecasting Forecasting |
The table stores consumption history by SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | identity |
| DateFrom | Date | no | Date | |
| Weight | Float | no | Weight | |
| AdjustedWeight | Float | yes | Adjusted Weight | |
| SiteMaterialUsageId | Identity | no | SKU (A reference to SiteMaterialUsages) | |
| WorkCentreId | Identity | yes | Workcentre Id | |
| Price | Float | yes | Price | |
| PriceQuantityUnitId | Identity | yes | Weight unit or any convertible to weight | |
| CurrencyId | Identity | yes | Currency Identity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ContractPeriodSnapshots | Scenario Analysis Reference Data |
Session snapshot of source period minimum and maximum constraints. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario session ID | |
| Id | Identity | no | Source contract period ID | |
| ContractId | Identity | no | Source contract ID | |
| DateFrom | Date | no | Source period start date | |
| DateTo | Date | no | Source period end date | |
| MinimumQuantity | Float | no | Source minimum quantity | |
| MaximumQuantity | Float | no | Source maximum quantity | |
| IsUserOverride | Integer | no | Whether the source period was overridden |
| ContractProductSnapshots | Scenario Analysis Reference Data |
Session snapshot of products and costs belonging to external supplier contracts. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario session ID | |
| Id | Identity | no | Source contract product ID | |
| ContractId | Identity | no | Source contract ID | |
| DetailId | Identity | no | Product characteristic detail ID | |
| Cost | Float | no | Contract product cost |
| ContractSnapshots | Scenario Analysis Reference Data |
Session snapshot of external supplier contracts selected for the SNP horizon. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario session ID | |
| Id | Identity | no | Source contract ID | |
| ContractName | String | no | Contract name | |
| WorkCentreId | Identity | no | External supplier workcentre ID | |
| DateFrom | Date | no | Contract start date | |
| DateTo | Date | no | Contract end date | |
| Quantity | Float | no | Agreement quantity | |
| PeriodType | String | no | Source period type |
| CoProducts | Core Core |
The table stores co-products |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialId | Identity | no | Material Identity | |
| CoProductMaterialId | Identity | no | Co Product Identity | |
| Percentage | Float | no | Co Product percentage | |
| PricePercentage | Float | no | Co Product price percentage of price for main product | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CoProductSnapshots | Master Planning Master Planning |
The table contains snapshot of co-products for user's SNP scenario session |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| PropertyValueId | Identity | no | Property Value Id | |
| GradeId | Identity | no | SNP Grade Id | |
| CoProductId | Identity | no | Co-Product Id | |
| CoProductPriceList | HugeString | yes | Co-Product price list (a semicolon separated list in format: CoProductId:Percentage:PricePercentage;CoProductId:Percentage:PricePercentage) | |
| Percentage | Float | no | Co-Product quantity percentage | |
| PricePercentage | Float | no | Co-product Price Percentage | |
| TotalPercentage | Float | no | Sum of Co-Product Percentage | |
| TotalPricePercentage | Float | no | Sum of Co-Product Price Percentage |
| CostRules | Core Core |
The table stores the rules of calculation of PM product prime costs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkcentreId | Identity | no | A reference to Workcentres table | |
| CostRuleCode | LongString | yes | Production rate code (It is used for fast comparison) | |
| Effective | Date | no | The date when the rule becomes active | |
| Cost | DoubleFloat | no | Cost | |
| RuleWeighting | Identity | no | Rule weighting | |
| OperationTypeId | Identity | no | Operation type Identity | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CostRuleSnapshots | Scenario Analysis Input Data |
The table contains the snapshots of production cost rules for SNP. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | ScenarioId | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| WorkcentreId | Identity | yes | Workcentre ID (A reference to Workcentres) | |
| OperationTypeId | Identity | yes | Operation Type ID (A reference to OperationTypes) | |
| Effective | Date | no | Effective date | |
| Cost | DoubleFloat | no | Cost | |
| OriginalCost | DoubleFloat | yes | Original cost | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CreateRealInventoryData | Replenishment Temporary |
In this table save information about calculation of incomings and outgoings of orders for creation of real inventory. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SkuKey | String | no | User id | |
| DateFrom | Date | no | Date from | |
| OverallOpening | Float | no | Opening quantity for Firm, Tentative and Consumption | |
| Opening | Float | no | Opening | |
| OrdersIn | Float | no | Quantity incoming firm orders | |
| TentativeOrdersIn | Float | no | Quantity incoming tentative orders | |
| OrdersOut | Float | no | Quantity outgoing firm orders | |
| TentativeOrdersOut | Float | no | Quantity outgoing tentative orders | |
| Closing | Float | no | Opening | |
| OverallClosing | Float | no | Closing quantity for Firm, Tentative and Consumption | |
| FirmClosing | Float | no | Quantity outgoing delivery orders | |
| MinOpening | Float | no | Quantity outgoing delivery orders | |
| Consumption | Float | no | Forecst consumption | |
| OriginalConsumption | Float | no | Original Forecst consumption | |
| IgnoredDemandValue | Float | no | Forecst consumption | |
| OperatorUserId | Identity | no | User id |
| CTPMessagesLog | Due date quoting Logging |
The table is used to maintain external messages log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| MessageReceivedTime | TimeStamp | no | ||
| MessageProcessStartTime | TimeStamp | no | ||
| MessageCompletedTime | TimeStamp | no | ||
| HeaderCode | ShortString | yes | ||
| LineCode | String | yes | ||
| Headers | Integer | no | ||
| Lines | Integer | no | ||
| SuccessFullLines | Integer | no | ||
| MessageIn | Text | no | ||
| MessageOut | Text | yes |
| Currencies | Core Core |
The table stores the list of all currencies available in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CurrencyName | String | no | Currency name | |
| CurrencyDescription | LongString | no | Currency description | |
| IsInternal | Integer | no | A flag: is this internal (Default currency in system) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CustomerOrdersFromStock | Replenishment Replenishment |
The table stores list of all the current firm customer orders sourced from a replenished warehouse. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OrderCode | ShortString | no | Order header code | |
| LineNoCode | String | no | External reference to the order line number | |
| DespatchDate | Date | no | Despatch date, i.e. when the order leaves source location | |
| WorkCentreId | Identity | no | Source workcentre ID | |
| SourceMaterialId | Identity | no | Semifinishing product ID | |
| SourceWeight | Float | no | Weight of SFG product consumed to produce the FG product | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CustomerRanks | Core Core |
The table stores the list of customer ranks. It describes possible service levels |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CustomerRankName | String | no | Rank name | |
| CustomerRankDesc | String | no | Rank abbreviation | |
| Priority | Integer | no | Priority of the customer rank | |
| DisplayInForecast | Integer | no | Define will be SKU with such ranks by default displayed in Forecast screen | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| CustomerRankSnapshots | Master Planning Master Planning |
The table stores the list of customer ranks per SNP scenarios. It describes possible service levels. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | no | Identity | |
| CustomerRankName | String | no | Rank name | |
| CustomerRankDesc | String | no | Rank description | |
| DisplayInForecast | Integer | no | Defines if the SKU of this rank are displayed in Forecast screen by default |
| CustomersForWorkcentreData | Replenishment Temporary |
Temp table for storing list destinations for selected workcentre |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| LocationId | Identity | no | Reference to Locations table | |
| IsDefault | Integer | no | 1 - is default distination; 0 - no default | |
| JourneyId | Identity | yes | Reference to Journeys table | |
| OperatorUserId | Identity | no | User identificator |
| CycleFrequencySnapshots | Scenario Analysis Reference Data |
Table to store cycle frequency data for SNP scenarios. This defines production frequency (referenced by CycleTypeID from other tables). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (reference to Scenarios) | |
| StartWeek | Date | no | Start date | |
| CycleTypeId | Identity | no | Cycle Type ID | |
| CycleFixedPeriodDate | Date | no | Date of the cycle fixed period | |
| FirstPeriodDate | Date | no | First producing date of the cycle | |
| Frequency | Integer | no | Cycle frequency (in snapshot periods) | |
| WeekTolerance | Integer | no | Cycle frequency tolerance (in snapshot periods) |
| CycleTypes | Master Planning Master Planning |
Cycle types per property set |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| Frequency | Identity | no | Frequency in weeks, i.e. produced every N weeks | |
| WeekTolerance | Integer | no | Earlier tolerance, to allow producing in earlier weeks | |
| Priority | String | yes | Priority | |
| ProducingDay | Integer | no | Preferred day for producing 1-7 Mon-Sun, 0 - any | |
| GroupName | String | yes | Group | |
| FixedPeriodInWeeks | Integer | no | Fixed period in weeks, i.e. not produced for the next N weeks (overriding Supply Planning fixed period) |
| CycleTypeSnapshots | Master Planning Master Planning |
SNP Cycle type snapshots |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| Id | Identity | no | Cycle Type ID | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| Frequency | Identity | no | Frequency in SNP periods, i.e. produced every N periods | |
| WeekTolerance | Integer | no | Earlier tolerance, for producing earlier | |
| Priority | String | yes | Priority | |
| ProducingDay | Integer | no | Preferred day for producing 1-7 Mon-Sun, 0 - any | |
| GroupName | String | yes | Group | |
| FixedPeriodInWeeks | Integer | no | Fixed period in weeks, i.e. not produced for the next N weeks (overriding Supply Planning fixed period) |
| CycleUtilisationSnapshots | Master Planning Master Planning |
The table contains detailed information about grades/paper machines per SNP period |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ||
| ScenarioId | Identity | no | ||
| SnoItemId | Identity | no | ||
| SourcePropertyValueId | Identity | no | ||
| WorkCentreId | Identity | no | ||
| WorkCentreTypeId | Identity | no | ||
| SourcePeriod | Date | no | ||
| CycleTypeId | Identity | yes | Reference for SNP | |
| SourceCycleTypeId | Identity | yes | ||
| CoProductId | Identity | yes | ||
| OrdersHours | Float | no | Order hours | |
| AllocationHours | Float | no | Allocation hours | |
| OrdersWeight | Float | no | Order weight | |
| AllocationWeight | Float | no | Allocation weight | |
| Rate | Float | yes | Is product replenished somewhere |
| Dashboards | Core Core |
The table stores dashboards defined in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | String | no | Dashboard name | |
| Description | String | no | Dashboard description (title) | |
| OrderNo | Integer | no | Dashboard order no | |
| UserId | Identity | yes | User Id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DashboardWidgets | Core Core |
Widgets placed on dashboards |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DashboardId | Integer | no | Dashboard Id | |
| WidgetId | Integer | no | Widget Id | |
| Top | Integer | no | Top | |
| Left | Integer | no | Left | |
| Height | Integer | no | Height | |
| Width | Integer | no | Width | |
| ZIndex | Integer | no | Z-index | |
| FilterId | Identity | yes | Filter of the widget instance | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DataSourceFields | Reports Reports |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Id |
| DataSourceId | Identity | no | A reference to DataSource table | |
| Name | String | no | Column name | |
| Description | LongestString | no | Column description | |
| Category | LongestString | yes | Column category, used for analysis in summary levels | |
| Expression | LongestString | yes | Expression for field | |
| DataType | String | no | Data type: String, Number, Float, DoubleFloat, Date, Month, Week | |
| EntityType | String | yes | Entity type: PropertyValue, PropertyCode, HierarchyName, HierarchyCode, Regular | |
| OrderNo | Integer | yes | Ordinal number of the column in the report, can be non unique | |
| DefaultFiltered | Integer | no | 0 - this field internal, and user should be able select it. Default system setting. | |
| Filtered | Integer | yes | 1 - this field internal, and user should be able select it. Can be overridden in particular model. Used for hiding some fields. | |
| Helper | String | yes | Helper view or table | |
| HelperColumn | String | yes | Helper column | |
| Partition | HugeString | yes | Partition part | |
| ParentField | String | yes | Parent field for Aggregated fields | |
| Function | String | yes | aggregate function | |
| UnitTypeId | Identity | yes | Unit Type Id | |
| UnitId | Identity | yes | Unit Id for field | |
| CurrencyId | Identity | yes | Currency Id for field | |
| IsCurrency | Integer | no | Currency Id for field | |
| TimeUnitId | Identity | yes | Time Unit Id for field | |
| IsTimeUnit | Integer | yes | Is this field Time Unit | |
| IncludeNullCondition | Integer | no | Currency Id for field | |
| IsCustomField | Integer | no | Is it a system field, or created by a user? | |
| IsMandatory | Integer | no | Is this field mandatory? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DataSourceFilters | Reports Reports |
Report filters |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Id |
| DataSourceId | Identity | no | Data Source identity | |
| ReportFilterId | Identity | no | Filter id | |
| Name | String | no | Filter name | |
| UserId | Identity | no | Filter owner (1 - global filter, otherwise user specific) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DataSources | Reports Reports |
System and user reports |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Id |
| Name | String | no | View name for system and helper datasources, report name for user data sources | |
| Title | LongString | no | Report title | |
| Description | LongestString | no | Report description | |
| Query | Text | no | Original query for system reports or system report name (view name - IV$XXX) | |
| DataSourceQuery | Text | yes | Expanded query | |
| Type | String | no | Report type - system, user, helper | |
| AccessRights | String | yes | sku, endusesku | |
| ReportFilters | HugeString | yes | list of filtered columns | |
| ReportRows | HugeString | yes | Rows | |
| ReportColumns | HugeString | yes | columns | |
| ReportValues | HugeString | yes | Values - field list | |
| ReportFunctions | HugeString | yes | functions for values | |
| ReportOrderBy | HugeString | yes | Values - field list | |
| ReportOrderByFunc | HugeString | yes | functions for values | |
| ParentDataSourceId | Identity | yes | A reference to parent (system) DataSource | |
| IsShowTotalColumns | Integer | no | Is show total for columns? | |
| IsShowTotalRows | Integer | no | Is show total for rows? | |
| IsShowRecordCount | Integer | no | Is show record count in report? | |
| IsColumnsAsRows | Integer | no | Is show total row? | |
| IsFreezeColumns | Integer | no | Is freeze columns? | |
| IsMergeRows | Integer | no | Is merge rows? | |
| IsIncludeUnit | Integer | no | Is include unit in column title | |
| Materialized | Integer | no | Is view materialized | |
| TopX | Integer | no | Show top x entries | |
| TopXField | String | yes | Top X Field | |
| TopXFieldOrder | String | yes | Top X Field | |
| IsIncludeOthersToTop | Integer | no | Is include unit in column title | |
| ReportSubTotalRow | HugeString | yes | Is show subtotal rows and columns? | |
| ReportSubTotalColumn | HugeString | yes | Is show subtotal rows and columns? | |
| ReportType | String | yes | Type of report - simple, pivot, grouped, master-detail (not supported now) | |
| UsedDataSources | LongString | yes | Used datasources | |
| CurrencyDateField | String | yes | Currency date field | |
| UseAsHelper | Integer | no | Used datasources | |
| DefaultFilterId | Identity | yes | Default Filter | |
| IsPublished | Integer | no | Is report published (actual only for user reports) | |
| IsMandatoryFilter | Integer | no | Is filter should be applied for any report execution | |
| UserId | Identity | no | Who is owner of report (userId = 1 is system wide report | |
| IsLocked | Integer | no | Is report locked (actual only for user reports) | |
| AllowProductUnits | Integer | no | Define is allowed use product units for this report. in Report should be present field MaterialId | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DBDictionaries | Core Language |
The table stores localizable words used in the database. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DictionaryKey | LongestString | no | Dictionary key | |
| DictionaryValue | LongestString | yes | Dictionary value | |
| TableRowId | Identity | yes | A reference to table ID (used for localization) | |
| LanguageId | Identity | no | A reference to Languages | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DDQAmendedOrders | Due date quoting Due date quoting |
DDQ amended orders (original orders or newly created orders) are stored in this table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderLineId | Identity | no | A reference OrderLines | |
| HeaderCode | ShortString | yes | Header code (It is equal to inquiry header number) | |
| SetNum | Integer | yes | Number of sets (1 - original orders, 2 - newly created orders) | |
| AmendNum | Identity | yes | Number of amends (0 - amended all lines from book, n - sequence) | |
| CreationSetTime | Date | yes | Set creation time | |
| UseOrder | Integer | yes | A flag: take this order into account when calculating RealInventory? | |
| UseOrderPM | Integer | yes | A flag: take this order into account when calculating free capacity of PM run? | |
| UseOrderFL | Integer | yes | A flag: take this order into account when calculating free capacity of FL run? |
| DDQConsignmentOrders | Due date quoting Due date quoting |
DDQ Consignments orders (Consignment and calloforders) are store in this table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ConsignmentOrderId | Identity | no | Identity of consignment order | |
| CallOfOrderId | Identity | no | Identity of callof order | |
| HeaderCode | ShortString | no | Header code of this query | |
| RequestId | Identity | no | Identity of request |
| DDQFGInventorySourcesData | Due date quoting Temporary table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProductId | Identity | yes | ||
| SkuKey | String | no | ||
| ConsignmentLocationId | Identity | yes | ||
| SiteId | Identity | yes | ||
| WHWorkCentreId | Identity | yes | ||
| WHLocationId | Identity | yes | ||
| Priority | Integer | no | ||
| JourneyId | Identity | yes | ||
| IsMain | Integer | no | ||
| DespatchDate | Date | yes | ||
| DeliveryDate | Date | yes | ||
| HasTransportRoute | Integer | no | ||
| HasOnHandInventory | Integer | no | ||
| HasProjectInventory | Integer | no | ||
| IsValid | Integer | no |
| DDQInquiryMethodTypes | Due date quoting Due date quoting |
The table stores the list of types of DDQ inquiry methods. This is a reference table. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| InquiryMethodName | String | no | Inquiry method name | |
| InquiryMethodCode | ShortString | yes | Inquiry method code (JIT, JITP, ASAP) | |
| Description | String | no | Description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DDQInventoryData | Due date quoting Temporary table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SkuKey | String | no | ||
| DateFrom | Date | no | ||
| Opening | Float | no | ||
| OnHandStock | Float | no | ||
| OrdersIn | Float | no | ||
| OrdersOut | Float | no | ||
| Closing | Float | no | ||
| MinClosing | Float | no | ||
| GlobalMinClosing | Float | no |
| DDQLog | Due date quoting Due date quoting |
The table is used to store DDQ operations log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TaskId | Identity | no | Task ID | |
| RequestCode | ShortString | yes | Request code | |
| LogTimeStamp | Date | no | Log entry time stamp | |
| LogSource | ShortString | yes | Log entry source | |
| LogText | HugeString | yes | Log entry text |
| DDQPossibleQuantityData | Due date quoting Due date quoting |
The table stores the list of DDQ result. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkCentreCode | String | yes | WorkCentreCode | |
| PossibleQuantity | Float | yes | Possible quantity |
| DDQProductionSourcesData | Due date quoting Temporary table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | yes | ||
| StageNo | Identity | no | ||
| OperationTypeId | Identity | yes | ||
| WorkCentreId | Identity | no | ||
| LocationId | Identity | no | ||
| WHWorkCentreId | Identity | yes | ||
| WHLocationId | Identity | yes | ||
| HasRate | Integer | no | ||
| SPPriority | Integer | no | ||
| JourneyId | Identity | yes | ||
| TransportMethodId | Identity | yes | ||
| TRTime | Integer | no | ||
| TRCost | Float | no | ||
| TRPriority | Integer | no | ||
| TotalCapacityOfRuns | Float | no | ||
| LastRunFinishDate | Date | yes |
| DDQRequests | Due date quoting Due date quoting |
The table contains DDQ requests received from External System/SAP. Some parameters are filled by the request parser on the results of incoming DDQ request analysis. Rows are not removed from this table, because requests are used to maintain the history of DDQ operations. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RequestCode | ShortString | no | Request code. It is equal to the request identifier from External System/SAP schedule request | |
| Sender | ShortString | no | Sender code (Client's unique identifier) | |
| HeaderCode | ShortString | yes | Header code. Unique symbolic code of the request.It is generated by External System | |
| OldHeaderCode | ShortString | yes | Old header code | |
| AutoCreate | Integer | yes | A flag: create firm orders automatically? (0-No, 1-Yes). If 1, Orders are created instead of inquiry reservations | |
| LineCode | String | yes | Inquiry line number. Always 0 for a new quote and for complete requote. If a specific line is specified for requote, the line is deleted, and new numbering is started from the last line number + 1 | |
| OldLineCode | String | yes | Inquiry old line number. | |
| LocationCode | String | yes | I-Plan unique customer location code | |
| LocationId | Identity | yes | Unique location ID. A reference to Locations table | |
| MultiLine | Integer | no | A flag: is the request multiline? (0-No, 1-Yes). Reserved for future use | |
| ProductCode | String | yes | Inquiry product code | |
| ProductId | Identity | yes | Unique product ID. A reference to Materials table | |
| EndCustomerCode | String | yes | I-Plan unique end customer location code | |
| EndCustomerId | Identity | yes | Unique location ID. A reference to Locations table | |
| EndUseCode | String | yes | I-Plan unique end use code | |
| EndUseId | Identity | yes | Unique location ID. A reference to enduses table | |
| SiteMaterialUsageId | Identity | yes | Unique SKU ID. A reference SiteMaterialUsages | |
| InhibitProduction | Integer | yes | A flag: is the use of PM runs and SFG inventories inhibited? (0-No, 1-Yes). If inhibitProduction = 0 then full quantity will be searched only at FG inventories | |
| SFGProductCode | String | yes | SFG product code to use. Overrides specific SFG product code, hard constraint | |
| SFGProductId | Identity | yes | Unique SFG product ID to use. A reference to Materials table | |
| RequestDate | Date | yes | The date that customer requested (can be empty) | |
| ValidRequestDate | Date | yes | The date that customer valid requested (can be empty) | |
| LateDays | Integer | yes | Allowed delivery delay time. Maximal delay in days, after which the customer will still accept the order | |
| InquiryMethodCode | ShortString | yes | Inquiry method code (Possible values: JIT, JITP, ASAP) | |
| InquiryMethodId | Identity | yes | Unique inquiry method ID. A reference to DDQInquiryMethodTypes table | |
| OriginalQuantity | Float | yes | Required quantity the original unit of request. | |
| Quantity | Float | yes | The quantity converted to weight of the specified product (this value is affected by the ProductCode field). Quantity is measured in kilogramms. It must not be less or equal to 0 | |
| OriginalUnitName | String | yes | ||
| UnitName | String | yes | ||
| UnitId | Identity | yes | ||
| TransportMethodName | String | yes | Transport method name (A transport code defined in IPlan) | |
| TransportMethodId | Identity | yes | Unique Transport method ID. A reference to TransportMethods table | |
| TypeOfDelivery | ShortString | yes | Type of delivery. Depending on it, the requested date can be: E - ex-mill, A - arrival | |
| ExpiryDate | Date | yes | Reserved for future use | |
| CheckAllocationMethod | ShortString | yes | Reserved for future use | |
| TransportAreaCode | ShortString | yes | Transport area code. Overrides destination transport location. If it is not specified in the request, then the customer location will be used | |
| TransportAreaId | Identity | yes | Unique Transport area ID. A reference to Locations table | |
| SourceWarehouseCode | ShortString | yes | Defines warehouse source. Blank or valid warehouse code | |
| SourceWarehouseId | Identity | yes | Unique warehouse source ID. A reference to WorkCentres table | |
| FixSourceAssignment | String | yes | Specific PM to be used as the material source. The order has to be sourced from a special source (PM). The field can be empty | |
| SourceWorkcentreId | Identity | yes | Specific PM ID. A reference to WorkCentres table | |
| OrderSplit | Integer | yes | A flag: is it allowed to split the order? (0-No, 1-Yes) | |
| SingleSourcing | Integer | yes | A flag: for a split order, is it allowed to source the order from different PMs? (0-No, 1-Yes). | |
| FinishingLock | Integer | yes | Reserved for future use | |
| UseOpportunisticRuns | Integer | yes | A flag: is it allowed to use opportunistic runs? (0-No, 1-Yes). | |
| PartialDelivery | Integer | yes | A flag: is it allowed to generate partial deliveries? (0-No, 1-Yes). | |
| Quality | Integer | yes | A flag: is a special quality required? (0-No, 1-Yes) | |
| StartNotBefore | Date | yes | Start date for the source search. The field can be empty | |
| RequestType | Integer | yes | Request type code (Possible codes: 0-New, 1-Requote, 2-Delete, 3-Resend, 4-Amend) | |
| LoggingLevel | Integer | yes | Logging level (0 - standart level, 255 - developer logging level) | |
| DisregardAllocation | Integer | yes | A flag: disregard allocation? (0-No, 1-Yes) | |
| RequestStatus | ShortString | yes | Status of the request after parsing (Possible values: DISCARD, READY) | |
| SourceTypes | Integer | yes | Allowed source types to use (Possible codes: 0-reserved; 1-FG only; 2-SFG only; 3-SFG and FG; 4-PM only; 5-PM and FG; 6-PM and SFG; 7-PM, SFG and FG) | |
| UseFG | Integer | yes | A flag: is it allowed to use FG inventories? (0-No, 1-Yes) | |
| UseSFG | Integer | yes | A flag: is it allowed to use SFG inventories? (0-No, 1-Yes) | |
| UsePM | Integer | yes | A flag: is it allowed to use PM runs? (0-No, 1-Yes) | |
| InsertDate | Date | yes | When the line was inserted? | |
| JourneyCode | String | yes | Code of journey | |
| JourneyId | Identity | yes | Unique Journey ID. | |
| ConsignmentParameters | ShortString | yes | Is required to indicate if consignment stock should be used, and preferences | |
| ConsignmentLocation | ShortString | yes | Is required to optionally specify a customer’s location code | |
| ConsignmentLocationId | Identity | yes | Unique Consignment Location Id. A reference to Locations table | |
| ReplaceConsignment | ShortString | yes | The value should be 000,100,101,102,110,111,112 | |
| ConsignmentOrder | Integer | no | This indicates that the order will produce consignment inventory | |
| AutoConfirm | Integer | no | A flag: confirm orders automatically? (0-No, 1-Yes). | |
| TimeProcessed | Integer | yes | time processed the request | |
| AllowLateOrders | Integer | no | ||
| UseInventory | Integer | no | ||
| UseProjectedInventory | Integer | no | ||
| UseConsignmenmtInventory | Integer | no | ||
| UseProduction | Integer | no | ||
| ReATPRequired | Integer | yes | ||
| SourcingCategories | LongString | yes | ||
| AlternateProducts | HugeString | yes | ||
| AlternateProductIdList | LongestString | yes | Unique Alternate product ID. A reference to Materials table | |
| AlternateProductSkuIdList | LongestString | yes | Unique Alternate SKU ID. A reference SiteMaterialUsages |
| DDQResponseOperations | Due date quoting Due date quoting |
The table stores DDQ response operations to send to External System/SAP |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ResponseId | Identity | no | A reference to Responses | |
| OperationNumber | Integer | no | Operation number | |
| WorkCentreCode | String | yes | Workcentre code | |
| ReservationCode | ShortString | yes | Reserved for future use | |
| RunEndDate | Date | yes | Run end date | |
| BlockCode | ShortString | yes | Block code | |
| RunCode | LongString | yes | Run code | |
| SFGProductCode | String | yes | SFG product code | |
| Quantity | Float | yes | Quantity | |
| Unit | String | yes | Unit name | |
| InsertDate | Date | no | When the line was inserted? |
| DDQResponseOperationsHistory | Due date quoting Due date quoting |
DDQ response operations sent to External System/SAP |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ResponseId | Identity | no | Response ID | |
| OperationNumber | Integer | no | Operation number | |
| WorkCentreCode | String | yes | Workcentre code | |
| ReservationCode | ShortString | yes | Reserved for future use | |
| RunEndDate | Date | yes | Run end date | |
| BlockCode | ShortString | yes | Block code | |
| RunCode | LongString | yes | Run code | |
| SFGProductCode | String | yes | SFG product code | |
| Quantity | Float | yes | Quantity | |
| Unit | String | yes | Unit name | |
| InsertDate | Date | no | When the line was inserted? |
| DDQResponses | Due date quoting Due date quoting |
The table stores DDQ responses to send to External System/SAP |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RequestId | Identity | no | A reference to Requests table | |
| RequestCode | ShortString | no | Request code | |
| Recipient | ShortString | no | Recipient code | |
| HeaderCode | ShortString | yes | Header code | |
| LineCode | String | yes | Line code | |
| SolutionNumber | Integer | yes | Solution number | |
| Status | ShortString | yes | Status code (Possible codes: Confirmed, Infomation, Reserved) | |
| DeliveryDate | Date | yes | Delivery date | |
| DispatchDate | Date | yes | Dispatch date | |
| Quantity | Float | yes | Quantity | |
| Unit | String | yes | Unit name | |
| Weight | Float | yes | Weight | |
| ProductCode | String | yes | Product code | |
| WareHouseCode | String | yes | Warehouse code | |
| InitialPaperMachine | String | yes | Source PM code | |
| ReturnStatus | ShortString | yes | Return status code (Possible values: Success, Failure) | |
| ReturnCode | ShortString | yes | Return code | |
| ExpiredDate | Date | yes | Reserved for future use | |
| JourneyCode | String | yes | Code of Journey | |
| TransportMethodCode | String | yes | Code of TransportMethod | |
| ConsignmentLocation | ShortString | yes | To indicate the consignment location code, if consignment stock is used by the search | |
| OnHandStock | Integer | no | OnHandStock | |
| OrderType | ShortString | yes | OrderType | |
| InsertDate | Date | no | When the line was inserted? |
| DDQResponsesHistory | Due date quoting Due date quoting |
The table stores DDQ responses sent to External System/SAP |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RequestId | Identity | no | A reference to Requests | |
| RequestCode | ShortString | no | Request code | |
| Recipient | ShortString | no | Sender code | |
| HeaderCode | ShortString | yes | Header code | |
| LineCode | String | yes | Line code | |
| SolutionNumber | Integer | yes | Solution number | |
| Status | ShortString | yes | Status (Confirmed, Infomation, Reserved) | |
| DeliveryDate | Date | yes | Delivery date | |
| DispatchDate | Date | yes | Despatch date | |
| Quantity | Float | yes | Quantity | |
| Unit | String | yes | Unit name | |
| Weight | Float | yes | Weight | |
| ProductCode | String | yes | Product code | |
| WareHouseCode | String | yes | Warehouse code | |
| InitialPaperMachine | String | yes | PM code | |
| ReturnStatus | ShortString | yes | Return status (Success, Failure) | |
| ReturnCode | ShortString | yes | Return code | |
| ExpiredDate | Date | yes | Reserved for future use | |
| JourneyCode | String | yes | Journey code | |
| TransportMethodCode | String | yes | Code of TransportMethod | |
| ConsignmentLocation | ShortString | yes | To indicate the consignment location code, if consignment stock is used by the search | |
| OnHandStock | Integer | no | OnHandStock | |
| OrderType | ShortString | yes | OrderType | |
| InsertDate | Date | no | When the line was inserted? |
| DDQResultCodes | Due date quoting Due date quoting |
The table stores the list of codes of DDQ result. This is a reference table. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Code | ShortString | no | Result code | |
| Name | LongString | no | Result name | |
| Description | LongestString | no | Result description | |
| SubDesc | LongString | yes | Sub Description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DDQResultData | Due date quoting Temporary table |
The table stores intermediate data of the the ASAP Evaluation process |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| SourceWorkCentreId | Identity | yes | A reference to the paper machine | |
| FGQuantity | Float | yes | Found FG quantity | |
| FLQuantity | Float | yes | Found FL quantity | |
| DeliveryDate | Date | yes | Delivery date to the destination area | |
| WarehouseId | Identity | yes | A reference to the warehouse | |
| SFGWarehouseId | Identity | yes | A reference to the SFG Warehouse | |
| SFGMaterialId | Identity | yes | A reference to the SFG Material | |
| PMMaterialRunId | Identity | yes | A reference to the PM material run |
| DDQRunsData | Due date quoting Temporary table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| StageNo | Identity | no | ||
| OperationTypeId | Identity | no | ||
| SiteId | Identity | yes | ||
| WorkCentreId | Identity | no | ||
| MaterialRunId | Identity | yes | ||
| RunCode | LongString | no | ||
| BlockRunCode | LongString | yes | ||
| Capacity | Float | no | ||
| Duration | Float | no | ||
| FreeCapacity | Float | no | ||
| FreeDuration | Float | no | ||
| RestoreCapacity | Float | no | ||
| RestoreDuration | Float | no | ||
| Rate | Float | yes | ||
| StartDate | Date | no | ||
| FinishDate | Date | no | ||
| Used | Float | no | ||
| OrderOperationId | Identity | yes |
| DDQSiteData | Due date quoting Temporary table |
The table contains information about available sites (used for Single Stage branch) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | no | A reference to the site | |
| DeliveryDate | Date | yes | Delivery date to the destination area | |
| DespatchDate | Date | yes | Despatch date from the FG Warehouse | |
| TransportMethodId | Identity | no | A reference to the transport method | |
| TransportRouteId | Identity | no | A reference to the transport route | |
| WarehouseId | Identity | no | A reference to the FG warehouse | |
| LocationId | Identity | no | A reference to the location of the FG Warehouse | |
| JourneyId | Identity | yes | A reference to the Journey |
| DDQSitesData | Due date quoting Temporary table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | yes | ||
| WHLocationId | Identity | no | ||
| WHWorkCentreId | Identity | no | ||
| IsMain | Integer | no | ||
| JourneyId | Identity | yes | ||
| DeliveryDate | Date | yes | ||
| DespatchDate | Date | yes |
| DDQSiteSourceData | Due date quoting Temporary table |
The table stores the list of available sites for the DDQ Request It is filled when starting the request, and is cleared when the request finished |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | no | Site ID | |
| LastFLDate | Date | yes | The date of the last FL run | |
| TransportRouteId | Identity | yes | Transport route ID | |
| TransportPeriod | Integer | yes | Transport time, days | |
| FinishingWarehouseId | Identity | yes | Finishing warehouse ID on the site | |
| JourneyId | Identity | yes | Journey ID for this site | |
| TransportCost | Float | yes | Full transport cost with consideration the journey and last transport route | |
| LastWHLocationIdOfJourney | Identity | yes | Last location id of FG Warehouse of Journey |
| DDQSourceData | Due date quoting Temporary table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| StageNo | Identity | no | ||
| OperationTypeId | Identity | no | ||
| WorkCentreTypeId | Identity | no | ||
| SiteId | Identity | yes | ||
| WorkCentreId | Identity | no | ||
| WCLocationId | Identity | no | ||
| IsFirstStage | Integer | no | ||
| IsLastStage | Integer | no | ||
| WHLocationId | Identity | yes | ||
| JourneyId | Identity | yes | ||
| TransportMethodId | Identity | yes | ||
| DespatchDate | Date | yes | ||
| DeliveryDate | Date | yes | ||
| IsLocked | Integer | no | ||
| Loss | Float | no | ||
| TotalCost | Float | no | ||
| HandlingDelay | Float | no | ||
| Multiplier | Float | no | ||
| Divider | Float | no | ||
| CreateOrder | Integer | no | ||
| OrderQuantity | Float | no | ||
| LastRunDate | Date | yes | ||
| Allocation | Float | no |
| DDQSourcePrioritiesData | Due date quoting Temporary table |
From which workcentres SKU warehause will be replenished. It depends from Priority |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | Destination SiteMaterialUsage identity | |
| WorkCentreId | Identity | no | A reference to Workcentres | |
| Priority | Integer | no | Source priority (1, 2, empty, 0) | |
| Portion | Integer | no | Percent of the source use, along with other sources of the given SKU |
| DDQSplittedOrders | Due date quoting Due date quoting |
DDQ splited orders (production and customers orders) are stored in this table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| CustomerOrderId | Identity | no | Identity of customer order | |
| ProductionOrderId | Identity | no | Identity of production order |
| DDQTasks | Due date quoting Due date quoting |
The table contains the list of DDQ inquiries accepted for processing. As soon as a DDQ inquiry is accepted, the corresponding task is created here |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Started | TimeStamp | no | Task start timestamp | |
| Finished | TimeStamp | yes | Task finish timestamp | |
| Status | Identity | no | Status | |
| RequestId | Identity | yes | Request ID | |
| RequestCode | ShortString | yes | Request code | |
| LogLevel | Identity | no | Logging level | |
| LogId | Identity | yes | Log ID | |
| UserId | Identity | no | User ID |
| DDQTimeStamps | Due date quoting Temporary table |
The table contains time stamps of program part runs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TSValue | String | no | Duration of the part (TimeStamp format) | |
| TSName | String | no | Name of the part |
| DDQUnConfirmedOrders | Due date quoting Due date quoting |
DDQ unconfirmed orders are stored in this table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderLineId | Identity | no | A reference OrderLines | |
| HeaderCode | ShortString | yes | Header code (It is equal to inquiry header number) | |
| LineCode | ShortString | yes | Line code (It is equal to inquiry line number) | |
| CreationSetTime | Date | yes | Set creation time | |
| ExpiryDate | Date | yes | Expiry Date |
| DDQWarehouseSourcesData | Due date quoting Temporary table |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | yes | ||
| WorkCentreId | Identity | no | ||
| LocationId | Identity | no | ||
| IsMain | Integer | no | ||
| JourneyId | Identity | yes | ||
| TransportMethodId | Identity | yes | ||
| DespatchDate | Date | yes | ||
| DeliveryDate | Date | yes | ||
| TRTime | Integer | no | ||
| TRCost | Float | no | ||
| TRPriority | Integer | no | ||
| SPPriority | Integer | no |
| DeletedRuns | Block Scheduling Block Scheduling |
The table stores information about deleted runs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Run Identity |
| MaterialBlockId | Identity | yes | no | Run Identity |
| BlockCode | LongString | no | Run code | |
| RunCode | LongString | no | Run code | |
| NominalCapacity | Float | no | Run capacity | |
| Quantity | Float | no | Run capacity | |
| WasteTime | Float | yes | Time waste | |
| ProcessRate | Float | yes | Production rate of the run | |
| StartDate | Date | no | Run start date | |
| FinishDate | Date | no | Run end date | |
| TargetStartDate | Date | yes | Run target start date | |
| InitialDuration | Float | no | Initial duration and real run duration, including changeover | |
| SwitchoverDuration | Float | yes | Changeover duration. This duration is a part or run duration | |
| QuantityComplete | Float | no | Cumulative run quantity produced on the productionUpdateTimestamp | |
| ProductionUpdateTimestamp | Date | yes | Date of production update (timestamp) | |
| MaterialRunStatusId | Identity | no | A reference to MaterialRunStatuses | |
| WorkcentreId | Identity | no | A reference to Workcentres.Id | |
| RunType | String | yes | Run type: production, floating shut or opportunistic run | |
| IsFixed | Integer | no | Indicator that required recalculation for order line dates. Used during Fine Planning update | |
| IsSent | Integer | no | ||
| SendTimestamp | Date | yes | Date of send (timestamp) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Deliveries | Replenishment Replenishment |
The table stores the list of delivery dates (i.e. when items will be delivered) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DeliveryCode | String | no | Delivery code | |
| ShipDate | Date | no | The date when the item was (or will be) shipped | |
| DueDate | Date | yes | The date when the item is due to get to the destination | |
| ReceivedDate | Date | no | The date when the item arrived to the destination | |
| OriginalWeight | Float | no | Delivery original weight | |
| Weight | Float | no | Delivery weight - can be changed by separatedDeliveries | |
| SourceWeight | Float | no | Delivery source weight | |
| SourceCoef | Float | no | Weight / Source Weight coeficient | |
| OrderLineId | Identity | no | Order line identification number | |
| OrderBookDeliveryId | Identity | yes | Order book delivery identification number | |
| SiteMaterialUsageId | Identity | no | SKU | |
| SourceSiteMaterialUsageId | Identity | yes | Source SKU | |
| ToConsignmentLocationId | Identity | yes | for consignment orders, this indicates the consignment location that the order will be stored for at the destination location | |
| FromConsignmentLocationId | Identity | yes | for call off orders, this indicates the consignment location that the stock is being sourced from | |
| DeliveryStatusId | Identity | no | Delivery status identifier | |
| SkuKey | String | no | Destination SKU Code - SKU-CS. | |
| SourceSkuKey | String | yes | FROM SKU Code - SourceSKU-CS. | |
| StockSkuKey | String | yes | FROM SKU Code - SourceSKU-CS. From order line stock location | |
| AlternativeKey | String | yes | Alternative Key | |
| reATPOrderCode | String | yes | reATP Order Code | |
| reATPOrderLine | String | yes | reATP Order Line | |
| reATPOrderLineId | Identity | yes | reATP Order Line Identity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DeliveryStatuses | Replenishment Replenishment |
The table stores the list of possible statuses of delivery processes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DeliveryStatusName | ShortString | no | Delivery status name | |
| DeliveryStatusDesc | String | no | Delivery status description | |
| DeliveryStatusCode | String | yes | Delivery status code | |
| Abbreviation | ShortString | yes | Delivery status abbreviation | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DerivedCharacteristicRules | Core Core |
The table stores forecast method rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ReportFilterId | Identity | yes | Filter Id | |
| DerivedCharacteristicId | Identity | no | Derived characteristic identity | |
| RuleWeighting | Integer | no | Rule Weighting | |
| CharacteristicValue | LongString | no | Value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| DerivedCharacteristics | Core Core |
The table stores the list of derived characteristics. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CharacteristicName | String | no | Property name | |
| HierarchyLevelNo | Integer | no | Property name | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Dictionaries | Core Language |
The table stores the dictionary of localizable words. It is used when localizing grids, captions, filters and other interface elements |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DictionaryKey | LongestString | no | Dictionary key | |
| DictionaryValue | LongestString | no | Dictionary value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| EndUseDetails | Core Core |
The table stores end use hashes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| EndUseId | Identity | no | EndUse Id | |
| EndUseBits | String | no | PropertyBits settings | |
| EndUseHash | RawHash | no | PropertyBits settings |
| EndUseProperties | Core Core |
The table stores the list of properties registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PropertyName | String | no | Property name | |
| HierarchyLevelNo | Integer | no | Property name | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| EndUses | Core Core |
The table stores the list of properties registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| EndUseCode | String | no | Property name | |
| EndUseDescription | String | no | Property code | |
| EndUseProperties | LongestString | yes | EndUse properties | |
| Property1 | String | yes | Property | |
| Property2 | String | yes | Property | |
| Property3 | String | yes | Property | |
| Property4 | String | yes | Property | |
| Property5 | String | yes | Property | |
| Property6 | String | yes | Property | |
| Property7 | String | yes | Property | |
| Property8 | String | yes | Property | |
| Property9 | String | yes | Property | |
| Property10 | String | yes | Property | |
| Property11 | String | yes | Property | |
| Property12 | String | yes | Property | |
| Property13 | String | yes | Property | |
| Property14 | String | yes | Property | |
| Property15 | String | yes | Property | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| EntitiesForExternalSystem | Replenishment Replenishment |
Store entity identifiers for sending into another external system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| EntityId | Identity | no | Original entity identity | |
| TargetSystem | String | no | Target system | |
| EntityType | String | no | Entity type | |
| TimeStamp | TimeStamp | no | When record added | |
| IsSent | Integer | no | Is order line sent |
| EventLogs | Core Logging |
The table stores the log of events occured in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateAppearence | Date | no | The date when the event occured | |
| Tier | ShortString | yes | Event level code. Possible values: com+, db | |
| DescriptionForDeveloper | HugeString | yes | Extented event description | |
| FormattedDescription | LongestString | yes | Procedure or com+ method where the event detected | |
| EventMessageId | Identity | no | A reference to the standard message | |
| UserId | Identity | no | User ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| EventMessages | Core Logging |
Event patterns for creation events in event log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| EventName | String | no | Event name | |
| EventDescription | LongestString | no | Event description | |
| EventTypeId | Identity | no | Event type reference | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| EventTypes | Core Reference |
The table stores the list of event types that can be registered in the event log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| EventTypeName | String | no | Event type name. Possible values: FatalError, Error, Warning, Message, etc. | |
| EventLevel | Integer | no | Event level | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ExchangeRates | Core Core |
The table stores the list of exchange rates registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CurrencyId | Identity | no | This is the currency to convert to from the system's base currency | |
| EffectiveDate | Date | no | Date that the exchange rate becomes effective | |
| Multiplier | DoubleFloat | no | The value to multiply the base currency by to convert to the specified currency. Can be used in conjunction with divider to specify the rate as a fraction | |
| Divider | DoubleFloat | no | Used with the multiplier to calculate the rate to convert from the base currency to the specified currency. Not usually required (hence defaults to 1), but useful if the exchange rate is a very low value to avoid rounding errors, eg the old Turkish lira was over 1,000,000 to the GBP | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ExcludedPropertiesFromSA | Master Planning Allocations |
Table of material property values that are excluded from Supply Planning (SNP). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PropertyId | Identity | no | Property ID (reference to Properties) | |
| Value | String | no | Property value |
| ExpandedExchangeRates | Core Core |
The table stores the list of exchange rates registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| CurrencyId | Identity | no | This is the currency to convert to from the system's base currency | |
| DateFrom | Date | no | Date that the exchange rate becomes effective | |
| DateTo | Date | no | Date that the exchange rate becomes effective | |
| Multiplier | DoubleFloat | no | The value to multiply the base currency by to convert to the specified currency. Can be used in conjunction with divider to specify the rate as a fraction | |
| Divider | DoubleFloat | no | Used with the multiplier to calculate the rate to convert from the base currency to the specified currency. Not usually required (hence defaults to 1), but useful if the exchange rate is a very low value to avoid rounding errors, eg the old Turkish lira was over 1,000,000 to the GBP |
| ExpandedHierarchies | Core Core |
The table describes relations between other hierarchies and their locations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| HierarchyId | Identity | no | Hierarchy identity | |
| ParentHierarchyId | Identity | no | Parent hierarchy identity | |
| HierarchyLevelId | Identity | no | Hierarchy level identity |
| ExpandedHierarchiesSpec | Core Core |
The table stores hierarchies (specifications) in unfolded form |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| HierarchyId | Identity | no | hierarchy identity | |
| HierarchyName1 | String | yes | Hierarchy Name | |
| HierarchyName2 | String | yes | Hierarchy Name | |
| HierarchyName3 | String | yes | Hierarchy Name | |
| HierarchyName4 | String | yes | Hierarchy Name | |
| HierarchyName5 | String | yes | Hierarchy Name | |
| HierarchyName6 | String | yes | Hierarchy Name | |
| HierarchyName7 | String | yes | Hierarchy Name | |
| HierarchyName8 | String | yes | Hierarchy Name | |
| HierarchyName9 | String | yes | Hierarchy Name | |
| HierarchyName10 | String | yes | Hierarchy Name | |
| HierarchyName11 | String | yes | Hierarchy Name | |
| HierarchyName12 | String | yes | Hierarchy Name | |
| HierarchyName13 | String | yes | Hierarchy Name | |
| HierarchyName14 | String | yes | Hierarchy Name | |
| HierarchyName15 | String | yes | Hierarchy Name | |
| HierarchyCode1 | ShortString | yes | Hierarchy Code | |
| HierarchyCode2 | ShortString | yes | Hierarchy Code | |
| HierarchyCode3 | ShortString | yes | Hierarchy Code | |
| HierarchyCode4 | ShortString | yes | Hierarchy Code | |
| HierarchyCode5 | ShortString | yes | Hierarchy Code | |
| HierarchyCode6 | ShortString | yes | Hierarchy Code | |
| HierarchyCode7 | ShortString | yes | Hierarchy Code | |
| HierarchyCode8 | ShortString | yes | Hierarchy Code | |
| HierarchyCode9 | ShortString | yes | Hierarchy Code | |
| HierarchyCode10 | ShortString | yes | Hierarchy Code | |
| HierarchyCode11 | ShortString | yes | Hierarchy Code | |
| HierarchyCode12 | ShortString | yes | Hierarchy Code | |
| HierarchyCode13 | ShortString | yes | Hierarchy Code | |
| HierarchyCode14 | ShortString | yes | Hierarchy Code | |
| HierarchyCode15 | ShortString | yes | Hierarchy Code |
| ExpandedLocations | Core Core |
The table describes relations between hierarchies and their locations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| HierarchyId | Identity | no | Hierarchy node ID | |
| LocationId | Identity | no | Location ID |
| ExpandedLocationsSpec | Core Core |
The table describes relations between locations and their hierarchies |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| LocationId | Identity | no | Location identity | |
| LocationName | LongString | no | Location name | |
| LocationCode | ShortString | no | Location code | |
| HierarchyName1 | String | yes | Hierarchy Name | |
| HierarchyName2 | String | yes | Hierarchy Name | |
| HierarchyName3 | String | yes | Hierarchy Name | |
| HierarchyName4 | String | yes | Hierarchy Name | |
| HierarchyName5 | String | yes | Hierarchy Name | |
| HierarchyName6 | String | yes | Hierarchy Name | |
| HierarchyName7 | String | yes | Hierarchy Name | |
| HierarchyName8 | String | yes | Hierarchy Name | |
| HierarchyName9 | String | yes | Hierarchy Name | |
| HierarchyName10 | String | yes | Hierarchy Name | |
| HierarchyName11 | String | yes | Hierarchy Name | |
| HierarchyName12 | String | yes | Hierarchy Name | |
| HierarchyName13 | String | yes | Hierarchy Name | |
| HierarchyName14 | String | yes | Hierarchy Name | |
| HierarchyName15 | String | yes | Hierarchy Name | |
| HierarchyCode1 | ShortString | yes | Hierarchy Code | |
| HierarchyCode2 | ShortString | yes | Hierarchy Code | |
| HierarchyCode3 | ShortString | yes | Hierarchy Code | |
| HierarchyCode4 | ShortString | yes | Hierarchy Code | |
| HierarchyCode5 | ShortString | yes | Hierarchy Code | |
| HierarchyCode6 | ShortString | yes | Hierarchy Code | |
| HierarchyCode7 | ShortString | yes | Hierarchy Code | |
| HierarchyCode8 | ShortString | yes | Hierarchy Code | |
| HierarchyCode9 | ShortString | yes | Hierarchy Code | |
| HierarchyCode10 | ShortString | yes | Hierarchy Code | |
| HierarchyCode11 | ShortString | yes | Hierarchy Code | |
| HierarchyCode12 | ShortString | yes | Hierarchy Code | |
| HierarchyCode13 | ShortString | yes | Hierarchy Code | |
| HierarchyCode14 | ShortString | yes | Hierarchy Code | |
| HierarchyCode15 | ShortString | yes | Hierarchy Code |
| ExpandedMasterRouteSnapshots | Master Planning Master Planning |
The table contains expanded master routes information for SNP user scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | yes | no | Mater Route Id |
| Cost | DoubleFloat | no | Cost | |
| MinCapacity | Float | no | Min. Capacity, quantity per full SNP time period. 0 means no limitation | |
| MaxCapacity | Float | no | Max. Capacity, quantity per full SNP time period. 0 means no limitation | |
| TimePeriod | Integer | no | timeperiod in days | |
| FromSiteId | Identity | no | Source site ID (reference to site id) | |
| LocationId | Identity | no | Destination Location ID | |
| MaterialTypeId | Identity | yes | Product type Id | |
| Type | String | yes | Master route type |
| ExpandedMaterials | Core Core |
The table describes relations between materials and their properties |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PropertyValueId | Identity | no | A reference to PropertyValues | |
| MaterialId | Identity | yes | A reference to Materials |
| ExpandedNominalCosts | Forecasting Forecasting |
The table stores monthly forecasts for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Day from | |
| DateTo | Date | no | Day toMonth | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| Cost | DoubleFloat | no | Cost for SKU | |
| CurrencyId | Identity | yes | A reference to the corresponding currencies | |
| NominalCostRuleId | Identity | no | A reference to the corresponding currencies | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ExpandedPrices | Forecasting Forecasting |
The table stores prices from price rules for each SKU |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Day from | |
| DateTo | Date | no | Day toMonth | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| Price | Float | no | Price for SKU | |
| CurrencyId | Identity | yes | A reference to the corresponding currencies | |
| PriceRuleId | Identity | yes | A reference to the corresponding pricerules | |
| Note | String | yes | ||
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ExpandedPropertyValues | Core Core |
The table stores property values in unfolded form |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PropertyValueId | Identity | no | A reference to PropertyValues | |
| ParentPropertyValueId | Identity | no | Identity of the parent property value | |
| PropertyId | Identity | no | A reference to Properties |
| ExpandedSKUNominalCosts | Core Core |
The table store combination sku/nominalcost rules for faster nominalcost updates with system where used non-sku-based nominalcosts |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| NominalCostRuleId | Identity | no | NominalCost rule Id | |
| DateFrom | Date | no | Day from | |
| Cost | DoubleFloat | no | Cost for SKU | |
| Priority | Integer | no | Cost for SKU | |
| CurrencyId | Identity | no | A reference to the corresponding currencies | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ExpandedSKUPrices | Forecasting Forecasting |
The table store combination sku/price rules for faster price updates with system where used non-sku-based prices |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| PriceRuleId | Identity | no | Price rule Id | |
| DateFrom | Date | no | Day from | |
| Price | Float | no | Price for SKU | |
| Priority | Integer | no | Price for SKU | |
| CurrencyId | Identity | no | A reference to the corresponding currencies | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ExternalAllocationSnapshots | Scenario Analysis Scenario Analysis Results |
Table to hold snapshot of allocations assigned to External Suppliers (aka External Fixed Sources) per SNP scenario. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| Id | Identity | no | SNP Item Id | |
| MaterialId | Identity | no | SNP Item Id | |
| SiteMaterialUsageId | Identity | no | SKU Id | |
| FixedSourceId | Identity | no | Fixed source Id (external supplier) | |
| DeliveryDate | Date | no | Demand date | |
| SourceDate | Date | no | Sourcing date | |
| SiteId | Identity | no | Site ID (A reference to Sites) | |
| WorkCentreId | Identity | yes | Workcentre ID (A reference to Workcentres) | |
| MasterRouteId | Identity | yes | Master route ID(A reference to MasterRoutes) | |
| Allocation | Float | no | Allocation value on the external source | |
| Price | Float | no | Revenue | |
| Revenue | Float | no | Revenue | |
| ProductionCost | Float | no | ProductionCost | |
| TransportCost | Float | no | TransportCost | |
| Margin | Float | no | Margin |
| ExternalFixedSources | Master Planning Reference Data |
The table stores External Suppliers information (aka External Fixed Sources) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| WorkCentreId | Identity | no | External supplier | |
| DateFrom | Date | no | Start Period | |
| DateTo | Date | yes | End Period | |
| Capacity | Float | no | Available capacity per period type | |
| PeriodType | String | no | Period type: week or month | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ExternalSupplierContractPeriods | Master Planning Reference Data |
The table stores normalized minimum and maximum quantities for generated contract periods. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ExternalSupplierContractId | Identity | no | External supplier contract | |
| DateFrom | Date | no | Period start date | |
| DateTo | Date | no | Period end date | |
| MinimumQuantity | Float | no | Minimum quantity in the default weight unit | |
| MaximumQuantity | Float | no | Maximum quantity in the default weight unit | |
| IsUserOverride | Integer | no | Flag: period quantities were explicitly overridden | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ExternalSupplierContractProducts | Master Planning Reference Data |
The table stores product characteristics and contract-specific normalized costs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ExternalSupplierContractId | Identity | no | External supplier contract | |
| DetailId | Identity | no | Product characteristics. A reference to HierarchyPropertyDetails. | |
| Cost | Float | no | Cost in default currency per default weight unit | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ExternalSupplierContracts | Master Planning Reference Data |
The table stores contracts for external supplier workcentres. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ContractName | String | no | Contract name | |
| WorkCentreId | Identity | no | External supplier workcentre | |
| DateFrom | Date | no | Agreement start date | |
| DateTo | Date | no | Agreement end date | |
| Quantity | Float | no | Total agreement quantity in the default weight unit | |
| PeriodType | String | no | Period type: week or month | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ExternalTrends | Forecasting Forecasting |
The table stores forecast patterns/trends for second pass rule for particular SKU |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SecondPassRuleId | Identity | yes | Second pass rule | |
| ForecastMethodRuleId | Identity | yes | Forecast method rule | |
| ForecastSampleMethodId | Identity | yes | Forecast sample method | |
| ForecastPatternId | Identity | no | Forecast pattern Identity | |
| ForecastPatternDate | Date | yes | Forecast pattern start date | |
| PatternPositionNo | Identity | yes | Pattern position | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| FavoritePages | Core Access rights |
The table stores the list of I-Plan Favorite pages |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| UserId | Identity | no | User Id (A reference to Users). | |
| PageId | Identity | no | Page Id (A reference to Pages). | |
| OrderNo | Integer | no | Order number. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| FilterBasedRules | Reference Reference |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Rule Id | |
| FilterType | String | no | Rule Type | |
| FilterColumns | LongestString | yes | Filter fields with delimiters | |
| FilterValues | LongestString | yes | Filter Values with delimiter | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| FilteredOrderLines | Replenishment Temporary |
List of orders for several pages |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User id | |
| OrderLineId | Identity | yes | Reference to OrderLines table | |
| Direction | String | no | Incoming/Outgoing | |
| MaterialCode | String | no | Material code | |
| Destination | String | no | Location code | |
| Source | String | no | Workcentre name | |
| OrderNo | Identity | no | Row number for grids |
| FilterEntries | Reports Reports |
Filter entries |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Report filter identity | |
| FieldName | String | no | Field name | |
| Operation | String | no | Operation | |
| Value | HugeString | yes | Value | |
| SecondValue | HugeString | yes | Second value for between operation |
| FilterHistories | Core Configuration |
The table contains the list select columns (Summary levels) for grids |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| TaskName | String | no | Grid Id | |
| ReportFilterid | Identity | no | Report filter | |
| IsLast | Integer | no | Is last created | |
| InsertDate | Date | no | Is last created | |
| InsertUserId | Identity | no | Is last created |
| FittedHistories | Forecasting Forecasting |
The table stores fitted history after forecast generation |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | SKU (A reference to SiteMaterialUsages) | |
| DateFrom | Date | no | Date | |
| Weight | Float | no | Weight | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| FixedSourceSnapshots | Scenario Analysis Reference Data |
The table stores a snapshot of External Suppliers information (aka External Fixed Sources) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Id | |
| ScenarioId | Identity | no | Id | |
| Id | Identity | yes | no | Identity |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| WorkCentreId | Identity | no | External supplier | |
| DateFrom | Date | no | Start period | |
| DateTo | Date | yes | End period | |
| Capacity | Float | no | Available capacity per period type | |
| PeriodType | String | no | Period type: week or month |
| FLforPMData | Due date quoting Temporary table |
The table stores the list of FL machines associated with paper machines. The table is filled when searching FL runs by the ddq.getPMForInquiryMethod procedure. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| FLId | Identity | no | A reference to the FL machine | |
| PMId | Identity | yes | A reference to the paper machine | |
| PMCode | String | yes | Paper machine code | |
| SiteId | Identity | yes | Reference to the site |
| ForecastBodies | Forecasting Forecasting |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Month | |
| ForecastId | Identity | no | A reference to the corresponding forecast | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| OriginalSystem | Float | no | Original forecast value generated by system (by first pass forecast generation) | |
| System | Float | no | Forecast value generated by system | |
| Customer | Float | no | Forecast value edited by customer | |
| Final | Float | no | Final forecast value | |
| ForecastAllocation | Float | no | Forecast allocation) | |
| IsWorking | Integer | no | A switch. Possible values: 0 - forecast state unchanged, or the forecast released; 1 - the forecast has been carried from the previous forecast, 2 - the forecast has been modified (edited) ) | |
| EditGroupId | Identity | yes | forecast changes id | |
| EditGroupFinalId | Identity | yes | forecast changes id | |
| OriginalEditGroupId | Identity | yes | original forecast final change id | |
| WeeklyEdited | Integer | yes | A flag that value was edited on weekly level | |
| Upper | Float | yes | Upper percentile generated by ForecastPro | |
| Lower | Float | yes | Lower percentile generated by ForecastPro | |
| OriginalUpper | Float | yes | Upper percentile generated by ForecastPro | |
| OriginalLower | Float | yes | Lower percentile generated by ForecastPro | |
| SystemPriceCurrencyId | Identity | no | Price Currency Id for system price | |
| PriceCurrencyId | Identity | no | Price Currency Id for forecasted price | |
| SystemPrice | Float | no | System Price | |
| ForecastedPrice | Float | no | Forecasted Price | |
| CostCurrencyId | Identity | no | Cost Currency Id | |
| NominalCost | DoubleFloat | no | Nominal Cost | |
| NominalCostAdjustment | Float | no | Nominal Cost adjustment | |
| ValueAddAdjustment | Float | no | Value Add adjustment | |
| SafetyStock | Float | yes | Safety Stock generated by ForecastPro | |
| SystemWeeklyCoefId | Identity | yes | System weekly coef id | |
| CustomerWeeklyCoefId | Identity | yes | System weekly coef id | |
| FinalWeeklyCoefId | Identity | yes | System weekyl coef id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastBodySnapshots | Scenario Analysis Input Data |
The table contains snapshots of forecasts used for SNP optimisation. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SnapshotState | Identity | no | State code: 0 - baseline; 1 - current | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| DateFrom | Date | no | Week | |
| System | Float | no | The value of the forecast at the moment when the session was created | |
| Customer | Float | no | Forecast value modified by user during the SNP session | |
| Id | Identity | no | SNP Item ID (A reference to SnoItems) | |
| SiteMaterialUsageId | Identity | no | SKU ID (A reference to Sitematerialusages) | |
| MaterialId | Identity | no | Materials Id of the SKU. Used for performance purposes. | |
| IsWorking | Integer | yes | A flag (2 - customer value has been edited, 0 - unchanged | |
| IsIgnore | Integer | no | used For SNPExclusionPeriod | |
| IsOrder | Integer | yes | A flag have this sku order or have not | |
| Price | Float | yes | The price of this item in base currency units |
| ForecastChangeDetails | Forecasting Forecasting |
The table stores detailed set of property values for each edit action |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ForecastChangeId | Identity | no | Edit action ID (A reference to ForecastChanges table) | |
| FieldName | String | no | Property ID (A reference to Properties) | |
| Value | String | yes | Property value | |
| Operation | String | no | Comparison operation |
| ForecastChanges | Forecasting Forecasting |
The table stores the list of forecast changes and comments |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Date of the change (month or week) | |
| PeriodRange | String | no | Period range - Week or Month | |
| ReasonId | Identity | yes | A reference to Reasons | |
| Operation | String | no | A reference to ForecastOperations | |
| ForecastId | Identity | yes | System forecast (A reference to Forecasts) | |
| ForecastSnapshotId | Identity | yes | System forecast (A reference to Forecasts) | |
| UnitId | Identity | yes | The unit on which the edit has been made (A reference to Units) | |
| CurrencyId | Identity | yes | The currency for price changes | |
| ForecastStatusId | Identity | no | Forecast status | |
| IsDisplayComment | Identity | no | A flag: is this record a forecast comment? | |
| InitValue | Float | no | Forecast value before modification | |
| LastValue | Float | no | Forecast value after modification | |
| ForecastComment | HugeString | yes | Forecast comment | |
| CommentLink | HugeString | yes | Complex link to this comment from matrix or collaboration screen | |
| SQLFilter | Text | yes | It's a result of ip.getAccessRightSqlQuery | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastChangeSku | Forecasting Forecasting |
The table stores detailed set of property values for each edit action |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ForecastChangeId | Identity | no | Forecast Change Id | |
| SiteMaterialUsageId | Identity | no | Sku Identity | |
| IsActive | Integer | no | Is active to take into consideration in carrying forecast |
| ForecastCollaborationData | Forecasting Forecasting |
A temporary table for forecast collaboration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| DateFrom | Date | yes | date | |
| System | Float | no | ||
| Customer | Float | no | ||
| Final | Float | no | ||
| Orders | Float | no | ||
| Allocations | Float | no | Current allocations | |
| ForecastAllocation | Float | no | Forecast allocation | |
| Budget | Float | no | ||
| Price | Float | yes | Forecasted Price | |
| SystemPrice | Float | yes | System Price | |
| Revenue | Float | yes | Revenue | |
| NominalCost | DoubleFloat | yes | ||
| TotalNominalCost | DoubleFloat | yes | ||
| NominalCostAdjustment | Float | no | ||
| ValueAdd | Float | yes | ||
| ValueAddAdjustment | Float | no | ||
| TotalValueAdd | Float | yes | ||
| UnallocatedRevenue | Float | yes | Unallocated Revenue | |
| Unallocated | Float | yes | ||
| UnallocatedTotalCost | Float | yes | ||
| UnallocatedValueAdd | Float | yes | ||
| IsWorking | Integer | no | ||
| EditableCustomer | Integer | no | ||
| EditableFinal | Integer | no | ||
| EditableForecastAllocation | Integer | no | ||
| EditablePrice | Integer | no | ||
| ForecastStatusId | Integer | no | ||
| HasComment | Integer | no | ||
| CustomerCssClass | String | yes | ||
| FinalCssClass | String | yes | ||
| CustomerForecastComment | LongestString | yes | ||
| FinalForecastComment | LongestString | yes | ||
| OriginalCustomerComment | LongestString | yes | ||
| OriginalFinalComment | LongestString | yes | ||
| FinancialToolTip | LongestString | yes | ||
| CustomerForecastChangeId | Identity | yes | ||
| CustomerReasonId | Identity | yes | ||
| FinalForecastChangeId | Identity | yes | ||
| FinalReasonId | Identity | yes | ||
| PriceForecastChangeId | Identity | yes | ||
| PriceReasonId | Identity | yes | ||
| PriceComment | LongestString | yes | ||
| OriginalPriceComment | LongestString | yes | ||
| PriceHasComment | Integer | no | ||
| NominalCostForecastChangeId | Identity | yes | ||
| NominalCostReasonId | Identity | yes | ||
| NominalCostComment | LongestString | yes | ||
| OriginalNominalCostComment | LongestString | yes | ||
| NominalCostHasComment | Integer | no | ||
| ValueAddForecastChangeId | Identity | yes | ||
| ValueAddReasonId | Identity | yes | ||
| ValueAddComment | LongestString | yes | ||
| OriginalValueAddComment | LongestString | yes | ||
| ValueAddHasComment | Integer | no | ||
| OriginalVAAdjustment | Float | no | ||
| OriginalNCAdjustment | Float | no | ||
| OriginalPrice | Float | no |
| ForecastEventRules | Core Core |
The table stores the list of rules of forecast events |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ReportFilterId | Identity | yes | Filter Id | |
| DateFrom | Date | no | The date when the rule becomes active | |
| ForecastEventTypeId | Identity | yes | A reference to ForecastEventTypes | |
| RuleWeighting | Identity | no | Rule weighting | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastEvents | Forecasting Forecasting |
A table stored forecast events per month/SKU |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Month | |
| SiteMaterialUsageId | Identity | yes | SKU ID (A reference to SiteMaterialUsages) | |
| ForecastEventTypeId | Identity | no | Forecast Event Type | |
| ForecastEventRuleId | Identity | no | Forecast event Rule | |
| InsertUserId | Identity | no | The ID of the user who have inserted the line | |
| InsertDate | Date | no | The ID of the user who have inserted the line |
| ForecastEventTypes | Forecasting Forecasting |
A table stored forecast events types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ForecastEventName | String | no | Forecast event name | |
| InsertUserId | Identity | no | The ID of the user who have inserted the line | |
| InsertDate | Date | no | The ID of the user who have inserted the line | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastHistoryData | Forecasting Forecasting |
A temporary table for history calculation, including in account suppercessions. This is helper table and calculated during forecast generation. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Month | |
| SiteMaterialUsageId | Identity | no | SKU (A reference to SitematerialUsages) | |
| SupercessionHistory1 | Float | no | history for month year ago including supercession | |
| SupercessionHistory2 | Float | no | average history for last 3 months including supercession | |
| SupercessionHistory3 | Float | no | history for 1 months ago including supercession | |
| SupercessionHistory4 | Float | no | average history for last 6 months including supercession | |
| SupercessionHistory5 | Float | no | history for 2 months ago including supercession | |
| SupercessionHistory6 | Float | no | history for 3 months ago including supercession | |
| SupercessionHistory7 | Float | no | history from begging of year to current month including supercession | |
| SupercessionHistory8 | Float | no | average history for last 12 months including supercession |
| ForecastItemsData | Forecasting Forecasting |
A temporary table for forecast collaboration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| Summary | HugeString | yes | Summary fields | |
| CommentLink | HugeString | yes | Comment link expression | |
| Items | ForecastItemArray | yes | Grouped Identity |
| ForecastMessagesLog | Forecasting Forecasting |
The table stores Forecast messages Log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | identity |
| DateFrom | Date | no | Date | |
| Period | ShortString | no | Period | |
| Weight | Float | no | Weight | |
| Unit | ShortString | no | Unit | |
| UnitId | Identity | yes | Unit | |
| Type | ShortString | no | Type | |
| Characteristics | HugeString | yes | Characteristics | |
| SqlFilter | HugeString | yes | Sql Filter | |
| Status | Integer | no | Status | |
| ForecastId | Identity | yes | Forecast identity | |
| ForecastStatusId | Identity | yes | Forecast status identity | |
| FailedReason | LongestString | yes | Failed Reason | |
| Comments | HugeString | yes | Comments | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ForecastMethodRules | Core Core |
The table stores forecast method rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| SiteMaterialUsageId | Identity | yes | Sku Id. | |
| RuleWeighting | Identity | no | Rule weighting | |
| ForecastMethodId | Identity | no | Forecast method | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastMethods | Forecasting Forecasting |
The table stores forecast method definitions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ForecastMethodName | LongString | no | Forecast method name | |
| ForecastMethodDesc | LongString | no | Description of the forecast method type | |
| Internal | Integer | no | An internal flag | |
| ForecastMethodTypeId | Identity | no | Type of the forecast method (A reference to ForecastMethodTypes) | |
| Engine | String | no | Engine for forecast method | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastMethodTypeParameters | Forecasting Forecasting |
The table stores definitions of forecast method type parameters |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ParameterId | Identity | no | Paramater (A reference to ForecastParameters) | |
| ForecastMethodTypeId | Identity | yes | Forecast Method Type (A reference to ForecastMethodTypes) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastMethodTypes | Forecasting Forecasting |
The table stores forecast method type definitions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ForecastMethodTypeName | String | no | Forecast method type name | |
| ForecastMethodTypeDesc | String | no | Description of the forecast method type | |
| Engine | String | no | Engine for forecast method | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastOperations | Forecasting Forecasting |
The table stores the list of available forecast operations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | String | no | Operation name | |
| Description | LongString | yes | Operation description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastParameters | Forecasting Forecasting |
The table stores forecast parameter definitions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ParameterName | String | no | Parameter name | |
| ParameterDescription | String | no | Parameter description | |
| DefaultValue | String | no | Default value | |
| DataType | ShortString | no | Data type of the parameter | |
| DataMask | String | yes | Data mask of the parameter | |
| BundleId | Identity | yes | Bundle Values | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastParameterValues | Forecasting Forecasting |
The table stores forecast parameter values |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Value | String | no | Parameter value | |
| ForecastMethodId | Identity | no | Forecast method (A reference to ForecastMethods) | |
| ForecastParameterId | Identity | no | Forecast parameter (A reference to ForecastParameters) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastPatterns | Forecasting Forecasting |
A table stored forecast patterns |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ForecastPatternName | String | no | Forecast pattern name | |
| PatternValues | Text | no | Comma separated values | |
| StartDate | Date | yes | Start Date | |
| InsertUserId | Identity | no | The ID of the user who have inserted the line | |
| InsertDate | Date | no | The ID of the user who have inserted the line | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastRanges | Forecasting Forecasting |
The ranges for daily distribution across months in weekly forecasting. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RangeName | String | no | Month | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastRangeValues | Forecasting Forecasting |
The range values for daily distribution across months in weekly forecasting. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RangeId | Identity | no | Forecast distribution range | |
| DayFrom | Integer | no | Day from | |
| DayTo | Integer | no | Day to | |
| Percentage | Float | no | Day to | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Forecasts | Forecasting Forecasts |
The table stores the list of forecasts existing in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Horizon | Identity | no | Length of the forecast horizon, months | |
| Offset | Integer | no | offset in months for forecast start date | |
| StartDate | Date | no | The first month where starts forecast values | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastSampleBodies | Forecasting Forecasting |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Month | |
| ForecastSampleId | Identity | no | A reference to the corresponding forecast snapshot | |
| ForecastSampleMethodId | Identity | no | Forecast sample method | |
| Forecast | Float | no | Forecast value generated by system | |
| Upper | Float | no | Upper percentile generated by ForecastPro | |
| Lower | Float | no | Lower percentile generated by ForecastPro | |
| SafetyStock | Float | no | Safety Stock generated by ForecastPro |
| ForecastSampleFittedHistories | Forecasting Forecasting |
The table stores fitted history after forecast sample generation |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ForecastSampleId | Identity | no | SKU (A reference to SiteMaterialUsages) | |
| ForecastSampleMethodId | Identity | no | SKU (A reference to SiteMaterialUsages) | |
| DateFrom | Date | no | Date | |
| Weight | Float | no | Weight |
| ForecastSampleHistory | Forecasting Forecasting |
A temporary table for history calculation, populated during forecast generation. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ForecastSampleId | Identity | no | Forecast sample identity | |
| DateFrom | Date | no | Month | |
| Weight | Float | no | History weight |
| ForecastSampleMethods | Forecasting Forecast Sample |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ForecastSampleId | Identity | no | A reference to the corresponding forecast sample | |
| ForecastMethodId | Identity | no | Forecast method | |
| MethodName | LongString | no | Forecast method name | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastSamples | Forecasting Forecasts |
The table stores the list of forecasts samples |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| HistoryStartDate | Date | yes | The history start month (from use limited set) | |
| StartDate | Date | no | The start month | |
| FinishDate | Date | no | The end month | |
| Name | String | no | Forecast sample name | |
| UserId | Identity | no | User identity (owner) | |
| ReportFilterId | Identity | yes | Filter for limit SKU inside sample | |
| SecondForecastMethods | HugeString | yes | Second pass methods - comma separated list | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastSampleSku | Forecasting Temporary |
Temporary table for selective or full forecast generation process. Table contains the list of skus |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ForecastSampleId | Identity | no | Id from SecondPass properties | |
| SiteMaterialUsageId | Identity | no | Sku Id | |
| HistoryStartDate | Date | yes | History Start Date | |
| Seasonality | Identity | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| Trend | Identity | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 |
| ForecastSampleStatistics | Forecasting Temporary |
Temporary table for selective or full forecast generation process. Table contains the list of skus |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ForecastSampleId | Identity | no | Id from SecondPass properties | |
| ForecastSampleMethodId | Identity | no | Sample method Id | |
| ForecastMethodId | Identity | no | Sample method Id | |
| Seasonality | Identity | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| Trend | Identity | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 | |
| UsedExternalTrends | HugeString | yes | Used external trends | |
| ymean | Float | yes | Mean of the historic series used to fit the model | |
| ysdev | Float | yes | Standard deviation of the historic series used to fit the model | |
| sigma | Float | yes | Standard forecast error of the model over the fitted data. | |
| rmserr | Float | yes | Root mean square forecast error of the model over the fitted data. | |
| adjrsq | Float | yes | Adjusted R-square | |
| mape | Float | yes | Mean absolute percent error. | |
| smape | Float | yes | Symmetric mean absolute percent error | |
| mad | Float | yes | Mean absolute deviation of the actual from the fitted fore-cast. | |
| ErrorStdDev | Float | yes | Standard deviation of errors | |
| MethodTextReport | HugeString | yes | Method Text Report |
| ForecastSnapshotBodies | Forecasting Forecasting |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Month | |
| ForecastSnapshotId | Identity | no | A reference to the corresponding forecast snapshot | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| Final | Float | no | Forecast value generated by system | |
| FinalWeeklyCoefId | Identity | yes | Final weekly coefficient id | |
| AllocationWeeklyCoefId | Identity | yes | Allocation weekly coefficient id | |
| Unallocated | Float | no | Unallocated demand | |
| ForecastStatusId | Identity | no | Forecast status (system, customer, final) | |
| SystemPriceCurrencyId | Identity | no | Price Currency Id for system price | |
| PriceCurrencyId | Identity | no | Price Currency Id for forecasted price | |
| SystemPrice | Float | no | System Price | |
| ForecastedPrice | Float | no | Forecasted Price | |
| CostCurrencyId | Identity | no | Cost Currency Id | |
| NominalCost | DoubleFloat | no | Nominal Cost | |
| NominalCostAdjustment | Float | no | Nominal Cost adjustment | |
| ValueAddAdjustment | Float | no | Value Add adjustment | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastSnapshots | Forecasting Forecasts |
The table stores the list of forecasts existing in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| StartDate | Date | no | The first month after the forecast horizon | |
| FinishDate | Date | no | The first month after the forecast horizon | |
| Name | String | no | Forecast snapshot name | |
| Description | String | no | Forecast snapshot description | |
| UserId | Identity | no | Snapshot owner identifier | |
| IsBudget | Integer | no | Is this a budget | |
| IsShowOnGraph | Integer | no | Should this snapshot shown on the graph. | |
| IsConstrained | Integer | no | Is this constrained snapshot. | |
| UnconstrainedSnapshotId | Identity | yes | Unconstrained snapshot identifier | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastStatisticData | Forecasting Forecasting |
The table stores the list of statistical parameters returned by Forecast Engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Who inserted the record? | |
| Id | Identity | no | Identity | |
| HistoricDataMean | Float | no | ||
| StandardDeviation | Float | no | ||
| StandardForecastError | Float | no | ||
| AdjustedRSquare | Float | no | ||
| BayesianInformationCriterion | Float | no | ||
| MeanAbsolutePercentError | Float | no | ||
| FinalTrend | Float | no | ||
| MAPE | Float | yes | MAPE. can be NULL | |
| ZMAPE | Float | no | ||
| SMAPE | Float | no | ||
| MPE | Float | no | ||
| MAE | Float | no | ||
| BIASP | Float | no | ||
| MAEP | Float | no | ||
| RMSE | Float | no | ||
| Variance | Float | no | ||
| TotalFinalForecast | Float | no | ||
| Orders | Float | no | ||
| FinalForecast | Float | no | ||
| CustomerForecast | Float | no | ||
| OrdersVsFinalForecast | Float | no | ||
| MTDFF | Float | no | ||
| MTDCF | Float | no | ||
| ForecastMethod | String | yes | ||
| ForecastMethodTooltip | HugeString | yes | ||
| GroupForecastMethod | String | yes | ||
| GroupForecastMethodTooltip | HugeString | yes | ||
| Seasonality | String | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| SeasonalityToolTip | HugeString | yes | ||
| Trend | String | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 | |
| TrendToolTip | HugeString | yes | ||
| WarningCssClass | LongString | yes | ||
| GroupSeasonality | String | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| GroupSeasonalityToolTip | HugeString | yes | ||
| UsedExternalTrends | HugeString | yes | ||
| GroupTrend | String | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 | |
| GroupTrendToolTip | HugeString | yes |
| ForecastStatistics | Forecasting Forecasting |
The table stores the list of statistical parameters returned by Forecast Engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ForecastId | Identity | no | Forecast ID (A reference to Forecasts) | |
| SiteMaterialUsageId | Identity | no | SKU ID (A reference to SiteMaterialUsages) | |
| ForecastMethodId | Identity | yes | ||
| GroupedForecastMethodId | Identity | yes | ||
| Seasonality | Identity | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| Trend | Identity | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 | |
| GroupedSeasonality | Identity | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| GroupedTrend | Identity | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 | |
| UseTradingDays | Integer | no | Use trading days mode? | |
| UsedExternalTrends | LongString | yes | Comma separated list of used external trends | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ForecastStatuses | Forecasting Forecasting |
The table stores forecast status definitions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| ForecastStatusName | ShortString | no | Forecast status name | |
| ForecastStatusDesc | ShortString | no | Forecast status description | |
| Abbreviation | ShortString | no | Forecast status abbreviation | |
| StatusLevel | Integer | no | Forecast status level | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ForecastTraceItems | Forecasting Diagnostics |
First-pass and second-pass input item metadata. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProcessId | Identity | no | Forecast trace process | |
| PassName | ShortString | no | FirstPass or SecondPass | |
| FirstPassId | Identity | yes | First pass identifier | |
| SecondPassId | Identity | yes | Second pass identifier | |
| SiteMaterialUsageIds | Text | yes | Source SKU identifiers | |
| StartDate | Date | no | History start date | |
| Horizon | Identity | no | Forecast horizon in months | |
| Succeeded | Integer | no | Input success flag | |
| Method | ShortString | no | Effective forecast method | |
| SecondPassRuleId | Identity | yes | Second-pass rule identifier | |
| CharacteristicsList | LongString | yes | Second-pass characteristic names | |
| Characteristics | HugeString | yes | Second-pass characteristics | |
| Skus | Text | yes | Comma-separated member SKU identifiers | |
| History | Text | yes | Ordered comma-separated history values | |
| Events | Text | yes | Ordered comma-separated event values | |
| InsertDate | Date | no | When the item was inserted |
| ForecastValueAddData | Forecasting Forecasting |
A temporary table for Forecast Value Add screen (IPLAN-69090) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID | |
| GroupId | Identity | no | Grouped Identity | |
| ErrorLevelGroupId | Identity | no | Error Level Grouped Identity | |
| DateFrom | Date | yes | date | |
| History | Float | yes | ||
| Naive | Float | yes | ||
| OriginalSystem | Float | yes | ||
| System | Float | yes | ||
| Customer | Float | yes | ||
| Final | Float | yes | ||
| IsMonthOut | Integer | yes |
| ForecastViewData | Forecasting Forecasting |
A temporary table for forecast collaboration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| GroupId | Identity | no | Grouped Identity | |
| DateFrom | Date | yes | date | |
| System | Float | no | ||
| Customer | Float | no | ||
| Final | Float | no | ||
| CustomerVsSystem | Float | no | ||
| SystemVsFinal | Float | no | ||
| CustomerVsFinal | Float | no | ||
| ForecastStatusId | Integer | no | ||
| Orders | Float | no | ||
| Budget | Float | no | ||
| Filtered | Identity | no |
| ForecastWeeklyCoefs | Forecasting Forecasting |
The table stores grouped monthly forecasts |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| DateFrom | Date | no | Month | |
| DateFromIW | Date | no | Week | |
| Coef | DoubleDouble | yes | Weekly Coef | |
| CalendarId | Identity | yes | Initial Calendar Id | |
| IsWorking | Integer | no | A switch. Possible values: 0 - forecast state unchanged, or the forecast released; 1 - the forecast has been carried from the previous forecast, 2 - the forecast has been modified (edited) ) | |
| WorkingDays | Integer | no | working days? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| FrozenEditingRules | Forecasting Forecasting |
The table stores rules for freeze forecast editing |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| CharacteristicsKey | LongString | no | csv list of fields | |
| CharacteristicsValue | LongString | no | csv list of values | |
| FrozenPeriod | Integer | no | Forecast frozen period | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| GradeCycleTypeSnapshots | Scenario Analysis Cycle Types |
SNP Cycle type snapshots |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| DateFrom | Date | no | Period | |
| GradeId | Identity | no | SNP Grade Id | |
| GroupId | Identity | no | Group Id for aggregation required demand | |
| Demand | Float | no | Demand volume per period and grade in default weight unit | |
| AvailableStock | Float | no | Available Stock in period in default weight unit | |
| SafetyStock | Float | no | Safety stock in period in default weight unit | |
| Rate | Float | no | Primary rate | |
| DemandDuration | Float | no | Demand duration in hours | |
| IsProductionPeriod | Integer | no | Is Production Period |
| GradeMaterials | Block Scheduling Block Scheduling |
The table describes many-to-many relation between grades and materials. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| GradeId | Identity | yes | A reference to GradeProperties.GradeId | |
| OperationTypeId | Identity | yes | yes | Operation Type Identity |
| GradeCode | String | yes | Grade code: concatenation of property codes of ProductionRatePicker | |
| MaterialId | Identity | no | A reference to Materials.Id |
| GradeProductionRates | Block Scheduling Temporary |
ProductionRates for grades on PM workcentres. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre Id | |
| GradeId | Identity | no | Reference to table GradeProperties | |
| OperationTypeId | Identity | no | Operation type | |
| Rate | Float | no | Production Rate Id |
| GradeProperties | Block Scheduling Block Scheduling |
The table stores properties of material grades. A grade is a set of properties. The set of properties is different for PMs and FLs and is defined by pickers (ProcutionRatePicker). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| GradeId | Identity | yes | no | Identity |
| GradeCode | String | no | Grade code | |
| OperationTypeId | Identity | yes | yes | Operation Type Identity |
| Code1 | ShortString | yes | References to PropertyCodes | |
| Code2 | ShortString | yes | References to PropertyCodes | |
| Code3 | ShortString | yes | References to PropertyCodes | |
| Code4 | ShortString | yes | References to PropertyCodes | |
| Code5 | ShortString | yes | References to PropertyCodes | |
| Code6 | ShortString | yes | References to PropertyCodes | |
| Code7 | ShortString | yes | References to PropertyCodes | |
| Code8 | ShortString | yes | References to PropertyCodes | |
| Code9 | ShortString | yes | References to PropertyCodes | |
| Code10 | ShortString | yes | References to PropertyCodes | |
| Code11 | ShortString | yes | References to PropertyCodes | |
| Code12 | ShortString | yes | References to PropertyCodes | |
| Code13 | ShortString | yes | References to PropertyCodes | |
| Code14 | ShortString | yes | References to PropertyCodes | |
| Code15 | ShortString | yes | References to PropertyValues | |
| Code16 | ShortString | yes | References to PropertyCodes | |
| Code17 | ShortString | yes | References to PropertyCodes | |
| Code18 | ShortString | yes | References to PropertyCodes | |
| Code19 | ShortString | yes | References to PropertyCodes | |
| Code20 | ShortString | yes | References to PropertyCodes | |
| Code21 | ShortString | yes | References to PropertyCodes | |
| Code22 | ShortString | yes | References to PropertyCodes | |
| Code23 | ShortString | yes | References to PropertyCodes | |
| Code24 | ShortString | yes | References to PropertyCodes | |
| Code25 | ShortString | yes | References to PropertyCodes | |
| Code26 | ShortString | yes | References to PropertyCodes | |
| Code27 | ShortString | yes | References to PropertyCodes | |
| Code28 | ShortString | yes | References to PropertyCodes | |
| Code29 | ShortString | yes | References to PropertyCodes | |
| Code30 | ShortString | yes | References to PropertyCodes |
| GradeSnapshots | Master Planning Master Planning |
The table contains SNP grade information, co-product data, and the session production configuration IDs for each material. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario session Id | |
| Id | Identity | no | SNP Grade Id | |
| MaterialId | Identity | no | Material Id (used for inventory sourcing) | |
| PropertyValueId | Identity | no | Property value ID (A reference to PropertyValues) | |
| CycleTypeId | Identity | no | Cycle Type Id | |
| ConfigurationSet | String | yes | SNP production configuration IDs for this material | |
| CoProductPercentage | Float | no | Sum of percentage of coproducts | |
| CoProductPriceList | HugeString | yes | Detailed co-product prices, a semicolon separated list in format: CoProductId:Percentage:PricePercentage;CoProductId:Percentage:PricePercentage |
| GridColumns | Core Configuration |
The table contains the list columns of grids |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| GridId | Identity | no | Grid Id | |
| MarkedForDelete | Integer | no | Temporary field for handling in messages | |
| ActionId | Identity | yes | Page action used for permissions | |
| orderNo | Identity | no | Grid Id | |
| Caption | ShortString | yes | Column name | |
| FieldName | ShortString | no | Field name | |
| Type | ShortString | no | Type: (Decimal, Integer, String, Date, DateTime, bool) | |
| ControlType | ShortString | no | Control Type (CheckBox, ComboBox, TextBox, DatePicker, MonthPicker, WeekPicker) | |
| IsEditable | Integer | no | Is editable (yes/no) | |
| IsShowTotal | Integer | no | Is show total (yes/no) | |
| IsFinancial | Integer | no | Is financial column | |
| TotalFunction | String | yes | Is show total (yes/no) | |
| State | ShortString | no | State = (normal, fixed, hidden) | |
| DataForColumn | String | yes | this column will place into column cell data object | |
| colorColumn | String | yes | ||
| BackgroundColorColumn | String | yes | ||
| dataColumns | LongestString | yes | ||
| dataColumnsMapping | LongestString | yes | ||
| editableColumn | String | yes | ||
| tooltipColumn | String | yes | ||
| showToolTipColumn | String | yes | ||
| ToolTipFormat | HugeString | yes | Tooltip format template | |
| classColumn | String | yes | ||
| Color | ShortString | yes | red, white (#566777) | |
| BackgroundColor | ShortString | yes | red, white (#566777) | |
| IsResizable | Integer | no | (yes/no) | |
| IsTransformColumn | Integer | no | (yes/no) | |
| IsTransformable | Integer | no | (yes/no) | |
| TransformFormat | String | yes | format for transformation | |
| IsShowToolTip | Integer | no | (yes/no) | |
| IsConfigurable | Integer | no | (yes/no) | |
| IsGridFilter | Integer | no | (yes/no) | |
| SubRow | String | yes | Subrow column | |
| MaxWidth | Integer | no | Max width for multi-line column | |
| MinWidth | Integer | no | Min width for multi-line column | |
| Style | String | yes | (string) | |
| Format | String | yes | (string) | |
| Sort | Integer | no | (yes/no) | |
| Filter | ShortString | yes | (text/select) | |
| DependOnColumn | ShortString | yes | visible depend on other column settings | |
| SystemParameter | String | yes | Visibility depend on parameter | |
| SystemParameterValue | String | yes | Visibility depend on parameter | |
| OrderColumn | ShortString | yes | order column for transformed grids | |
| ColumnToolTip | HugeString | yes | column tooltip | |
| Help | HugeString | yes | column help | |
| IsSummary | Integer | no | Is summary column? |
| Grids | Core Configuration |
The table contains the list of grids |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | ShortString | no | Grid name | |
| Description | String | no | Grid description | |
| IsColumnsAsRows | Integer | no | Is show columns As rows | |
| IsExtendCaptions | Integer | no | Is extend captions before adding totals | |
| TransformTotals | Integer | no | Create transform total columns from empty transform values | |
| PageId | Identity | yes | Page |
| GroupedSKU | Replenishment Replenishment |
The table contains information about inventories on every single day, by SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | SKU Id | |
| GroupType | String | no | Site, Company or Locatio | |
| GroupId | Identity | no | Location,Company,Site Id | |
| LocationId | Identity | yes | Location Id | |
| MaterialId | Identity | no | Material Id | |
| ConsignmentLocationId | Identity | yes | Location Id | |
| GroupKey | String | no | Group key included Site, Company or Location and identity key | |
| Opening | Float | no | Last known opening | |
| HighQuantity | Float | no | ||
| LowQuantity | Float | no | ||
| DaysOfSupply | Float | no | ||
| MaxDaysOfSupply | Float | no | ||
| TransportTime | Float | no | ||
| ReplenishmentFrequency | Float | no | ||
| MaxReplenishmentFrequency | Float | no | ||
| HistoryStartDate | Date | yes | ||
| SafetyStockMethodId | Identity | no | ||
| MaxSafetyStockMethodId | Identity | yes | ||
| ReplenishmentHorizon | Integer | no | ||
| ForecastMethodId | Identity | no |
| GroupForecastViewData | Forecasting Forecasting |
A temporary table for forecast view |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| SummaryFields | HugeString | yes | SummaryFields | |
| ForecastStatusId | Integer | no | ||
| WarningCssClass | String | yes | ||
| HistoricDataMean | Float | no | ||
| StandardDeviation | Float | no | ||
| StandardForecastError | Float | no | ||
| AdjustedRSquare | Float | no | ||
| BayesianInformationCriterion | Float | no | ||
| MeanAbsolutePercentError | Float | no | ||
| FinalTrend | Float | no | ||
| MAPE | Float | no | ||
| ZMAPE | Float | no | ||
| SMAPE | Float | no | ||
| MPE | Float | no | ||
| MAD | Float | no | ||
| RMSE | Float | no | ||
| Variance | Float | no | ||
| TotalFinalForecast | Float | no | ||
| FinalForecast | Float | no | ||
| CustomerForecast | Float | no | ||
| OrdersVsFinalForecast | Float | no | ||
| MTDFF | Float | no | ||
| MTDCF | Float | no | ||
| ForecastMethod | String | yes | ||
| ForecastMethodTooltip | HugeString | yes | ||
| GroupForecastMethod | String | yes | ||
| GroupForecastMethodTooltip | HugeString | yes | ||
| Seasonality | String | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| SeasonalityToolTip | HugeString | yes | ||
| Trend | String | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 | |
| TrendToolTip | HugeString | yes | ||
| GroupSeasonality | String | yes | Exponential smoothing No seasonality = 0 Additive seasonality=1 Multiplicative seasonality = 2 | |
| GroupSeasonalityToolTip | HugeString | yes | ||
| GroupTrend | String | yes | Exponential smoothing No trend = 0 Linear trend = 1 Decaying trend = 2 Exponential = 3 | |
| GroupTrendToolTip | HugeString | yes | ||
| History1 | Float | no | History1 | |
| History2 | Float | no | History2 | |
| History3 | Float | no | History3 | |
| History4 | Float | no | History4 | |
| History5 | Float | no | History5 | |
| History6 | Float | no | History6 | |
| History7 | Float | no | History7 | |
| History8 | Float | no | History8 | |
| MTD | Float | no |
| GroupRealInventoryProfiles | Due date quoting Due date quoting |
The table contains information about the inventory on every day by SKUs. For each SKU and each day we have opening quantity in the beginning of the day. It is calculated as the difference of incoming and outgoing order quantities of the previous day. Closing quantity is calculated as the difference of incoming and outgoing order quantities of the current day. MinOpening value determines the minimal opening quantity at the real inventory horizon. Data in this table is updated when processing order operations. When recalculating of the real inventory for specific SKUs, appropriate rows can be deleted and inserted. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | yes | A reference to SiteMaterialUsages | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| SKUKey | String | no | A reference to Workcentres | |
| DateFrom | Date | no | Date | |
| OverallOpening | Float | no | Opening quantity for Firm, Tentative and Consumption | |
| Opening | Float | no | Opening quantity | |
| OrdersIn | Float | no | Incoming orders quantity | |
| TentativeOrdersIn | Float | no | Incoming tentative orders quantity | |
| OrdersOut | Float | no | Outgoing orders quantity | |
| TentativeOrdersOut | Float | no | Outgoing tentative orders quantity | |
| Closing | Float | no | Closing quantity | |
| OverallClosing | Float | no | Closing quantity for Firm, Tentative and Consumption | |
| FirmClosing | Float | no | Closing quantity only for Firm orders | |
| MinOpening | Float | no | Minimal opening quantity | |
| SafetyStock | Float | no | Safety stock | |
| MaxSafetyStock | Float | yes | Safety stock | |
| Consumption | Float | no | Forecst consumption | |
| OriginalConsumption | Float | no | Original Forecst consumption | |
| SupersededStockStatus | Integer | no | Replenishment result |
| HiddenSharedReports | Reports Access rights |
The table describes many-to-many relation between roles and system reports |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| UserId | Identity | no | System Role Id | |
| DataSourceId | Identity | no | data source id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| Hierarchies | Core Core |
The table stores the list of all hierarchies registered in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| HierarchyName | String | no | Hierarchy name | |
| HierarchyCode | ShortString | no | Hierarchy external code | |
| ParentHierarchyId | Identity | yes | Parent hierarchy identity | |
| HierarchyLevelId | Identity | no | Hierarchy level identity | |
| Latitude | ShortString | yes | Latitude | |
| Longitude | ShortString | yes | Longitude | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| HierarchyLevels | Core Core |
The table stores the list of all levels of hierarchies registered in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| HierarchyLevelName | String | no | Hierarchy level name | |
| HierarchyLevelNo | Integer | no | Hierarchy level number | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| HierarchyPropertyDetails | Core Core |
The table stores the list of properties and hierarchies in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity row |
| DetailHash | RawHash | yes | Hash for all codes and properties | |
| PropertySignature | HugeString | yes | Values signature for property codes | |
| HierarchySignature | HugeString | yes | Values signature for hierarchy codes | |
| EndCustomerHierarchySignature | HugeString | yes | Values signature for end customer hierarchy codes | |
| EndUseSignature | HugeString | yes | Values signature for end use codes | |
| PropertyBits | String | no | Notnull indicator for property columns | |
| HierarchyBits | String | no | Notnull indicator for hierarchy columns | |
| EndCustomerHierarchyBits | String | no | Notnull indicator for hierarchy columns | |
| EndUseBits | String | no | Notnull indicator for end use property columns | |
| PropertyHash | RawHash | yes | Values signature for property codes | |
| HierarchyHash | RawHash | yes | Values signature for hierarchy codes | |
| EndCustomerHierarchyHash | RawHash | yes | Values signature for end customer hierarchy codes | |
| EndUseHash | RawHash | yes | Values signature for end use codes | |
| HierarchyCode1 | String | yes | Hierarchy Code1 | |
| HierarchyCode2 | String | yes | Hierarchy Code2 | |
| HierarchyCode3 | String | yes | Hierarchy Code3 | |
| HierarchyCode4 | String | yes | Hierarchy Code4 | |
| HierarchyCode5 | String | yes | Hierarchy Code5 | |
| HierarchyCode6 | String | yes | Hierarchy Code6 | |
| HierarchyCode7 | String | yes | Hierarchy Code7 | |
| HierarchyCode8 | String | yes | Hierarchy Code8 | |
| HierarchyCode9 | String | yes | Hierarchy Code9 | |
| HierarchyCode10 | String | yes | Hierarchy Code10 | |
| HierarchyCode11 | String | yes | Hierarchy Code11 | |
| HierarchyCode12 | String | yes | Hierarchy Code12 | |
| HierarchyCode13 | String | yes | Hierarchy Code13 | |
| HierarchyCode14 | String | yes | Hierarchy Code14 | |
| HierarchyCode15 | String | yes | Hierarchy Code15 | |
| Code1 | String | yes | Property value Code1 | |
| Code2 | String | yes | Property value Code2 | |
| Code3 | String | yes | Property value Code3 | |
| Code4 | String | yes | Property value Code4 | |
| Code5 | String | yes | Property value Code5 | |
| Code6 | String | yes | Property value Code6 | |
| Code7 | String | yes | Property value Code7 | |
| Code8 | String | yes | Property value Code8 | |
| Code9 | String | yes | Property value Code9 | |
| Code10 | String | yes | Property value Code10 | |
| Code11 | String | yes | Property value Code11 | |
| Code12 | String | yes | Property value Code12 | |
| Code13 | String | yes | Property value Code13 | |
| Code14 | String | yes | Property value Code14 | |
| Code15 | String | yes | Property value Code15 | |
| Code16 | String | yes | Property value Code16 | |
| Code17 | String | yes | Property value Code17 | |
| Code18 | String | yes | Property value Code18 | |
| Code19 | String | yes | Property value Code19 | |
| Code20 | String | yes | Property value Code20 | |
| Code21 | String | yes | Property value Code21 | |
| Code22 | String | yes | Property value Code22 | |
| Code23 | String | yes | Property value Code23 | |
| Code24 | String | yes | Property value Code24 | |
| Code25 | String | yes | Property value Code25 | |
| Code26 | String | yes | Property value Code26 | |
| Code27 | String | yes | Property value Code27 | |
| Code28 | String | yes | Property value Code28 | |
| Code29 | String | yes | Property value Code29 | |
| Code30 | String | yes | Property value Code30 | |
| Property1 | String | yes | EndUse property 1 | |
| Property2 | String | yes | EndUse property 2 | |
| Property3 | String | yes | EndUse property 3 | |
| Property4 | String | yes | EndUse property 4 | |
| Property5 | String | yes | EndUse property 5 | |
| Property6 | String | yes | EndUse property 6 | |
| Property7 | String | yes | EndUse property 7 | |
| Property8 | String | yes | EndUse property 8 | |
| Property9 | String | yes | EndUse property 9 | |
| Property10 | String | yes | EndUse property 10 | |
| Property11 | String | yes | EndUse property 11 | |
| Property12 | String | yes | EndUse property 12 | |
| Property13 | String | yes | EndUse property 13 | |
| Property14 | String | yes | EndUse property 14 | |
| Property15 | String | yes | EndUse property 15 | |
| EndcustomerHierarchyCode1 | String | yes | EndcustomerHierarchy Code1 | |
| EndcustomerHierarchyCode2 | String | yes | EndcustomerHierarchy Code2 | |
| EndcustomerHierarchyCode3 | String | yes | EndcustomerHierarchy Code3 | |
| EndcustomerHierarchyCode4 | String | yes | EndcustomerHierarchy Code4 | |
| EndcustomerHierarchyCode5 | String | yes | EndcustomerHierarchy Code5 | |
| EndcustomerHierarchyCode6 | String | yes | EndcustomerHierarchy Code6 | |
| EndcustomerHierarchyCode7 | String | yes | EndcustomerHierarchy Code7 | |
| EndcustomerHierarchyCode8 | String | yes | EndcustomerHierarchy Code8 | |
| EndcustomerHierarchyCode9 | String | yes | EndcustomerHierarchy Code9 | |
| EndcustomerHierarchyCode10 | String | yes | EndcustomerHierarchy Code10 | |
| EndcustomerHierarchyCode11 | String | yes | EndcustomerHierarchy Code11 | |
| EndcustomerHierarchyCode12 | String | yes | EndcustomerHierarchy Code12 | |
| EndcustomerHierarchyCode13 | String | yes | EndcustomerHierarchy Code13 | |
| EndcustomerHierarchyCode14 | String | yes | EndcustomerHierarchy Code14 | |
| EndcustomerHierarchyCode15 | String | yes | Hierarchy Code15 | |
| LocationCode | String | yes | Location Code | |
| ProductCode | String | yes | Material Code | |
| EndUseCode | String | yes | End Use Code | |
| EndCustomerCode | String | yes | End customer code - Location Code | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was inserted? |
| HistoryComparisonData | Forecasting Temporary |
Temporary table for data for Forecast comparison screen |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date (month) | |
| Weight | Float | yes | total usage | |
| AdjustedWeight | Float | yes | total usage | |
| OriginalSystem | Float | yes | original system forecast value | |
| System | Float | yes | system forecast value | |
| Customer | Float | yes | customer forecast value | |
| Final | Float | yes | final forecast value | |
| AllHistory | Float | yes | final forecast value | |
| FittedHistory | Float | yes | final forecast value | |
| Budget | Float | yes | final forecast value | |
| Orders | Float | yes | orders | |
| OperatorUserId | Identity | no | user id |
| HistoryData | Forecasting Forecasting |
A temporary table for history calculation, populated during forecast generation. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Month | |
| StartDate | Date | no | Forecast start date | |
| SiteMaterialUsageId | Identity | yes | SKU ID (A reference to SiteMaterialUsages) | |
| Successed | Identity | yes | A flag: include supercessions? | |
| TradingDays | Integer | no | Trading days quantity (from calendars by working days) | |
| Weight | Float | no | History weight | |
| UpdateDate | Date | no | When record was updated |
| HistoryForOppBlocksData | Block Scheduling Temporary |
History for opportunistic blocks. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date of entry | |
| WorkcentreId | Identity | no | Workcentre Id | |
| StartDate | Date | no | Current date, truncated to month | |
| GradeId | Identity | no | GradeId (for PM) or FinishingId (for FL) | |
| Quantity | Float | yes | Quantity | |
| Upper | Float | yes | Upper percentile | |
| Lower | Float | yes | Lower percentile | |
| OperatorUserId | Identity | no | Who inserted the line? |
| HistoryGlobalData | Forecasting Forecasting |
A GLOBAL temporary table for history calculation, populated once during forecast generation. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | yes | SKU ID (A reference to SiteMaterialUsages) | |
| DateFrom | Date | yes | Month | |
| HistoryWeight | Float | yes | History weight | |
| SourceDateFrom | Date | yes | ||
| SourceSkuId | Identity | yes | SKU ID (A reference to SiteMaterialUsages) |
| HoldingCosts | Core Core |
The table stores the list of costs of storing products at warehouses |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SiteId | Identity | yes | A reference to the Sites table | |
| Effective | Date | no | The date when the cost becomes active | |
| HoldingCost | DoubleFloat | no | Storing cost. InternalCurrency/BaseWeightUnit/week | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| HoldingCostSnapshots | Scenario Analysis Input Data |
The table stores the costs of storing (holding) products at warehouses per SNP scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| SiteId | Identity | yes | Holding site ID (a reference to the Sites table) | |
| Effective | Date | no | The date when this cost becomes active | |
| HoldingCost | DoubleFloat | no | Holding cost value | |
| OriginalCost | DoubleFloat | yes | Original holding cost | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Indicatives | Master Planning Master Planning |
The table stores weekly Indicatives for SKUs per demand periods |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DeliveryWeek | Date | yes | Delivery Week | |
| DeliveryMonth | Date | yes | Delivery Month | |
| SiteMaterialUsageId | Identity | no | A reference to the corresponding SKU | |
| WorkcentreId | Identity | yes | A reference to Workcentres | |
| Value | Float | no | Indicative value | |
| ConversionFactor | Float | no | Production rate conversion factor | |
| MasterRouteId | Identity | yes | Master Route ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| InitialSourceRulePeriodSnapshots | Scenario Analysis Initial Source Rules |
This table stores the snapshot of active product substitutions per period in SNP user scenario. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| InitialSourceRuleId | Identity | no | Scenario InitialSourceRule ID | |
| DateFrom | Date | no | Effective date | |
| IsActive | Integer | no | Is this time period active for initial source rule |
| InitialSourceRules | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| IsActive | Integer | no | Is rule active? | |
| RuleWeighting | Identity | no | Rule weighting | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| InitialSourceRuleSnapshots | Scenario Analysis Initial Source Rules |
The table stores initial source rule snapshot per SNP user scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | no | Initial Source Rule Id | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| IsActive | Integer | no | Is rule is active | |
| RuleWeighting | Integer | no | Rule weight |
| InitialSourceRuleSources | Core Core |
The table stores about sources for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| InitialSourceRuleId | Identity | no | Identity | |
| OperationTypeId | Identity | no | A reference to operation type | |
| WorkCentreId | Identity | yes | A reference to Workcentres | |
| SiteId | Identity | yes | A reference to Sites | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| InitialSourceRuleSourceSnapshots | Scenario Analysis Initial Source Rules |
The table stores snapshot of SKU initial sources for SNP user scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | no | Identity | |
| InitialSourceRuleId | Identity | yes | no | Initial Source Snapshot ID |
| OperationTypeId | Identity | yes | Operation Type Id | |
| WorkCentreId | Identity | yes | Production Workcentre Id | |
| SiteId | Identity | yes | Site ID (reference to Sites) |
| InitialSources | Core Core |
The table stores about sources for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| WorkCentreId | Identity | yes | A reference to Workcentres | |
| OperationTypeId | Identity | yes | A reference to Operation types on workcentres | |
| InitialSourceRuleId | Identity | yes | A reference to initial source rule | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| InitialSourceSnapshots | Scenario Analysis Initial Source Rules |
This table stores the snapshot of active product substitutions per period in SNP user scenario. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| InitialSourceRuleId | Identity | no | Initial Source Rule - (needs for active periods) | |
| SnpItemId | Identity | no | Scenario SNP item ID | |
| OperationTypeId | Identity | no | Operation type Id | |
| WorkcentreId | Identity | no | Production workcentre Id |
| InnerPointForecast | Replenishment Temporary table |
The table stores a forecast, generated by forecast engine from the customer history |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| GroupKey | String | no | Group key included Site, Company or Location and identity key | |
| MaterialId | Identity | no | A reference to Materials | |
| DateFrom | Date | no | Date (first day of month) | |
| Quantity | Float | no | Forecasted weight | |
| SafetyStock | Float | no | Safety stock weight |
| InnerPointHistory | Replenishment Temptorary table |
The table stores history data (consumption) of the customer for each warehouse. This data is used for calculation of statistical safety stock in allocation-based replenishment process using the forecast engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | Group key Id | |
| DateFrom | Date | no | Date (First day of month) | |
| GroupKey | String | no | Group key included Site, Company or Location and identity key | |
| MaterialId | Identity | no | A reference to Materials | |
| ForecastMethodId | Identity | no | Type of forecast method | |
| IsWeekly | Integer | no | Type of forecast method | |
| Quantity | Float | no | Consumed weight | |
| FittedHistory | Float | no | Fitted History Weight |
| InternalErrorLogs | Core Logging |
The table is used to maintain internal error log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| ErrorType | LongString | no | Error Type (db, js, http) | |
| Version | String | no | Version | |
| Page | LongString | no | Page | |
| Browser | LongString | no | Browser | |
| Url | LongString | no | Url | |
| Params | Text | yes | Params | |
| Error | Text | yes | Error description | |
| Message | Text | yes | Message text |
| Inventories | Replenishment Replenishment |
The table stores in-stock balances of warehouses (this data is received from external system) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Date | |
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| SkuKey | String | no | A reference to Sku. For performance reason and simplify conditions | |
| StockType | String | no | Stock type: Standard, Customer, InTransit, Quarantine | |
| Weight | Float | no | Opening weight | |
| AvailableOnHandWeight | Float | no | Available on hand weight | |
| CalculatedOnHandWeight | Float | no | Calculated on hand weight | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| InventoryData | Replenishment Replenishment |
The table is used for storing Inventory |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date from | |
| Opening | Float | no | Forecasted opening stocks | |
| Incoming | Float | no | Forecasted incoming consignment Orders | |
| Outgoing | Float | no | Forecasted outgoing consignment Orders | |
| Closing | Float | no | Forecasted closing stocks |
| InventoryLogs | Inventory Planning Inventory Planning |
The table stores inventory record changes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date | |
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| StockType | String | no | Stock type: Standard, Customer, InTransit, Quarantine | |
| Weight | Float | no | Opening weight | |
| AvailableOnHandWeight | Float | no | Available on hand weight | |
| CalculatedOnHandWeight | Float | no | Calculated on hand weight | |
| Comments | HugeString | yes | Comments | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| InventoryProfiles | Replenishment Replenishment |
The table contains information about inventories on every single day, by SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date | |
| SiteMaterialUsageId | Identity | yes | SKU Id | |
| CompanyId | Identity | yes | Company Id | |
| SiteId | Identity | yes | Site Id | |
| LocationId | Identity | yes | Location Id | |
| MaterialId | Identity | no | Material Id | |
| ConsignmentLocationId | Identity | yes | Consignment customer identity | |
| Opening | Float | no | Opening stock | |
| Consumption | Float | no | Consumption (can be based on orders or forecast or netted forecast with orders | |
| ConsumptionOrders | Float | no | Order Consumption - outgoing orders and deliveries | |
| ConsumptionForecast | Float | no | Forecast consumption | |
| FirmOrdersIn | Float | no | Incoming orders and deliveries | |
| TentativeOrdersIn | Float | no | Incoming Tentative orders | |
| TentativeOrdersOut | Float | no | Outgoing Tentative orders | |
| PlannedInventory | Float | no | Inventory with taking in account tentative adn firm orders | |
| SafetyStock | Float | no | Safety stock | |
| MaxSafetyStock | Float | yes | Safety stock | |
| OriginalSafetyStock | Float | no | Safety stock | |
| MinOpening | Float | no | Original Min opening based on final Safety stock | |
| OriginalMinOpening | Float | no | Original Min opening based on final Safety stock | |
| MinPlannedInventory | Float | no | Min planned Inventory | |
| RequestedOrdersIn | Float | no | Requested Incoming Tentative orders | |
| RequestedOrdersOut | Float | no | Requested Outgoing Tentative orders | |
| RequestedOpening | Float | no | Requested Incoming Tentative orders | |
| OriginalFirmIn | Float | no | Original firm orders | |
| OriginalConsumptionForecast | Float | no | Original Consumption Forecast | |
| IgnoredDemandValue | Float | no | IgnoredDemandValue | |
| IsRunAvailable | Integer | no | Is run available | |
| AvailableRunCapacity | Float | no | available run capacity | |
| IsReceivingDate | Integer | no | Is Receiving Date | |
| GroupKey | String | no | Group key included Site, Company or Location and identity key |
| InventoryProfilesData | Replenishment Temporary |
The table contains information about inventories on every single day, by SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date | |
| Opening | Float | no | Quantity at the begining of the DateFrom day | |
| ForecastDemand | Float | no | Consumption (can be based on orders, forecast, or netted forecast with orders | |
| FirmOrdersIn | Float | no | Total income according to incoming orders and deliveries | |
| FirmOrdersOut | Float | no | Total income according to incoming orders and deliveries | |
| TentativeOrdersIn | Float | no | Total income according to incoming orders and deliveries | |
| TentativeOrdersOut | Float | no | Total income according to incoming orders and deliveries | |
| Closing | Float | no | Inventory, taking into account tentative and firm orders | |
| ProjectInventory | Float | no | Inventory, taking into account firm orders only | |
| SafetyStock | Float | no | Safety stock | |
| MaxSafetyStock | Float | yes | Safety stock | |
| Capacity | Float | no | Capacity of warehouse | |
| SafetyStockPercentWarning | Float | no | Safety stock percent warning | |
| OriginalForecastDemand | Float | no | Original ForecastDemand | |
| IsReceivingDay | Integer | no | Is Receiving Day | |
| OperatorUserId | Identity | no | User id |
| InventorySnapshots | Master Planning Master Planning |
The table contains user snapshots of excess warehouse inventories (FG and SFG) for SNP scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID | |
| DateFrom | Date | no | Scenario period date | |
| MaterialTypeId | Identity | no | Material Type Id | |
| SiteMaterialUsageId | Identity | no | Reference to SKU Id | |
| MaterialId | Identity | no | material id (reference to materials) | |
| PropertyValueId | Identity | yes | SNP property level | |
| LocationId | Identity | no | location id (reference to locations) | |
| ConsignmentLocationId | Identity | yes | Consignment Location ID (reference to locations), which location is the inventory consigned for. | |
| IsMainWarehouse | Integer | yes | Flag, 1 if this is the main warehouse of the site | |
| InitialInventory | Float | no | MinOpening minus SafetyStock on the MP Horizon Start Date plus incoming tentative orders minus outgoing tentative orders after or on current date and before MP Horizon Start. For calculating this value, incoming and outgoing tentative orders are used, which have timestamp from current date (including it) to the beginning of MP horizon (not including the date). | |
| AvailableInventory | Float | no | For FG Inventory: MinOpening minus SafetyStock on the MP Horizon Start Date; for SFG Inventory: Opening minus SafetyStock on the MP Horizon Start Date. Orders are not used. | |
| SafetyStock | Float | no | Current safety stock per scenario. Could be reduced from original Safety stock | |
| OriginalSafetyStock | Float | no | Original Safety stock | |
| Allocation | Float | no | Used Allocation. | |
| UsedSafetyStock | Float | no | Used Safety stock | |
| InventoryDeficit | Float | no | Inventory Deficit | |
| Demand | Float | no | Warehouse demands. | |
| StockDeficit | Float | no | Surplus Increase | |
| SatisfiedFromSafetyStock | Float | no | Surplus Increase | |
| Replenished | Integer | no | Replenished status | |
| IsProductionPeriod | Integer | no | Is Production period, 0 - no, 1 - yes, 2 - first production period | |
| LeadTimeDays | Float | yes | Raw material lead time, in days |
| IPlanHooks | General General |
Table where stored messages for Opt-Studio |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Action | String | no | Action | |
| Procedure | String | no | Procedure for call | |
| Enabled | Integer | no | Is action enabled |
| Jobs | Core Core |
I-Plan jobs. Long-running tasks with progress |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| JobType | String | no | JobType | |
| FileName | LongString | no | FileName for processing | |
| FailedReason | HugeString | yes | FailedReason | |
| IsFinished | Integer | no | Who inserted the record? | |
| SystemProcessId | Identity | no | System process Id | |
| Parameters | Text | yes | Job parameters | |
| Identifier | String | no | Unique identifier | |
| FinishDate | Date | yes | When job finished | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| JobStates | Core Core |
Job states. Indicate progress |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| JobId | Identity | no | Identity | |
| Name | String | no | JobType | |
| Description | String | no | JobType | |
| CurrentState | Identity | no | Current stage | |
| Total | Identity | no | Total | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| JourneyRoutes | Replenishment Replenishment |
The table is used for storing many-to-many link between Journeys and Routes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| JourneyId | Identity | no | A reference to the Journeys table | |
| OrderNo | Integer | no | Order number | |
| TransportRouteId | Identity | no | A reference to the TransportRoutes table | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Journeys | Replenishment Replenishment |
The table is used for storing several routes, with specific transport methods. Journey is from a Site to a Location (normally this will be customer location) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| JourneyCode | String | no | A journey code | |
| IsDefault | Integer | no | A parameter which to specify which journey to use if there are several between the site and the customer | |
| IsInternal | Integer | no | A parameter which to specify which journey to use if there are several between the site and the customer | |
| FromSiteId | Identity | yes | A reference to the Sites table | |
| FromLocationId | Identity | yes | A reference to the Locations table | |
| ToLocationId | Identity | yes | A reference to the Locations table | |
| QuantityLegs | Identity | no | QuantityLegs | |
| Cost | DoubleFloat | no | Tranport route cost | |
| TimePeriod | Integer | no | Duration, days | |
| FirstTransportMethodId | Identity | yes | Transport method used by the leg from the order source to the first location in the chain | |
| LastTransportMethodId | Identity | yes | Transport method used by the leg from the last location in the chain to the order destination | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| LanguageCategories | Core Language |
The table defines the list of language categories used for localization of interface elements |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| LanguageCategoryName | String | no | Language category name | |
| LanguageCategoryDesc | LongString | no | Language category description | |
| LanguageCategoryMask | LongString | no | Key mask | |
| CategoryTypeId | Identity | no | Category type | |
| IsTableMapping | Integer | no | A flag: is this element stored in a separate table? | |
| TableName | String | yes | Table name | |
| TableField | String | yes | Field name in the table | |
| TableFieldKey | String | yes | Key field name of the table | |
| Condition | LongString | yes | Additional condition (optional) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| LanguageCategoryTypes | Core Language |
The table defines language category types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CategoryTypeName | String | no | Language category type name | |
| CategoryTypeDesc | LongString | no | Language category type description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Languages | Core Language |
The table stores the list of languages used in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| LanguageName | String | no | Language name | |
| LanguageDesc | String | no | Language description | |
| internal | Integer | no | An internal column | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| LastReplenishmentOperations | Replenishment Replenishment |
The table stores information about material run operations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderLineId | Identity | no | Order line ID of the operation | |
| OperationNo | Identity | no | Operation number | |
| MaterialRunId | Identity | yes | A reference to the MaterialRuns table | |
| WorkCentreId | Identity | no | The ID of the workcentre where the operation will be performed. A reference to the WorkCentres table | |
| OrderOperationStatusId | Identity | no | Current status of the operation. A reference to the OrderOperationStatuses table | |
| Quantity | Float | no | Quantity | |
| DueDate | Date | yes | Finish date of the run | |
| OperationDuration | Float | no | Calculated operation duration from other columns. Time in minutes | |
| ProcessDuration | Float | yes | Time in minutes. Can be not provided. | |
| Rate | Float | yes | Production rate | |
| StageCode | ShortString | yes | ||
| StageNo | Identity | yes | ||
| OperationTypeId | Identity | no | A reference to the OperationTypes table | |
| MaterialId | Identity | yes | A reference to output production product, if NULL used product from order line | |
| IsLastOperation | Integer | no | Is it last operation? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| LastReplenishmentOrders | Replenishment Replenishment |
The table stores detailed data about the last generated replenihsment order |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| OrderCode | String | no | Order code | |
| AlternateCode1 | String | yes | Alternate code 1 | |
| AlternateCode2 | String | yes | Alternate code 2 | |
| Phase | String | no | Phase for tentative orders | |
| LineNoCode | String | no | External reference to the order line number | |
| LocationId | Identity | no | Customer location | |
| SourceMaterialId | Identity | no | Semifinishing product ID | |
| SourceWeight | Float | no | Weight of SFG product consumed to produce the FG product | |
| MaterialId | Identity | no | Product material ID | |
| WorkCentreId | Identity | yes | Source workcentre ID | |
| FinalWeight | Float | no | Weight, adujsted by supplier | |
| OrderLineStatusId | Identity | no | Order line status | |
| TransportMethodId | Identity | yes | Transport method | |
| DestinationLocationId | Identity | no | Destination location | |
| RequestedDate | Date | no | Requested date, i.e. when the product should be delivered | |
| DeliveryDate | Date | no | Delivery date, i.e. when the product will actually be delivered | |
| DespatchDate | Date | yes | Despatch date, i.e. when the order leaves source location | |
| ConsumptionDate | Date | yes | Consumption date, i.e. when the order should be delivered to the finishing line (it must occur before the run is started) | |
| RequestedDespatchDate | Date | yes | Requested despatch date , i.e. based on requested date | |
| OrderBookId | Identity | no | A reference to the OrderBooks table | |
| JourneyId | Identity | yes | A reference to the Journey table | |
| SiteMaterialUsageId | Identity | no | SKU | |
| SourceSiteMaterialUsageId | Identity | yes | Source SKU | |
| ToConsignmentLocationId | Identity | yes | for consignment orders, this indicates the consignment location that the order will be stored for at the destination location | |
| FromConsignmentLocationId | Identity | yes | for call off orders, this indicates the consignment location that the stock is being sourced from | |
| AllowSubstitution | Integer | no | Flag indicate if an order can be substituted or not. | |
| SkuKey | String | no | Destination SKU Code - SKU-CS. | |
| SourceSkuKey | String | yes | FROM SKU Code - SourceSKU-CS. | |
| ReplenishmentPointId | Identity | yes | Replenishment point Id. For tentative orders generated by replenishment process. | |
| ReplenishmentProcessId | Identity | yes | Replenishment Process Id. For tentative orders generated by replenishment process. | |
| SiteId | Identity | yes | A reference to the Site table | |
| Priority | Integer | no | Priority | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| LaunchProfilePatterns | Forecasting Forecasting |
The table stores pattern values for product launching |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PatternName | String | no | Pattern name | |
| PatternValues | Text | yes | Comma separated values | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| LaunchProfiles | Forecasting Forecasting |
The table stores values per periods |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Launch profile Id |
| SecondPassRuleId | Identity | yes | A reference to second pass rule | |
| ForecastMethodRuleId | Identity | yes | forecast method rule Id | |
| PatternId | Identity | no | Launch profile pattern | |
| StartMonth | Date | no | StartMonth | |
| Volume | Float | no | Volume in default weight unit | |
| Periods | Integer | no | Period Number | |
| UnitId | Identity | no | Weight unit Id | |
| InsertUserId | Identity | yes | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ListOrdersData | Replenishment Temporary |
List of orders for inventory profiles. Used in replenishment for show List Orders screen. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialId | Identity | yes | Reference to Materials table | |
| LocationId | Identity | yes | Reference to Locations table | |
| OrderLineId | Identity | yes | Reference to OrderLines table | |
| DeliveryId | Identity | yes | Reference to OrderLines table | |
| Quantity | Float | yes | for incoming order - SupplierAdjusted, for outgoing order - SourceWeight | |
| FinalWeight | Float | yes | ||
| OrderType | String | yes | ||
| MovementType | String | no | Firm, Replenishment, Delivery | |
| Direction | String | yes | incoming, outgoing | |
| MovementDate | Date | yes | Movement date | |
| DeliveryDate | Date | yes | Delivery date | |
| RequestedDate | Date | yes | Delivery date | |
| RequestedDespatchDate | Date | yes | Requested despatch date | |
| Phase | String | yes | Replenishment phase | |
| MaterialRunId | Identity | yes | Reference to MaterialRuns table | |
| OperatorUserId | Identity | no | Who insert line? | |
| WorkCentreName | String | yes | Work centre name | |
| SourceWorkCentreName | String | yes | Source work centre name | |
| Transport | String | yes | Transport | |
| OrderCode | String | yes | The OrderBook code | |
| LineNoCode | String | yes | Externl reference to Order line number | |
| DeliveryCode | String | yes | Delivery Code | |
| AlternateCode1 | String | yes | Alternate Code 1 | |
| AlternateCode2 | String | yes | Alternate Code 2 | |
| Status | String | yes | Status | |
| DispatchDate | Date | yes | Dispatch date | |
| CustomerRank | String | yes | Customer rank | |
| Source | LongString | yes | Source | |
| SourceMaterial | String | yes | Source material | |
| AllowSubstitution | Integer | no | Allow substitution flag | |
| DestinationMaterial | String | yes | Destination material | |
| ReplenishmentPoint | String | yes | Final replenishment point | |
| IsEditable | Integer | no | Is row editable |
| LiveAllocationData | Master Planning Master Planning |
A temporary table for live allocations. These are the allocations released from SNP optimisation to be used by subsequent processes (shown in Demand Control screen, used by Replenishment, etc). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| SummaryFields | HugeString | yes | Summary Fields | |
| DateFrom | Date | yes | date | |
| Forecast | Float | no | Forecast quantity | |
| Orders | Float | no | Orders quantity | |
| UnallocatedOrders | Float | no | Unallocated Orders quantity | |
| BackOrders | Float | no | Outstanding orders quantity (back-orders) | |
| OriginalAllocation | Float | no | Original Allocation quantity (quantity on release from SNP scenario) | |
| CurrentAllocation | Float | no | Current Allocation quantity (potentially edited by user or external messages) | |
| RemainingAllocation | Float | no | Remaining Allocation quantity | |
| Unallocated | Float | no | Unallocated quantity | |
| IsWorking | Integer | no | ||
| AllocationComment | LongestString | yes | Comment Text | |
| AllocationChangeId | Identity | yes | Allocation Change ID | |
| ReasonId | Identity | yes | Allocation Reason ID | |
| ForecastTotal | Float | no | Total Forecast quantity | |
| Indicatives | Float | no | Indicatives value | |
| IndicativesTotal | Float | no | Indicative Total | |
| MTDHistory | Float | no | Month-to-Date History quantity | |
| OriginalAllocationTotal | Float | no | Original Allocation Total quantity | |
| CurrentAllocationTotal | Float | no | Current Allocation Total quantity | |
| OrdersTotal | Float | no | Orders Total quantity | |
| UnallocatedOrdersTotal | Float | no | Unallocated Orders Total quantity | |
| RemainingAllocationTotal | Float | no | Remaining Allocation Total quantity | |
| UnallocatedTotal | Float | no | Unallocated Total quantity | |
| MTDHistoryTotal | Float | no | Month-to-Date History Total quantity | |
| Filtered | Identity | no | ||
| EditableIndicatives | Integer | no | Editable Indicatives |
| LiveAllocationStatData | Master Planning Master Planning |
A temporary table for live allocations (Demand Control) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| SummaryFields | HugeString | yes | SummaryFields | |
| Allocation | Float | no | ||
| Indicatives | Float | no | ||
| TotalAllocation | Float | no | ||
| TotalIndicatives | Float | no | ||
| HistoryMTD | Float | no | ||
| AllocationMTD | Float | no | ||
| AllocationOrders | Float | no | ||
| IndicativesMTD | Float | no | ||
| IndicativesOrders | Float | no |
| LiveProdPlanLevelsData | Master Planning Production Plan |
A temporary table for production plan levels |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (A reference to Users) | |
| OperationTypeId | Identity | no | ||
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| MaterialId | Identity | no | ||
| WorkCentreTypeId | Identity | no | ||
| WorkCentreId | Identity | no | ||
| Priority | Identity | no |
| LocationDetails | Core Core |
The table stores location hashes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| LocationId | Identity | no | Location Id | |
| HierarchyBits | String | no | PropertyBits settings | |
| HierarchyHash | RawHash | no | PropertyBits settings |
| Locations | Core Core |
The table stores the list of locations registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| LocationName | LongString | no | Location name | |
| LocationCode | ShortString | no | Location external code | |
| CompanyId | Identity | no | Company ID | |
| HierarchyId | Identity | yes | Hierarchy ID | |
| CustomerRankId | Identity | yes | Customer rank | |
| SafetyStockMethodId | Identity | yes | Default safety stock method | |
| CalendarId | Identity | yes | Used calendar | |
| TransportLocationId | Identity | yes | Reference to the transport location | |
| StockLocationId | Identity | yes | Reference to the stock location | |
| WarehouseLocationId | Identity | yes | Reference to the warehouse group location | |
| SiteId | Identity | yes | Site | |
| OrderAutoConfirmPeriod | Integer | yes | Period of automatic confirmation of tentative orders | |
| LocationProperties | HugeString | yes | Hierarchies properties for location | |
| CurrencyId | Identity | yes | Currency | |
| ForecastRangeId | Identity | yes | forecast range for daily distribution | |
| DefaultCustomerForecast | ShortString | no | values - System, Budget, Zero, Budget then Zero | |
| Capacity | Float | no | Location capacity used for DC | |
| AllocatedStock | Float | no | Location capacity used for DC | |
| UseTradingDays | Integer | yes | Ue trading days for forecast generation | |
| LocationStatus | ShortString | no | Status | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| LoginInformation | Core Configuration |
The table stores the information of active logins |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date from | |
| MaxLogins | Identity | no | Count max logins | |
| FailedLogins | Identity | no | Count failed logins | |
| TopPageName | String | yes | NULL if its general failed logins | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MachineInformation | Master Planning Master Planning |
The table contains detailed information about capacity workcentres (machines: e.g. paper machines, rewinders, extruders etc) for each user, to pass to the SNP optimisation engine. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| SiteId | Identity | no | Site ID (A reference to Sites) | |
| WorkcentreId | Identity | yes | Workcentre ID (A reference to Workcentres) | |
| TimePeriod | Integer | no | SNP time period index | |
| DateFrom | Date | no | Sourcing period | |
| NominalCapacity | Float | no | Nominal Capacity (in quantity units) | |
| Capacity | Float | no | Capacity reduced by the shut time | |
| Allocation | Float | no | Allocation quantity | |
| Orders | Float | no | Orders quantity | |
| CoProductAllocation | Float | no | Co-product Allocation quantity | |
| CoProductOrders | Float | no | Co-Product Orders quantity | |
| AvailableCapacityHours | Float | no | Available capacity in hours: (nominal - shuts) * machine time efficiency / 100 | |
| CapacityHours | Float | no | Available capacity in hours | |
| NominalCapacityHours | Float | no | Nominal Capacity in hours | |
| ShutHours | Float | no | Duration of shuts (in hours) | |
| OrdersHours | Float | no | Time in hours spent to produce nonmovable orders within the time period | |
| AllocationHours | Float | no | Time in hours of Production Allocations | |
| CoProductOrdersHours | Float | no | Time in hours spent to produce coproducts of nonmovable orders within the time period | |
| CoProductAllocationHours | Float | no | Time in hours to produce coproducts of demand allocations | |
| FixedCapacityHours | Float | no | Fixed capacity time in hours | |
| TimeEfficiency | Float | no | Time efficiency coefficient | |
| MachineType | String | no | String describing the machine type: PM (production), WH (inventory) |
| MandatorySettings | Master Planning Allocations |
Table that stores customer hierarchy and material property combinations that are configured to be mandatory. This data is outside of an SNP session, but used when the session is created (it's then stored in MandatorySettingSnapshots). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Id |
| Value1 | LongString | yes | Property/Hierarchy value | |
| Value2 | LongString | yes | Property/Hierarchy value | |
| Value3 | LongString | yes | Property/Hierarchy value | |
| Value4 | LongString | yes | Property/Hierarchy value | |
| Value5 | LongString | yes | Property/Hierarchy value | |
| Value6 | LongString | yes | Property/Hierarchy value | |
| Value7 | LongString | yes | Property/Hierarchy value | |
| Value8 | LongString | yes | Property/Hierarchy value | |
| Value9 | LongString | yes | Property/Hierarchy value | |
| Value10 | LongString | yes | Property/Hierarchy value | |
| Value11 | LongString | yes | Property/Hierarchy value | |
| Value12 | LongString | yes | Property/Hierarchy value | |
| Value13 | LongString | yes | Property/Hierarchy value | |
| Value14 | LongString | yes | Property/Hierarchy value | |
| Value15 | LongString | yes | Property/Hierarchy value | |
| Value16 | LongString | yes | Property/Hierarchy value | |
| Value17 | LongString | yes | Property/Hierarchy value | |
| Value18 | LongString | yes | Property/Hierarchy value | |
| Value19 | LongString | yes | Property/Hierarchy value | |
| Value20 | LongString | yes | Property/Hierarchy value | |
| Value21 | LongString | yes | Property/Hierarchy value | |
| Value22 | LongString | yes | Property/Hierarchy value | |
| Value23 | LongString | yes | Property/Hierarchy value | |
| Value24 | LongString | yes | Property/Hierarchy value | |
| Value25 | LongString | yes | Property/Hierarchy value | |
| Value26 | LongString | yes | Property/Hierarchy value | |
| Value27 | LongString | yes | Property/Hierarchy value | |
| Value28 | LongString | yes | Property/Hierarchy value | |
| Value29 | LongString | yes | Property/Hierarchy value | |
| Value30 | LongString | yes | Property/Hierarchy value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MandatorySettingSnapshots | Master Planning Allocations |
Snapshot of customer hierarchy and material property combinations that are mandatory in SNP user scenarios. SNP will prioritise allocating the demands that match these hierarchy/properties. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Id | |
| ScenarioId | Identity | no | Scenario Id | |
| ScenarioSessionId | Identity | yes | Scenario SessionID, NULL means new session for the user (to be able to store and edit before session is crteated). | |
| SnapshotUserId | Identity | no | Who inserted the record? | |
| Value1 | LongString | yes | Property/Hierarchy value | |
| Value2 | LongString | yes | Property/Hierarchy value | |
| Value3 | LongString | yes | Property/Hierarchy value | |
| Value4 | LongString | yes | Property/Hierarchy value | |
| Value5 | LongString | yes | Property/Hierarchy value | |
| Value6 | LongString | yes | Property/Hierarchy value | |
| Value7 | LongString | yes | Property/Hierarchy value | |
| Value8 | LongString | yes | Property/Hierarchy value | |
| Value9 | LongString | yes | Property/Hierarchy value | |
| Value10 | LongString | yes | Property/Hierarchy value | |
| Value11 | LongString | yes | Property/Hierarchy value | |
| Value12 | LongString | yes | Property/Hierarchy value | |
| Value13 | LongString | yes | Property/Hierarchy value | |
| Value14 | LongString | yes | Property/Hierarchy value | |
| Value15 | LongString | yes | Property/Hierarchy value | |
| Value16 | LongString | yes | Property/Hierarchy value | |
| Value17 | LongString | yes | Property/Hierarchy value | |
| Value18 | LongString | yes | Property/Hierarchy value | |
| Value19 | LongString | yes | Property/Hierarchy value | |
| Value20 | LongString | yes | Property/Hierarchy value | |
| Value21 | LongString | yes | Property/Hierarchy value | |
| Value22 | LongString | yes | Property/Hierarchy value | |
| Value23 | LongString | yes | Property/Hierarchy value | |
| Value24 | LongString | yes | Property/Hierarchy value | |
| Value25 | LongString | yes | Property/Hierarchy value | |
| Value26 | LongString | yes | Property/Hierarchy value | |
| Value27 | LongString | yes | Property/Hierarchy value | |
| Value28 | LongString | yes | Property/Hierarchy value | |
| Value29 | LongString | yes | Property/Hierarchy value | |
| Value30 | LongString | yes | Property/Hierarchy value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MandatorySnpItemSnapshots | Master Planning Master Planning |
The table stores Mandatory SNP Items |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| SnpItemId | Identity | yes | SNP Item ID | |
| IsMandatory | Integer | no | Is Mandatory flag (1 - mandatory, 0 - optional) |
| MarketInfo | Forecasting Forecasting |
The table stores the Market info |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Month | |
| Value | Float | no | tonnes | |
| Market | String | no | Market | |
| ProductManager | String | yes | Product Manager | |
| Region | String | yes | Region | |
| Country | String | yes | Country | |
| BusinessArea | String | yes | Business Area | |
| Segment1 | String | yes | Segment1 | |
| Segment2 | String | yes | Segment2 | |
| Segment3 | String | yes | Segment3 | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MasterRoutes | Replenishment Replenishment |
The table contains the list of transport routes (with their parameters - cost, delivery time, location, shedule) between a site and a hierarchy node (for both types of hierarchy). It is used by master planning subsystem of I-Plan. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Cost | DoubleFloat | no | Master route cost | |
| TimePeriod | Integer | no | Route time | |
| FromSiteId | Identity | no | Source site ID of the route | |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| MinCapacity | Float | no | Min. Capacity. 0 mean no limitation | |
| MaxCapacity | Float | no | Max. Capacity. 0 mean no limitation | |
| IsActive | Integer | no | Is route active? | |
| RouteCategory | String | yes | Route category | |
| RuleWeighting | Integer | no | Rule Weighting | |
| MaterialTypeId | Identity | yes | Material Type Id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MasterRouteSnapshots | Master Planning Master Planning |
The table contains master routes for SNP user scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Snapshot user ID (A reference to Users) | |
| Id | Identity | yes | no | Master Route ID |
| Cost | DoubleFloat | no | Master Route Cost | |
| TimePeriod | Integer | no | Master Route duration, in days | |
| FromSiteId | Identity | no | Source site ID (reference to Sites) | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| IsActive | Integer | no | Flag: is the mater route active (included in SNP) | |
| MinCapacity | Float | no | Min. Capacity, quantity per full SNP time period. 0 means no limitation | |
| MaxCapacity | Float | no | Max. Capacity, quantity per full SNP time period. 0 means no limitation | |
| RouteCategory | String | yes | Route category | |
| MaterialTypeId | Identity | yes | Material Type Id | |
| RuleWeighting | Integer | no | Rule Weighting, the higher the more priority the route is given | |
| InsertUserId | Identity | no | Who insert line? | |
| InsertDate | Date | no | When line is inserted? | |
| UpdateUserId | Identity | yes | Who update line? | |
| UpdateDate | Date | yes | When line is updated? |
| MaterialBlocks | Block Scheduling Block Scheduling |
Runs are combines into blocks. All information about a block is applied to all runs in the block. However, start and end dates of a block are start and finish date of the first and the last run in the block, respectively. The table describes material blocks. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| BlockCode | ShortString | no | Block code | |
| WorkCentreId | Identity | no | A reference to WorkCentre | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialDetails | Core Core |
The table stores material hashes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialId | Identity | no | Material Id | |
| PropertyBits | String | no | PropertyBits settings | |
| PropertyHash | RawHash | no | PropertyBits settings |
| MaterialGroups | Core Core |
Store materials which share same source priorities |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialId | Identity | no | Identity | |
| Edge | HugeString | no | Source Priorities list | |
| GroupId | Identity | no | Material Group Id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| MaterialPropsSpec | Core Core |
The table stores material properties (specifications) in unfolded form |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialId | Identity | no | Material identity | |
| MaterialTypeId | Identity | no | Material type | |
| PropertyValueId | Identity | yes | Property Value Id of latest property | |
| MaterialTypeName | String | no | Material type name | |
| MaterialName | LongString | no | Product name | |
| MaterialCode | String | no | Product code | |
| Value1 | LongString | yes | References to PropertyValues | |
| Value2 | LongString | yes | References to PropertyValues | |
| Value3 | LongString | yes | References to PropertyValues | |
| Value4 | LongString | yes | References to PropertyValues | |
| Value5 | LongString | yes | References to PropertyValues | |
| Value6 | LongString | yes | References to PropertyValues | |
| Value7 | LongString | yes | References to PropertyValues | |
| Value8 | LongString | yes | References to PropertyValues | |
| Value9 | LongString | yes | References to PropertyValues | |
| Value10 | LongString | yes | References to PropertyValues | |
| Value11 | LongString | yes | References to PropertyValues | |
| Value12 | LongString | yes | References to PropertyValues | |
| Value13 | LongString | yes | References to PropertyValues | |
| Value14 | LongString | yes | References to PropertyValues | |
| Value15 | LongString | yes | References to PropertyValues | |
| Value16 | LongString | yes | References to PropertyValues | |
| Value17 | LongString | yes | References to PropertyValues | |
| Value18 | LongString | yes | References to PropertyValues | |
| Value19 | LongString | yes | References to PropertyValues | |
| Value20 | LongString | yes | References to PropertyValues | |
| Value21 | LongString | yes | References to PropertyValues | |
| Value22 | LongString | yes | References to PropertyValues | |
| Value23 | LongString | yes | References to PropertyValues | |
| Value24 | LongString | yes | References to PropertyValues | |
| Value25 | LongString | yes | References to PropertyValues | |
| Value26 | LongString | yes | References to PropertyValues | |
| Value27 | LongString | yes | References to PropertyValues | |
| Value28 | LongString | yes | References to PropertyValues | |
| Value29 | LongString | yes | References to PropertyValues | |
| Value30 | LongString | yes | References to PropertyValues | |
| Code1 | ShortString | yes | References to PropertyCodes | |
| Code2 | ShortString | yes | References to PropertyCodes | |
| Code3 | ShortString | yes | References to PropertyCodes | |
| Code4 | ShortString | yes | References to PropertyCodes | |
| Code5 | ShortString | yes | References to PropertyCodes | |
| Code6 | ShortString | yes | References to PropertyCodes | |
| Code7 | ShortString | yes | References to PropertyCodes | |
| Code8 | ShortString | yes | References to PropertyCodes | |
| Code9 | ShortString | yes | References to PropertyCodes | |
| Code10 | ShortString | yes | References to PropertyCodes | |
| Code11 | ShortString | yes | References to PropertyCodes | |
| Code12 | ShortString | yes | References to PropertyCodes | |
| Code13 | ShortString | yes | References to PropertyCodes | |
| Code14 | ShortString | yes | References to PropertyCodes | |
| Code15 | ShortString | yes | References to PropertyCodes | |
| Code16 | ShortString | yes | References to PropertyCodes | |
| Code17 | ShortString | yes | References to PropertyCodes | |
| Code18 | ShortString | yes | References to PropertyCodes | |
| Code19 | ShortString | yes | References to PropertyCodes | |
| Code20 | ShortString | yes | References to PropertyCodes | |
| Code21 | ShortString | yes | References to PropertyCodes | |
| Code22 | ShortString | yes | References to PropertyCodes | |
| Code23 | ShortString | yes | References to PropertyCodes | |
| Code24 | ShortString | yes | References to PropertyCodes | |
| Code25 | ShortString | yes | References to PropertyCodes | |
| Code26 | ShortString | yes | References to PropertyCodes | |
| Code27 | ShortString | yes | References to PropertyCodes | |
| Code28 | ShortString | yes | References to PropertyCodes | |
| Code29 | ShortString | yes | References to PropertyCodes | |
| Code30 | ShortString | yes | References to PropertyCodes | |
| Characteristic1 | ShortString | yes | References to Product Characteristics | |
| Characteristic2 | ShortString | yes | References to Product Characteristics | |
| Characteristic3 | ShortString | yes | References to Product Characteristics | |
| Characteristic4 | ShortString | yes | References to Product Characteristics | |
| Characteristic5 | ShortString | yes | References to Product Characteristics | |
| Characteristic6 | ShortString | yes | References to Product Characteristics | |
| Characteristic7 | ShortString | yes | References to Product Characteristics | |
| Characteristic8 | ShortString | yes | References to Product Characteristics | |
| Characteristic9 | ShortString | yes | References to Product Characteristics | |
| Characteristic10 | ShortString | yes | References to Product Characteristics |
| MaterialRunAttributes | Block Scheduling Block Scheduling |
Except properties, FL runs also should contain attributes. Attributes are properties of PM run concerned with FL run. The table contains information about attributes of material runs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunId | Identity | no | A reference to MaterialRuns.Id | |
| PropertyId | Identity | no | A reference to Properties.Id | |
| PropertyValueCode | String | no | Property value code | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialRunLogs | Block Scheduling Logging |
The table stores field-level changes of material runs. Status changes use FieldName = RunStatusCode and store status codes in OldValue and NewValue. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Unique identifier |
| EventTime | TimeStamp | no | When the field change was recorded | |
| MaterialRunId | Identity | no | Material run identity | |
| RunCode | LongString | yes | Run code snapshot at the time of change | |
| OldMaterialBlockId | Identity | yes | Material block before the change | |
| NewMaterialBlockId | Identity | yes | Material block after the change | |
| OldWorkCentreId | Identity | yes | WorkCentre before the change | |
| NewWorkCentreId | Identity | yes | WorkCentre after the change | |
| WorkCentreId | Identity | yes | WorkCentre snapshot at the time of change | |
| FieldName | String | no | Changed MaterialRun field | |
| OldValue | String | yes | Previous field value | |
| NewValue | String | yes | New field value | |
| ReasonCode | String | no | Reason code for the change | |
| ReasonDetails | LongString | yes | Additional reason details | |
| SourceProcedure | String | yes | Procedure or application path that initiated the change | |
| OperatorUserId | Identity | yes | Application or operator user identity |
| MaterialRunParametersData | Block Scheduling Temporary |
Properties and attributes of the run being edited in the Campaign Editor. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre Id | |
| MaterialRunId | Identity | yes | Reference to MaterialRuns table | |
| StartDate | Date | yes | Run StartDate | |
| FinishDate | Date | yes | Run FinishDate | |
| TargetStartDate | Date | yes | Run TargetStartDate | |
| InitialDuration | Float | yes | Run InitialDuration | |
| SwitchoverDuration | Float | yes | Run SwitchoverDuration | |
| ProductId | Identity | no | Reference to MaterialRunProducts table | |
| PropertyId | Identity | no | Property Id | |
| PropertyValueCode | String | no | PropertyValueCode | |
| PropertyQuantity | Integer | yes | Quantity of properties of the run | |
| isAttribute | Integer | no | 0 for properties, 1 for attributes | |
| RunCode | LongString | yes | Run Code | |
| Quantity | Float | yes | Run Quantity | |
| WasteTime | Float | yes | Run Waste Time | |
| ProcessRate | Float | yes | Run Process Rate | |
| Status | ShortString | yes | Run Status | |
| RunType | String | yes | Run Type | |
| IsPropsChanged | Integer | yes | 1 when properties are changed in the first screen of the Campaign Editor, 0 otherwise | |
| OperatorUserId | Identity | no | Who inserted the line? |
| MaterialRunProducts | Block Scheduling Block Scheduling |
A run can produce one or more products. Opportunistic runs and idle times don't produce any materials. The table contains information about products that are planned to produce on material runs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Unique Identifier |
| MaterialRunId | Identity | no | A reference to MaterialRuns.Id | |
| ProductName | LongString | yes | Product name | |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| MaterialRunProperties | Block Scheduling Block Scheduling |
The table contains run properties. Each run (PM and FL) which contains products, should contain properties as well. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| RunProductId | Identity | no | A reference to RunProducts.Id | |
| PropertyId | Identity | no | A reference to Properties.Id | |
| PropertyValueCode | ShortString | no | Property value code | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialRunPropertiesData | Block Scheduling Temporary |
List of properties of a run. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunPropertyId | Identity | no | Reference to MaterialRunProperties table | |
| MaterialRunId | Identity | no | Reference to MaterialRuns table | |
| PropertyId | Identity | no | Property Id | |
| PropertyName | String | no | Property Name | |
| PropertyDesc | String | no | Property description | |
| Value | LongString | no | Value of the property | |
| PropertyValueCode | String | no | PropertyValueCode of the property | |
| LevelNo | Integer | no | HierarchyLevelNo of the property | |
| OperatorUserId | Identity | no | Who inserted the line? |
| MaterialRuns | Block Scheduling Block Scheduling |
The table stores information about campaigns. A campaign consists of a few individual material runs. Currently there are 2 possible types of campaigns - template and conventional (not template). Also there are 3 types of Material runs: run, opportunistic run, and idle time. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Unique identifier |
| RunCode | LongString | no | Run code | |
| BlockRunCode | LongString | yes | Block + space + Run code | |
| NominalCapacity | Float | no | Run capacity | |
| Quantity | Float | no | Run capacity | |
| WasteTime | Float | no | Time waste | |
| ProcessRate | Float | no | Production rate of the run | |
| StartDate | Date | no | Run start date | |
| FinishDate | Date | no | Run end date | |
| TargetStartDate | Date | yes | Run target start date | |
| InitialDuration | Float | no | Initial duration and real run duration, including changeover | |
| SwitchoverDuration | Float | no | Changeover duration. This duration is a part or run duration | |
| QuantityComplete | Float | no | Cumulative run quantity produced on the productionUpdateTimestamp | |
| ProductionUpdateTimestamp | Date | yes | Date of production update (timestamp) | |
| MaterialRunStatusId | Identity | no | A reference to MaterialRunStatuses | |
| MaterialBlockId | Identity | no | A reference to MaterialBlocks.Id | |
| WorkcentreId | Identity | no | A reference to Workcentres.Id | |
| RunType | String | yes | Run type: production, floating shut or opportunistic run | |
| UpdateOrderDates | Integer | no | Indicator that required recalculation for order line dates. Used during Fine Planning update | |
| IsFixed | Integer | no | Indicator that required recalculation for order line dates. Used during Fine Planning update | |
| IsChanged | Integer | no | Indicator that run was changed. Used for sending to external systems | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialRunsForPlan | Scenario Analysis Production Plan |
Material production runs "Release to Production Plan" logic from the Demand Control screen. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | ||
| SnapshotState | Integer | no | 0 - live state (copy) 1 - working state | |
| MaterialRunId | Identity | yes | ||
| WorkCentreId | Identity | no | ||
| SourcePeriod | Date | no | ||
| StartDate | Date | no | ||
| FinishDate | Date | no | ||
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InitialDuration | Float | no | ||
| OrderDuration | Float | no | ||
| IsFixed | Integer | no | ||
| IsActive | Integer | no | ||
| OriginalOrderNo | Integer | no | ||
| AvailableDuration | Float | no | ||
| Rate | Float | no | ||
| NewMaterialRunId | Identity | yes |
| MaterialRunStatuses | Block Scheduling Block Scheduling |
The table stores the list of possible material run statuses |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RunStatusCode | ShortString | no | Run Status Code | |
| RunStatusName | String | no | Run Status Name | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Materials | Core Core |
The table stores the list of all products registered in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialName | LongString | no | Product name | |
| MaterialCode | String | no | Product code | |
| MaterialTypeId | Identity | no | A reference to MaterialTypes table | |
| PropertyValueId | Identity | yes | A reference to a value in the properties tree | |
| SourceMaterialId | Identity | yes | A reference to Materials table | |
| MaterialProperties | LongestString | no | Product properties | |
| SiteId | Identity | yes | A reference to Sites table | |
| UsedWithMaterialId | Identity | yes | A reference to pair material, used only for tools | |
| ForecastStartDate | Date | yes | Forecast start date | |
| ForecastFinishDate | Date | yes | Forecast end date | |
| ReplenishmentStartDate | Date | yes | Replenishment start date | |
| ReplenishmentFinishDate | Date | yes | Replenishment start date | |
| IsActive | Integer | no | Is active | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialSupercessions | Core Core |
The table stores the list of possible material supercessions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Type | String | no | Supercession type: Supercession, Substitution, Both | |
| SiteMaterialUsageId | Identity | no | Superceded SKU. A reference to SiteMaterialUsages | |
| OnSiteMaterialUsageId | Identity | no | Superceding SKU. A reference to SiteMaterialUsages | |
| SupercessionRuleId | Identity | yes | Supercession rule ID | |
| StartDate | Date | no | The date, after which the rule is effective | |
| GeneratedFromId | Identity | yes | id from which this rule has been generated | |
| Percentage | Float | no | Percentage | |
| LevelNo | Identity | no | depth in tree for autocreated supercessions | |
| DisableSupersededItems | Integer | no | Switch off supercessed sku for forecasting | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialTypeProperties | Core Core |
The table describes relations between material types and properties available for these types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialTypeId | Identity | no | Material type ID. A reference to MaterialTypes | |
| PropertyId | Identity | no | An ID of a property available for the material type. A reference to Properties | |
| DataMask | String | yes | Data mask for property value formatting | |
| HierarchyLevelNo | Integer | no | Hierarchy level number | |
| ProductionStageNo | Integer | no | Production stage code: 1 - conventional property; 2 - dimensional property | |
| DefaultValue | String | yes | Default value for property | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialTypes | Core Core |
The table stores the list of available material types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialTypeName | String | no | Material type name | |
| MaterialCodePattern | LongestString | yes | Pattern for material type code | |
| MaterialNamePattern | LongestString | yes | Pattern for material type name | |
| IsFinishedGoods | Integer | no | A flag: is this a finishing goods materials? | |
| IsTool | Integer | no | A flag: is this a tool material? | |
| RoundingUnitId | Identity | yes | A reference to Units | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MaterialUnits | Core Core |
The table stores coefficients for units convertion |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialId | Identity | no | A reference to Materials | |
| UnitId | Identity | no | A reference to Units | |
| Dividend | DoubleFloat | no | Dividend | |
| Divisor | DoubleFloat | no | Divisor | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MessageCharacteristics | Core Configuration |
The table stores allowed entity type for message |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MessageName | LongestString | no | Message name | |
| EntityType | LongestString | no | Characteristic entity type | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MessageHierarchies | Core Core |
The table stores initial source hierarchies |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Id | |
| EntityName | String | no | EntityName (SupercessionRule, InitialSourceRule) | |
| HierarchyLevelId | Identity | yes | A reference to HierarchyLevels table | |
| HierarchyCode | String | no | Hierarchy code | |
| ToHierarchyCode | String | yes | ToHierarchy code |
| MessageProperties | Core Core |
The table stores mapped property codes for supercessions and product substitutions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Id | |
| EntityName | String | no | EntityName (SupercessionRule, ProductSubstitution) | |
| PropertyId | Identity | yes | A reference to Properties table | |
| PropertyValueCode | String | no | Source priority value code | |
| ToPropertyValueCode | String | yes | Source priority value code |
| MessagesLog | Core Logging |
The table is used to maintain external messages log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| Direction | String | no | Direction: incoming or outgoing | |
| TopElement | String | no | Top element | |
| Code | String | yes | Message code | |
| Message | Text | no | Message text | |
| Error | Text | yes | Error description | |
| ExactMessage | Text | yes | Exact message where error is happens | |
| StartTime | TimeStamp | no | The moment when the record was inserted | |
| FinishTime | TimeStamp | no | The moment when the record was inserted | |
| IsFailed | Integer | no | The moment when the record was inserted | |
| SourceDestination | ShortString | yes | Source Destination | |
| ContentType | ShortString | yes | Content Type with possible values: json, xml, xml-metadata | |
| OperatorUserId | Identity | yes | Who inserted the record? |
| MinimumAllocations | Master Planning Allocations |
Table to store minimum marekt allocations. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Property ID (A reference to Properties) | |
| Value1 | LongString | yes | Property/Hierarchy value | |
| Value2 | LongString | yes | Property/Hierarchy value | |
| Value3 | LongString | yes | Property/Hierarchy value | |
| Value4 | LongString | yes | Property/Hierarchy value | |
| Value5 | LongString | yes | Property/Hierarchy value | |
| Value6 | LongString | yes | Property/Hierarchy value | |
| Value7 | LongString | yes | Property/Hierarchy value | |
| Value8 | LongString | yes | Property/Hierarchy value | |
| Value9 | LongString | yes | Property/Hierarchy value | |
| Value10 | LongString | yes | Property/Hierarchy value | |
| Value11 | LongString | yes | Property/Hierarchy value | |
| Value12 | LongString | yes | Property/Hierarchy value | |
| Value13 | LongString | yes | Property/Hierarchy value | |
| Value14 | LongString | yes | Property/Hierarchy value | |
| Value15 | LongString | yes | Property/Hierarchy value | |
| Value16 | LongString | yes | Property/Hierarchy value | |
| Value17 | LongString | yes | Property/Hierarchy value | |
| Value18 | LongString | yes | Property/Hierarchy value | |
| Value19 | LongString | yes | Property/Hierarchy value | |
| Value20 | LongString | yes | Property/Hierarchy value | |
| Value21 | LongString | yes | Property/Hierarchy value | |
| Value22 | LongString | yes | Property/Hierarchy value | |
| Value23 | LongString | yes | Property/Hierarchy value | |
| Value24 | LongString | yes | Property/Hierarchy value | |
| Value25 | LongString | yes | Property/Hierarchy value | |
| Value26 | LongString | yes | Property/Hierarchy value | |
| Value27 | LongString | yes | Property/Hierarchy value | |
| Value28 | LongString | yes | Property/Hierarchy value | |
| Value29 | LongString | yes | Property/Hierarchy value | |
| Value30 | LongString | yes | Property/Hierarchy value | |
| Allocation | Float | yes | Allocation, null means that the value is not configured | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| MinimumAllocationsSnapshot | Master Planning Allocations |
Table to store minimum market allocations per SNP session. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Property ID (A reference to Properties) | |
| Allocation | Float | no | Allocation, null means that the value is not configured | |
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) |
| MonthlyExchangeRates | Core Core |
The table stores the list of exchange rates registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| FromCurrencyId | Identity | no | This is the currency to convert to from the system's base currency | |
| ToCurrencyId | Identity | no | This is the currency to convert to from the system's base currency | |
| DateFrom | Date | no | Date that the exchange rate becomes effective | |
| FromMultiplier | DoubleFloat | no | The value to multiply the base currency by to convert to the specified currency. Can be used in conjunction with divider to specify the rate as a fraction | |
| FromDivider | DoubleFloat | no | Used with the multiplier to calculate the rate to convert from the base currency to the specified currency. Not usually required (hence defaults to 1), but useful if the exchange rate is a very low value to avoid rounding errors, eg the old Turkish lira was over 1,000,000 to the GBP | |
| ToMultiplier | DoubleFloat | no | The value to multiply the base currency by to convert to the specified currency. Can be used in conjunction with divider to specify the rate as a fraction | |
| ToDivider | DoubleFloat | no | Used with the multiplier to calculate the rate to convert from the base currency to the specified currency. Not usually required (hence defaults to 1), but useful if the exchange rate is a very low value to avoid rounding errors, eg the old Turkish lira was over 1,000,000 to the GBP |
| MovingForecastGroupData | Forecasting Temporary |
Temporary table for carrying forecast values from previous forecast generations to current. Used when selected method - by Property |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | date (month) | |
| GroupId | Identity | no | Group Id | |
| EditGroupId | Identity | yes | Group Id | |
| EditGroupFinalId | Identity | yes | Group Id | |
| SiteMaterialUsageId | Identity | no | Site Material Usage Id | |
| RealFinal | Float | yes | Final previous forecast value | |
| Final | Float | yes | Final previous forecast value | |
| RealFinalSum | Float | yes | Final previous forecast value sum | |
| FinalSum | Float | yes | Final previous forecast value sum | |
| CurrentSum | Float | yes | Current forecast value sum | |
| System | Float | yes | system forecast value | |
| Quantity | Float | yes | quantity sku per edit group | |
| WeeklyEdited | Integer | yes | flag | |
| ShouldBeMoved | Integer | yes | Should be moved (mean real change) | |
| OperatorUserId | Identity | no | user id |
| MPBSAllocationData | Block Scheduling Temporary |
A temporary table for order and allocation netting (ticket 51150) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| DeliveryDate | Date | no | ||
| DateFrom | Date | no | ||
| SiteMaterialUsageId | Identity | no | ||
| WorkcentreId | Identity | no | ||
| Allocation | Float | no | ||
| Orders | Float | no | ||
| Flag | Identity | no |
| MPBSComparisonData | Block Scheduling Temporary |
A temporary table for BS / MP comparison screen (ticket 51150) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| DateFrom | Date | no | ||
| RunCapacity | Float | no | ||
| TotalAllocation | Float | no | ||
| Difference | Float | no | ||
| CumulativeTotalAllocation | Float | no | ||
| CumulativeRunCapacity | Float | no | ||
| CumulativeDifference | Float | no | ||
| AllocationToOrders | Float | no | ||
| AllocationToForecast | Float | no | ||
| FirmOrders | Float | no | ||
| TentativeOrders | Float | no | ||
| FreeCapacity | Float | no | ||
| GroupId | Identity | no |
| Navigations | Core Configuration |
The table stores tree navigation levels, main page for each level, and pickers for hierarchies and properties. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TaskName | String | no | Task Name (Page name) | |
| InputType | ShortString | no | Input type column picker | |
| LevelName | String | no | Level Name | |
| DisplayLabel | String | yes | Display Label | |
| LevelNo | Identity | no | Level number(Ordinal number) | |
| Mandatory | Integer | yes | Is the field in the dynamic filter mandatory one? i.e. value always should be selected | |
| DefaultValue | String | yes | Default value for returned for dynamic filter field | |
| DefaultOperation | String | yes | Default value for returned for dynamic filter field | |
| OrderByField | String | yes | Order by field for ViewBased dynamic filters | |
| FreeEntry | Integer | yes | Mean can user input own value into picker | |
| Hidden | Integer | no | Permanent hidden level for summaries | |
| OperationTypeId | Identity | yes | OperationTypeId for specific navigations | |
| MaterialTypeId | Identity | yes | MaterialTypeId for specific navigations | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| NavigationTaskParameters | Core Configuration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| NavigationTaskId | Identity | no | Navigation Task Id | |
| ParameterName | String | no | Parameter name | |
| ParameterDescription | LongString | no | Parameter description | |
| ParameterHint | LongString | yes | Parameter hint | |
| DataType | ShortString | yes | Parameter data type: Boolean, Date, DateTime, Enum, Integer, MultiEnum, Number, or String | |
| DefaultValue | LongestString | no | Default system parameter value | |
| Value | LongestString | yes | Parameter value set in model | |
| MinValue | ShortString | yes | Parameter min value | |
| MaxValue | ShortString | yes | Parameter max value | |
| BundleId | Identity | yes | Bundle with values | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| NavigationTasks | Core Configuration |
The table stores all used nivagation tasks in the system. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TaskName | String | no | Task Name (Page name) or Picker name | |
| SourceType | ShortString | no | Source for task - page or picker | |
| Source | ShortString | yes | Source view name | |
| FullSource | ShortString | yes | Full Source view name | |
| FilterType | String | yes | Filter Type Enumeration (filter, picker), Picker - mean only one value for each filter entry can be selected | |
| Area | String | yes | Functional area | |
| PageName | String | yes | Page name | |
| ValidateMessage | LongString | yes | Message for confirmation (used only for MinimumAllocations) | |
| IsUnrestricted | Integer | no | if 1 then filter entries does not filtered by selected values, example: creating new product with properties | |
| IsSystem | Integer | no | Is system | |
| SpecificType | String | no | Specific type: usual, materialType, operationType. Define is it usual type or material type or operation type specific navigation | |
| AllowedOperations | LongString | yes | List of allowed operations | |
| MaxLevels | Integer | no | Maximum quantity of levels allowed for this task. 0 - is unlimited. | |
| MandatoryHandling | ShortString | yes | How to handle mandatory fields. null - ignore mandatory fields. "all" - all mandatory fields should be filled. "one" - one of defined mandatory fields should be filled. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| NeedRebuildProfiles | Replenishment Replenishment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | ||
| ConsignmentLocationId | Identity | yes |
| NominalCostRules | Core Core |
The table stores the list of rules of Nominal Costs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Effective | Date | no | The date when the rule becomes active | |
| Cost | DoubleFloat | no | Cost | |
| CurrencyId | Identity | yes | A reference to Currencies | |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| RuleWeighting | Identity | no | Rule weighting | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Notifications | Core Reference |
The table stores the list of notifications |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Title | String | no | Notification title | |
| Body | HugeString | no | Notification body | |
| Severity | String | no | Notification severity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| OperationPredecessors | Replenishment Replenishment |
The table stores information about operation predecessors |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderOperationId | Identity | no | Order Operation ID of the operation | |
| ParentOrderOperationId | Identity | no | Operation number |
| OperationProperties | Replenishment Replenishment |
The table stores information operation properties |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderOperationId | Identity | no | Order operation ID | |
| Type | String | no | ||
| Code | String | no | ||
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OperationTypeConversions | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProductionConfigurationId | Identity | no | Weight of rule | |
| OperationTypeId | Identity | no | Weight of rule | |
| InputUnitId | Identity | no | Weight of rule | |
| OutputUnitId | Identity | no | Weight of rule | |
| Multiplier | Float | no | Site | |
| IsLastCoProductStage | Integer | no | Is Last Stage for coproducts | |
| Divider | Float | no | Who inserted the record? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OperationTypes | Core Core |
Store product route operations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OperationTypeName | String | no | OperationType name | |
| WorkCentreTypeId | Identity | no | WorkCentre type Id | |
| ToolMaterialTypeId | Identity | yes | Tool material type required for operation | |
| ApplyCyclePlan | Integer | no | Define will be rates restricted by cycle plan frequency | |
| IsCrossSiteInput | Integer | no | Allow accepting cross-site input for this operation type | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was inserted? |
| OppBlockData | Due date quoting Temporary table |
The table is used for calculation of opportunistic runs duration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| RunId | Identity | no | A reference to the material run | |
| OppRunId | Identity | no | A reference to the opportunistic run | |
| EnabledOppDuration | Float | no | Found opportunistic duration |
| OppBlockDurationData | Block Scheduling Temporary |
Duration of opportunisitic bocks. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| GradeId | Identity | no | GradeId (for PM) or FinishingId (for FL) | |
| WorkcentreId | Identity | no | Workcentre Id | |
| System | Float | yes | Quantity | |
| Upper | Float | yes | Upper percentile | |
| OperatorUserId | Identity | no | Who inserted the line? |
| OptimizedRunOrders | Block Scheduling Block Scheduling |
The table describes many-to-many relation between OptimizedRuns and OrderLines. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| RunId | Identity | no | A reference to OptimizedRuns.Id | |
| OrderId | Identity | yes | A reference to GradeOrders.Id | |
| OrderLineId | Identity | yes | A reference to GradeOrders.Id | |
| DateFrom | Date | yes | Required Date for order or allocation | |
| Duration | Float | no | Duration | |
| Lateness | Float | no | Lateness | |
| LatenessType | Float | no | Lateness type (-1 - early, 0 - on-time, 1 - late | |
| SequenceNo | Identity | no | Sequence No |
| OptimizedRunProperties | Block Scheduling Block Scheduling |
The table contains properties of the optimized runs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OptimizedRunId | Identity | no | A reference to OptimizedRuns.Id | |
| PropertyId | Identity | no | A reference to Properties.Id | |
| PropertyValueCode | String | no | Property value code |
| OptimizedRuns | Block Scheduling Block Scheduling |
The table contains runs generated by Run Optimizer during the most recent calculation. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CampaignType | Identity | no | Campaign type: 0 - optimised campaign, 1 - release campaign | |
| TemplateName | String | yes | Program Template Name | |
| BlockCode | String | yes | Block Code | |
| RunCode | String | yes | Run Code | |
| SequenceNo | Identity | no | Program sequence | |
| PositionNo | Identity | no | Run sequence | |
| GradeId | Identity | yes | A reference to GradeProperties.GradeId | |
| WorkcentreId | Identity | no | A reference to Workcentres.Id | |
| StartDate | Date | no | Run start date | |
| TargetStartDate | Date | yes | Target start date | |
| InitialDuration | Float | no | Initial and real run duration. Includes changeover time | |
| Duration | Float | no | Run duration, including shuts | |
| Mandatory | Integer | no | Does it mandatory run? (Will be excluded during BSO release if have zero length) | |
| SwitchoverDuration | Float | no | Switchover duration | |
| SwitchoverCost | Float | no | Switchover cost | |
| LatenessCost | Float | no | Lateness cost | |
| EarlinessCost | Float | no | Earliness cost | |
| OriginalAllocation | Float | no | OriginalAllocation | |
| Allocation | Float | no | OriginalAllocation | |
| OnTimeOrders | Float | no | OriginalAllocation | |
| EarlyOrders | Float | no | OriginalAllocation | |
| LateOrders | Float | no | OriginalAllocation | |
| Rate | Float | no | Run production rate | |
| OppBlock | Integer | no | A flag: is the run an opportunistic block? | |
| FSBlock | Integer | no | A flag: is the run an floating shut block? | |
| IsFixed | Integer | no | A flag: is the run an fixed? | |
| IsShut | Integer | no | A flag: is the run an shut? | |
| MaterialRunId | Identity | yes | An identity that points to the new run. This field is populated after RO results released | |
| Properties | String | yes | Run properties in one string | |
| Inventory | Float | no | Value Opening for run FinishDate from table RunInventoryProfiles | |
| SafetyStock | Float | no | Value SafetyStock for run FinishDate from table RunInventoryProfiles | |
| IsReadOnly | Integer | no | A flag: is the run an readonly? | |
| IsLiveRun | Integer | no | LiveRun: 1 - production run, 0 - optimized run | |
| IsLiveBlock | Integer | no | LiveBlock: 1 - production block, 0 - optimized template | |
| IsFrozen | Integer | no | A flag: is the run an FP Frozen? | |
| IsModified | Integer | no | A flag: is the run an modified? |
| OptStudioMessages | Replenishment Replenishment |
Table where stored messages for Opt-Studio |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Mes_Id | Identity | yes | no | Message ID, can be set to be automatically incremented or can be set by interacting system |
| Mes_Origin | Integer | no | System identifier that generates the message, provided by Greycon. Normally just ‘1’. | |
| Mes_Status | Integer | no | Message status, '1' on insert, (means not processed) | |
| Mes_Type | Integer | no | Message type identifier. Type = 41 | |
| Mes_Timout | Integer | yes | Message timeout before Integration Manager discard processing. Leave null | |
| Mes_IDate | Date | yes | Message creation date. | |
| Mes_Conts | Text | no | Message contents, Key/Value comma separated pairs. | |
| Mes_Error | Identity | yes | IM error code if any. | |
| Mes_Reply | LongestString | yes | IM reply message if any error. | |
| Mes_Priori | Integer | yes | Messaage priotity in case needed |
| OrderBookDeliveries | Replenishment Replenishment |
The table stores the list of delivery dates (i.e. when items will be delivered) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderBookId | Identity | no | A reference to the OrderBooks table | |
| DeliveryCode | String | no | Delivery code | |
| SourceType | String | no | SourceType; Indicate whether the dispatched quantity was from a production or stock source, values are Stock or Production | |
| SourceWarehouseId | Identity | no | SourceWarehouse; This is the site warehouse that the order is dispatched from | |
| TargetWarehouseId | Identity | yes | TargetWarehouse; This is the site warehouse that the order is delivered to | |
| ShipDate | Date | no | The date when the item was (or will be) shipped | |
| ReceivedDate | Date | no | The date when the item arrived to the destination | |
| Weight | Float | no | Delivery weight | |
| DeliveryStatusId | Identity | no | Delivery status identifier | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderBookInventories | Replenishment Replenishment |
The table stores in-stock balances of warehouses (this data is received from external system) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Date | |
| OrderLineId | Identity | no | A reference to OrderLines | |
| LocationId | Identity | no | A reference to Current Warehouse | |
| Weight | Float | no | Opening weight | |
| StockWeight | Float | no | Weight reduced by Planned (Firm) deliveries from feature | |
| DeliveryDate | Date | no | Delivery Date calculated from current location and despatch date as today | |
| IsLatest | Integer | no | Is it last order line inventory for order line/location? (calculated field) | |
| IsSameSource | Integer | no | Is it same source (calculated field)? | |
| IsDelivered | Integer | no | Is it delivered (calculated field)? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderBooks | Replenishment Replenishment |
The table stores order books. An order book can include many orders |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderCode | ShortString | no | Order header code | |
| Checked | Integer | yes | A flag; determines whether the order should be sent. it is used in GUI | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderBookTypes | Replenishment Replenishment |
The table stores order book types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OrderBookTypeName | String | no | OrderBook type name | |
| ChangingDeliveryDates | Integer | no | Is action is active for changing delivery/dispatch dates |
| OrderInformation | Replenishment Replenishment |
The table stores information about Order Informations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderLineId | Identity | no | Order Line identity | |
| Type | String | no |
| OrderInformationCategories | Replenishment Replenishment |
The table stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| CategoryInfo | String | no | Category name | |
| ItemType | String | no | Item name | |
| IsSelected | Integer | no | Is selected for showing | |
| IsEditable | Integer | no | Is editable? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderInformationItems | Replenishment Replenishment |
The table stores information about Order Information Items |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderInformationId | Identity | no | Order Information identity | |
| Type | String | no | ||
| Value | LongestString | no |
| OrderLineProperties | Replenishment Replenishment |
The table stores information order line properties |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderLineId | Identity | no | Order line ID | |
| Type | String | no | ||
| Code | String | no | ||
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderLines | Replenishment Replenishment |
The table stores detailed data about the current order |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| AlternateCode1 | String | yes | Alternate code 1 | |
| AlternateCode2 | String | yes | Alternate code 2 | |
| Phase | String | no | Phase for tentative orders | |
| LineNoCode | String | no | External reference to the order line number | |
| LocationId | Identity | no | Customer location | |
| SourceMaterialId | Identity | no | Semifinishing product ID | |
| SourceWeight | Float | no | Weight of SFG product consumed to produce the FG product | |
| MaterialId | Identity | no | Product material ID | |
| WorkCentreId | Identity | yes | Source workcentre ID | |
| OriginalWeight | Float | no | Weight | |
| WeightComplete | Float | no | Complete weight (produced weight of SFG material) | |
| WeightIssued | Float | no | Issued weight (produced weight of FG material) | |
| Quantity | Float | yes | Quantity, in the product units | |
| SupplierWeight | Float | no | Weight, adujsted by supplier | |
| FinalWeight | Float | no | Weight, adujsted by supplier | |
| AllocatedStock | Float | no | Allocated stock from on-hand inventory | |
| StockWorkCentreId | Identity | yes | Stock workcentre Id for allocated stock | |
| SourceCoef | Float | no | Weight / Source Weight coeficient | |
| OrderLineStatusId | Identity | no | Order line status | |
| InitialOrderLineStatusId | Identity | yes | Initial Order line status | |
| TransportMethodId | Identity | yes | Transport method | |
| DestinationLocationId | Identity | no | Destination location | |
| RequestedDate | Date | no | Requested date, i.e. when the product should be delivered | |
| ConfirmedDate | Date | yes | Confirmed date, the order is confirmed for (ie the promised date) | |
| DeliveryDate | Date | no | Delivery date, i.e. when the product will actually be delivered | |
| MakeByDate | Date | yes | The date when the order is produced | |
| DespatchDate | Date | yes | Despatch date, i.e. when the order leaves source location | |
| ConsumptionDate | Date | yes | Consumption date, i.e. when the order should be delivered to the finishing line (it must occur before the run is started) | |
| RequestedDespatchDate | Date | yes | Requested despatch date , i.e. based on requested date | |
| ExMillDate | Date | yes | This is the date at which the order line should leave the site at latest to get to the destination in time for the requested date. | |
| OrderBookId | Identity | no | A reference to the OrderBooks table | |
| FinishingLock | Integer | yes | A flag: did the request have finishing lock on? For order lines created as a result of a DDQ request, this field should be populated with the value of FinishingLock flag of the request | |
| ReasonId | Identity | yes | Reason ID | |
| CriticalDate | Date | yes | Critical date | |
| IsSent | Integer | no | A flag: have the order been sent to the external system? | |
| JourneyId | Identity | yes | A reference to the Journey table | |
| FinishingDate | Date | yes | Date the order is finished on | |
| MarkCompleted | Integer | yes | If parameter equal 1 DeliveryDate or ConsumptionDate or DespatchDate modified equal current system date. Otherwise do not touch. | |
| SiteMaterialUsageId | Identity | no | SKU | |
| EndUseId | Identity | yes | EndUse | |
| EndCustomerId | Identity | yes | EndCustomer | |
| SourceSiteMaterialUsageId | Identity | yes | Source SKU | |
| ToConsignmentLocationId | Identity | yes | for consignment orders, this indicates the consignment location that the order will be stored for at the destination location | |
| FromConsignmentLocationId | Identity | yes | for call off orders, this indicates the consignment location that the stock is being sourced from | |
| DeliveryWeight | Float | no | Sum of weight for non-cancelled deliveries | |
| DeliveredWeight | Float | no | Sum of delivered deliveries | |
| DispatchedWeight | Float | no | Sum of dispatched deliveries | |
| DeliverySourceWeight | Float | no | Sum of source weight for non-cancelled deliveries | |
| StockWeight | Float | no | Sum of weight for last non-delivered OrderInventories and In-Transit deliveries | |
| StockSourceWeight | Float | no | Sum of source weight for last non-delivered OrderInventories and In-Transit deliveries | |
| NeedRebuildProfile | Integer | yes | If parameter equal 1 need rebuild Real Inventory Profile. Otherwise do not touch. | |
| ReduceCSQuantity | Float | yes | What quantity was used to reduce CS orders and/or inventory. | |
| IsCSComplete | Integer | yes | Whether the order is CS complete. | |
| AllowSubstitution | Integer | no | Flag indicate if an order can be substituted or not. | |
| SkuKey | String | no | Destination SKU Code - SKU-CS. | |
| SourceSkuKey | String | yes | FROM SKU Code - SourceSKU-CS. | |
| StockSkuKey | String | yes | FROM SKU Code - StockSourceSKU-CS. For Customer MTO orders with specified stockWarehouse | |
| OrderType | String | no | Order type: Customer or stock | |
| ReplenishmentPointId | Identity | yes | Replenishment point Id. For tentative orders generated by replenishment process. | |
| ReplenishmentProcessId | Identity | yes | Replenishment Process Id. For tentative orders generated by replenishment process. | |
| PeriodType | ShortString | no | Order period type: week or day | |
| OrderGroupId | Identity | yes | Combined order | |
| SiteId | Identity | yes | A reference to the Site table | |
| Price | Float | yes | Price | |
| UnitId | Identity | yes | Weight unit or any convertible to weight | |
| Dividend | DoubleFloat | yes | Dividend | |
| Divisor | DoubleFloat | yes | Divisor | |
| CurrencyId | Identity | yes | Currency Identity | |
| SalesOrderLineId | Identity | yes | A reference to the OrderLine table | |
| AlternativeKey | String | yes | Alternative Key | |
| DeleteObsoleteOperations | Integer | yes | if need Delete Obsolete Operations | |
| IsPaymentHold | Integer | yes | Payment hold | |
| Priority | Integer | no | Priority | |
| ReATPRequired | Integer | yes | ReATPRequired | |
| TypeOfDelivery | ShortString | yes | Type of delivery: Arrival or Ex-Mill | |
| FullyAllocatedDate | Date | yes | The date when order became fully allocated | |
| OrderCompleteDate | Date | yes | The date when order became completed | |
| IsLate | Integer | no | Is a late order | |
| UseSchedule | Integer | no | Schedule | |
| IsConfirmed | Integer | no | Is a confirmed order | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderLinesForSplit | Replenishment Replenishment |
The table stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OriginalOrderLineId | Identity | no | Original order line for split | |
| orderCode | String | no | Item name | |
| lineCode | String | no | Is selected for showing | |
| RequestedDate | Date | yes | Requested date | |
| DeliveryDate | Date | yes | Delivery date | |
| ConfirmedDate | Date | yes | Confirmed date | |
| DespatchDate | Date | yes | Despatch date | |
| Quantity | Float | no | Order weight (Final Weight) | |
| UnitId | Identity | no | Weight unit | |
| OneUnitWeight | Float | no | One unit weight | |
| OrderLineId | Identity | yes | Original order line for split if provided in split part | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| OrderLineStatuses | Replenishment Replenishment |
The table stores the list of possible order line statuses |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderLineStatusName | ShortString | no | Order line status name | |
| OrderLineStatusDesc | String | no | Order line status description | |
| OrderLineStatusCode | String | yes | Order line status code | |
| Abbreviation | ShortString | yes | Order line status abbreviation | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderMaintenanceData | Replenishment Temporary |
Contains information about consignment stock orders. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Key | Identity | no | Key | |
| OrderLineId | Identity | no | OrderLine Identity | |
| MaterialRunId | Identity | no | MaterialRun Identity | |
| SkuId | Identity | no | SKU Identity | |
| OrderNo | String | no | Order Code of the order line | |
| LineNo | String | no | Line Number of the order line | |
| Warehouse | String | no | Destination warehouse code of the order line | |
| Product | String | no | Product code of the order line | |
| DeliveryDate | Date | no | Delivery Date of order | |
| Source | String | yes | Source | |
| IsReadOnly | Identity | no | Flag: is quantity and weight is read only? | |
| OperatorUserId | Identity | no | User which insert line |
| OrderOperationMaterials | Replenishment Replenishment |
The table stores information about material run operations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OrderOperationId | Identity | no | Order operation Id | |
| MaterialId | Identity | no | Product | |
| Quantity | Float | no | Quantity | |
| RemainingQuantity | Float | no | Remaining Quantity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderOperations | Replenishment Replenishment |
The table stores information about material run operations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderLineId | Identity | no | Order line ID of the operation | |
| OperationNo | Identity | no | Operation number | |
| SplitNo | Identity | no | Operation split number (for MM the production order number plus product route step plus split is unique | |
| MaterialRunId | Identity | yes | A reference to the MaterialRuns table | |
| WorkCentreId | Identity | no | The ID of the workcentre where the operation will be performed. A reference to the WorkCentres table | |
| OrderOperationStatusId | Identity | no | Current status of the operation. A reference to the OrderOperationStatuses table | |
| Quantity | Float | no | Quantity | |
| DueDate | Date | yes | Finish date of the run | |
| OriginalDueDate | Date | yes | Original due date of the order. This column is populated when the order gets into the system and an operation is assigned to a run | |
| OriginalWorkCentreId | Identity | yes | The ID of the workcentre where the operation is created | |
| StartTime | Date | yes | Date and time job starts: YYYY-MM-DD HH:MI This is the start time of the set up job, not the process job | |
| FinishTime | Date | yes | Date and time the job finishes: YYYY-MM-DD HH:MI Finish time of the process job | |
| SetupDuration | Float | no | Set up time in minutes | |
| ProcessDuration | Float | yes | Time in minutes. Can be not provided. | |
| OperationDuration | Float | no | Calculated operation duration from other columns. Time in minutes | |
| OperationCompletedDuration | Float | no | Calculated completed operation duration from other columns. Time in minutes | |
| Rate | Float | yes | Production rate | |
| UnitId | Identity | yes | Production Rate Unit | |
| QuantityComplete | Float | no | Quantity of the job already complete. Only include this and the following attributes if the job has started or is complete | |
| QuantityCompleteTime | Date | yes | Date the quantity complete was last updated | |
| ActualStartTime | Date | yes | Actual start time of the job | |
| StageCode | ShortString | yes | ||
| StageNo | Identity | yes | ||
| PlanningStatus | String | yes | Status needed by SHP | |
| OperationTypeId | Identity | no | A reference to the OperationTypes table | |
| MaterialId | Identity | yes | A reference to output production product, if NULL used product from order line | |
| IsLastOperation | Integer | no | Is it last operation? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? | |
| IsUpdated | Integer | no | If the record was updated? |
| OrderOperationsForPlan | Scenario Analysis Production Plan |
Copy of order operations for "Release to Production Plan" logic from the Demand Control screen. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | ||
| WorkCentreId | Identity | no | ||
| OldMaterialRunId | Identity | yes | ||
| MaterialRunId | Identity | yes | ||
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| OrderLineId | Identity | no | ||
| OrderOperationId | Identity | no | ||
| DueDate | Date | yes |
| OrderOperationSnapshots | Master Planning Master Planning |
The table contains snapshot detailed information about order operations per SNP period, used for moving between runs. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID | |
| OldMaterialRunId | Identity | yes | Original run ID | |
| WorkCentreId | Identity | no | Workcentre ID | |
| OrderLineId | Identity | no | Order Line ID | |
| OrderOperationId | Identity | no | Order Operation ID | |
| DueDate | Date | yes | Order Line's due date | |
| MaterialRunId | Identity | yes | Current run ID | |
| CycleTypeId | Identity | no | Cycle Type ID | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. |
| OrderOperationStatuses | Replenishment Replenishment |
The table stores the list of possible order line statuses |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderOperationStatusName | ShortString | no | Order line status name | |
| OrderOperationStatusDesc | String | no | Order line status description | |
| OrderOperationStatusCode | String | yes | Order line status code | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrderOperationTools | Replenishment Replenishment |
The table stores information about tool materials used in operation |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OrderOperationId | Identity | no | Order operation Id | |
| ToolMaterialId | Identity | no | Tool product | |
| IsMajorTool | Integer | no | Is major tool - used for determine rate | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| OrdersForMovingData | Block Scheduling Temporary |
A temporary table for storing the list of orders selected by customer for moving to a different run |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OrderLineId | Identity | no | Reference to OrderLines table | |
| OrderOperationId | Identity | no | Reference to OrderOperations table | |
| MaterialId | Identity | no | Reference to Materials table | |
| OldMaterialRunId | Identity | yes | Reference to MaterialRuns table | |
| IsSplitConflict | Integer | no | Is split conflict by default will have value 0 | |
| Weight | Float | no | Order line weight | |
| Duration | Float | no | Order line duration | |
| OperatorUserId | Identity | no | User identificator |
| OrdersForNetting | Replenishment Order generation |
Temporary table which used for netting customer forecast and customer orders |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Devlivery Date of order | |
| Allocation | Float | no | Appropriate PM allocation, received from SNO engine | |
| Orders | Float | no | The sum of firm orders for the specified SKU for a given week | |
| Consumption | Float | no | Consumption for the specified SKU for one week (it is calculated from Forecast, Allocation and Orders) |
| OrdersPerRunData | Replenishment Temporary |
Used for display of list of runs on Production Orders screen. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunId | Identity | no | Reference to MaterialRuns table | |
| FirmOrders | Float | yes | Weight firm orders on run | |
| TentativeOrders | Float | yes | Weight tentative(system) orders on run | |
| FirmOrdersDuration | Float | yes | Duration firm orders on run | |
| TentativeOrdersDuration | Float | yes | Duration tentative(system) orders on run | |
| OperatorUserId | Identity | no | User which insert line |
| OutlierDetectionData | Forecasting Forecasting |
A temporary table for Outlier Detection screen (IPLAN-69973) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID | |
| GroupId | Identity | no | Grouped Identity | |
| SummaryFields | HugeString | yes | SummaryFields | |
| DateFrom | Date | yes | ||
| AdjustedHistory | Float | yes | ||
| FittedHistory | Float | yes | ||
| Difference | Float | yes | ||
| MeanOfErrors | Float | yes | ||
| StdDevOfErrors | Float | yes | ||
| StdDevs | Float | yes | ||
| Event | HugeString | yes | ||
| IsOutlier | Integer | yes | ||
| OutlierMonths | HugeString | yes |
| OutlierGraphData | Forecasting Temporary |
Temporary table for data for Outlier Graph screen |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date (month) | |
| Usage | Float | yes | total usage | |
| AdjustedUsage | Float | yes | total usage | |
| FittedUsage | Float | yes | all fitted usage with superceded history | |
| IsOutlier | Integer | yes | ||
| OperatorUserId | Identity | no | user id |
| OverallStockData | Due date quoting Temporary |
The table contains information about the overall inventory on every day by SKUs. For each SKU and each day we have opening quantity in the beginning of the day. It is calculated as the difference of incoming and outgoing order quantities of the previous day. Closing quantity is calculated as the difference of incoming and outgoing order quantities of the current day. MinOpening value determines the minimal opening quantity at the real inventory horizon. Data in this table is updated when processing order operations. When recalculating of the real inventory for specific SKUs, appropriate rows can be deleted and inserted. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | yes | A reference to SiteMaterialUsages | |
| DateFrom | Date | no | Date | |
| Opening | Float | no | Opening quantity | |
| OrdersIn | Float | yes | Incoming orders quantity | |
| OrdersOut | Float | yes | Outgoing orders quantity | |
| Closing | Float | yes | Closing quantity | |
| MinOpening | Float | yes | Minimal opening quantity | |
| Delivered | Float | no | Delivered movements | |
| OnHandInventory | Float | no | Delivered movements | |
| OnHandMinOpening | Float | no | Delivered movements | |
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) |
| PageParameters | Core Configuration |
The table stores page parameter definitions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PageId | Identity | no | Page | |
| ActionId | Identity | yes | Action | |
| ParameterName | String | no | Parameter name | |
| ParameterDescription | LongString | no | Parameter description | |
| ParameterHint | LongString | yes | Parameter hint | |
| ParameterType | ShortString | yes | Parameter type page/session | |
| DataType | ShortString | yes | Parameter data type (Possible values: Boolean, Date, Enum, Number, String) | |
| DefaultValue | LongestString | no | Default system parameter value | |
| Value | LongestString | yes | Parameter value set in model | |
| MinValue | ShortString | yes | Parameter min value | |
| MaxValue | ShortString | yes | Parameter max value | |
| DependOn | String | yes | Name of the parameter on which depends whether the specified parameter is enabled. | |
| DependBehaviour | String | yes | Behaviour of depend element. | |
| DependValues | String | yes | Behaviour values (for comboboxes) | |
| OrderNo | ShortString | yes | Name of the parameter on which depends whether the specified parameter is enabled. | |
| Separator | Integer | yes | Name of the parameter on which depends whether the specified parameter is enabled. | |
| GroupName | String | yes | Group name of parameters. | |
| BundleId | Identity | yes | Bundle with values | |
| IsDevMode | Integer | no | A flag: is this a dev mode action? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Pages | Core Access rights |
The table stores the list of I-Plan interface pages |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PageName | String | no | Page name | |
| PageDescription | LongString | no | Page description | |
| PageHint | LongString | yes | Page hint | |
| Icon | String | yes | Page icon | |
| IsBasePage | Integer | no | A flag: is the page a base page? 1 - this is a base page, and it is shown in the tree, 0 - this is an additional page | |
| ShowAlways | Integer | no | Will be page shown irrespective user rights. 1- shown always, 0 - depend on user rights (via Actions) | |
| HelpRef | LongString | yes | Help reference ID | |
| Cloud | Integer | no | Will be page visible for cloud: 1 - yes, 0 - no | |
| BlockedTasks | LongestString | yes | Blocked tasks | |
| IsDevMode | Integer | no | A flag: is this a dev mode action? | |
| Area | String | yes | Area page | |
| SubGroup | String | yes | Sub Group page | |
| HasAiAnalysis | Integer | no | A flag: enable AI analysis dropdown. 1 - yes, 0 - no | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| PasteOrdersData | Replenishment Replenishment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Demand identity |
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| WorkCentreId | Identity | yes | A reference to the WorkCentres table | |
| MaterialCode | String | yes | ||
| MaterialId | Identity | yes | A reference to the Materials table | |
| MaterialCode_Status | Integer | no | ||
| CustomerCode | String | yes | ||
| CustomerId | Identity | yes | A reference to the Locations table | |
| CustomerCode_Status | Integer | no | ||
| OriginalWeight | ShortString | yes | Order line | |
| Weight | Float | no | Order line | |
| Weight_Status | Integer | no | ||
| OriginalQuantity | ShortString | yes | Order line | |
| Quantity | Float | no | Order line | |
| Quantity_Status | Integer | no | ||
| SkuId | Identity | yes | A reference to the SiteMaterialUsages table | |
| SkuId_Status | Integer | no | ||
| JourneyId | Identity | yes | A reference to the Journeys table | |
| IsFailed | Integer | no |
| PMSourceData | Due date quoting Temporary table |
The table stores the list of available paper machines. The list is recreated at start of each ddq ccrequest. Only the paper machines able to produce the requested material are included into the list. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PMId | Identity | no | A reference to PaperMachines | |
| PMCode | String | no | Paper Machine Code | |
| AvgLossForFL | Float | no | Average losses on FL machines of the site | |
| LossForPM | Float | no | Losses on the paper machine | |
| PMAllocation | Float | no | Allocation quantity for the paper machine | |
| TotalCost | Float | no | Total cost for the paper machine | |
| LocationPM | Identity | yes | Location ID of the paper machine | |
| SiteId | Identity | yes | Site ID of the paper machine | |
| JourneyId | Identity | yes | Journey ID for this PM | |
| DespatchDate | Date | yes | Despatch date from site's FG Warehouse consideration Journey | |
| DeliveryDate | Date | yes | Delivery date from site's FG Warehouse consideration Journey | |
| TransportMethodId | Identity | yes | Transport method of the last transport route | |
| LocationSourceWarehouseId | Identity | yes | Location Id of site's FG Warehouse | |
| TotalPMAllocation | Float | yes | Total PMAllocation on the site | |
| StageNo | Identity | no | ||
| WorkCentreTypeId | Identity | no |
| PMSourceForFGData | Due date quoting Temporary table |
The table stores the list of paper machines for FG search. It is filled when running an FG search, and cleared when ddq request finished. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PMId | Identity | no | Paper machine ID | |
| PMCode | String | no | Paper machine code | |
| QuantityFound | Float | no | Found quantity on the PM | |
| PMAllocation | Float | yes | Allocation quantity on the PM | |
| TotalCost | Float | yes | Total cost |
| PreTrimSolutions | Block Scheduling Block Scheduling |
Storing generated Pre-Trim solutions for each run. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Unique Identifier |
| MaterialRunId | Identity | no | A reference to MaterialRuns.Id | |
| IsInternalTool | Integer | no | Whether the solution was created by internal Pre-Trim tool. | |
| SolutionJSON | Text | yes | Detailed solution for chart display (JSON for now as it's a demo) | |
| TrimQty | Float | no | Quantity of orders trimmed | |
| TrimLossQty | Float | no | Quantity of trim loss | |
| MaxWidth | Float | no | Machine's MaxWidth at the time of generation | |
| MinTrimLoss | Float | no | Machine's MinTrimLoss at the time of generation | |
| MaxTrimLoss | Float | no | Machine's MaxTrimLoss at the time of generation | |
| OvermakeCoefficient | Float | no | Order overmake coefficient used for generation | |
| UndermakeCoefficient | Float | no | Order undermake coefficient used for generation | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| PriceRules | Core Core |
The table stores the list of rules of price assignment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Effective | Date | no | The date when the rule becomes active | |
| Price | Float | no | Price | |
| CurrencyId | Identity | yes | A reference to Currencies | |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| RuleWeighting | Identity | no | Rule weighting | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Processes | Core Logging |
The table stores the list of all launched processes. It is used to track process statuses |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProcessName | String | no | Process name | |
| ProcessType | String | no | Process type | |
| SystemProcessId | String | yes | System process ID | |
| Started | Date | no | Process creation date/time | |
| Finished | Date | yes | Process completion date/time | |
| Status | Integer | no | Process status. A reference to ProcessStatusNames | |
| UserId | Identity | no | The ID of the user who have started the process | |
| FailedReason | HugeString | yes | Error text for failed processes | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ProcessingLog | Core Logging |
The table is used to maintain external messages log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Stamp | TimeStamp | no | Identity | |
| Severity | String | no | Severity entry | |
| Message | LongestString | no | Message text | |
| SessionId | String | no | Message text |
| ProcessLogs | Core Logging |
The table is used to store process logs. It is used to trace processes execution |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProcessId | Identity | no | Process ID | |
| Action | LongString | no | Action | |
| Description | HugeString | no | Action description | |
| Stamp | TimeStamp | no | Action start date/time |
| ProcessParts | Core Reference |
The table stores the list of process type parts. It is used to organize progress display of processes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TaskId | Identity | no | Task ID | |
| ProcessPartName | String | no | Process part name | |
| ProcessPartDesc | LongString | no | Process part description | |
| ProcessPartType | Integer | no | Process part type | |
| OrderNo | Integer | no | Ordinal number of the part on the progress screen | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProcessResults | Core Reference |
The table stores the result of process. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProcessId | Identity | no | Task ID | |
| Name | String | no | Task result part name | |
| Value | LongString | yes | Task result part description |
| ProcessStatuses | Core Temporary table |
The table stores the list of progress values for all parts of all processes launched by users and I-Plan system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProcessId | Identity | no | Process ID | |
| TaskId | Identity | no | Task ID | |
| TaskName | String | no | Task name | |
| ProcessPartId | Identity | yes | Process part ID | |
| ProcessPartName | String | no | Process part name | |
| UserId | Identity | no | User ID | |
| Done | Identity | no | A flag: is the process part completed? | |
| Total | Identity | no | Total | |
| OrderNo | Integer | no | Ordinal number of the part on the progress screen |
| ProcessStatusNames | Core - Processes Reference |
The table stores the list of possible process statuses |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| ProcessStatusName | ShortString | no | Process status name | |
| ProcessStatusDesc | ShortString | no | Status description | |
| StatusLevel | Integer | no | Status level | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProductCharacteristics | Core Core |
The table stores the list of product characteristicssystem |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CharacteristicName | String | no | Property name | |
| HierarchyLevelNo | Integer | no | Property name | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProductGradeCosts | Forecasting Forecasting |
The table stores the Market info |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProductGrade | String | no | Product Grade | |
| SetupCost | Float | yes | Setup Cost | |
| StockValue | Float | yes | Stock Value | |
| HoldingCost | Float | yes | Holding Cost |
| ProductionConfigurations | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialId | Identity | no | Characteristics | |
| ProductRouteId | Identity | no | Product route | |
| Site | String | yes | Site | |
| Preferred | Integer | no | Site | |
| BomId | Identity | yes | BOM | |
| buildRoute | String | no | build route from configuration | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProductionInformationData | Block Scheduling Temporary |
The table contains detailed information about paper machines and finishing areas for each user, to pass to the SNO engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| WorkcentreId | Identity | yes | Workcentre ID (A reference to Workcentres) | |
| TimePeriod | Integer | no | Ordinal number of the time period | |
| DateFrom | Date | no | Week | |
| CapacityHours | Float | no | Available capacity in hours | |
| NominalCapacityHours | Float | no | Nominal Capacity in hours | |
| ShutHours | Float | no | Duration of shuts (in hours) | |
| OrdersHours | Float | no | Time in hours spent to produce nonmovable orders within the time period | |
| TentativeOrdersHours | Float | no | Time in hours for Tentative Orders | |
| OrdersWeight | Float | no | Weight of nonmovable orders within the time period | |
| TentativeOrdersWeight | Float | no | Weight of Tentative Orders | |
| FixedCapacityHours | Float | no | Fixed capacity time in hours | |
| UnusedRunHours | Float | no | Unuse capacity time in hours | |
| TimeEfficiency | Float | no | Time efficiency coefficient |
| ProductionPlans | Master Planning Production Plan |
Production Plan information for releasing from the Demand Control screen. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | ||
| Id | Identity | no | Material run id? | |
| WorkCentreId | Identity | no | ||
| SourcePeriod | Date | no | ||
| StartDate | Date | no | ||
| FinishDate | Date | no | ||
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InitialDuration | Float | no | ||
| OrderDuration | Float | no | ||
| AllocationDuration | Float | no | ||
| Rate | Float | no | Average Rate? | |
| IsFixed | Integer | no |
| ProductionRates | Core Core |
The table stores the list of rules of production rate calculation. It allows to define, how much product can be produced on each workcentre |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OperationTypeId | Identity | no | A reference to the OpearationTypes table | |
| WorkcentreId | Identity | no | A reference to the Workcentres table | |
| Effective | Date | no | The date, when the rule becomes active | |
| Rate | Float | yes | Production rate, base weight unit/hour | |
| TimeEfficiency | Float | no | Coefficient of effective time, percents | |
| MaterialEfficiency | Float | yes | Production efficiency, taking into account production losses | |
| ConversionFactor | Float | no | Conversion factor for getting source weight | |
| ProductionRateCode | LongString | yes | Production rate code (It is used for fast comparison) | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| RuleWeighting | Identity | no | Rule weighting | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProductionRateSnapshots | Scenario Analysis Input Data |
The table contains snapshots of production rate rules for SNP. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| OperationTypeId | Identity | no | Operation Type ID (A reference to OperationTypes) | |
| WorkcentreId | Identity | no | Workcentre ID (A reference to Workcentres) | |
| Effective | Date | no | Effective date | |
| Rate | Float | yes | Production rate value | |
| OriginalRate | Float | yes | Original Production rate value | |
| TimeEfficiency | Float | no | Time efficiency | |
| MaterialEfficiency | Float | no | Material efficiency | |
| ConversionFactor | Float | no | Conversion factor for getting source weight | |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| IsGenerated | Identity | yes | A flag to describe rule origin: 1 - generated when creating a snapshot, 0 - entered by a user |
| ProductionUpdates | Replenishment Replenishment |
Records about what was produced and delivered to production warehouse |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderOperationId | Identity | no | Identity | |
| ProductionDate | Date | no | Date | |
| Quantity | Float | no | Quantity | |
| QuantityType | String | no | type of quantity 'OrderLineTotal or DailyTotal. Not used | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProductRoutes | Core Core |
Store Product Routes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProductRouteName | String | no | Route code | |
| MaterialTypeId | Identity | yes | Material type Id | |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails.?? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was inserted? |
| ProductRouteStages | Core Core |
Store Product Route stages |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProductRouteId | Identity | no | Product Route Id | |
| OrderNo | Integer | no | Ordinal number | |
| StageCode | ShortString | no | External stage core | |
| OperationTypeId | Identity | no | Operation type Id | |
| StoreOutput | Integer | no | Store Output | |
| CreateCampaign | Integer | no | Create runs for such operation via SNP release | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was inserted? |
| ProductSubstitutionCustomers | Core Core |
The table stores the sets of customer for particular product substitutions in SNP |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProductSubstitutionId | Identity | no | Identity of substitution | |
| ReportFilterId | Identity | no | Report filter | |
| FilterType | Integer | no | 0 - inclusive, 1 - exclusive filter | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProductSubstitutionMapSnapshots | Master Planning SNP |
The table stores substitution mapping pairs between original and substitute materials, including their property values, per SNP scenario session. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| ProductSubstitutionId | Identity | no | Substitution Id | |
| MaterialId | Identity | no | Material Id | |
| SubstitutionMaterialId | Identity | no | Substitution material id | |
| PropertyValueId | Identity | no | Substitution site | |
| SubstitutionPropertyValueId | Identity | no | Substitution site |
| ProductSubstitutions | Core Core |
The table stores the list of product substitutions in SNP |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| IsActive | Integer | no | Is substitution active | |
| MaterialTypeId | Identity | yes | Material type | |
| OriginalSiteId | Identity | yes | Original site | |
| SubstitutionSiteId | Identity | yes | Substitution site | |
| DetailId | Identity | yes | To Characteristics Id. A reference to HierarchyPropertyDetails. | |
| FromDetailId | Identity | yes | From Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ProductSubstitutionSnapshots | Scenario Analysis Reference Data |
This table stores the list of product substitutions in SNP: this allows specific sites to produce one material instead of what is requested by the customer demand. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | yes | no | Identity |
| MaterialTypeId | Identity | yes | Material type | |
| OriginalSiteId | Identity | yes | Original Site ID, used to limit total quantity of substitutions for one Original Site (not used by anything else at the moment) | |
| SubstitutionSiteId | Identity | yes | Substitution site ID, defines at which site this substitution is allowed. | |
| IncludeFilter | LongestString | yes | Customer include filter | |
| ExcludeFilter | LongestString | yes | Customer exclude filter | |
| DetailId | Identity | no | From Characteristics Id. A reference to HierarchyPropertyDetails. Demand product properties (the originally requested product) | |
| FromDetailId | Identity | no | To Characteristics Id. A reference to HierarchyPropertyDetails. Substitute product properties (the produced replacement product) |
| ProjectedInventory | Master Planning Master Planning |
The table for projected inventory per site for reporting purpose |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SnapshotDate | Date | no | Snapshot Date | |
| DateFrom | Date | no | Inventory record date | |
| SiteId | Identity | no | Site Id | |
| Opening | Float | no | Opening Inventory | |
| ProductionOrders | Float | no | Production Orders | |
| Deliveries | Float | no | Deliveries | |
| Closing | Float | no | Closing Inventory |
| ProjectedInventoryData | Master Planning Master Planning |
The temporary table for projected inventory per site |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID | |
| DateFrom | Date | no | Inventory record date | |
| SiteId | Identity | no | Site ID (reference to Sites) | |
| Opening | Float | no | Opening Inventory | |
| ProductionOrders | Float | no | Production Orders | |
| Deliveries | Float | no | Deliveries |
| Properties | Core Core |
The table stores the list of properties registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PropertyName | String | no | Property name | |
| PropertyDesc | String | no | Property code | |
| DataType | ShortString | yes | Data type | |
| DataMask | String | yes | Data mask for property value formatting | |
| DefaultValue | String | yes | Default value of the property | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| PropertyCharacteristics | Core Core |
The table stores mapping between properties and product characteristics |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Code1 | ShortString | yes | References to PropertyCodes | |
| Code2 | ShortString | yes | References to PropertyCodes | |
| Code3 | ShortString | yes | References to PropertyCodes | |
| Code4 | ShortString | yes | References to PropertyCodes | |
| Code5 | ShortString | yes | References to PropertyCodes | |
| Code6 | ShortString | yes | References to PropertyCodes | |
| Code7 | ShortString | yes | References to PropertyCodes | |
| Code8 | ShortString | yes | References to PropertyCodes | |
| Code9 | ShortString | yes | References to PropertyCodes | |
| Code10 | ShortString | yes | References to PropertyCodes | |
| Code11 | ShortString | yes | References to PropertyCodes | |
| Code12 | ShortString | yes | References to PropertyCodes | |
| Code13 | ShortString | yes | References to PropertyCodes | |
| Code14 | ShortString | yes | References to PropertyCodes | |
| Code15 | ShortString | yes | References to PropertyValues | |
| Code16 | ShortString | yes | References to PropertyCodes | |
| Code17 | ShortString | yes | References to PropertyCodes | |
| Code18 | ShortString | yes | References to PropertyCodes | |
| Code19 | ShortString | yes | References to PropertyCodes | |
| Code20 | ShortString | yes | References to PropertyCodes | |
| Code21 | ShortString | yes | References to PropertyCodes | |
| Code22 | ShortString | yes | References to PropertyCodes | |
| Code23 | ShortString | yes | References to PropertyCodes | |
| Code24 | ShortString | yes | References to PropertyCodes | |
| Code25 | ShortString | yes | References to PropertyCodes | |
| Code26 | ShortString | yes | References to PropertyCodes | |
| Code27 | ShortString | yes | References to PropertyCodes | |
| Code28 | ShortString | yes | References to PropertyCodes | |
| Code29 | ShortString | yes | References to PropertyCodes | |
| Code30 | ShortString | yes | References to PropertyCodes | |
| Characteristic1 | String | yes | ||
| Characteristic2 | String | yes | ||
| Characteristic3 | String | yes | ||
| Characteristic4 | String | yes | ||
| Characteristic5 | String | yes | ||
| Characteristic6 | String | yes | ||
| Characteristic7 | String | yes | ||
| Characteristic8 | String | yes | ||
| Characteristic9 | String | yes | ||
| Characteristic10 | String | yes | ||
| Key | HugeString | no |
| PropertyFilterData | Forecasting Temporary |
Temporary table for storing filters data |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| TaskName | String | no | Task Name | |
| PropertyId | Identity | no | Property ID | |
| PropertyValue | String | no | Property Value | |
| OperatorUserId | Identity | no | User id |
| PropertyValues | Core Core |
The table stores the list of property values with references to the parent properties |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PropertyValueCode | ShortString | yes | Code of the property value | |
| Value | LongString | no | Value of the property | |
| PropertyId | Identity | no | A reference to Properties | |
| ParentPropertyValueId | Identity | yes | A reference to the parent property | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| PurgeObsoleteData | Core Configuration |
The table stores parameters for Purge Obsolete Data |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | String | no | Name | |
| Description | LongString | yes | Description | |
| Help | LongestString | yes | Help | |
| Period | Integer | no | Period | |
| PeriodType | String | no | Period type | |
| LastAnalyzed | Date | yes | Last date when data was analyzed | |
| ObsoleteEntries | Identity | no | Obsolete entries for removing | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| RealInventoryForFlRunData | Due date quoting Temporary table |
The table stores intermediate data from Real Inventory Profile for an SFG search |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| SourceWorkCentreId | Identity | yes | A reference to PaperMachines | |
| MinDateFrom | Date | no | Start date of the interval, during which there exists constant material quantity at the inventory | |
| MaxDateFrom | Date | no | End date of the interval of constant material quantity at the inventory | |
| MinOpening | Float | no | Minimal Opening on the interval | |
| OldMinOpening | Float | no | Old minimal Opening. Minimal Opening value is stored here when performing calculations |
| RealInventoryProfiles | Due date quoting Due date quoting |
The table contains information about the inventory on every day by SKUs. For each SKU and each day we have opening quantity in the beginning of the day. It is calculated as the difference of incoming and outgoing order quantities of the previous day. Closing quantity is calculated as the difference of incoming and outgoing order quantities of the current day. MinOpening value determines the minimal opening quantity at the real inventory horizon. Data in this table is updated when processing order operations. When recalculating of the real inventory for specific SKUs, appropriate rows can be deleted and inserted. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | yes | A reference to SiteMaterialUsages | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| SKUKey | String | no | A reference to Workcentres | |
| DateFrom | Date | no | Date | |
| OverallOpening | Float | no | Opening quantity for Firm, Tentative and Consumption | |
| Opening | Float | no | Opening quantity | |
| OrdersIn | Float | no | Incoming orders quantity | |
| TentativeOrdersIn | Float | no | Incoming tentative orders quantity | |
| OrdersOut | Float | no | Outgoing orders quantity | |
| TentativeOrdersOut | Float | no | Outgoing tentative orders quantity | |
| Closing | Float | no | Closing quantity | |
| OverallClosing | Float | no | Closing quantity for Firm, Tentative and Consumption | |
| FirmClosing | Float | no | Closing quantity only for Firm orders | |
| MinOpening | Float | no | Minimal opening quantity | |
| SafetyStock | Float | no | Safety stock | |
| MaxSafetyStock | Float | yes | Safety stock | |
| Consumption | Float | no | Forecst consumption | |
| OriginalConsumption | Float | no | Original Forecst consumption | |
| SupersededStockStatus | Integer | no | Replenishment result |
| RealInventoryProfilesData | Replenishment Temporary |
The table contains information about the inventory on every day by SKUs. For each SKU and each day we have opening quantity in the beginning of the day. It is calculated as the difference of incoming and outgoing order quantities of the previous day. Closing quantity is calculated as the difference of incoming and outgoing order quantities of the current day. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date | |
| Opening | Float | no | Quantity at the begining of the DateFrom day | |
| Closing | Float | yes | Quantity at the end of the DateFrom day | |
| OrdersOut | Float | yes | Outgoing orders quantity | |
| OrdersIn | Float | yes | Incoming orders quantity | |
| TentativeIn | Float | yes | Tentative incoming orders quantity | |
| TentativeOut | Float | yes | Tentative outgoing orders quantity | |
| PrevOrdersOut | Float | yes | Outgoing orders for previous date | |
| PrevOrdersIn | Float | yes | Incoming orders for previous date | |
| PrevClosing | Float | yes | Closing for previous date | |
| Consumption | Float | yes | Consumption (can be based on orders, forecast, or netted forecast with orders | |
| SafetyStock | Float | yes | Safety stock | |
| MaxSafetyStock | Float | yes | Safety stock | |
| MinOpening | Float | yes | Min Opening quantity for particular date | |
| OriginalConsumption | Float | no | Original Consumption | |
| IsReceivingDay | Integer | no | Is Receiving Day | |
| OperatorUserId | Identity | no | User id |
| RealInventoryProfileSnapshot | Due date quoting Due date quoting |
The table contains information about the inventory on every day by SKUs. For each SKU and each day we have opening quantity in the beginning of the day. It is calculated as the difference of incoming and outgoing order quantities of the previous day. Closing quantity is calculated as the difference of incoming and outgoing order quantities of the current day. MinOpening value determines the minimal opening quantity at the real inventory horizon. Data in this table is updated when processing order operations. When recalculating of the real inventory for specific SKUs, appropriate rows can be deleted and inserted. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| SiteMaterialUsageId | Identity | yes | SKU ID (reference to SiteMaterialUsages) | |
| ConsignmentLocationId | Identity | yes | For consigned stock, shows which Location ID the stock is reserved for. | |
| DateFrom | Date | no | Inventory Date | |
| Opening | Float | no | Opening quantity | |
| OrdersIn | Float | no | Incoming orders quantity | |
| OrdersOut | Float | no | Outgoing orders quantity | |
| Closing | Float | no | Closing quantity | |
| SafetyStock | Float | no | Safety Stock quantity |
| Reasons | Replenishment Replenishment |
The table stores the list of available reasons for commenting forecast editing and other user actions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Reason | String | no | Reason name | |
| ReasonType | ShortString | no | Reason type | |
| ReasonDescription | LongString | yes | Reason description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| RebalancedOrderLines | Replenishment Replenishment |
The table stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProcessId | Identity | yes | Process Id for rebalance orders and available onhandstock | |
| OrderLineId | Identity | no | Original order line for rebalance | |
| SiteMaterialUsageId | Identity | no | ||
| ConsignmentLocationId | Identity | yes | ||
| FinalWeight | Float | no | ||
| DispatchedWeight | Float | no | ||
| AllocatedStockWeight | Float | no | ||
| RemainingOperationWeight | Float | no | ||
| RemainingWeight | Float | no | ||
| NewAllocatedStockWeight | Float | yes | ||
| ReturnedAllocatedStockWeight | Float | yes | ||
| RequestedDate | Date | no | Requested date | |
| ConfirmedDate | Date | no | Confirmed date | |
| InsertDate | Date | no | Confirmed date | |
| Priority | Integer | no | Confirmed date | |
| OrderNo | Integer | no | Order for balancing | |
| Comments | LongString | no | Comment for order | |
| IsSent | Integer | no | Order for balancing | |
| TimeStamp | TimeStamp | no | When record was addeed or updated |
| RebalancedStock | Replenishment Replenishment |
The table stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ProcessId | Identity | no | Process Id for rebalance orders and available onhandstock | |
| SiteMaterialUsageId | Identity | no | ||
| ConsignmentLocationId | Identity | yes | ||
| PreviousStock | Float | no | ||
| OnHandStock | Float | no | ||
| TotalOnHandStock | Float | no |
| RedundantEntitiesData | Core Temporary |
Temporary table for storing the ids to be deleted |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity |
| RemainingOrdersData | Replenishment Replenishment |
The table is used for storing Remaining Orders |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | A reference to the Users table | |
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| SiteId | Identity | yes | Site Id of the paper machine | |
| DateFrom | Date | no | Date from | |
| Weight | Float | no | Min opening consignment stock |
| RemovedOrderLineEntities | Replenishment Replenishment |
Store entity identifiers for sending into another external system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| TargetSystem | String | no | Target system | |
| EntityId | Identity | no | Original entity identity | |
| OrderCode | String | no | Order book code | |
| OrderLine | String | no | Order line lineNoCode | |
| TimeStamp | TimeStamp | no | When record added | |
| IsSent | Integer | no | Is order line sent |
| ReplacedLocations | Core Core |
The table stores the list of replaced locations |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| FromLocationId | Identity | no | old location Id | |
| ToLocationId | Identity | no | Replaced location Id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| ReplenishedCustomerDemands | Replenishment Replenishment |
The table stores information about the allocations of SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to the SiteMaterialUsages table | |
| DateFrom | Date | no | Date | |
| Forecast | Float | no | Forecast for one week for the specified SKU | |
| Demand | Float | no | Appropriate PM allocation, received from SNO engine | |
| Orders | Float | no | The sum of firm orders for the specified SKU for a given week | |
| NettedOrders | Float | no | Orders for netting, moved in periods | |
| Consumption | Float | no | Consumption for the specified SKU for one week (it is calculated from Forecast, Allocation and Orders) | |
| IsWorkingDay | integer | no | Is Working Day | |
| SiteId | Identity | yes | SiteId for allocation base replenishment | |
| ConsumptionType | String | no | ConsumptionType Forecast, Allocation or AllocationPerSource |
| ReplenishedCustomerSKU | Replenishment Order generation |
The table stores data about customer SKU's which involved in the allocation based replenishment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| MaterialId | Identity | yes | A reference to Materials | |
| SourceMaterialId | Identity | yes | A reference to Materials, source material | |
| LocationId | Identity | yes | A reference to Locations | |
| JourneyId | Identity | yes | A reference to Journeys | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| WorkcentreId | Identity | yes | PM Id where allocation exists for such SKU | |
| Portion | Float | no | Portion | |
| SourceSiteMaterialUsageId | Identity | yes | Source SKU ID | |
| TimePeriod | Integer | yes | Duration (days) from source to destination | |
| MaxPeriod | Integer | no | Max perido for demand calculation | |
| DateFrom | Date | no | Date | |
| DateTo | Date | no | Date | |
| GroupKey | String | yes | Group key | |
| NettingAlgorithm | String | yes | Taken from customer sku | |
| ConsumptionType | String | yes | Taken from customer sku |
| ReplenishedPoints | Replenishment Order generation |
The table contains the list of primary warehouse SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| GroupKey | String | yes | A group key | |
| GroupType | String | yes | A group type - Company, Site, Location | |
| GroupId | Identity | yes | A group key | |
| SiteMaterialUsageId | Identity | no | Primary warehouse SKU | |
| MaterialId | Identity | no | Primary warehouse material | |
| LocationId | Identity | no | Primary warehouse location | |
| WarehouseLocationId | Identity | yes | Group warehouse location | |
| ConsignmentLocationId | Identity | yes | Primary warehouse location | |
| GroupCompanyId | Identity | yes | Source workcentre company | |
| IgnoreNegativeInventoryDays | Integer | yes | 0 - ignore negative demand, positive ignore negative demands for N days, null - nothing | |
| IgnoreNegativeInventoryMethod | String | yes | ||
| ChainStartDate | Date | no | Start date for searching crash date | |
| ReplenishmentStartDate | Date | yes | replenishment start date | |
| ReplenishmentFinishDate | Date | yes | replenishment finish date | |
| Replenished | Integer | no | Does sku replenished? | |
| ChainsQuantity | Identity | yes | Quantity of chains | |
| SelectedChain | Identity | yes | Chain for which we will create orders | |
| AllowSubstitution | Integer | no | Flag indicate if an order can be substituted or not. | |
| IsSelected | Integer | no | Flag indicate if an sku selected for replenished. | |
| Criteria | Integer | no | Criteria by production rate properties | |
| ReplenishmentHorizon | Integer | no | Chain for which we will create orders | |
| TargetProductionSites | LongestString | yes | Target sites for allocation based replenishment. command separated list |
| ReplenishedSKU | Replenishment Order generation |
The table stores all warehouse SKUs which will be replenished in the process of allocation based replenishment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PointId | Identity | no | Replenishment point identity | |
| ChainNo | Integer | no | Chain no for replenishment point | |
| LevelNo | Identity | no | Level number | |
| GroupKey | String | no | Group key | |
| Replenished | Integer | no | Does sku replenished? | |
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| LocationId | Identity | no | A reference to Locations | |
| MaterialId | Identity | no | A Reference to Materials | |
| WarehouseLocationId | Identity | yes | Group warehouse location | |
| ConsignmentLocationId | Identity | yes | Primary warehouse location | |
| SourceSiteMaterialUsageId | Identity | yes | Source SKU | |
| IsConsignmentStock | Integer | no | A flag: should we replenish from consignment stock? | |
| FromLocationId | Identity | yes | Source location ID | |
| FromWorkcentreId | Identity | yes | Destination workcentre ID | |
| FromTransportLocationId | Identity | yes | Source location ID | |
| ToTransportLocationId | Identity | yes | Destination workcentre ID | |
| TransportWorkcentreId | Identity | yes | TransportWorkcentreId for orders | |
| FromSiteId | Identity | yes | Source Site ID | |
| SourceMaterialId | Identity | yes | Source material | |
| ToSiteId | Identity | yes | Source Site ID | |
| JourneyId | Identity | yes | Journey ID | |
| TotalTimePeriod | Identity | no | Total Time Period to first warehouse in chain | |
| CalendarId | Identity | yes | A reference to Calendars | |
| FATimePeriod | Identity | yes | Duration (days) from SFG warehouse to Finishing line | |
| FrozenPeriod | Identity | no | Frozen period in days | |
| FrozenPeriodStartDate | Date | no | First day after frozen period | |
| ReArrangeDate | Date | no | First date where sku can be replenished | |
| MaxCapacity | Float | no | MaxCapacity | |
| SourceType | String | yes | Source type - can be : DirectWH, WH, DirectPM, SWH, SitePM , AllPm | |
| LocationChain | LongestString | yes | Location replenishment chain | |
| PriorityPath | LongestString | yes | Location priority path | |
| AllowSubstitution | Integer | no | Flag indicate if an order can be substituted or not. | |
| StageNo | Integer | no | Stage No for operations. |
| ReplenishedSubstitutedSku | Replenishment Order generation |
The table stores pair of substituted SKU's |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | superseded sku | |
| OnSiteMaterialUsageId | Identity | no | on sku | |
| MaterialId | Identity | no | superseded product identity | |
| Replenished | Integer | no | Is superseded delisted? |
| ReplenishmentHorizonRules | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| RuleWeighting | Integer | no | Weight of rule | |
| ReplenishmentHorizon | Integer | no | Replenishment horizon | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ReplenishmentReports | Replenishment Replenishment |
Temporary table for storing warehouse sku data for replenishment report. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Report date | |
| WarehouseSkuId | Identity | no | Warehouse SKU Id | |
| FinalForecast | Float | no | ||
| AdditiveFinalForecast | Float | no | ||
| DeliveriesIn | Float | no | ||
| OrdersOut | Float | no | ||
| History | Float | no | ||
| SafetyStock | Float | no | ||
| Inventory | Float | no | ||
| InternalInventory | Float | no | ||
| ExternalInventory | Float | no | ||
| Consumption | Float | no | ||
| IsWorkingDay | Integer | no | ||
| CalendarId | Identity | no | ||
| DaysOfSupply | Integer | no | Days of supply (delivery time) | |
| HighQuantity | Float | no | Maximal quantity | |
| LowQuantity | Float | no | Minimal quantity | |
| MaxCapacity | Float | no | Max capacity | |
| Replenished | Integer | no | A flag: is the SKU replenished? (0 - not replenished, 1 - replenished) | |
| SafetyStockMethodId | Identity | no | ID of the SafetyStock calculation method | |
| ReplenishmentFrequency | Identity | no | Frequency of warehouse replenishment | |
| SkuProperty1 | String | yes | Sku Property 1 | |
| SkuProperty2 | String | yes | Sku Property 2 | |
| SkuProperty3 | String | yes | Sku Property 3 | |
| SkuProperty4 | String | yes | Sku Property 4 | |
| SkuProperty5 | String | yes | Sku Property 5 | |
| UpperPercentile | Float | no | Upper percentile | |
| LowerPercentile | Float | no | Lower percentile | |
| ReplenishmentStartDate | Date | yes | Replenishment start date | |
| ReplenishmentFinishDate | Date | yes | Replenishment start date | |
| MinOrderQuantity | Float | no | Minimal order quantity | |
| OrderUnitId | Identity | no | A reference to Units |
| ReplenishmentRestrictions | Replenishment |
The table store logs of the consignment stock edit |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkcentreId | Identity | no | A reference to the SiteMaterialUsages table | |
| PropertyId | Identity | no | A reference to the Locations table | |
| RangeFrom | Float | yes | ||
| RangeTo | Float | yes | ||
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who inserted the record? | |
| UpdateDate | Date | yes | When the record was inserted? |
| ReportFilterEntries | Reports Reports |
Filter entries |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ReportFilterId | Identity | no | Report filter identity | |
| FieldName | String | no | Field name | |
| Operation | String | no | Operation | |
| FilterValues | Text | yes | list of filter values | |
| Aggregation | String | yes | Aggregation function | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ReportFilters | Reports Reports |
Report filters |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Filter Id |
| DataSourceId | Identity | no | Data Source identity | |
| Code | String | yes | Filter name | |
| IsShared | Integer | no | Filter shared flag | |
| Logic | String | no | Logic to combine criteria (AND/OR) | |
| HashCode | Text | yes | Filter hash code for comparison | |
| ShaCode | String | yes | Sha-265 hash code for comparing filters | |
| ToolTip | HugeString | yes | Filter ToolTip | |
| SqlText | Text | yes | Filter condition | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ReservationStockSKUData | Replenishment Temporary |
A temporary table for Stock Reservation (ticket 51626) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| OrderNo | Identity | yes | Material Id | |
| SkuKey | String | no | SKU Code - SKU-CS-SW. | |
| SiteMaterialUsageId | Identity | no | SiteMaterialUsage Id | |
| LocationId | Identity | no | Location Id | |
| MaterialId | Identity | no | Material Id | |
| ConsignmentLocationId | Identity | yes | Consignment Location Id |
| RestMessagesLog | Due date quoting Logging |
The table is used to maintain rest messages log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| Endpoint | String | yes | ||
| MessageReceivedTime | TimeStamp | no | ||
| MessageCompletedTime | TimeStamp | no | ||
| MessageIn | Text | yes | ||
| MessageOut | Text | yes |
| Roles | Core Access rights |
The table stores the list of all roles available in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RoleName | String | no | Role name | |
| RoleDescription | LongString | no | Role description | |
| IsAdmin | Integer | no | If on then user who have such role have access to all locations and workcentres | |
| IsInternal | Integer | no | A flag: is this internal (not editable and non-removable role? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| RolesActions | Core Access rights |
The table describes many-to-many relation between roles and actions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ActionId | Identity | no | Action ID | |
| RoleId | Identity | no | Role ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| RolesDataSources | Reports Access rights |
The table describes many-to-many relation between roles and system reports |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| RoleId | Identity | no | System Role Id | |
| DataSourceId | Identity | no | data source id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| RolesDataSources2 | Reports Access rights |
The table describes many-to-many relation between roles and system reports |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| RoleId | Identity | no | System Role Id | |
| DataSourceId | Identity | no | data source id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| RolesTasks | Core Access rights |
The table describes many-to-many relation between roles and task (process) notifications |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TaskId | Identity | no | Task ID | |
| RoleId | Identity | no | Role ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| RolesWidgets | Core Access rights |
The table describes many-to-many relation between roles and Widgets |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WidgetId | Identity | no | Widget ID | |
| RoleId | Identity | no | Role ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| RPTemporaryOrders | Replenishment Order Generation |
The table stores temporary orders generated during allocation based replenishment for each replenishment chain |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PointId | Identity | yes | A reference to SiteMaterialUsages | |
| ChainNo | Integer | no | A chain number for replenishment point | |
| LevelNo | Identity | no | Level number | |
| DestinationLocationId | Identity | no | Destination location | |
| SiteMaterialUsageId | Identity | yes | A reference to SiteMaterialUsages | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| LocationId | Identity | no | A reference to Locations | |
| MaterialId | Identity | no | A Reference to Materials | |
| SourceMaterialId | Identity | yes | A Reference to Materials | |
| GroupKey | String | yes | A reference to Sites | |
| FromLocationId | Identity | yes | Source location of the item | |
| FromWorkcentreId | Identity | yes | Source workcenter of the item | |
| TransportWorkcentreId | Identity | yes | TransportWorkcentreId for orders | |
| OperationWorkcentreId | Identity | yes | OrderOperation workcentre Id | |
| FromSiteId | Identity | yes | Source site of the item | |
| ToSiteId | Identity | yes | Source site of the item | |
| SourceSiteMaterialUsageId | Identity | yes | Source SKU ID | |
| FATimePeriod | Identity | yes | Duration (days) from SFG warehouse to the finishing line | |
| DespatchDate | Date | yes | Despatch date from the warehouse | |
| DeliveryDate | Date | yes | Delivery date to the destination area | |
| RequestedDate | Date | yes | Requested date to the destination area | |
| ConsumptionDate | Date | yes | Delivery date to the destination area | |
| FinishingDate | Date | yes | Delivery date to the destination area | |
| JourneyId | Identity | yes | Journey ID | |
| MaterialRunId | Identity | yes | A reference to MaterialRuns | |
| Weight | Float | no | Weight | |
| DueDate | Date | yes | Weight | |
| SourceWeight | Float | no | Weight | |
| AvailableInventory | Float | no | Weight | |
| IsCreateOrder | Integer | no | Order is create | |
| AllowSubstitution | Integer | no | Flag indicate if an order can be substituted or not. | |
| MaxCapacity | Float | no | Max Capacity. | |
| SourceConsignmentLocationId | Identity | yes | Order is create | |
| SourceType | String | no | Order is create | |
| FrozenPeriod | Identity | no | Frozen period in days | |
| FrozenPeriodStartDate | Date | no | First day after frozen period | |
| ToTransportLocationId | Identity | yes | Destination workcentre ID | |
| FromTransportLocationId | Identity | yes | TransportWorkcentreId for orders | |
| MaxLevelNo | Identity | no | Quantity of levels in the chain | |
| Rate | Float | no | Rate | |
| Stageno | Integer | no | StageNo for last operation |
| RsoDemands | Replenishment Replenishment |
Store demands for RSO property sets |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Demand identity |
| RsoPropertySetId | Identity | no | Property Set Id | |
| RsoScenarioId | Identity | no | Scenario Id | |
| Width | Integer | yes | Demand width | |
| Weight | Float | no | Demand weight | |
| PatternQty | Integer | yes | Demand pattern qty (output from RSO, for selected stock size) | |
| RsoStockSizeId | Identity | yes | Stock Size Id (assigned by RSO) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| RsoPropertySets | Replenishment Replenishment |
Store RSO property sets (individual RSO problems) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Property set identity |
| RsoScenarioId | Identity | no | Scenario Id | |
| RequestedStockSizes | Integer | yes | Nuber of requested stock sizes | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| Properties | HugeString | yes | comma separated properties | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| RsoScenarios | Replenishment Replenishment |
Store RSO scenarios |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Scenario identity (-1 to use the current scenario) |
| Name | String | yes | Scenario name | |
| UserId | Identity | no | User ID of the scenario owner | |
| WorkcentreId | Identity | no | ID of the workcentre the scenario is for | |
| DateFrom | Date | no | The start date of scenario | |
| DateTo | Date | no | The end date of scenario | |
| DemandGenerationDate | Date | no | Date of the demand snapshot creation | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| RsoStockSizes | Replenishment Replenishment |
Stock sizes created manually and by the RSO process |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Stock size identity |
| RsoPropertySetId | Identity | no | Property Set Id | |
| RsoScenarioId | Identity | no | Scenario Id | |
| Width | Integer | yes | Demand width | |
| IsRequired | Identity | yes | A flag (1 means that the stock size should be kept by RSO process) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| RunInventoryProfiles | Block Scheduling Block Scheduling |
The table stores allocations as input for BSO engine |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date | |
| SiteId | Identity | no | Site Identity | |
| GradeId | Identity | no | Grade Identity | |
| Opening | Float | no | Calculate Opening for current date by using opening from RealInventoryProfile for all SKU which match selected GradeId | |
| Demand | Float | no | Passed Allocations and Orders to BSO from table BSOInputData + orders assigned to runs before BSOHorizon based on OrderOperations.DueDate (between CurrentDate and BSOStartDate) | |
| Capacity | Float | no | Calculate daily run capacity for BSO generated runs plus runs with StartDate before BSOStartDate and FinishDate after CurrentDate, proportioning run daily capacities taken from getMPBSComparison | |
| Closing | Float | no | Opening - Demand + Capacity | |
| SafetyStock | Float | no | Calculate SafetyStock for each Grade/Date - take sum of safety stocks from InventoryProfiles which match GradeId | |
| OperatorUserId | Identity | no | User identity |
| RunsForAdjustingData | Block Scheduling Block Scheduling |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Guid | String | no | Unique identifier per batch | |
| MaterialRunId | Identity | no | Unique identifier | |
| PositionNo | Identity | no | Position No | |
| OriginalStartDate | Date | no | Run start date | |
| OriginalFinishDate | Date | no | Run end date | |
| StartDate | Date | no | Run start date | |
| FinishDate | Date | no | Run end date | |
| TargetStartDate | Date | yes | Run target start date | |
| InitialDuration | Float | no | Initial duration and real run duration, including changeover | |
| SwitchoverDuration | Float | no | Changeover duration. This duration is a part or run duration | |
| WorkcentreId | Identity | no | A reference to Workcentres.Id | |
| RunStatusCode | String | yes | Run status code |
| SADemandAllData | Scenario Analysis Temporary |
Stores aggregated SA Demand totals and detail rows by summary group and period for paging. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID | |
| Id | Identity | no | Summary group ID; 0 identifies the total row | |
| SummaryFields | HugeString | yes | Summary field values | |
| AllocationStatusCssClass | LongString | yes | Allocation status CSS class | |
| DateFrom | Date | no | Demand period start | |
| AllocationNettedForecast | Float | yes | Netted forecast allocation | |
| AllocationAllocated | Float | yes | Allocated demand | |
| DemandNettedForecast | Float | yes | Netted forecast demand | |
| Forecast | Float | yes | Forecast demand | |
| Inventory | Float | yes | Inventory | |
| InventoryDeficit | Float | yes | Inventory deficit | |
| Price | Float | yes | Average price | |
| UnallocatedForecast | Float | yes | Unallocated forecast | |
| Cost | Float | yes | Cost | |
| Revenue | Float | yes | Revenue | |
| UnallocatedRevenue | Float | yes | Unallocated revenue | |
| Margin | Float | yes | Margin | |
| MarginWeight | Float | yes | Margin per allocated weight | |
| FirmOrders | Float | yes | Firm orders | |
| IgnoredDemand | Float | yes | Ignored demand |
| SADemandFlatData | Scenario Analysis Temporary |
Stores filtered SNP demand items as flat rows grouped by SA Demand summary fields for getSADemand paging. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID | |
| GroupId | Identity | no | Summary group ID | |
| SummaryFields | HugeString | yes | Summary field values | |
| AllocationStatusCssClass | String | yes | Allocation status CSS class | |
| SnpItemId | Identity | no | SNP item ID | |
| CoProductId | Identity | yes | Co-product ID | |
| UnallocatedReasonId | Identity | yes | Unallocated reason ID | |
| Dividend | Float | yes | Weight conversion dividend | |
| Divisor | Float | yes | Weight conversion divisor |
| SafetyStockMethods | Core Configuration |
The table stores the list of available methods of safety stock calculation |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SafetyStockMethodName | String | no | Method name | |
| SafetyStockMethodDesc | LongString | no | Method description | |
| IsMaxMethod | Integer | no | Can be used method as Max safety stock method | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SafetyStockSnapshots | Scenario Analysis Input Data |
The table contains snapshots of safety stock percentage values for SNP. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| SiteId | Identity | yes | Site ID (A reference to Sites) | |
| Effective | Date | no | Effective date | |
| Percentage | Float | no | Safety Stock Percentage value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SAInventorySourcingData | Master Planning Temporary |
A temporary table for Supply Planning / SA Sourcing View screen, focusing on allocations sourced from warehouses. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Group Id | |
| SiteMaterialUsageId | Identity | yes | Group Id | |
| DateFrom | Date | no | date | |
| Capacity | Float | no | ||
| InitialInventory | Float | no | ||
| TotalInventory | Float | no | ||
| AvailableInventory | Float | no | ||
| Allocation | Float | no | ||
| SafetyStock | Float | no | ||
| OriginalSafetyStock | Float | no | ||
| InventoryDeficit | Float | no | ||
| RestoredAllocation | Float | no | ||
| IsProductionPeriod | Integer | no | ||
| Orders | Float | no | ||
| Revenue | Float | no | ||
| Cost | Float | no | ProductionCost | |
| Margin | Float | no |
| SASiteInventoryData | Master Planning Temporary |
A temporary table for Supply Planning / SA Site Inventory screen, focusing on the inventory side of live allocations' impact on stock levels. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Group Id | |
| SummaryFields | HugeString | yes | Summary fields | |
| DateFrom | Date | no | date | |
| Opening | Float | no | Opening Inventory | |
| Incoming | Float | no | Incoming Quantity | |
| Outgoing | Float | no | Outgoing Quantity | |
| Produced | Float | no | Produced Quantity | |
| Dispatched | Float | no | Dispatched Quantity | |
| UnallocatedRunCapacity | Float | no | Unallocated Run Capacity | |
| RemainingAllocation | Float | no | Remaining Allocation | |
| AllocatedProduction | Float | no | Allocated Production | |
| CustomerAllocation | Float | no | Customer Allocation |
| SASourcingData | Master Planning Temporary |
A temporary table for Supply Planning / SA Sourcing View screen, focusing on the sourcing side of live allocations (viewed in Demand Control). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Group Id | |
| DateFrom | Date | no | date | |
| Capacity | Float | no | ||
| NominalCapacity | Float | no | ||
| Allocation | Float | no | ||
| Orders | Float | no | ||
| Utilisation | Float | no | ||
| CycleInventory | Float | no | ||
| Revenue | Float | no | ||
| ProductionCost | Float | no | ProductionCost | |
| TransportCost | Float | no | TransportCost | |
| InventoryCost | Float | no | InventoryCost | |
| TotalCost | Float | no | TotalCost | |
| UtilisationTime | Float | no | ||
| Margin | Float | no | ||
| Profitability | Float | no | Margin per hour | |
| NominalCapacityHours | Float | no | ||
| CapacityHours | Float | no | ||
| AllocationHours | Float | no | ||
| OrdersHours | Float | no | ||
| ShutHours | Float | no | ||
| UnallocatedHours | Float | no | ||
| UnallocatedCapacity | Float | no | ||
| Losses | Float | no | Losses |
| SAToolPoolingUsageData | Scenario Analysis Temporary |
Temporary table for Supply Planning tool pooling usage analysis per operator. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Group Id | |
| ToolMaterialId | Identity | no | Tool Material Id | |
| TotalQuantity | Integer | no | ||
| InitialSites | LongestString | yes | ||
| DateFrom | Date | yes | date | |
| OrderUsage | Float | yes | Group Id | |
| AllocationUsage | Float | yes | Group Id | |
| TotalUsage | Float | yes | Group Id | |
| PrimarySiteId | Identity | yes | Group Id | |
| SecondarySiteId | Identity | yes | Group Id | |
| PrimaryUtilisation | Float | yes | Group Id | |
| SecondaryUtilisation | Float | yes | Group Id | |
| HasMovements | Integer | no | ||
| ToolSites | LongestString | yes | ||
| OrderSites | LongestString | yes | ||
| OrderSiteIds | LongestString | yes |
| SATransportationData | Master Planning Temporary |
A temporary table for Supply Planning / SA Sourcing View screen, focusing on the Transportation data. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Group Id | |
| SummaryFields | HugeString | yes | Group fields | |
| DateFrom | Date | no | date | |
| MinCapacity | Float | no | ||
| MaxCapacity | Float | no | ||
| Allocation | Float | no | ||
| Orders | Float | no | ||
| Revenue | Float | no | ||
| ProductionCost | Float | no | ProductionCost | |
| TransportCost | Float | no | TransportCost | |
| InventoryCost | Float | no | InventoryCost | |
| TotalCost | Float | no | TotalCost | |
| Margin | Float | no | ||
| Filtered | Integer | no |
| ScenarioActionParameters | Scenario Analysis Reference Data |
Parameters related to the manual user modifications of SNP scenario (details for actions stored in ScenarioActions). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ActionId | Identity | no | Action ID (same as Id in ScenarioActions) | |
| ParameterName | LongestString | no | Parameter name | |
| ParameterType | LongestString | no | Parameter value type (Date, String, Integer, Decimal etc) | |
| ParameterValue | LongestString | yes | Parameter value | |
| InsertDate | Date | yes | Date and time when the action was inserted |
| ScenarioActions | Scenario Analysis Reference Data |
The table contains saved history of manual user modifications (e.g. editing Forecast) for SNP scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Scenario action ID | |
| ScenarioId | Identity | no | Scenario ID (a reference to Scenarios) | |
| ActionName | String | yes | System mnemonic of the user's action | |
| SqlText | LongestString | yes | SQL statement text | |
| ActionComment | LongestString | yes | The action comment to show in GUI | |
| ScenarioSessionId | Identity | yes | Scenario Session ID (a reference to ScenarioSessions) | |
| InsertDate | Date | no | Date and time when the action was inserted |
| ScenarioAnalysisSnapshots | Master Planning Master Planning |
The table contains user snapshots of SKU coefficients for prorating |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| ScenarioId | Identity | no | ScenarioId | |
| SnpItemId | Identity | no | Snp item Id | |
| DeliveryDate | Date | no | ||
| ChainNo | Identity | no | ||
| SourceDate | Date | no | ||
| SeqNo | Integer | no | ||
| WorkcentreId | Identity | no | ||
| OperationTypeId | Identity | no | ||
| Cost | DoubleFloat | yes | ||
| Rate | Float | yes |
| ScenarioComparisonData | Master Planning Temporary |
Temporary table for comparing scenarios in Supply Planning screens. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario session Id | |
| ScenarioId | Identity | no | Scenario Id | |
| UserId | Identity | no | User Id | |
| SessionName | String | no | Scenario Session Name (snapshot name) | |
| ScenarioName | String | no | Scenario Name | |
| Forecast | Float | no | Forecast quantity | |
| RemainingForecast | Float | no | Forecast quantity after pretenning and aggregation | |
| IgnoredSmallDemands | Float | no | Quanity of ignored small demands | |
| SNODemand | Float | no | SNP Demand quantity | |
| FirmOrders | Float | no | Non-moveable orders weight | |
| MoveableFirmOrders | Float | no | moveable orders weight | |
| NonMoveableOrdersWithLoss | Float | no | Non-moveable orders with losses | |
| Allocation | Float | no | Allocation quantity | |
| DemandFulfilment | Float | no | Demand Fulfilment, percentage | |
| UnAllocatedDemand | Float | no | Unallocated demand quantity (demands that SNP did not allocate) | |
| UnAllocatedPMCapacity | Float | no | Unallocated production workcentre capacity | |
| Revenue | Float | no | Revenue | |
| Cost | Float | no | Cost | |
| Margin | Float | no | Margin | |
| Score | Float | no | Score | |
| RevenuePerUnit | Float | no | Revenue per unit | |
| CostPerUnit | Float | no | Cost per unit | |
| MarginPerUnit | Float | no | Margin per unit | |
| OperatorUserId | Identity | no | User that updated this row | |
| DateFrom | Date | yes | Date (SNP period start date) |
| ScenarioParameters | Master Planning Master Planning |
The table stores the system parameters per SNP scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to ScenarioSessions) | |
| ParameterName | String | no | Parameter name (a reference to the SystemParameters table) | |
| Value | LongestString | no | Parameter Value (a reference to the SystemParameters table) |
| ScenarioPeriodSnapshots | Scenario Analysis Reference Data |
List of time periods for the user's SNP session. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| StartPeriod | Date | no | Period start date | |
| EndPeriod | Date | no | Period end date | |
| PeriodNumber | Integer | no | Period index in the SNP horizon | |
| PeriodLength | Integer | no | Period length (duration), days |
| ScenarioRates | Core Temporary |
Temporary table to calculate production rates for SNP. These define at which rate demands can be produced on workcentres, in quantity per time. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| DateFrom | Date | yes | From which date does this production rate come into effect | |
| ScenarioId | Identity | no | Scenario Id (reference to Scenarios) | |
| WorkcentreId | Identity | no | Workcentre Id (reference to Workcentres) | |
| SiteId | Identity | no | Site Id (reference to Sites) | |
| OperationTypeId | Identity | no | Operation Type Id | |
| PropertyValueId | Identity | no | Property Value Id | |
| CycleTypeId | Identity | yes | Cycle Type Id | |
| IsActive | Integer | no | Is Active: Can this rate be used in this period. 0 - non-production, 1 - forced production via run or orders, 2 - copied from the reference | |
| HasOrder | Integer | no | Indicates that an order exists for this rate | |
| HasRun | Integer | no | Indicates that a run with fixed capacity exists for this rate | |
| Rate | Float | yes | Production Rate value (quantity per time) | |
| Cost | Float | yes | Production Cost value (currency per time) | |
| ConversionFactor | Float | no | Production Rate Conversion factor | |
| MaterialEfficiency | Float | no | Material efficiency (corresponds to conversion loss, 100% means no loss) | |
| TimeEfficiency | Float | no | Time efficiency (how much time is used on the production workcentre) |
| ScenarioResultSnapshots | Master Planning Master Planning |
Table to store scenario results for comparison in Supply Planning screens. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario session Id | |
| ScenarioId | Identity | no | Scenario Id | |
| DateFrom | Date | yes | Period date | |
| IsCoProduct | Integer | yes | Co-product state flag: 1 if coproduct, 0 if main product. | |
| Forecast | Float | no | Forecast quantity | |
| RemainingForecast | Float | no | Forecast quantity after prenetting and aggregation | |
| IgnoredSmallDemands | Float | no | Quantity of ignored small demands | |
| SNODemand | Float | no | SNP Demand quantity | |
| FirmOrders | Float | no | Non-moveable orders weight | |
| MoveableFirmOrders | Float | no | Moveable orders weight | |
| NonMoveableOrdersWithLoss | Float | no | Non-moveable orders with losses | |
| Allocation | Float | no | Allocation quantity | |
| UnAllocatedDemand | Float | no | Unallocated demand quantity (demands that SNP did not allocate) | |
| UnAllocatedPMCapacity | Float | no | Unallocated production workcentre capacity | |
| Revenue | Float | no | Revenue | |
| Cost | Float | no | Cost | |
| Margin | Float | no | Margin |
| Scenarios | Scenario Analysis Reference Data |
List of scenarios created for the user's SNP Session. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Scenario ID (not globally unique, but only as part of a Scenario Session; -1 means the current scenario) |
| ScenarioName | String | yes | Scenario name | |
| IsCurrentBase | Identity | yes | A flag (1 means that the current scenario is selected as the parent scenario) | |
| OptimizationMode | Integer | no | Optimization mode selected for the SNP engine (0 - minimise cost, 1 - maximise profit, 2 - maximise service level) | |
| Released | Integer | no | A flag (1 means that the scenario was released, 0 - non-released scenario) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| State | String | no | State: None, Stored, Optimized, ReferenceChanged | |
| HasReferenceChanges | Integer | no | A flag: does the scenario have any changes in reference data which not taking in optimisation process? 1- yes, 0 - no | |
| IsProblem | Integer | yes | A flag: does the scenario have any problems in data? 1 - yes, 0 - no | |
| PenaliseDowntime | HugeString | yes | Workcentres/WorkcentreTypes to penalise the downtime for. This penalises unallocated capacity and ensures more demands are allocated. | |
| IgnoreSourceLists | Integer | no | A flag: Ignore source lists | |
| UseOnlyPrimarySources | Integer | no | A flag: Use only primary sources | |
| UseMinAllocation | Integer | no | A flag: Apply minimum allocation settings | |
| CrossSite | ShortString | no | Whether to allow cross-site (cross-mill) allocations: on/off/useOperationType | |
| MaxEarlyPeriods | Integer | yes | Max periods to produce allocations early (compared to demand date) | |
| MaxLatePeriods | Integer | no | Max lateness periods | |
| MaxEarlyPeriodsOrders | Integer | yes | Max periods to produce moveable orders early | |
| MaxLatePeriodsOrders | Integer | no | Max lateness periods for moveable orders | |
| MaxEarlyPeriodsSFG | Integer | yes | Max periods allowed between production stages and semi-finished goods (SFG) warehouse. | |
| MaxReplenishPeriodsForSafetyStock | Integer | yes | Max periods to replenish safety stock. | |
| Ranks | HugeString | yes | Comma-separated customer ranks included in the scenario. | |
| UseUnlimitedPMCapacity | Integer | no | A flag: does the use unlimited production capacity in this scenario | |
| IsFullLog | Integer | no | A flag: Whether to generate full log | |
| MovableOrdersMode | ShortString | no | Mode for movable orders in SNP | |
| SNPStockCustomers | ShortString | no | Mode for customer sku's allocation from stock: Replenished or Any | |
| IgnoreEmptyProductionOrders | Integer | no | Ignore production orders without operations | |
| IsToolPoolingEnabled | Integer | no | Is tool pooling (using tools on all sites) enabled | |
| ToolPoolingFrozenPeriods | Integer | no | Tool pooling frozen window (full periods) | |
| WorkcentrePriorityTierLimit | Integer | no | Workcentre priority tier limit | |
| MinRunHours | Integer | no | Min run in hours for automatic cycle types | |
| EngineZipFilePath | LongestString | yes | Full path to the engine storage ZIP file created for this scenario SNP optimisation. | |
| InsertDate | Date | no | When scenario was created |
| ScenarioSessionParameters | Master Planning Master Planning |
The table stores the system parameters per SNP scenario session. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ParameterName | String | no | Parameter name (a reference to the SystemParameters table) | |
| Value | LongestString | no | Parameter Value (a reference to the SystemParameters table) |
| ScenarioSessions | Scenario Analysis Reference Data |
The table contains user sessions (also called snapshots) for SNP. Multiple scenarios exist within one session. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Session ID |
| SnapshotUserId | Identity | no | User ID | |
| SessionName | String | no | Scenario Session Name | |
| SnapshotPeriodType | String | no | Which snapshot period type is used: Day, Week, Month, WeekMonth, Quarter | |
| FixedPeriod | Integer | no | Duration of Fixed period (in the selected period type) | |
| UseFixedPeriod | Integer | no | Flag, if 1 then SNP includes frozen period in the optimisation horizon. | |
| Horizon | Integer | no | Length of SNP session horizon (in the selected period type) | |
| ReadOnly | Integer | no | Read-only flag: 1 means the session is read-only, the user can only view but not edit it. | |
| IsValid | Integer | no | Flag to show if the session was created properly. | |
| UsedPriceSettings | String | no | Which prices source was used in the session: Reference, Forecast or ForecastAndReference | |
| CreationDate | Date | no | The date when session was created. It's SYSDATE for tracking | |
| StartDate | Date | no | The internal date for handling anything before today. | |
| StartWeek | Date | no | The first period start date of the SNP horizon | |
| FixedPeriodDate | Date | no | The fixed period **end** period date. | |
| FinishWeek | Date | no | The last period start date of the SNP horizon | |
| ForecastSnapshotId | Identity | yes | Forecast snapshot ID. If null, the session was created from the Forecast data, otherwise from the specified Forecast Snapshot. |
| ScheduleRules | Core Schedules |
The table stores schedule rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ScheduleId | Identity | no | A reference to schedule | |
| ScheduleRuleNo | String | no | Schedule number | |
| Day | Integer | yes | Day of month | |
| DayOfWeek | Integer | yes | Day of week | |
| NumOfWeek | Integer | yes | Number of week | |
| Month | Integer | yes | Month | |
| Year | Integer | yes | Year | |
| Description | LongString | no | Description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Schedules | Core Schedules |
In this table schedules are stored. A schedule defines when a product can be despatched from a warehouse. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ScheduleName | String | no | Schedule name | |
| GeneralScheduleId | Identity | yes | Parent schedule ID | |
| DefaultAvailable | Integer | no | A flag: 0 - all rules of this schedule define possible shipping dates, 1 - impossible shipping dates | |
| IsReceivingDays | Integer | yes | A flag; defines, if this schedule is used for defining possible leave dates or for possible receiving dates | |
| LastGeneratedDate | Date | yes | When schedule was last time regenerated. | |
| LastExistingDate | Date | yes | Schedule last existing date. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ScheduleSources | Core Schedules |
The table stores detailed information on each day of schedules. Schedule rules are expanded into this table. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScheduleId | Identity | no | Schedule ID (A reference to Schedules) | |
| DateFrom | Date | no | Date | |
| IsLeaveDay | Integer | yes | A flag: is this a shipping day? Meaning of this flag depends on Schedules.DefaultAvailable value for the schedule | |
| Description | LongString | yes | Description (copied from the rule) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| SecondPassRules | Core Core |
The table stores forecast method rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ReportFilterId | Identity | yes | Filter Id | |
| CharacteristicsList | HugeString | no | List of characteristics for grouping | |
| RuleWeighting | Integer | no | Rule Weighting | |
| ForecastMethodId | Identity | no | Forecast method | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SelectiveData | Forecasting Temporary |
Temporary table for selective or full forecast generation process. Table contains the list of skus |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| FirstPassId | Identity | no | First pass Id | |
| SecondPassId | Identity | yes | Id from SecondPass properties | |
| SecondPassRuleId | Identity | yes | Id from SecondPassRules | |
| SiteMaterialUsageId | Identity | no | SMU Id | |
| ForecastMethodId | Identity | yes | Forecast Method Id. NULL - mean used for Launch Profiles | |
| SecondForecastMethodId | Identity | yes | Forecast Method Id | |
| HistoryStartDate | Date | yes | History Start Date | |
| Successed | Integer | no | Does SKU have supercessions in the future | |
| StartDate | Date | yes | Start Date for forecast (used for future supercessions | |
| CurrencyId | Identity | no | Currency | |
| UseTradingDays | Integer | no | Use Trading Days for forecast generation | |
| CalendarId | Identity | no | Use Trading Days for forecast generation | |
| LowerPercentile | Float | no | Lower percentile | |
| UpperPercentile | Float | no | Upper percentile | |
| HistoryExists | Integer | no | Does SKU have history | |
| Patterns | LongString | yes | list of sku Forecast patterns | |
| SecondPatterns | LongString | yes | list of sku Forecast patterns for second pass | |
| CharacteristicsList | LongString | yes | list of characteristics for second pass | |
| Characteristics | HugeString | yes | Characteristics values | |
| Events | HugeString | yes | Forecast events | |
| LaunchProfileId | Identity | yes | Launch profile id | |
| SecondLaunchProfileId | Identity | yes | Launch profile id for second pass | |
| OperatorUserId | Identity | no | user id |
| SelfLog | Core Logging |
The table is used to maintain external messages log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Stamp | TimeStamp | no | Identity | |
| Message | Text | no | Message text | |
| ProcedureName | String | no | Message text | |
| OperatorUserId | Identity | no | Message text |
| SiteMaterialUsages | Core Core |
The table stores the list of SKU parameters |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| MaterialId | Identity | no | SKU material ID | |
| LocationId | Identity | no | SKU location ID | |
| EndUseId | Identity | yes | Identity | |
| EndCustomerId | Identity | yes | Identity | |
| DaysOfSupply | Integer | no | Days of supply (delivery time) | |
| MaxDaysOfSupply | Integer | no | Max Days of supply (delivery time) | |
| HighQuantity | Float | no | Maximal quantity | |
| LowQuantity | Float | no | Minimal quantity | |
| MinOrderQuantity | Float | yes | Minimal order quantity | |
| OrderUnitId | Identity | yes | A reference to Units | |
| MaxCapacity | Float | yes | Capacity of the warehouse | |
| Status | Integer | yes | A flag: is the SKU forecasted? (0 - not forecasted, 1 - forecasted) | |
| HistoryStartDate | Date | yes | History start date. The earliest month of history, which need to be taken into account when generating forecast | |
| Replenished | Integer | no | A flag: is the SKU replenished? (0 - not replenished, 1 - replenished) | |
| ReplenishmentFlag | Integer | no | A flag: does SKU replenished or have non-zero source priority to replenished SKU? (0 - not replenished, 1 - replenished) | |
| SafetyStockMethodId | Identity | yes | ID of the SafetyStock calculation method | |
| MaxSafetyStockMethodId | Identity | yes | ID of the SafetyStock calculation method | |
| CustomerRankId | Identity | yes | A reference to CustomerRanks | |
| UpperPercentile | Float | yes | Upper percentile | |
| LowerPercentile | Float | yes | Lower percentile | |
| ReplenishmentFrequency | Identity | no | Frequency of warehouse replenishment | |
| MaxReplenishmentFrequency | Identity | no | Frequency of warehouse replenishment | |
| ForecastStartDate | Date | yes | Forecast start date | |
| ForecastFinishDate | Date | yes | Forecast end date | |
| ReplenishmentStartDate | Date | yes | Replenishment start date | |
| ReplenishmentFinishDate | Date | yes | Replenishment start date | |
| inhibitProduction | Integer | no | A flag: disable further production of the SKU? | |
| DDQContingency | Float | yes | The quantity of units for keep on the warehouse | |
| TurnOffForecastId | Identity | yes | A reference to forecast header which has turn off this sku (by supersessions) | |
| TurnOnForecastId | Identity | yes | A reference to forecast header which has turn on this sku (by supersessions) | |
| NeedCheckForecastId | Identity | yes | A reference to forecast header .... | |
| LastInventoryDate | Date | yes | Last known inventory date | |
| GroupKey | String | yes | Group key for grouping in replenishment | |
| DefaultCustomerForecast | ShortString | no | values - NotSet, System, Budget, Zero, Budget then Zero | |
| NettingAlgorithm | String | yes | Netting algorithm for replenishment. Values from Bundle NettedAlgorithm | |
| AlternateProduct | String | yes | Alternate Product | |
| ExistingAlternateProduct | String | yes | Alternate Product | |
| SkuKey | String | no | Destination SKU Code - SKU-CS-SW | |
| SkuProperty1 | String | yes | Sku Property 1 | |
| SkuProperty2 | String | yes | Sku Property 2 | |
| SkuProperty3 | String | yes | Sku Property 3 | |
| SkuProperty4 | String | yes | Sku Property 4 | |
| SkuProperty5 | String | yes | Sku Property 5 | |
| SkuProperties | HugeString | yes | All sku properties | |
| SNPExclusionPeriod | Integer | no | SNP Forecast exclusion period | |
| DerivedCharacteristic1 | String | yes | Derived Characteristic 1 | |
| DerivedCharacteristic2 | String | yes | Derived Characteristic 2 | |
| DerivedCharacteristic3 | String | yes | Derived Characteristic 3 | |
| DerivedCharacteristic4 | String | yes | Derived Characteristic 4 | |
| DerivedCharacteristic5 | String | yes | Derived Characteristic 5 | |
| SafetyStockPercentWarning | Float | yes | Safety stock percent warning | |
| UpperPercentileMethod | String | no | Method for upper percentile | |
| ReplenishmentHorizon | Float | yes | ReplenishmentHorizon | |
| LeadTimeDays | Float | yes | Raw material lead time, in days | |
| UpperPercentileMonths | Integer | no | Method for upper percentile | |
| ForecastFrozenEditingPeriod | Integer | yes | Hidden columns managed by rules | |
| ConsumptionType | String | yes | What will be used as replenishment demand - forecast or allocation, null - mean use value from system parameter ReplenishmentDemandType | |
| IsActiveSku | Integer | no | Is suck sku have inventory or movements. Valid only for WH skus | |
| ForecastStatusId | Identity | no | Forecast status Id | |
| OnSiteMaterialUsageId | Identity | yes | OnSiteMaterialUsageId from Active supersessions | |
| ExcludeFromSA | Identity | no | Exclude From SA | |
| ForecastMethodRuleId | Identity | yes | First pass forecast method rule | |
| SecondPassRuleId | Identity | yes | Second pass method rule | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SiteProperties | Core Core |
The table stores the list of properties registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PropertyName | String | no | Property name | |
| HierarchyLevelNo | Integer | no | Property name | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Sites | Core Core |
The table stores the list of all sites registered in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SiteName | String | no | Site name | |
| SiteCode | ShortString | no | Site external code | |
| Ownership | Float | no | percent of profit | |
| TaxRate | Float | no | Tax Rate | |
| BSLocked | Identity | no | 0 - BS process not locked site; 1 -0 - BS process locked site | |
| ProcessId | Identity | yes | BS process identity that locked site | |
| Latitude | ShortString | yes | Latitude | |
| Longitude | ShortString | yes | Longitude | |
| StandardTransportCost | DoubleFloat | no | Standard transport cost | |
| MaxLeavingCapacity | Float | no | Max.Leaving Capacity | |
| SiteProperty1 | String | yes | Site Property 1 | |
| SiteProperty2 | String | yes | Site Property 2 | |
| SiteProperty3 | String | yes | Site Property 3 | |
| SiteProperty4 | String | yes | Site Property 4 | |
| SiteProperty5 | String | yes | Site Property 5 | |
| SiteProperties | HugeString | yes | All site properties | |
| UserId | Identity | yes | The ID of the user who have locked the site | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SkuAllocationsData | Master Planning Master Planning |
A temporary table for |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (A reference to Users) | |
| Id | Identity | no | ||
| SiteMaterialUsageId | Identity | yes | Sku Id | |
| Workcentres | myIdentityArray | yes | Workcentre list | |
| SiteSummaryColumns | HugeString | yes | Site summary columns | |
| Dividend | Float | yes | ||
| Divisor | Float | yes | ||
| MtdHistory | Float | yes | MTD History | |
| MtdAllocation | Float | yes | ||
| MtdIndicatives | Float | yes | ||
| CurrentAllocation | Float | yes | ||
| CurrentIndicatives | Float | yes | ||
| Proposal | Float | yes | ||
| Difference | Float | yes |
| SkuComments | Reference Reference |
The table stores the list of commmented for replenished (warehouse sku) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ReasonId | Identity | no | A reference to Reasons | |
| SiteMaterialUsageId | Identity | no | A reference to Reasons | |
| ConsignmentLocationId | Identity | yes | A reference to Reasons | |
| CommentText | HugeString | yes | Allocation comment | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SKULeadTimes | Replenishment Replenishment |
The table store average non-production periods of finishing lines and paper machines, depending on the material |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to the SiteMaterialUsages table | |
| MTSLeadTime | Integer | no | Timeperiod from MTS Warehouse to customer, in case of MTO decision should be use FG WH of Mill as source point | |
| DirectLeadTime | Integer | no | Timeperiod from route from FG WH of site (depend on Site) to customer | |
| MTSMillLeadTime | Integer | no | Transport time from Mill FG WH to MTS warehouse, in case if for SKU/PM pair not defined MTS warehouse (i.e. MTO SKU) this value should zero | |
| TotalLeadTime | Integer | no | TimePeriod + ProductionCycleTime + FinishingCycleTime + FinishingLeadTime |
| SkuProperties | Core Core |
The table stores the list of properties registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| PropertyName | String | no | Property name | |
| HierarchyLevelNo | Integer | no | Property name | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SkuTempData | Temporary Temporary |
A temporary table for storing SKU for paging and aggregation |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| SourceProcedure | String | no | Source ProcedureName | |
| Id | Identity | no | Group Id | |
| SiteMaterialUsageId | Identity | no | Sku Id | |
| Dividend | DoubleFloat | no | Dividend | |
| Divisor | DoubleFloat | no | Divider | |
| SummaryColumns | Text | yes | Summary column values separated by CHR(31) |
| SkuValuesLogs | Core Core |
The table stores about sources for SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteMaterialUsageId | Identity | no | A reference to SiteMaterialUsages | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| FieldName | String | no | Sku Field Name | |
| OldValue | String | yes | The old value of field | |
| NewValue | String | yes | The new value of field | |
| Description | String | yes | A reference to initial source rule | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| TimeStamp | TimeStamp | no | When the record was inserted? |
| SMIForecastData | Forecasting Forecasting |
A temporary table for forecast collaboration |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| Summary | HugeString | yes | ||
| DateFromMonth | Date | yes | date | |
| DateFromWeek | Date | yes | date | |
| Forecast | Float | no | ||
| WeeklyForecast | Float | no | ||
| TotalForecast | Float | no | ||
| IsWorking | Integer | no | ||
| ForecastStatusId | Integer | no | ||
| Editable | Integer | no | ||
| ForecastComment | LongestString | yes | ||
| ForecastChangeId | Identity | yes | ||
| ReasonId | Identity | yes | ||
| WeeklyForecastComment | LongestString | yes | ||
| WeeklyForecastChangeId | Identity | yes | ||
| WeeklyReasonId | Identity | yes |
| SMIInventoryData | Replenishment Temporary |
The table contains information about inventories on every single day, by SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date | |
| Opening | Float | no | Quantity at the begining of the DateFrom day | |
| Forecast | Float | yes | Consumption used in replenishment calculations | |
| PlannedFirm | Float | yes | Consumption (can be based on orders, forecast, or netted forecast with orders | |
| PlannedTentative | Float | yes | Consumption (can be based on orders, forecast, or netted forecast with orders | |
| ProducedFirm | Float | yes | Total income according to incoming orders and deliveries | |
| ProducedTentative | Float | yes | Total income according to incoming orders and deliveries | |
| InTransit | Float | yes | Incoming tentatave orders | |
| Closing | Float | yes | Inventory, taking into account tentative and firm orders | |
| SafetyStock | Float | yes | Safety stock | |
| PlannedForProduction | Float | yes | Inventory, taking into account firm orders only | |
| OperatorUserId | Identity | no | User id |
| SnapshotAllocationData | Master Planning Temporary data table |
A temporary table for snapshot allocation |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| SummaryFields | HugeString | yes | List of Summary Fields (grouping) | |
| DateFrom | Date | yes | date | |
| Allocation | Float | no | ||
| IsWorking | Integer | no | ||
| Filtered | Identity | no |
| SNOAllOrderSnapshots | Scenario Analysis Reference Data |
The table contains the scenario-session baseline of all orders relevant to SNP. Per-scenario demand, ignored-for-netting, and future movable classifications are stored only in SNOMovableOrderSnapshots. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| OrderLineId | Identity | no | Order Line ID, reference to OrderLines.Id | |
| OrderOperationId | Identity | yes | Order Operation ID, reference to OrderOperations.Id | |
| SiteId | Identity | yes | Site Id where the order is sourced from | |
| WorkcentreId | Identity | yes | Workcentre Id where the order is sourced from | |
| LocationId | Identity | no | Location Id where the order is to be delivered to | |
| MaterialId | Identity | no | Material Id of the order's SKU | |
| SourceMaterialId | Identity | no | SourceMaterial Id of the order | |
| ToolMaterialId | Identity | yes | Major tool material for getting correct rate | |
| SiteMaterialUsageId | Identity | no | Order's SKU ID | |
| IsFirm | Integer | no | Is order the Firm one (0 means the order is Tentative, 1-Firm, 2- Completed) | |
| SourceType | String | no | Type of order's source: PM for paper machine, SFGWH for semifinidhing warehouse, FGWH for finishing warehouse, FL for finishing line, UNKNOWN otherwise. | |
| DestinationType | String | no | Type of order's destination: SFGWH for semifinishing warehouse, FGWH for finishing warehouse, CUST for customer, UNKNOWN otherwise | |
| MethodCode | String | yes | Used for debug purposes: internal code. | |
| SourceWeight | Float | no | Order source weight | |
| Weight | Float | no | Order weight (SFG for SFGWH-targeted orders and FG otherwise) | |
| RemainingWeight | Float | no | Order remaining weight | |
| RemainingSourceWeight | Float | no | Order remaining source weight | |
| ProductionDate | Date | yes | Calculated for relevant firm non-moveable orders only. | |
| RequestedDate | Date | yes | Requested date of the order (when the customer wants it to be delivered) | |
| DespatchDate | Date | yes | Despatch date of the order (when it will be sent to the customer) | |
| SourcePeriod | Date | yes | Source Period - truncated to SNP session period type | |
| DeliveryPeriod | Date | yes | Delivery Period - truncated to SNP session period type | |
| PropertyValueId | Identity | yes | Property value ID (A reference to PropertyValues) | |
| SourcePropertyValueId | Identity | yes | Source Property value ID (A reference to PropertyValues) | |
| ProductionCost | Float | no | Production cost | |
| InventoryCost | Float | no | Inventory cost (holding cost) | |
| TransportCost | Float | no | Transport cost | |
| TotalCost | Float | no | Total cost | |
| Price | Float | no | Price | |
| Revenue | Float | no | Revenue | |
| Margin | Float | no | Margin | |
| SnoItemId | Identity | yes | SNP Item ID (a reference to SnoItems | |
| CoProductId | Identity | yes | CoProduct Id | |
| Rate | Float | no | Production Rate (quantity per time) | |
| ConversionFactor | Float | no | Production Rate Conversion Factor | |
| MasterRouteId | Identity | yes | Master Route Id | |
| MRTimePeriod | Integer | yes | Master Route time period | |
| MRCost | Float | yes | Master route cost | |
| JourneyId | Identity | yes | Reference to Journeys table | |
| OperationTypeId | Identity | yes | Operation Type ID (reference to OperationsTypes table) | |
| StageNo | Integer | no | Stage No | |
| IsLastStage | Integer | no | Is Last Stage | |
| Duration | Float | no | Order duration | |
| RemainingDuration | Float | no | Remaining Order Duration | |
| MaterialEfficiency | Float | no | Material efficiency coefficient | |
| TimeEfficiency | Float | no | Time efficiency coefficient | |
| IsLate | Integer | no | Is the order late, and moved to first session period | |
| HasInputProducts | Integer | no | Does the order operation have input products |
| SNODemands | Master Planning Master Planning |
The table contains data on demands for SNP user scenarios, these are forecasted customer demands that SNP will attempt to satisfy by allocating to production or inventory sources. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| DateFrom | Date | no | The date of demand (Delivery date) | |
| Id | Identity | no | SNP Item Id | |
| CoProductId | Identity | yes | CoProduct Id | |
| Forecast | Float | no | Forecast quantity for the SNP item | |
| NonMoveableFirm | Float | no | Total eligible firm-order quantity used for demand netting | |
| MoveableFirm | Float | no | Firm-order quantity also passed to SNP Engine as individual order demands | |
| Inventory | Float | no | Quantity of inventory as demand (excess on warehouses) | |
| InventoryDeficit | Float | no | inventory deficit (not a demand) | |
| Demand | Float | no | Demand quantity | |
| IgnoredDemand | Float | no | ignored small demand | |
| MandatoryDemand | Float | no | Mandatory demand quantity | |
| OptionalDemand | Float | no | Optional demand quantity | |
| Netted | Float | no | Netted demand quantity | |
| OldNetted | Float | no | Old netted demand - temporary field | |
| Aggregated | Float | no | Gross demand after order netting and small-demand aggregation, before external preallocation | |
| TotalDemand | Float | no | Legacy gross-demand stage, currently synchronized with Aggregated and used by release compatibility logic | |
| PreAllocatedDemand | Float | no | Quantity covered by external fixed-source allocations after Aggregated and before SnoDemand | |
| SNODemand | Float | no | Resulting SNP Demand quantity | |
| Price | Float | no | Price | |
| Cost | Float | no | Cost | |
| Revenue | Float | no | Revenue | |
| Margin | Float | no | Margin | |
| Allocation | Float | no | Total allocation quantity received from SNP engine for the demand | |
| IsDemand | Integer | no | An internal column. 1 means that the SNP item has non-zero demand in any period within the SNP horizon. | |
| UnallocatedReasonId | Identity | no | Unallocated Reason ID |
| SNOForecastData | Scenario Analysis Temporary Tables |
A temporary table to store forecast or forecast snapshot values. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| SiteMaterialUsageId | Identity | no | SKU ID (A reference to SiteMaterialUsages) | |
| DateFrom | Date | no | Scenario snapshot period | |
| Final | Float | no | Final forecast | |
| Price | Float | no | Price | |
| IsOrder | Integer | no | 1 - this sku has orders, 0 - this sku has not orders | |
| IsIgnore | Integer | no | Should the forecast be ignored by SNP | |
| Status | Integer | no | Forecast Status |
| SNOInventoryCostData | Master Planning Master Planning |
A temporary table to calculate inventory costs before transferring them to the SNP optimisation engine. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | no | Site ID (A reference to Sites) | |
| TimePeriod | Identity | no | Time period ID | |
| DateFrom | Date | no | Date | |
| Cost | Float | no | Cost | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) |
| SNOItemsData | Master Planning Master Planning |
The table contains information about grouping SKUs into SNP items. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (snapshot ID, a reference to ScenarioSessions) | |
| SiteMaterialUsageId | Identity | no | SKU ID (A reference to SiteMaterialUsages) | |
| LocationId | Identity | no | Location ID (A reference to Locations) | |
| MaterialId | Identity | yes | Reference to SKU Material Id | |
| CustomerRankId | Identity | no | Customer rank ID (A reference to CustomerRanks) | |
| Status | Integer | no | A flag: Forecasted? 1 - forecasted, 0 - not forecasted | |
| IsWarehouse | Integer | no | Is this a warehouse SKU? | |
| ReplenishmentFlag | Integer | no | A flag: is this SKU replenished or have non-zero source priority to a replenished SKU? (0 - not replenished, 1 - replenished) |
| SNOItemsShort | Master Planning Master Planning |
The table contains information about grouping of SKUs into SNP items |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | SNO item ID | |
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| NettingGroupId | Identity | yes | Id For netting | |
| PropertyValueId | Identity | no | Property value ID (A reference to PropertyValues) | |
| SiteMaterialUsageId | Identity | no | SKU ID (A reference to SiteMaterialUsages) | |
| GradeId | Identity | no | SMU ID (A reference to SiteMaterialUsages) | |
| LocationId | Identity | no | Location ID (A reference to Locations) | |
| MaterialId | Identity | yes | Reference to SKU Material Id | |
| CoProductId | Identity | yes | CoProduct Id. Record with CoProducts added after scenario optimisation | |
| CustomerRankId | Identity | no | Customer rank ID (A reference to CustomerRanks) | |
| SubstitutionHash | LongestString | yes | List of substitutions | |
| CoverPeriod | Integer | no | Cover period from SafetyStock methods, days | |
| IsDemandRecord | Integer | no | Demand stage flag | |
| IsOptional | Integer | no | Optional flag. Set from Mandatory Settings | |
| IsForecast | Integer | no | Forecasted flag | |
| IsWarehouse | Integer | no | Warehouse flag | |
| HasInventory | Integer | no | SNP item has inventory deficit | |
| IncludedInPrenetting | Integer | no | Is SKU included in pre-netting | |
| Status | Integer | no | Forecasted flag. For forecast snapshot items - status will be equal 1 to all items | |
| MinimumAllocationId | Identity | yes | ID of the Minimum Allocation record | |
| Description | HugeString | no | SNP Item description | |
| ReplenishmentFlag | Integer | no | A flag: does SKU replenished or have non-zero source priority to replenished SKU? (0 - not replenished, 1 - replenished) | |
| ProductRouteId | Identity | yes | Product Route |
| SNOMaterialCoefs | Master Planning Master Planning |
The table contains user snapshots of SKU coefficients for prorating in SNP |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| MaterialId | Identity | no | SMU ID (A reference to SiteMaterialUsages) | |
| Id | Identity | no | SNP item ID | |
| DateFrom | Date | no | Start date | |
| Coef | DoubleFloat | no | Coefficient |
| SNOMovableOrderSnapshots | Scenario Analysis Input Data |
The table contains per-scenario classifications for orders that require special SNP processing. A row with IsDemand = 1 is passed to SNP Engine as an individual order demand. A row with IsIgnoredForNetting = 1 is excluded from demand netting and is not passed to SNP Engine. A row with both flags equal to 0 is reserved for future movable-order classification. IsDemand = 1 together with IsIgnoredForNetting = 1 is an invalid state; the database CHECK constraint will be added after table-definition constraints are extended. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario session ID (a reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| SnoItemId | Identity | no | Snp Item Id | |
| OrderLineId | Identity | no | Order Line ID (reference to OrderLines.Id) | |
| OrderOperationId | Identity | yes | Order Operation ID (reference to OrderOperations.Id) | |
| OperationTypeId | Identity | yes | Operation Type ID (reference to OperationsTypes) | |
| RemainingWeight | Float | no | Remaining order line weight (the weight that still needs to be produced -- and thus to be allocated by SNP) | |
| IsDemand | Integer | no | When 1, the order is passed to SNP Engine as an individual demand | |
| IsIgnoredForNetting | Integer | no | When 1, the order is excluded from demand netting and SNP Engine |
| SNOSKUWeeklyData | Master Planning Temporary |
Temporary table to resolve performance issues during WeeklyForecastBody snapshot creation in SNP. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | User Id | |
| Id | Identity | no | SiteMaterialUsage Id | |
| Status | Integer | no | Forecasted flag | |
| IsOrder | Integer | no | Is order flag |
| SNOSolutionTempData | Master Planning Master Planning |
A temporary table for storing solution data received from the SNP optimisation engine. It holds data from the latest optimisation in a Scenario Session (always the current scenario), until it is processed to update the solution tables such as: SNODemands, SourcingAllocation, InventorySnapshots, SNOAllOrderSnapshots, MachineInformation, CycleUtilisationSnapshots. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| DeliveryPeriod | Integer | no | Delivery Date (Demand date) | |
| SourcePeriod | Integer | no | Source Date (Production or Inventory-sourcing date) | |
| DispatchPeriod | Integer | no | Dispatch date (site-out date) | |
| SnoItemId | Identity | no | SNP Item Id (reference to SnoItems) | |
| OrderLineId | Identity | yes | Movable order line id | |
| AllocationId | Identity | no | Allocation ID (links different stages of the same multi-stage allocation chain) | |
| MasterRouteId | Identity | yes | Master Route ID (a reference to MasterRoutes | |
| WorkCentreId | Identity | yes | WorkCentre ID (a reference to WorkCentres) | |
| Allocation | Float | no | Allocation Quantity | |
| CoProductAllocation | Float | no | Co-product allocation quantity | |
| AllocationDurationMinutes | Float | yes | Allocation Duration (for capacity workcentres, excludes co-products), minutes | |
| ProductionRateHours | Float | yes | Production Rate (for capacity workcentres), qty per hour | |
| TransportCost | Float | yes | Transport cost | |
| InventoryCost | Float | yes | Inventory cost (holding cost) | |
| ProductionCost | Float | yes | Production cost | |
| UsedPrice | Float | yes | Used price | |
| ConfigurationId | Identity | yes | Production configuration ID used to produce this allocation | |
| OperationTypeId | Identity | yes | Operation Type ID used by this production stage | |
| NextOperationTypeId | Identity | yes | Next operation Type (used by the next production stage, if present) | |
| GradeId | Identity | yes | grade | |
| SourceGradeId | Identity | yes | Source grade (due to Substitution or BOM) | |
| SeqNo | Identity | yes | Stage sequence number | |
| StageNo | Integer | Stage No | ||
| IsLastStage | Integer | If 1, then the current stage is the last stage in a multi-stage allocation chain. | ||
| SourcePropertyValueId | Identity | yes | Substitution grade | |
| BomMaterialId | Identity | yes | BOM Material Id (used for SFG inventory sourcing) | |
| SourceMaterialId | Identity | yes | Source material ID for allocation from warehouses. | |
| ToolMaterialId | Identity | yes | Tool Material Id |
| SNPEdges | Master Planning Master Planning |
The table contains the list of SNP graph edges (possible transport links) used by inventory pre-netting logic. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| FromSiteId | Identity | no | Source Site ID (reference to Sites) | |
| ToSiteId | Identity | no | Destination Site ID (used for cross-site links) | |
| LocationId | Identity | no | Destination Customer Location Id (used for links to the end customer) | |
| TimePeriod | Integer | no | Delivery time period (demand date) | |
| DelayDays | Float | no | Transport duration, in days |
| SNPInventorySnapshots | Master Planning Master Planning |
The table contains user snapshots of consolidated SNP Inventory. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario Id (reference to Scenarios) | |
| DateFrom | Date | no | Date of available inventory | |
| IsFinishedGoods | Integer | no | FG/SFG inventory indicator: 0 for SFG, 1 for FG inventories. | |
| GradeId | Identity | yes | Grade ID based on production rates | |
| SiteId | Identity | no | Site ID, inventory is assumed to be stored on the Main Site Warehouse | |
| Inventory | Float | no | Initial Inventory | |
| Opening | Float | no | Opening Inventory | |
| Capacity | Float | no | Total Site Warehouse Capacity | |
| Orders | Float | no | Orders | |
| Indicatives | Float | no | Indicatives | |
| Allocation | Float | no | Used Allocation. |
| SNPMaterialRunSnapshots | Master Planning Master Planning |
The table contains detailed information about production grades for workcentres per SNP period (for SNP user scenarios). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (reference to Scenarios) | |
| MaterialRunId | Identity | yes | Material Run ID (production run) | |
| WorkCentreId | Identity | no | Workcentre ID | |
| SourcePeriod | Date | no | Source period date | |
| StartDate | Date | no | Run start date | |
| FinishDate | Date | no | Run end date | |
| CycleTypeId | Identity | no | Cycle Type ID | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InitialDuration | Float | no | Full run duration | |
| OrderDuration | Float | no | Duration of orders in the run | |
| IsFixed | Integer | no | Is the run fixed (this allows only allocations of matching grades to this portion of the workcentre capacity) | |
| IsActive | Integer | no | Is the run active | |
| OriginalOrderNo | Integer | no | Original production order number | |
| AvailableDuration | Float | no | Available run duration | |
| Rate | Float | no | Production rate of the run | |
| NewMaterialRunId | Identity | yes |
| SNPOnHoldStockData | Master Planning Master Planning |
A temporary table for production plan levels |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (A reference to Users) | |
| SiteId | Identity | no | ||
| DateFrom | Date | no | ||
| Produced | Float | no | ||
| Dispatched | Float | no | ||
| MaxCapacity | Float | no |
| SNPProdPlanLevelsData | Scenario Analysis Production Plan |
A temporary table for production plan levels |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (A reference to Users) | |
| CycleTypeId | Identity | no | ||
| OperationTypeId | Identity | no | ||
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| MaterialId | Identity | no | ||
| WorkCentreTypeId | Identity | no | ||
| WorkCentreId | Identity | no | ||
| Priority | Identity | no |
| SNPProductionPlanSnapshots | Master Planning Master Planning |
The table contains snapshot of production plan per SNP user scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID | |
| ScenarioId | Identity | no | Scenario ID | |
| Id | Identity | no | ID | |
| WorkCentreId | Identity | no | Workcentre ID | |
| SourcePeriod | Date | no | Source date | |
| StartDate | Date | no | Run start date | |
| FinishDate | Date | no | Run end date | |
| CycleTypeId | Identity | no | Cycle Type ID | |
| DetailId | Identity | no | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| InitialDuration | Float | no | Original Run Duration | |
| OrderDuration | Float | no | Duration of orders assigned to the run | |
| AllocationDuration | Float | no | Duration of allocations assigned to the run | |
| Rate | Float | no | Run's production rate | |
| IsFixed | Integer | no | Is the run fixed |
| SNPUnallocatedItems | Scenario Analysis Scenario Analysis Results |
The table contains unallocated demands for scenario. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| ScenarioId | Identity | yes | Scenario ID (reference to Scenarios) | |
| SnpItemId | Identity | no | SNP Item ID (reference to SnoItems) | |
| OrderLineId | Identity | yes | Demand Order Line Id | |
| DateFrom | Date | yes | Delivery date (demand date) | |
| Demand | Float | no | Demand quantity | |
| Allocation | Float | no | Allocation quantity | |
| IsMandatory | Integer | no | Is Mandatory Demand | |
| FirstDeliveryDate | Date | yes | First Possible delivery period | |
| Price | Float | yes | Price | |
| TotalCost | Float | yes | Min total cost | |
| TransportCost | Float | yes | Min transport cost | |
| TransportTime | Integer | yes | Min transport duration, days | |
| UnallocatedReasonId | Identity | no | Unallocated Reason ID |
| SNPWorkCentreFixedGrades | Master Planning Master Planning |
Table to store fixed grades per Workcentre in SNP user scenarios. It should be exposed for PropertyValueId (as rates). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| WorkCentreId | Identity | yes | Workcentre ID (A reference to Workcentres) | |
| CycleTypeId | Identity | no | Cycle Type ID | |
| DateFrom | Date | no | Week | |
| CapacityHours | Float | no | Available capacity in hours |
| SourceHashSnapshots | Master Planning Master Planning |
The table stores initial source rules hashes for SNP scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| SiteMaterialUsageId | Identity | yes | no | SKU ID |
| SourcesHash | HugeString | no | List of sources in format - 'OperationTypeId1:Wkc1,Wkc2...WkcN;OperationTypeId1:Wkc1,Wkc2...WkcN |
| SourcePriorities | Core Core |
From which workcentres SKU warehause will be replenished. It depends from Priority |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SiteMaterialUsageId | Identity | no | Destination SiteMaterialUsage identity | |
| DestinationLocationId | Identity | no | Destination location identity | |
| DestinationMaterialId | Identity | no | Destination material identity | |
| SourceSiteMaterialUsageId | Identity | yes | Source SiteMaterialUsage identity | |
| SourceLocationId | Identity | yes | Source location identity | |
| SourceMaterialId | Identity | yes | Source material identity | |
| ConsignmentLocationId | Identity | yes | A reference to Locations | |
| WorkCentreId | Identity | no | A reference to Workcentres | |
| Priority | Integer | no | Source priority (1, 2, empty, 0) | |
| Portion | Integer | no | Percent of the source use, along with other sources of the given SKU | |
| SourcePriorityRuleId | Identity | yes | A reference to SourcePriorityRules | |
| JourneyId | Identity | yes | JourneyId for use with this SKU | |
| MaterialTypeId | Identity | yes | Define from which material type we will source | |
| IsConsignmentStock | Integer | no | Indicate that sourcing will be from consignment stock (ued in replenishment) | |
| RPJourneyId | Identity | yes | Journey selected for replenishment | |
| DateFrom | Date | yes | Effective start date | |
| DateTo | Date | yes | Effective finish date | |
| IsActive | Integer | no | Is the record active? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SourcePriorityRules | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DetailId | Identity | yes | Characteristics Id. A reference to HierarchyPropertyDetails. | |
| WorkCentreId | Identity | no | A reference to the destination workcentre | |
| Priority | Integer | no | Source priority (1, 2, empty, 0) | |
| Percentage | Integer | no | Percentage | |
| Rebuild | Integer | no | Rebuild | |
| RuleWeighting | Integer | no | Rule Weighting | |
| JourneyId | Identity | yes | JourneyId for use with this SKU | |
| MaterialTypeId | Identity | yes | Define from which material type we will source | |
| IsConsignmentStock | Integer | no | Indicate that sourcing will be from consignment stock (used in replenishment) | |
| DateFrom | Date | yes | Effective start date | |
| DateTo | Date | yes | Effective finish date | |
| GroupName | String | yes | Group name | |
| IsActive | Integer | no | Is the record active? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SourceRunMaterials | Replenishment Order generation |
The table stores data about available runs and material which when can produce for allocation based replenishment process |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunId | Identity | no | A reference to MaterialRuns | |
| MaterialId | Identity | no | Material identity | |
| Cost | Float | yes | Calculate production cost for combination Material/Paper Machine | |
| Rate | Float | yes | Production Rate for Material/Paper Machine |
| SourceRuns | Replenishment Order generation |
The table stores data about available runs for allocation based replenishment process |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteWHLocationId | Identity | yes | A reference to Locations | |
| WorkcentreId | Identity | no | A reference to Workcentres | |
| SiteId | Identity | yes | A reference to Sites | |
| MaterialRunId | Identity | no | A reference to MaterialRuns | |
| BlockRunCode | String | yes | A reference to MaterialRuns.BlockRunCode | |
| InitialDuration | Float | no | Original Run Duration can be reduced by shut or not reduced | |
| FirmDuration | Float | no | Firm operation duration | |
| OriginalDuration | Float | no | Run Duration reduced by firm operations | |
| Duration | Float | no | Run Duration - remaining free duration | |
| OriginalCapacity | Float | no | Run original capacity | |
| Capacity | Float | no | Run capacity | |
| OriginalStartDate | Date | no | The date when run will be started | |
| OriginalFinishDate | Date | no | The date when run will be finished | |
| StartDate | Date | no | The date when run will be started | |
| FinishDate | Date | no | The date when run will be finished | |
| CalculatedFinishDate | Date | no | The date when run will be finished | |
| MaxTrimLoss | Float | no | Maximal trim loss | |
| MinTrimLoss | Float | no | Minimal trim loss | |
| MaxSheetOut | Float | no | Maximal sheet out | |
| ConsumptionType | String | yes | Consumption type - can be FG or SFG | |
| HandlingDelay | Float | no | Handling delay (minutes) before of shipping | |
| IsUnlimitedCapacity | Integer | no | Is unlimited capacity | |
| Cost | Float | no | Calculate production cost for combination Material/Paper Machine | |
| Rate | Float | no | Run process rate | |
| ConversionFactor | Float | no | Conversion factor for getting source weight | |
| IsLastStage | Integer | no | 1 = used for last stage, 0 - used for all stages | |
| PointId | Identity | yes | Virtual run for specific replenishment point | |
| ChainNo | Integer | yes | Virtual run for specific replenishment point |
| SourceWorkcentresData | Block Scheduling Temporary |
A temporary table for storing the list of source workcentres for selected orders |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OrderLineId | Identity | no | Reference to OrderLines table | |
| WorkCentreId | Identity | no | Reference to WorkCentres table | |
| IsValid | Integer | no | 0 - no valid; 1 - is valid | |
| OperatorUserId | Identity | no | User identificator |
| SourcingAllocation | Master Planning Master Planning |
The table contains per-stage SNP allocations sourced from workcentres (production, as well as finished and semifinished goods inventory). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | no | SNP Item Id | |
| CoProductId | Identity | yes | CoProduct Id | |
| GradeId | Identity | yes | Demand Grade Id | |
| SourceGradeId | Identity | yes | Source (Production) Grade ID | |
| DeliveryDate | Date | yes | Demand date (delivery date) | |
| SourceDate | Date | no | Sourcing date (production date) | |
| DispatchDate | Date | no | Dispatch date (site-out date) | |
| SiteId | Identity | no | Site ID (A reference to Sites) | |
| WorkCentreId | Identity | yes | Workcentre ID (A reference to Workcentres) | |
| AllocationId | Identity | no | Allocation Id (links different stages of the same multi-stage allocation chain) | |
| StageNo | Integer | no | Stage Number | |
| IsLastStage | Integer | no | If 1, this stage is the last stage of a multi-stage allocation chain | |
| OrderLineId | Identity | yes | OrderLine Id | |
| Allocation | Float | no | Allocation quantity in base unit | |
| AllocationHours | Float | no | Allocation duration in minutes | |
| CycleInventory | Float | no | Cycle inventory | |
| Price | Float | no | Price | |
| Revenue | Float | no | Revenue | |
| ProductionCost | Float | no | Production Cost | |
| TransportCost | Float | no | Transport Cost | |
| InventoryCost | Float | no | Inventory Cost (holding cost) | |
| Margin | Float | no | Financial Margin | |
| MasterRouteId | Identity | yes | Master route ID (a reference to MasterRoutes) | |
| Rate | Float | yes | Production rate (base weight unit per hour) used by this allocation stage | |
| ConversionFactor | Float | no | Production rate conversion factor (input to output quantity) | |
| MaterialEfficiency | Float | no | Material efficiency (100% means no losses) | |
| TimeEfficiency | Float | no | Time efficiency (100% means the full production rate is used to calculate required production time) | |
| ConfigurationId | Identity | yes | Production Configuration Id used to produce this allocation. | |
| OperationTypeId | Identity | yes | Operation Type ID of this allocation stage | |
| NextOperationTypeId | Identity | yes | Operation Type ID of the next production stage (if present) | |
| SourcePropertyValueId | Identity | yes | Source SNP grade | |
| SourceMaterialId | Identity | yes | Source material ID | |
| BOMSourceMaterialId | Identity | yes | BOM Source material ID | |
| ToolMaterialId | Identity | yes | Tool Material Id | |
| SeqNo | Identity | yes | Sequence No | |
| IsSafetyStock | Integer | no | Does the allocation use safety stock or provide safety stock recovery. | |
| IsSubstituted | Integer | no | Is substituted | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| SplitRunsData | Block Scheduling Block Scheduling |
Temp table for split runs by Started status |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User Identity | |
| PositionNo | Integer | no | ||
| WorkcentreId | Identity | no | ||
| MaterialRunId | Identity | no | ||
| StartDate | Date | no | ||
| FinishDate | Date | no | ||
| TargetStartDate | Date | yes | ||
| Duration | Identity | no | ||
| RunStatusCode | String | yes | ||
| RunType | String | yes | ||
| MinStartedDate | Date | yes | ||
| SystemDuration | Float | no | ||
| FirmDuration | Float | no | ||
| SystemWeight | Float | no | ||
| FirmWeight | Float | no | ||
| HaveLateOrders | Integer | no | ||
| HaveOrders | Integer | no |
| SPValuesData | Core Temporary |
The temporary table for storing of list of system parameters values. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ParameterId | Identity | no | System parameter Id (A reference to SystemPparameters). | |
| Key | String | yes | Key | |
| Value | LongString | yes | Value | |
| OrderNo | Integer | yes | OrderNo | |
| Description | LongString | yes | Description of value. | |
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) |
| StageAllocations | Master Planning Interfaces |
The table contains temporary data for multi-stage allocation. Used in interfaces to import allocation data. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| AllocationId | Identity | no | Allocation Id | |
| CharacteristicsId | Identity | no | Characteristics | |
| DeliveryWeek | Date | yes | Delivery week | |
| DeliveryMonth | Date | yes | Delivery Month | |
| DistributeWeekly | Integer | no | Distribute monthly value across all weeks in the month |
| StageAllocationSources | Master Planning Interfaces |
The table contains temporary data for multi-stage allocation. Used in interfaces to import allocation data. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| AllocationId | Identity | no | Allocation Id | |
| WorkcentreId | Identity | no | Workcentre Id | |
| OperationTypeId | Identity | no | Operation Type Id | |
| SourceWeek | Date | yes | Source week | |
| SourceMonth | Date | yes | Source Month | |
| UnitId | Identity | no | WorkcentreId | |
| AllocationValue | Float | no | WorkcentreId | |
| isLastStage | Integer | no | Is last stage |
| StagedInventoryProfiles | Replenishment Replenishment |
The table contains information about inventories on every single day, by SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| DateFrom | Date | no | Date | |
| Phase | String | no | Phase | |
| SiteMaterialUsageId | Identity | yes | SKU Id | |
| LocationId | Identity | yes | Location Id | |
| MaterialId | Identity | no | Material Id | |
| ConsignmentLocationId | Identity | yes | Consignment customer identity | |
| Opening | Float | no | Opening stock | |
| Consumption | Float | no | Consumption (can be based on orders or forecast or netted forecast with orders | |
| ConsumptionOrders | Float | no | Order Consumption - outgoing orders and deliveries | |
| ConsumptionForecast | Float | no | Forecst consumption | |
| FirmOrdersIn | Float | no | Incoming orders and deliveries | |
| TentativeOrdersIn | Float | no | Incoming Tentative orders | |
| TentativeOrdersOut | Float | no | Outgoing Tentative orders | |
| PlannedInventory | Float | no | Inventory with taking in account tentative adn firm orders | |
| SafetyStock | Float | no | Safety stock | |
| MaxSafetyStock | Float | yes | Safety stock | |
| OriginalSafetyStock | Float | no | Safety stock | |
| MinOpening | Float | no | Min opening | |
| OriginalMinOpening | Float | no | Original Min opening based on final Safety stock | |
| MinPlannedInventory | Float | no | Min planned Inventory | |
| OriginalConsumptionForecast | Float | no | Original Consumption Forecast | |
| IgnoredDemandValue | Float | no | Ignored Demand Value | |
| IsRunAvailable | Integer | no | Is run available | |
| AvailableRunCapacity | Float | no | Run Available Capacity | |
| IsReceivingDate | Integer | no | Is Receiving Date | |
| InsertDate | Date | no | When record was created | |
| GroupKey | String | no | Group key included Site, Company or Location and identity key |
| StockMonitoringData | Replenishment Temporary |
A temporary table for Stock Monitoring (ticket 52254) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| OrderNo | Identity | no | Order No | |
| SiteMaterialUsageId | Identity | yes | SiteMaterailUsage Id | |
| ConsignmentLocationId | Identity | yes | Consignment Customer Id | |
| UnitId | Identity | yes | Unit Id for default unit per product | |
| Dividend | Float | no | Unit Id for default unit per product | |
| Divisor | Float | no | Unit Id for default unit per product | |
| LocationId | Identity | yes | Warehouse location id | |
| Replenished | Integer | no | Is replenished | |
| PrevMonthDespatches | Float | no | Previous month's despatches | |
| MaxCapacity | Float | no | MaxCapacity | |
| ShowMaxCapacityWarning | Integer | no | Max Capacity Behaviour | |
| SafetyStock | Float | no | Safety Stock | |
| SafetyStockPercentWarning | Float | no | Safety stock percent warning | |
| StockDate | Date | yes | Stock Date | |
| LastPeriodDate | Date | yes | Last period Stock Date | |
| InternalStock | Float | no | Internal Stock from internal suppliers | |
| ExternalStock | Float | no | External Stock from external suppliers | |
| Opening | Float | no | Opening Stock Value | |
| Closing | Float | no | Closing Stock Value | |
| DaysOfStock | Float | no | Days Of Stock | |
| Orders | Float | no | Orders | |
| AvailableCapacity | Float | no | Available Capacity | |
| FirmOrders | Float | no | Firm Orders | |
| Consumption | Float | no | Consumption | |
| StockStatus | Integer | yes | Stock Status | |
| QuarantineStock | Float | yes | Daily Demand | |
| OpeningToolTip | HugeString | yes | Stock Status | |
| WarningColor | integer | yes | Warning Color | |
| DailyDemand | Float | no | Daily Demand | |
| MonthlyDemand | Float | no | Monthly Demand | |
| DayOfStockCssClass | String | yes | DayOfStock CssClass | |
| GroupId | Identity | yes | Group for subtotals | |
| GroupProperties | HugeString | yes | Group properties | |
| IsSubTotal | Integer | no | Group properties | |
| Delisted | HugeString | yes | Delisted sku and value of product which superseding thi SKU | |
| IsOrdersEditable | Integer | no | Id allow edit tentative orders | |
| ActiveCustomers | Identity | no | Count of Active Customers in a network | |
| IsReceivingDay | Integer | no | Is Receiving Day |
| StockMovements | Replenishment Replenishment |
The table stores detailed data about the current order |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | date, i.e. when the stock was relocated | |
| SiteMaterialUsageId | Identity | no | SKU | |
| ToConsignmentLocationId | Identity | yes | for consignment orders, this indicates the consignment location that the order will be stored for at the destination location | |
| FromConsignmentLocationId | Identity | yes | for call off orders, this indicates the consignment location that the stock is being sourced from | |
| SkuKey | String | no | Destination SKU Code - SKU-CS. | |
| SourceSkuKey | String | no | FROM SKU Code - SourceSKU-CS. | |
| Weight | Float | no | Weight of moved stock | |
| Description | String | yes | Description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| StockReservationData | Replenishment Temporary |
A temporary table for Stock Reservation (ticket 51626) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| OrderNo | Identity | yes | Order no | |
| SkuKey | String | no | SKU Code - SKU-CS-SW. | |
| SkuID | Identity | no | sku ID | |
| MaterialID | Identity | no | Material ID | |
| WorkCentreID | Identity | no | WorkCentre ID | |
| LocationID | Identity | yes | Location ID | |
| StockDate | Date | no | ||
| StockValue | Float | yes | ||
| CompletedStock | Float | yes | Weight completed orders and deliveries today | |
| WarningColor | String | yes | ||
| LowestAvailableStock | Float | yes | The lowest inventory level is the lowest available stock level between today and the end of the real in-ventory profile | |
| LowestAvailableStockComment | LongestString | yes | The lowest inventory level is the lowest available stock level between today and the end of the real in-ventory profile |
| STODatesData | Due date quoting Temporary table |
The table contains information about STO despatch and delivery dates |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | no | A reference to the site | |
| DateFrom | Date | yes | Date of end of FL-run (truncate) | |
| OrderNo | Identity | no | A reference to the routes of journey | |
| DespatchDate | Date | no | Despatch date from the source STO Warehouse | |
| DeliveryDate | Date | no | Delivery date to the destination STO Warehouse |
| StorageEntries | Core Language |
The table stores various data |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Name | LongestString | no | Dictionary key | |
| Value | LongestString | no | Dictionary value | |
| StorageId | Identity | no | A reference to table ID (used for localization) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Storages | Core Language |
The table stores various data |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| StorageType | String | no | Dictionary key | |
| Name | String | no | Dictionary value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SubstitutionConstraintSnapshots | Scenario Analysis Reference Data |
This table stores the snapshot of product substitution constraints in SNP: this limits quantity of substitutions with matching Original Site ID (if defined), per production Site, per sourcing time period. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| OriginalSiteId | Identity | no | Original Site ID, if set then only limits substitutionis with matching OriginalSiteId value. | |
| SubstitutionSiteId | Identity | no | Substitution site ID (the production Site of the substitute material) | |
| DateFrom | Date | no | Date from - period | |
| Weight | Float | no | Weight of rule |
| SubstitutionCustomerSnapshots | Master Planning SNP |
The table stores the sets of customer for particular product substitutions in SNP, per scenario session (snapshot). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ProductSubstitutionId | Identity | no | Product Substitution ID | |
| LocationId | Identity | no | Customer Location ID |
| SubstitutionItemSnapshots | Master Planning SNP |
This table stores the snapshot of product substitutions as applied to specific SNP Items, per user scenario. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| SNPItemId | Identity | no | Original site | |
| ProductSubstitutionId | Identity | no | Product Substitution ID | |
| PropertyValueId | Identity | no | Demand product properties (the originally requested product) | |
| SourcePropertyValueId | Identity | no | Substitute product properties (the produced replacement product) | |
| ProductionGradeId | Identity | no | Production Grade ID |
| SubstitutionPeriodSnapshots | Master Planning SNP |
This table stores the snapshot of active product substitutions per period in SNP user scenario. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | ScenarioSession ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| ProductSubstitutionId | Identity | no | Product Substitution ID | |
| DateFrom | Date | no | Effective date | |
| IsActive | Integer | no | Is this time period active for substitutions |
| SummaryHistories | Core Configuration |
The table contains the list select columns (Summary levels) for grids |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| TaskName | String | no | Grid Id | |
| Summary | HugeString | no | Column name | |
| Title | LongestString | yes | Column name | |
| IsLast | Integer | no | Is last created | |
| InsertDate | Date | no | Is last created | |
| InsertUserId | Identity | no | Is last created |
| SupercessionConflictsData | Forecasting Temporary |
Temporary table for showing conflicts in Supercession rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SupercessionRuleId | Identity | no | Supercession Rule Id | |
| CountProps | Identity | yes | number of properties in this rule | |
| OperatorUserId | Identity | no | User Id |
| SupercessionRules | Core Core |
The table stores the list of supercession rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TestCode | String | no | Test code for reference | |
| Type | String | no | Supercession type: Supercession, Substitution, Both | |
| StartDate | Date | no | The date when the rule becomes effective | |
| Percentage | Float | no | Percentage | |
| AutoCreateSku | Integer | no | Create or not new sku's | |
| DisableSupersededItems | Integer | no | Switch off supercessed sku for forecasting | |
| HierarchyLevels | String | yes | ||
| HierarchyCodes | HugeString | yes | ||
| Properties | HugeString | yes | ||
| FromPropertyCodes | HugeString | yes | ||
| ToPropertyCodes | HugeString | yes | ||
| FromCharacteristicId | Identity | yes | ||
| ToCharacteristicId | Identity | yes | ||
| FromLocationId | Identity | yes | ||
| ToLocationId | Identity | yes | ||
| FromMaterialId | Identity | yes | ||
| ToMaterialId | Identity | yes | ||
| FromEndCustomerId | Identity | yes | ||
| ToEndCustomerId | Identity | yes | ||
| FromEndUseId | Identity | yes | ||
| ToEndUseId | Identity | yes | ||
| DeleteOnNextRebuild | Integer | no | Delete On Next Rebuild | |
| RequiresRebuild | Integer | no | Requires Rebuild | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SupplierInventories | Replenishment Replenishment |
The table stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| DateFrom | Date | no | Date | |
| WorkCentreId | Identity | no | A reference to Supplier workcentre | |
| LocationId | Identity | yes | A reference to Location Warehouses | |
| CustomerId | Identity | yes | A reference to Customer Location | |
| MaterialId | Identity | no | A reference to Materials | |
| Quantity | Float | no | Opening weight | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| SupplierInventoryData | Master Planning Master Planning |
A temporary table for Supplier Inventory |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Grouped Identity | |
| SummaryFields | HugeString | yes | SummaryFields | |
| BackOrders | Float | no | ||
| OHStock | Float | no | ||
| Consumption | Float | no | ||
| MTDHistory | Float | no | ||
| DateFrom | Date | yes | date | |
| Indicatives | Float | no | ||
| OriginalAllocation | Float | no | ||
| CurrentAllocation | Float | no | ||
| Orders | Float | no |
| SystemParameterLogs | Core Logging |
The table is used to store audit log for system parameters |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ParameterName | String | no | System parameter name | |
| OldValue | LongString | no | Old value | |
| NewValue | LongString | no | New value | |
| UserId | Identity | no | Who inserted the record? | |
| Stamp | Date | no | When the record was inserted? |
| SystemParameters | Core Configuration |
The table stores system parameter definitions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ParameterName | String | no | Parameter name | |
| ParameterDescription | LongString | no | Parameter description | |
| ParameterHelp | HugeString | yes | Parameter help | |
| ParameterType | String | no | Parameter type (Possible values: system, user) | |
| DataType | ShortString | yes | Parameter data type (Possible values: Boolean, Date, Enum, Number, String) | |
| Value | LongestString | no | Parameter value | |
| DefaultValue | LongestString | no | Parameter default value | |
| MinValue | ShortString | yes | Parameter min value | |
| MaxValue | ShortString | yes | Parameter max value | |
| ReadOnly | Integer | no | A flag: is the parameter read-only? | |
| Cloud | Integer | no | A flag: is it visible and can be changed inside application? | |
| Category | LongString | yes | Parameter category. Used on parameter pages. | |
| DependOn | String | yes | Name of the parameter on which depends whether the specified parameter is enabled. | |
| BundleId | Identity | yes | Bundle id | |
| SkipValidate | Integer | no | A flag to skip content validation for the default parameter value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| TargetSystems | Replenishment Replenishment |
The table stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| TargetSystem | String | no | Target system | |
| ViewName | String | no | View name used for selecting entities | |
| Condition | String | yes | Condition applied to view | |
| EntityType | String | yes | Reserved for future use | |
| IsActive | Integer | no | Is target system active | |
| UseForRemoving | Integer | no | Should be also use for removed entities |
| TaskResults | Core Reference |
The table stores the result of process. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Task ID |
| TaskId | Identity | yes | Task ID | |
| OrderNo | Integer | no | Ordinal number of the part on the progress screen | |
| Name | String | no | Task result part name | |
| Description | LongString | no | Task result part description | |
| IsForActiveTask | Integer | no | Is active task | |
| DataType | String | no | Data type of value |
| Tasks | Core - Processes Reference |
The table stores the list of process types, that can be started in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TaskName | String | no | Task name | |
| Executable | String | no | Task name | |
| Description | String | yes | Task description | |
| IsSystemTask | Integer | no | A flag: is this a system task? | |
| DaysToKeepLogs | Identity | no | How many days should be stored logs? | |
| IsActive | Integer | no | A flag: is the column visible in the user report? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| TempConsignmentOrdersData | Replenishment Replenishment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| OrderLineId | Identity | yes | Order line | |
| OrderBookId | String | yes | Line no | |
| SkuId | Identity | yes | Order line | |
| MaterialId | Identity | no | Order line | |
| CustomerId | Identity | no | Order line | |
| MaterialRunId | Identity | no | Order line | |
| IsExisting | Integer | no | Order line | |
| IsEditable | Integer | no | Order line | |
| ForDelete | Integer | no | Order line | |
| Modified | Integer | no | Order line | |
| Weight | Float | no | Order line | |
| QuantityUnitId | Identity | yes | Quantity Unit | |
| Quantity | Float | no | Order line | |
| Capacity | Float | no | Order line | |
| AvailableCapacity | Float | no | Order line | |
| TotalOrderWeight | Float | no | Order line | |
| FreeCapacity | Float | no | Order line | |
| LineNo | String | no | Line no |
| TestTable | Test Test |
The test table for some experiments and testing |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| IdentityField | Identity | no | Widget identity | |
| StringField | String | yes | Widget template parameter name | |
| ClobField | Text | yes | Value | |
| IntegerField | Integer | yes | Value | |
| FloatField | Float | yes | Value | |
| DateTimeField | Date | yes | Value | |
| TimeStampField | TimeStamp | yes | Value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| TimeEfficiencySnapshots | Scenario Analysis Input Data |
The table stores the workcentre time efficiency for SNP scenarios. This affects how much time is used by producing allocations. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioId | Identity | no | Scenario ID (a reference to Scenarios) | |
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| WorkcentreId | Identity | yes | Workcentre ID (a reference to Workcentres) | |
| Effective | Date | no | The date when the cost becomes effective | |
| RoughTimeEfficiency | Float | no | Rough time efficiency coefficient | |
| OriginalTimeEfficiency | Float | no | Original time efficiency coefficient (used for Reset action) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ToolBatches | Core Core |
The table stores pairs between tool materials and finishing products per batch |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| BatchNo | Identity | no | Batch number | |
| ToolMaterialId | Identity | no | Tool Material | |
| MaterialId | Identity | no | Finishing Material | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ToolInventorySnapshots | Due date quoting Due date quoting |
Tools inventory from RealInventoryProfiles |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| SiteMaterialUsageId | Identity | no | Warehouse SKU ID (reference to SiteMaterialUsages) | |
| DateFrom | Date | no | Inventory Date, SNP Period date | |
| UsedByOrders | Float | no | Tools used by orders. Daily coefficient | |
| Opening | Float | no | Opening on start date of scenario session |
| ToolMovementsSnapshots | Due date quoting Due date quoting |
Tools inventory from RealInventoryProfiles |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | yes | session movement Id. For new tools movements inside session scenarios |
| ScenarioSessionId | Identity | no | Scenario Session ID (reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario Id | |
| IsActive | Identity | no | Is Active Scenario Movement | |
| MovementId | Identity | yes | Order Line Id | |
| ToolMaterialId | Identity | no | Tool Material Id | |
| DespatchDate | Date | no | ||
| DeliveryDate | Date | no | Delivery Date | |
| Quantity | Float | no | Tools used by orders | |
| LocationId | Identity | no | Destination Location Id | |
| FromLocationId | Identity | no | Source Location Id |
| ToolPoolingResultSnapshots | Scenario Analysis Temporary |
Temporary table for Supply Planning tool pooling results, including tool quantities, site usage, and utilisation across primary and secondary sites. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | User ID (reference to Users ) | |
| ScenarioId | Identity | no | Group Id | |
| ToolMaterialId | Identity | no | Tool Material Id | |
| InitialSitesIds | LongestString | yes | List of sites where tool available in first SNP period | |
| PrimarySiteId | Identity | yes | Primary Site Id | |
| SecondarySiteId | Identity | yes | Secondary SiteId | |
| OtherPrimary | Integer | yes | Primary site is different | |
| OtherSecondary | Integer | yes | Secondary site is different |
| TransportationAllocationsData | Master Planning Temporary |
A temporary table for Live Allocation transportation View screen |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | User ID (reference to Users ) | |
| Id | Identity | no | Group Id | |
| SummaryFields | HugeString | yes | Group fields | |
| DateFrom | Date | no | date | |
| MinCapacity | Float | no | ||
| MaxCapacity | Float | no | ||
| Allocation | Float | no | ||
| Orders | Float | no | ||
| Revenue | Float | no | ||
| ProductionCost | Float | no | ProductionCost | |
| TransportCost | Float | no | TransportCost | |
| InventoryCost | Float | no | InventoryCost | |
| TotalCost | Float | no | TotalCost | |
| Margin | Float | no | ||
| Filtered | Integer | no |
| TransportMethods | Replenishment Replenishment |
The table stores the list of possible transportation methods |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TransportMethodName | String | no | Transport method name | |
| TransportMethodCode | String | no | Transport method code (external reference) | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| TransportRouteChains | Replenishment Replenishment |
For each transport route, the table describes a set of points (locations) of the path, |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| TransportPathId | Identity | no | A reference to the TransportRoutePaths table | |
| LevelNo | Identity | no | Transport route chain level number | |
| TimePeriod | Integer | yes | Total transportation time from source to destination | |
| LocationId | Identity | no | A reference to the Locations table |
| TransportRoutePaths | Replenishment Replenishment |
The table stores detailed description of transport routes |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| FromLocationId | Identity | no | Source location (FG warehouse site) | |
| ToLocationId | Identity | no | Destination location (external customer) | |
| SiteId | Identity | no | A reference to the Sites table | |
| TimePeriod | Identity | no | Total transportation time from source to destination | |
| WarehouseTimePeriod | Identity | no | Time of transportation to a warehouse (to a primary replenishment point) | |
| WarehouseLocationId | Identity | yes | Warehouse location ID (to a primary replenishment point) | |
| MainRouteId | Identity | no | Main route ID | |
| LevelNo | Integer | no | Transport route level number |
| TransportRoutePoints | Replenishment Replenishment |
The table contains the list of intermediate points for a transport route (latitude/longitude). It is used for Map chart display (StockMonitoring / Deliveries Map, see IPLAN-60267). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| OrderNo | Integer | no | Order number of point | |
| TransportRouteId | Identity | no | Reference to transport route | |
| Description | String | yes | Description | |
| Latitude | Float | no | Latitude | |
| Longitude | Float | no | Longitude | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| TransportRoutes | Replenishment Replenishment |
The table contains the list of transport routes (with their parameters - cost, delivery time, location, shedule) between two locations. It is used by replenishment subsystem of I-Plan. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| CalendarId | Identity | yes | Calendar for the route | |
| Cost | DoubleFloat | no | Tranport route cost | |
| TimePeriod | Integer | no | Duration, days | |
| Priority | Integer | no | Priority of the transport route | |
| TransportMethodId | Identity | no | Reference to transport method | |
| FromLocationId | Identity | no | Source location | |
| ToLocationId | Identity | no | Destination location | |
| ScheduleId | Identity | yes | Schedule for the route | |
| LoadingTime | Integer | no | Number of days the goods must be available at starting point prior to dispatch | |
| UnLoadingTime | Integer | no | Number of days after transportation before goods available at destination Will not be used by interface from TIPS, 0 should be sent | |
| MaxCapacity | Float | no | Scenario Analysis Max.Capacity (for cross-site), in weight/week. Zero means no limitation. | |
| CargoVolume | Float | no | Cargo max volume. | |
| CargoUnitId | Identity | yes | Cargo unit for loading. | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| TransportRouteSnapshots | Master Planning Master Planning |
The table contains user snapshots of transport routes (used for cross-site transportation in SNP). |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | yes | no | Route ID |
| Cost | DoubleFloat | no | Route Cost | |
| MaxCapacity | DoubleFloat | no | Max.Capacity (for cross-site), in quantity per full SNP time period. 0 means no constraint. | |
| TimePeriod | Integer | no | Route duration, days | |
| FromSiteId | Identity | no | Source site ID (reference to Sites) | |
| ToSiteId | Identity | no | Destination Site ID (reference to Sites) | |
| TransportMethodId | Identity | no | Transport Method ID | |
| IsActive | Integer | no | Flag: is the route active (used in SNP) |
| TransportTimeTable | Replenishment Replenishment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| FromLocationId | Identity | no | ||
| ToLocationId | Identity | no | ||
| JourneyId | Identity | no | ||
| Priority | Integer | no | ||
| DespatchDate | Date | no | ||
| DeliveryDate | Date | no |
| UnallocatedReasons | Master Planning |
List of possible reasons for demands not being allocated by SNP optimisation. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Reason Id |
| ReasonCode | String | no | Reason Code | |
| Name | String | no | Reason Name | |
| Description | String | no | Description | |
| Message | LongString | no | Message | |
| Severity | String | no | Severity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Units | Core Units |
The table lists units of measure registered in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| UnitName | ShortString | no | Unit name | |
| UnitDescription | String | no | Unit description | |
| UnitTypeId | Identity | no | Unit type (A reference to UnitTypes) | |
| IsBaseUnit | Integer | no | A flag: is this a base unit? (0, 1) | |
| Dividend | DoubleFloat | no | Dividend | |
| Divisor | DoubleFloat | no | Divisor | |
| MaterialTypeId | Identity | yes | A reference to MaterialTypes | |
| DividendProductPart | LongString | yes | A Reference to Unit Formula | |
| DivisorProductPart | LongString | yes | A Reference to Unit Formula | |
| FromBaseUnit | Integer | no | A flag: should we used material units for conversion and create such entries | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UnitTypeConverts | Core Units |
The table stores the list of mutually convertible unit types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| FromUnitTypeId | Identity | no | Initial unit type ID | |
| ToUnitTypeId | Identity | no | Final unit type ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UnitTypes | Core Units |
The table stores the list of unit types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| UnitTypeName | String | no | Unit type name (such as length, weight, quantity) | |
| UnitTypeDesc | String | no | Unit type description | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UploadedConsignmentOrders | Replenishment Replenishment |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| OperatorUserId | Identity | no | Operator User ID (A reference to Users) | |
| OrderNo | Identity | no | Row number | |
| WorkCentreCode | String | yes | ||
| BlockCode | String | yes | ||
| RunCode | String | yes | ||
| CustomerCode | String | yes | ||
| ProductCode | String | yes | ||
| Quantity | Float | yes | ||
| UnitName | String | yes | ||
| UnitId | Identity | yes | ||
| MaterialId | Identity | yes | Order line | |
| CustomerId | Identity | yes | Order line | |
| MaterialRunId | Identity | yes | Order line | |
| Weight | Float | yes | Order line | |
| RunCapacity | Float | no | Order line | |
| AvailableRunCapacity | Float | no | Order line | |
| TotalOrderWeight | Float | no | Order line | |
| FreeRunCapacity | Float | no | Order line |
| UsageHistories | Forecasting Forecasting |
The table stores usage history by SKUs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | identity |
| DateFrom | Date | no | Date | |
| Weight | Float | no | Weight | |
| AdjustedWeight | Float | yes | Adjusted Weight | |
| SiteMaterialUsageId | Identity | no | SKU (A reference to SiteMaterialUsages) | |
| WorkCentreId | Identity | yes | Workcentre Id | |
| Price | Float | yes | Price | |
| PriceQuantityUnitId | Identity | yes | Weight unit or any convertible to weight | |
| CurrencyId | Identity | yes | Currency Identity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UsedOppQuantityData | Due date quoting Temporary table |
The table stores temporary data for calculation of the initial quantity |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunId | Identity | no | A reference to the material run | |
| Quantity | Float | no | Used quantity, or used duration | |
| IsOppBlock | Identity | no | A flag: is this an opportunistic run? (0, 1) |
| UseOppRuns | Due date quoting Temporary table |
The table is used for calculation of the quantity on opportunistic runs |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| MaterialRunId | Identity | no | A reference to the material run | |
| Quantity | Float | no | Found quantity | |
| WCType | ShortString | no | Workcentre type (FL or PM) |
| UserAudit | Core Configuration |
The table stores the information about changes to User settings (password, MFA method etc) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| UserId | Identity | yes | Affected User Id | |
| UserName | String | yes | Affected User Name (at the time of recording) | |
| UserGroupId | Identity | yes | Affected User Group Id | |
| UserGroupName | String | yes | Affected User Group Name (at the time of recording) | |
| Description | HugeString | yes | Change description | |
| ClientIPAddress | String | yes | Client IP address for the blocked-user event | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| UserGroupFilters | Core Core |
The table stores infomation about locations assignment to users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| UserGroupId | Identity | no | Identity | |
| ReportFilterid | Identity | no | User ID | |
| FilterType | Integer | no | 0-inclusive, 1 - exclusive filter | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UserGroupGroups | Core Core |
The table stores infomation about locations assignment to users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| UserGroupId | Identity | no | Identity | |
| AccessGroupId | Identity | no | User ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| UserGroupLocations | Core Core |
The table stores infomation about locations assignment to users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| UserGroupId | Identity | no | Identity | |
| LocationId | Identity | no | User ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| UserGroups | Core Core |
The table stores infomation about locations assignment to users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| GroupName | String | no | Group name | |
| GroupType | String | no | Group type | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UserIPLogging | Core Logging |
Users IP address log |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| UserId | Identity | yes | User ID | |
| LoginTime | Date | no | When the user logged in to the system | |
| LogoutTime | Date | yes | When the user logged off the system | |
| IPAdress | String | no | IP Address of the user | |
| IPAdress2 | String | yes | Second IP Address of the user | |
| SessionKey | String | yes | Session key | |
| ExtraClientInfo | LongestString | yes | Additional information about the client used |
| UserNavigations | Core Configuration |
The table stores user configured navigation levels for summary and filters. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| TaskName | String | no | Task Name (Page name) | |
| LevelName | String | no | Level Name | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| UserNotifications | Core Reference |
The table connects notifications to users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| NotificationId | Identity | no | Notification Id | |
| UserId | Identity | no | User Id | |
| IsRead | Integer | no | 0 if unread, 1 if read | |
| DeliveryMethod | String | no | Method of delivery, values: iplan, email, iplanandemail | |
| IsSent | Integer | no | Used for delivery methods email/iplanandemail, 0 if not sent yet (or not needed), 1 if sent | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| UserPageParameters | Core Configuration |
The table contains the list of parameters and values, that were changed by users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| PageParameterId | Identity | no | Parameter ID | |
| UserId | Identity | no | User ID | |
| Value | LongestString | no | Value of the parameter | |
| IsSession | Integer | no | 0 - default user settings for Page 1 - session user settings for Page | |
| StorageName | String | yes | Storage name | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UserParameters | Core Configuration |
The table contains the list of parameters and values, that were changed by users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| SystemParameterId | Identity | no | Parameter ID | |
| UserId | Identity | no | User ID | |
| Value | LongString | no | Value of the parameter | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UserPasswordsHistory | Core Logging |
The table stores the list of recent passwords for each of the users. It serves to disable the use of the same passwords |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| UserId | Identity | no | User ID | |
| UserPassword | LongString | yes | Password | |
| InsertDate | Date | no | The date and time when password was changed |
| Users | Core Configuration |
The table contains the list of users of I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| UserLogin | ShortString | no | Login name | |
| DomainLogin | ShortString | yes | Domain login name | |
| UserName | String | no | Full name | |
| UserPassword | LongString | yes | Password | |
| Disabled | Integer | no | A flag: is the user disabled? | |
| LongString | yes | Email of the user | ||
| UserCode | ShortString | no | External reference | |
| CompanyId | Identity | yes | Company ID that the user belongs to | |
| UserGroupId | Identity | yes | User group that the user belongs to | |
| PasswordHistory | Identity | no | Number of previous passwords to store | |
| PasswordAge | Identity | no | Maximal allowed password age, days. After this number of days passed since last password change, the user will be forced to change password again | |
| PasswordUpdateTime | Date | yes | The date when the password was changed last time | |
| LockInvalidPasswordFlag | Integer | no | Current attempts from entering wrong password | |
| LockInvalidPasswordTime | Date | yes | Last time when enterer wrong password | |
| MFARequired | Integer | no | A flag: is MFA required for this user to login? | |
| MFAMethod | ShortString | yes | Multi-factor authentication method | |
| MFAConfirmed | Integer | no | A flag: is MFA method confirmed? | |
| MFASecret | LongString | yes | Multi-factor authentication method secret | |
| MFASecretDate | Date | yes | When the MFA secret was created? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| UserSessions | Core Logging |
The table stores additional information about user sessions |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| FromAddress | LongString | yes | User IP address | |
| SessionKey | LongString | no | Unique session key | |
| StartedAt | Date | no | Session start time | |
| LatestActionAt | Date | no | The moment of the latest action | |
| UserId | Identity | yes | User ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? |
| UsersRoles | Core Access rights |
The table is used to maintain the list of roles assigned to each of the users |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| RoleId | Identity | no | Role ID | |
| UserId | Identity | no | User ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ValidSources | Core Core |
The table stores source priority rules |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ProductionConfigurationId | Identity | no | Weight of rule | |
| OperationTypeId | Identity | no | Weight of rule | |
| WorkCentreId | Identity | no | Weight of rule | |
| Preferred | Integer | no | Site | |
| SourceRank | String | no | Is primary source | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WarehouseConsumption | Replenishment Replenishment |
The table stores in-stock balances of warehouses from suppliers |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WarehouseSkuId | Identity | no | Warehouse Sku Id | |
| ConsignmentLocationId | Identity | yes | Consignment Location Id | |
| DateFrom | Date | no | Date | |
| EditableWarehouseConsumption | Identity | no | A reference to Suppliers | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WHSKUSnapshots | Master Planning Master Planning |
The table contains WH SKU snapshots for SNP user scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| SiteMaterialUsageId | Identity | no | SiteMaterialUsage ID (A reference to SiteMaterialUsages) | |
| ExcludeFromSA | Integer | no | Exclude this WH SKU from Supply Planning (does not participate as an available source in SNP) |
| WidgetGraphData | Widgest Temporary |
Write description here. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WidgetName | String | no | ||
| Key | String | no | ||
| Value1 | Float | yes | ||
| Value2 | Float | yes | ||
| OperatorUserId | Identity | no |
| WidgetParameters | Core Core |
The table stores WidgetParameters defined in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WidgetId | Identity | no | Widget identity | |
| Name | String | no | Widget template parameter name | |
| Value | HugeString | yes | Value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| Widgets | Core Core |
The table stores widgets defined in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WidgetName | String | no | Widget name | |
| WidgetDescription | String | no | widget description (title) | |
| WidgetCategory | LongString | yes | Widget category (functional area) | |
| WidgetTemplateId | Identity | no | Widget Template Id | |
| IsEditable | Integer | no | A flag: is the widget editable by user | |
| UserId | Identity | no | Widget owner Id | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WidgetTemplateParameters | Core Core |
The table stores WidgetTemplateParameters defined in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WidgetTemplateId | Identity | no | Widget Template identity | |
| Name | String | no | Widget template parameter name | |
| Description | String | no | Widget template parameter description | |
| Help | HugeString | yes | Widget template parameter help (optional) | |
| Value | HugeString | yes | Value | |
| ControlType | String | no | Parameter visual control | |
| IsMandatory | Integer | no | Parameter visual control | |
| Category | String | yes | Parameter visual control | |
| Options | HugeString | yes | Additional options for different controls | |
| BundleId | Identity | yes | Bundle with values | |
| OrderNo | Integer | no | Sequence of UI control inside category | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WidgetTemplates | Core Core |
The table stores WidgetTemplate defined in the system |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | String | no | Widget template name | |
| Description | String | no | Widget template name | |
| Category | String | no | Widget template category | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreAttributes | Block Scheduling Block Scheduling |
The table contains PM run properties which should be present in FL run attributes (MaterialRunAttributes table) and which are not defined in PM run Properties (MaterialRunProperties table). They are defined per workcentre. Currently, only paper machine property are used. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Unique identifier |
| WorkCentreId | Identity | no | A reference to Workcentres.Id | |
| PropertyId | Identity | no | A reference to Properties.Id | |
| PropertyValueCode | ShortString | no | Property value code | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkcentreCampaignRunData | Source Selection Temporary table |
The table used in source selection process for storing paper machine production periods for each paper machine. It is used for calculation of production cycles |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | no | Identity | |
| MaterialRunId | Identity | no | A reference to MaterialRuns | |
| StartDate | Date | no | Start date of campaign run | |
| FinishDate | Date | no | End date of campaign run | |
| Valid | Identity | no | Valid | |
| OperatorUserId | Identity | no | Operator user ID |
| WorkCentreCapacities | Core Core |
The table stores the list of capacities of workcentres |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkcentreId | Identity | no | Workcentre ID | |
| Capacity | Float | no | Capacity | |
| EffectiveDate | Date | yes | Effective date | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreChangeOvers | Block Scheduling Block Scheduling |
The table contains detailed information about Workcentre changeovers. Changeover matrix, described by this table, contains all grades registered in the system, both in rows and columns, and specifies switchover time and cost necessary to switch between any two grades. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkcentreId | Identity | no | A reference to Workcentres.Id | |
| DateFrom | Date | no | Date | |
| Time | Float | no | Changeover time | |
| Cost | Float | no | Changeover cost | |
| FromGradeId | Identity | yes | Source grade ID | |
| ToGradeId | Identity | yes | Product grade ID | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreParameters | Core Core |
The table stores the list of parameters for workcentres |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkcentreId | Identity | no | Workcentre ID | |
| ParameterTypeId | Identity | no | Parameter type | |
| Value | String | yes | Value | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreParametersData | Core Temporary |
Keeps the most used parameters of workcentres from the table WorkcentreParameters. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| SiteId | Identity | no | Site Id | |
| WorkCentreId | Identity | no | Workcentre Id | |
| MinWidth | Float | no | MinWidth parameter Value | |
| MaxWidth | Float | no | MaxWidth parameter Value | |
| MaxNumberOfSheetsOut | Float | no | MaxNumberOfSheetsOut parameter Value | |
| MinTrimLoss | Float | no | MinTrimLoss parameter Value | |
| MaxTrimLoss | Float | no | MaxTrimLoss parameter Value |
| WorkCentreParameterSnapshots | Master Planning Master Planning |
The table contains workcentre parameter snapshots for SNP user scenarios. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| WorkCentreId | Identity | no | Workcentre ID (A reference to Workcentres) | |
| IdleCost | Float | no | Idle time cost, base currency unit per hour | |
| ExcludeFromSA | Float | no | Exclude this workcentre from Supply Planning (does not participate as an available source in SNP) | |
| MaxCapacity | Float | no | Max Warehouse Capacity (quantity per full SNP time period) | |
| Priority | Integer | yes | Workcentre priority, lower numbers mean higher priority. Used with the 'SNP: Maximum build complexity' system parameter to determine fallback workcentres when demand exceeds complexity limits. |
| WorkCentreParameterTypes | Core Core |
The table stores the list of all type of parameters for workcentres registered in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| ParameterName | String | no | Parameter name | |
| ParameterDescription | String | no | Parameter description | |
| ParameterHelp | HugeString | yes | Parameter help | |
| DataType | String | no | Type of data | |
| UnitDescription | String | no | Description of unit | |
| MinValue | Float | yes | Min value of data | |
| MaxValue | Float | yes | Max value of data | |
| DefaultValue | String | no | Default value of data | |
| WorkcentreTypeId | Identity | no | Workcentre type identity | |
| ParameterGroup | String | no | Column which will be indicate parameter group - possible values: Common, Master Planning, BSO | |
| Undefined | Integer | no | possible values 0 and 1, indicate that parameter can be undefined | |
| BundleId | Identity | yes | possible values 0 and 1, indicate that parameter can be undefined | |
| HasInventory | Integer | no | A flag: is this warehouse | |
| IsProductionSource | Integer | no | A flag: is this a valid initial source workcentre type? | |
| SupplierType | String | no | Supplier type: none, internal, external | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkcentreROData | Block Scheduling Temporary |
The list of workcentres to be processed in RO per user. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Workcentre Id | |
| OrdersQuantity | Integer | yes | Quantity of orders passed to RO engine | |
| GradesQuantity | Integer | yes | Quantity of grades | |
| ChangeOversQuantity | Integer | yes | Quantity of changeovers | |
| ShutsQuantity | Integer | yes | Quantity of shuts per workcentre | |
| OperatorUserId | Identity | no | Who inserted the line? |
| WorkCentreROParameters | Block Scheduling Block Scheduling |
The table stores global parameters for RO. The data should be passed to the Run Optimiser engine. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | A Reference to Workcentres.Id | |
| EarlyTolerance | Float | no | Earliness Tolerance, hrs - non-negative floating-point numeric value, default value - 0. This value is used in template assignment logic, if the demand's projected finish date is not before its due date minus the earliness tolerance - then the order has no earliness penalty | |
| LateTolerance | Float | no | Lateness Tolerance, hrs - non-negative floating-point numeric value, default value - 0. This value is used in template assignment logic, if the demand's projected finish date is not after its due date plus the lateness tolerance - then the order has no lateness penalty | |
| OrderLP | Float | no | Order penalty of lateness | |
| OrderFLP | Float | no | Order fixed penalty of lateness | |
| OrderEP | Float | no | Order penalty of earliness | |
| OrderFEP | Float | no | Order fixed penalty of earliness | |
| AllocationLP | Float | no | Allocation penalty of lateness | |
| AllocationFLP | Float | no | Allocation fixed penalty of lateness | |
| AllocationEP | Float | no | Allocation penalty of earliness | |
| AllocationFEP | Float | no | Allocation fixed penalty of earliness | |
| PropOrderLP | Integer | yes | A flag: 1 - calculate order lateness costs proportionally to the run length | |
| PropOrderFLP | Integer | yes | A flag: 1 - calculate order fixed lateness costs proportionally to the run length | |
| PropOrderEP | Integer | yes | A flag: 1 - calculate order earliness costs proportionally to the run length | |
| PropOrderFEP | Integer | yes | A flag: 1 - calculate order fixed earliness costs proportionally to the run length | |
| PropAllocationLP | Integer | yes | A flag: 1 - calculate allocation lateness costs proportionally to the run length | |
| PropAllocationFLP | Integer | yes | A flag: 1 - calculate allocation fixed lateness costs proportionally to the run length | |
| PropAllocationEP | Integer | yes | A flag: 1 - calculate allocation earliness costs proportionally to the run length | |
| PropAllocationFEP | Integer | yes | A flag: 1 - calculate allocation fixed earliness costs proportionally to the run length | |
| OpportunisticBlocks | Identity | yes | Opportunistic blocks | |
| GenericChangeoverCost | Float | no | Generic changeover cost | |
| GenericChangeoverDuration | Float | no | Generic changeover duration | |
| FrozenPeriodEnd | Date | yes | Moment of the frozen period end | |
| Saved | Integer | no | A flag: 1 indicates that RO Results were saved (i.e. campaign saving should be disabled) | |
| Released | Integer | no | A flag: 1 indicates that RO results were released | |
| AllowIdleTime | Integer | no | A flag: 1 indicates that idle time between generated runs is allowed | |
| AllowIdleTimeFS | Integer | no | A flag: 1 indicates that idle time around generated floating shuts is allowed and for runs not used | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreROResults | Block Scheduling Block Scheduling |
The table stores results of the most recent run optimization. The table is populated after completion of the RO process, and is used to display statistics of campaigns generated for corresponding workcentres. |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| WorkcentreId | Identity | no | Reference to Workcentres.Id | |
| LatenessCost | Float | no | Total lateness cost | |
| EarlinessCost | Float | no | Total earliness cost | |
| SwitchoverCost | Float | no | Total switchover cost | |
| OpportunisticBlocks | Identity | yes | Average duration of an opportunistic block | |
| GeneratedDate | Date | yes | Date and time when displayed results were generated | |
| AllowIdleTime | Integer | no | A flag: indicates that idle time was allowed when optimizing runs | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentres | Core Core |
The table stores the list of all workcentres registered in I-Plan |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkCentreName | String | no | Workcentre name | |
| WorkCentreCode | String | no | Workcentre code | |
| WorkCentreTypeId | Identity | no | A reference to WorkCentreTypes | |
| LocationId | Identity | no | A reference to Location (only supplier can contain workcentres) | |
| FrozenPeriod | Identity | no | Period in days from current date to set frozen status on runs, orders and operations before sending them to fine planning system | |
| ReleasePeriod | Identity | no | Period in days from current date for sending runs, orders and operations to fine planning system | |
| FinePlanningRelease | Date | yes | The date of the latest release to fine planning system | |
| FinePlanningUpdate | Date | yes | The date of the latest update from fine planning system | |
| CampaignReleaseDate | Date | yes | The date of the latest RO release on the workcentre | |
| NewLiveAllocations | Integer | yes | Flags that RO results were not released yet on the workcentre after latest MP calculation | |
| DDQLocked | Identity | no | 0 - workcentre is not locked for DDQ process; 1 - workcentre is locked for DDQ process | |
| BSLocked | Identity | no | 0 - BS process not locked workcentre; 1 -0 - BS process locked workcentre | |
| ProcessId | Identity | yes | BS process identity that locked site | |
| AutoConfirmationPeriod | Integer | yes | Replenishment orders auto-confirmation period | |
| UserId | Identity | yes | The ID of the user who have locked the workcentre | |
| DefaultRate | Float | no | Default Production rate, base weight unit/hour | |
| NumberOfWorkcentres | Integer | no | Number of physical workcentres | |
| IdleCost | Float | no | Idle time cost, base currency unit/hour | |
| LineOfAuthority | Date | yes | The date of the LineOfAuthority | |
| WorkcentreGroup | ShortString | yes | Workcentre Group | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreShuts | Core Core |
The table stores infomation about shuts for workcentres |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkCentreId | Identity | no | WorkCentre identity | |
| ShutCode | String | no | WorkCentre shut code | |
| StartDate | Date | no | Start date | |
| FinishDate | Date | no | Finish date | |
| Description | String | yes | Description | |
| UseShutInMPOnly | Integer | no | Use shut only in MP | |
| UseOnlyInBSOGantt | Integer | no | Use shut only In BSOGantt | |
| WorkCentreShutTypeId | Identity | no | WorkCentre shut type Identity | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreShutSnapshots | Master Planning Master Planning |
The table contains workcentre shut snapshots for SNP (non-working time for production workcentres) |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| ScenarioSessionId | Identity | no | Scenario Session ID (A reference to ScenarioSessions) | |
| ScenarioId | Identity | no | Scenario ID (A reference to Scenarios) | |
| Id | Identity | yes | no | Identity |
| ShutCode | String | no | WorkCentre shut code | |
| WorkcentreId | Identity | no | Workcentre ID (A reference to Workcentres) | |
| StartDate | Date | no | Start date and time of the snapshot | |
| FinishDate | Date | no | End date and time of the snapshot | |
| Description | String | yes | User description of the shut | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreShutTypes | Core Core |
The table stores infomation about type shuts for workcentres |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| Name | String | no | Shut type name | |
| Description | String | yes | Shut type description | |
| IsDefault | Integer | no | A flag: is this a default action? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreTimeEfficiencies | Core Core |
The table stores the time efficiency for workcentres |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkcentreId | Identity | no | Workcentre ID | |
| RoughTimeEfficiency | Float | no | Capacity | |
| EffectiveDate | Date | yes | Effective date | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| WorkCentreTypes | Core Core |
The table stores the list of workcentre types |
|---|
| name | type | identity | null | description |
|---|---|---|---|---|
| Id | Identity | yes | no | Identity |
| WorkCentreTypeName | String | no | Workcentre type name | |
| WorkCentreTypeDesc | String | no | Description of the workcentre type | |
| IsValidInitialSource | Integer | no | A flag: is this a valid initial source workcentre type? | |
| HasInventory | Integer | no | A flag: is this warehouse | |
| IsProductionSource | Integer | no | A flag: is this a valid initial source workcentre type? | |
| SupplierType | String | no | Supplier type: none, internal, external | |
| StageDelayHours | Integer | no | Fixed (min) delay after this stage in SNP, in hours | |
| MaxStageDelayHours | Integer | no | Max delay after this stage in SNP, in hours | |
| OrderNo | Integer | no | Order number for sequencing by wkcType on screens | |
| BSOptimisation | Integer | no | Such workcentre type can be optimized in BSO | |
| BSONextCampaign | Integer | no | Should generate runs for next workcentre type in the production chain | |
| IncludeAllocationMessages | Integer | no | Include allocations into allocation messages | |
| IsPrimaryType | Integer | no | A flag: is this primary workcentre type? | |
| InsertUserId | Identity | no | Who inserted the record? | |
| InsertDate | Date | no | When the record was inserted? | |
| UpdateUserId | Identity | yes | Who updated the record? | |
| UpdateDate | Date | yes | When the record was updated? |
| ActiveProcessStatusesView |
|---|
SELECT ps.TaskName, ps.ProcessPartName AS ProcessPartDesc,
ps.Done,
ps.Total,
DECODE(ps.Total, 0, 0, ROUND(ps.Done / ps.Total * 100, 0)) AS Percentage,
ps.UserId,
u.UserLogin,
ps.OrderNo,
ps.ProcessId
FROM ProcessStatuses ps, Users u, Processes p
WHERE ps.UserId = u.Id
AND ps.ProcessId = p.Id
AND p.Status = 0
|
| AvailableWidgetsIPlanView |
|---|
-- Own user widgets (for UserId=1 categorized as System)
SELECT 0 IsTemplate, w.Id, w.WidgetName Name,
w.WidgetDescription Description,
DECODE(w.UserId, 1, 'system-widgets', 'my-widgets') CATEGORY,
wt.Name TemplateName, w.IsEditable, wt.id AS WidgetTemplateId, w.UserId,
0 IsShared
FROM Widgets w, WidgetTemplates wt
WHERE wt.Id = w.WidgetTemplateId
UNION
-- UserId = 1: "System" Widgets (match role, various categories, non-editable)
-- UserId != 1: Shared widgets (match role, category 'Shared Widgets', editable)
SELECT DISTINCT 0 IsTemplate, w.Id, w.WidgetName Name,
w.WidgetDescription Description,
DECODE(w.UserId, 1, 'system-widgets', 'shared-widgets') Category, -- ignore category for pre-created ones
wt.Name TemplateName, w.IsEditable, wt.id AS WidgetTemplateId, ur.UserId,
DECODE(w.UserId, 1, 0, 1) IsShared
FROM Widgets w, UsersRoles ur, RolesWidgets rw, WidgetTemplates wt
WHERE wt.Id = w.WidgetTemplateId
AND ur.RoleId = rw.RoleId
AND rw.WidgetId = w.Id
UNION
-- Widget Templates
SELECT 1 IsTemplate, 0 Id, wt.Name, wt.Description WidgetDescription, wt.Category,
wt.Name TemplateName, 1 AS IsEditable, wt.Id AS WidgetTemplateId, 0 UserId, 0 IsShared
FROM WidgetTemplates wt
WHERE EXISTS (SELECT 1
FROM WidgetTemplateParameters p
WHERE p.WidgetTemplateId = wt.Id
AND p.controltype != 'Hidden')
|
| DashboardsIPlanView |
|---|
SELECT sd.Id, sd.Name, sd.Description, sd.OrderNo, u.Id UserID FROM Dashboards sd CROSS JOIN Users u WHERE sd.UserId = 1 AND NOT EXISTS(SELECT 1 FROM Dashboards ud WHERE ud.Name = sd.Name AND ud.UserId != sd.UserId AND ud.UserId = u.Id) UNION ALL SELECT d.Id, d.Name, d.Description, d.OrderNo, d.UserId FROM Dashboards d WHERE d.UserId != 1 |
| EndCustomerLevelsIPlanView |
|---|
SELECT Id,
'EndCustomer'||HierarchyLevelName AS HierarchyLevelName,
'EndCustomer '||REGEXP_REPLACE(HierarchyLevelName, '[^[:alnum:]_]', '') AS HierarchyName,
UPPER('H_EH_' || REGEXP_REPLACE(HierarchyLevelName, '[^[:alnum:]_]', '')) AS HierarchyViewName,
UPPER('H_EH_' || REGEXP_REPLACE(HierarchyLevelName, '[^[:alnum:]_]', '') || 'CODE') AS HierarchyViewCode,
'End Customer '||HierarchyLevelName as HierarchyDesc,
'EndCustomerHierarchyCode' || ROW_NUMBER() Over(ORDER BY Id) FieldHierarchyCode,
'EndCustomerHierarchyName' || ROW_NUMBER() Over(ORDER BY Id) FieldHierarchyValue,
ROW_NUMBER() Over(ORDER BY Id) OrderNo,
HierarchyLevelNo,
'H_EH' Prefix
FROM HierarchyLevels
|
| EndUsePropertiesIPlanView |
|---|
SELECT Id,
REGEXP_REPLACE(PropertyName, '[^[:alnum:]_]', '') AS PropertyName,
PropertyName AS PropertyDesc,
UPPER('EU_' || REGEXP_REPLACE(PropertyName, '[^[:alnum:]_]', '')) PropertyViewName,
'Property' || ROW_NUMBER() Over(ORDER BY Id) FieldProperty,
HierarchyLevelNo OrderNo,
'EU' Prefix
FROM EndUseProperties
|
| EV#ActiveSupercessions |
|---|
SELECT fsmu.LocationCode FromLocationCode, tsmu.LocationCode ToLocationCode, fsmu.MaterialCode FromMaterialCode,
tsmu.MaterialCode ToMaterialCode, fsmu.EndUseCode FromEndUseCode, tsmu.EndUseCode ToEndUseCode,
fsmu.EndCustomerCode FromEndCustomerCode, tsmu.EndCustomerCode ToEndCustomerCode,
TO_CHAR(ls.StartDate, 'YYYY-MM-DD') StartDate, ls.SiteMaterialUsageId SiteMaterialUsageId,
ls.OnSiteMaterialUsageId OnSiteMaterialUsageId
FROM IH#ActiveSupercessions ls
JOIN EV#SiteMaterialUsages fsmu ON fsmu.Id = ls.SiteMaterialUsageId
JOIN EV#SiteMaterialUsages tsmu ON tsmu.Id = ls.OnSiteMaterialUsageId
|
| EV#AllForecastBodies |
|---|
SELECT s.*, fb.ForecastId, f.StartDate AS ForecastStartDate, fb.SiteMaterialUsageId, fb.DateFrom,
fb.OriginalSystem, fb.System, fb.Customer, fb.Final, smu.ForecastStatusId,
fs.ForecastStatusName AS ForecastStatus, fb.EditGroupId, fb.EditGroupFinalId, fb.OriginalEditGroupId,
fb.IsWorking, fb.SystemPrice, fb.ForecastedPrice, smu.Status AS SkuForecastedStatus
FROM ForecastBodies fb
JOIN Forecasts f ON f.Id = fb.ForecastId
JOIN EV#Skus s ON s.Id = fb.SiteMaterialUsageID
JOIN SiteMaterialUsages smu ON smu.Id = s.Id
JOIN ForecastStatuses fs ON fs.Id = smu.ForecastStatusId
|
| EV#AllocationBodies |
|---|
SELECT smu.LocationName, smu.LocationCode, smu.MAterialName, smu.MaterialCode, wc.WorkcentreName, wc.WorkcentreCode, wc.SiteName, wc.SiteCode, ab.SourceWeek, ab.SourceMonth, ab.DeliveryWeek, ab.DeliveryMonth, ab.System, ab.Customer, smu.id as SiteMaterialUsageId, wc.WorkcentreId, wc.SiteId FROM AllocationBodies ab JOIN EV#Sitematerialusages smu ON smu.Id = ab.SiteMaterialUSageId JOIN IH#Workcentres wc ON wc.WorkcentreId = ab.WorkcentreId |
| EV#AllSiteMaterialUSages |
|---|
SELECT smu.Id, NULL ConsignmentLocationId, l.LocationName, l.LocationCode, MaterialName, MaterialCode,
eu.endusecode, eu.EndUseDescription, ec.LocationCode EndCustomerCode, ec.LocationName EndCustomerName,
NULL ConsignmentCustomerName, NULL ConsignmentCustomerCode, Replenished, smu.Status, ReplenishmentFlag,
smu.MaterialId, smu.LocationId
FROM SiteMaterialUsages smu
JOIN Locations l ON (smu.LocationId = l.Id)
JOIN Materials m ON smu.MaterialId = m.Id
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId
UNION ALL
SELECT smu.Id, cp.CustomerId ConsignmentLocationId, l.LocationName, l.LocationCode, MaterialName, MaterialCode,
NULL endusecode, NULL EndUseDescription, NULL EndCustomerCode, NULL EndCustomerName,
cc.LocationName ConsignmentCustomerName, cc.LocationCode ConsignmentCustomerCode, cp.Replenished,
0 Status, 0 ReplenishmentFlag, smu.MaterialId, smu.LocationId
FROM SiteMaterialUsages smu
JOIN ConsignmentParameters cp ON cp.SiteMaterialUsageId = smu.Id
JOIN Locations l ON (smu.LocationId = l.Id)
JOIN Materials m ON smu.MaterialId = m.Id
JOIN Locations cc ON cc.Id = cp.CustomerId
|
| EV#AllWeeklyForecastBodies |
|---|
SELECT fb.SiteMaterialUSageId, LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode,
EndUseDescription, EndCustomerCode, EndCustomerName, s.DateFromIW DateFromWeek,
fb.DateFrom DateFromMonth, OriginalSystem * s.Coef OriginalSystem, SYSTEM * s.Coef SYSTEM,
Customer * c.Coef Customer, FINAL * f.Coef FINAL, smu.Status
FROM ForecastBodies fb
JOIN EV#SiteMaterialUSages smu ON smu.Id = fb.SiteMaterialUsageID
JOIN ForecastWeeklyCoefs s ON s.Id = fb.SystemWeeklyCoefId AND fb.DateFrom = s.DateFrom
JOIN ForecastWeeklyCoefs c ON c.Id = fb.SystemWeeklyCoefId AND fb.DateFrom = c.DateFrom
JOIN ForecastWeeklyCoefs f ON f.Id = fb.SystemWeeklyCoefId AND fb.DateFrom = f.DateFrom
WHERE s.DateFromIW = f.DateFromIW
AND c.DateFromIw = f.DatefromIw
AND s.Datefrom = f.DateFrom
AND c.Datefrom = f.DateFrom
|
| EV#ArchivedForecastBodies |
|---|
SELECT afb.SiteMaterialUSageId, f.StartDate, LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode,
EndUseDescription, EndCustomerCode, EndCustomerName, DateFrom, OriginalSystem, System, Customer, FINAL,
EditGroupId, EditGroupFinalId, DeletedFlag
FROM ArchivedForecastBodies afb
JOIN EV#SiteMaterialUSages smu ON smu.Id = afb.SiteMaterialUsageID
JOIN Forecasts f ON afb.ForecastId = f.Id
|
| EV#BSOInput |
|---|
WITH
s AS (SELECT u.UserName, WorkcentreCode, ab.DateFrom SourcePeriod, gp.Gradecode,
OriginalWeight DemandControlWeight, OperatorUserId, WorkcentreId, ab.GradeId,
ab.OperationTypeId, ab.Finishingid
FROM BSOAllocationData ab
JOIN GradeProperties gp ON ab.GradeId = gp.GradeId AND ab.OperationTypeId = gp.Operationtypeid
JOIN USERS u ON ab.OperatorUserId = u.Id
JOIN Workcentres wc ON wc.Id = ab.WorkcentreId),
i AS (SELECT WorkcentreCode, TRUNC(DateFrom, p.AllocationPeriod) SourcePeriod, gp.Gradecode,
SUM(Weight) InputWeight, WorkcentreId, ab.GradeId, ab.OperationTypeId, ab.FinishingId
FROM Bsoinputdata ab
JOIN GradeProperties gp ON ab.GradeId = gp.GradeId AND gp.Operationtypeid = ab.Operationtypeid
JOIN Workcentres wc ON wc.Id = ab.WorkcentreId
CROSS JOIN (SELECT CASE WHEN VALUE IN ('Week', 'WeekMonth') THEN 'IW' ELSE 'month' END AllocationPeriod
FROM SystemParameters
WHERE ParameterName = 'LiveAllocationPeriod') p
GROUP BY WorkcentreCode, TRUNC(DateFrom, p.AllocationPeriod), gp.Gradecode, ab.WorkcentreId,
ab.GradeId, ab.OperationTypeId, ab.FinishingId)
SELECT s.UserName, s.SourcePeriod, s.WorkcentreCode, s.GradeCode, ot.OperationTypeName, s.FinishingId,
s.GradeId, s.DemandControlWeight, InputWeight
FROM s
LEFT JOIN i ON s.GradeId = i.GradeId AND s.WorkcentreId = i.WorkcentreId AND s.SourcePeriod = i.SourcePeriod AND
s.OperationTypeId = i.OperationTypeId AND NVL(s.FinishingId, 0) = NVL(i.FinishingId, 0)
JOIN OperationTypes ot ON ot.Id = s.OperationTypeId
|
| EV#CarriedForecast |
|---|
SELECT fb.SiteMaterialUSageId, LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode,
EndUseDescription, EndCustomerCode, EndCustomerName, DateFrom, GroupId, EditGroupId, EditGroupFinalId,
RealFinal, Final, RealFinalSum, FinalSum, CurrentSum, System, Quantity
FROM MovingForecastGroupData fb
JOIN EV#SiteMaterialUSages smu ON smu.Id = fb.SiteMaterialUsageID
|
| EV#CarriedForecastNoSuper |
|---|
SELECT *
FROM EV#CarriedForecast fb
WHERE NOT EXISTS (SELECT 1
FROM MovingForecastGroupData md
JOIN IH#MaterialSupercessions ms ON (ms.OnSiteMaterialUsageId = md.SiteMaterialUsageId OR
ms.SiteMaterialUsageId = md.SiteMaterialUsageId)
WHERE NVL(fb.EditGroupId, 0) = NVL(md.EditGroupId, 0)
AND NVL(fb.EditGroupFinalId, 0) = NVL(md.EditGroupFinalId, 0))
|
| EV#ConsignmentSku |
|---|
SELECT v.LocationName, v.LocationCode, v.MAterialName, v.MaterialCode, l.LocationName CustomerName,
l.LocationCode CustomerCode
FROM Consignmentparameters cp
JOIN EV#Skus v ON v.Id = cp.SiteMaterialUSageID
JOIN Locations l ON l.Id = cp.CustomerId
|
| EV#ConsumptionHistories |
|---|
SELECT smu.LocationName, smu.LocationCode, MaterialName, MaterialCode, EndUseCode, EndUseDescription,
EndCustomerCode, EndCustomerName, SiteName, SiteCode, WorkcentreName, WorkcentreCode, DateFrom, Weight,
AdjustedWeight
FROM ConsumptionHistories ch
JOIN EV#SiteMaterialUsages smu ON ch.SiteMaterialUsageId = smu.Id
JOIN IH#SiteWorkcentres wc ON wc.WorkcentreId = ch.WorkcentreId
|
| EV#DailyForecastDistribution |
|---|
SELECT smu.*, d.*
FROM IH#DailyForecastDistribution d
JOIN EV#SiteMaterialUsages smu ON smu.Id = d.SiteMaterialUsageId
|
| EV#ExpandedPrices |
|---|
SELECT LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode, EndUseDescription, EndCustomerCode,
EndCustomerName, DateFrom, DateTo, CurrencyId, Price, CurrencyName
FROM IH#ExpandedPrices p
JOIN EV#SiteMaterialUsages smu ON smu.Id = p.SiteMaterialUsageId
JOIN Currencies c ON c.Id = p.CurrencyId
|
| EV#FixedSourceSnapshots |
|---|
SELECT d.Description, wc.WorkcentreName, s.ScenarioName, s.UserName, fs.*
FROM FixedSourceSnapshots fs
JOIN IH#HierarchyPropertyDetails d ON d.ID = fs.DetailId
JOIN Workcentres wc ON wc.Id = fs.WorkcentreId
JOIN IH#Scenarios s ON s.USerId = fs.ScenarioSessionId AND s.Id = fs.ScenarioId
|
| EV#ForecastBodies |
|---|
SELECT s.*, fb.SiteMaterialUsageId, DateFrom, OriginalSystem, System, Customer, FINAL, smu.ForecastStatusId,
EditGroupId, EditGroupFinalId, OriginalEditGroupId, IsWorking, SystemPrice, ForecastedPrice,
c.CurrencyDescription, smu.Status
FROM ForecastBodies fb
JOIN EV#Skus s ON s.Id = fb.SiteMaterialUsageID
JOIN SiteMaterialUsages smu ON smu.Id = s.Id
JOIN Currencies c ON c.Id = NVL(fb.PriceCurrencyId, core.InternalCurrencyId())
WHERE fb.ForecastId = forecasting.getLatestForecast()
|
| EV#ForecastBodiesNoSuper |
|---|
SELECT *
FROM EV#ForecastBodies fb
WHERE NOT EXISTS (SELECT 1
FROM IH#ActiveSupercessions ms
WHERE ms.OnSiteMaterialUsageId = fb.SiteMaterialUsageId
OR ms.SiteMaterialUsageId = fb.SiteMaterialUsageId)
|
| EV#ForecastBodyPrices |
|---|
SELECT smu.*, DateFrom, SystemPrice, sc.CurrencyName AS SystemPriceCurrency, ForecastedPrice,
fc.CurrencyName AS ForecastedPriceCurrency, NominalCost, cc.CurrencyName AS NominalCostCurrency
FROM ForecastBodies fb
JOIN EV#Skus smu ON smu.Id = fb.SiteMaterialUsageId
JOIN Currencies sc ON sc.Id = fb.SystemPriceCurrencyId
JOIN Currencies fc ON fc.Id = fb.PriceCurrencyId
JOIN Currencies cc ON cc.Id = fb.CostCurrencyId
WHERE fb.ForecastId = forecasting.getLatestForecast()
|
| EV#ForecastFirstPass |
|---|
SELECT i.Id TraceItemId, i.ProcessId, i.FirstPassId, i.StartDate, i.Succeeded, i.History, i.Events,
s.LocationName, s.LocationCode, s.MaterialName, s.MaterialCode, s.EndUseCode, s.EndUseDescription,
s.EndCustomerCode, s.EndCustomerName
FROM ForecastTraceItems i
JOIN EV#SiteMaterialUsages s ON s.Id = i.FirstPassId
WHERE i.PassName = 'FirstPass' AND
i.ProcessId IN (SELECT MAX(p.Id) FROM Processes p WHERE p.ProcessType = 'Forecast')
|
| EV#ForecastHistory |
|---|
SELECT smu.Id SiteMaterialUsageId, LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode,
EndUseDescription, EndCustomerCode, EndCustomerName, DateFrom, SupercessionHistory1,
SupercessionHistory2, SupercessionHistory3, SupercessionHistory4, SupercessionHistory5,
SupercessionHistory6, SupercessionHistory7, SupercessionHistory8
FROM ForecastHistoryData fh
JOIN EV#SiteMaterialUSages smu ON smu.Id = fh.SiteMaterialUsageID
|
| EV#ForecastHistoryNoSuper |
|---|
SELECT *
FROM EV#ForecastHistory uh
WHERE NOT EXISTS (SELECT 1
FROM IH#ActiveSupercessions ms
WHERE ms.OnSiteMaterialUsageId = uh.SiteMaterialUsageId
OR ms.SiteMaterialUsageId = uh.SiteMaterialUsageId)
|
| EV#ForecastSecondPass |
|---|
SELECT i.Id TraceItemId, i.ProcessId, i.SecondPassId, i.StartDate, i.Succeeded, i.SecondPassRuleId,
i.CharacteristicsList, i.Characteristics, i.Skus, i.History, i.Events
FROM ForecastTraceItems i
WHERE i.PassName = 'SecondPass'
AND i.ProcessId IN (SELECT MAX(p.Id) FROM Processes p WHERE p.ProcessType = 'Forecast')
|
| EV#ForecastSnapshotBodies |
|---|
SELECT fs.Name, fs.Description, fs.StartDate, fs.FinishDate, fb.SiteMaterialUSageId, LocationName, LocationCode,
MaterialName, MaterialCode, EndUseCode, EndUseDescription, EndCustomerCode, EndCustomerName, DateFrom,
FINAL, smu.ForecastStatusId, SystemPrice, ForecastedPrice
FROM ForecastSnapshotBodies fb
JOIN ForecastSnapshots fs ON fs.Id = fb.ForecastSnapshotId
JOIN EV#SiteMaterialUSages smu ON smu.Id = fb.SiteMaterialUsageID
|
| EV#ForecastUsedHistory |
|---|
SELECT smu.Id SiteMaterialUsageId, LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode,
EndUseDescription, EndCustomerCode, EndCustomerName, DateFrom, StartDate, Successed, Weight,
Weight Quantity, TradingDays
FROM HistoryData fh
JOIN EV#SiteMaterialUSages smu ON smu.Id = fh.SiteMaterialUsageID
|
| EV#ForecastUsedHistoryNoSuper |
|---|
SELECT *
FROM EV#ForecastUsedHistory uh
WHERE NOT EXISTS (SELECT 1
FROM IH#ActiveSupercessions ms
WHERE ms.OnSiteMaterialUsageId = uh.SiteMaterialUsageId
OR ms.SiteMaterialUsageId = uh.SiteMaterialUsageId)
|
| EV#InnerPointForecast |
|---|
SELECT s.LocationCode, s.MaterialCode, s.LocationName, s.MaterialName, EndUseCode, EndCustomer, a.*
FROM InnerpointForecast a
JOIN (SELECT DISTINCT GroupKey, MaterialId, SiteMaterialUSageId FROM ReplenishedSku) r
ON r.GroupKey = a.GroupKey AND r.MaterialId = a.MaterialId
JOIN IH#sku s ON s.Id = r.Sitematerialusageid
ORDER BY 1, 2, DateFrom
|
| EV#InnerPointHistory |
|---|
SELECT s.LocationCode, s.MaterialCode, s.LocationName, s.MaterialName, EndUseCode, EndCustomer, a.*
FROM Innerpointhistory a
JOIN (SELECT DISTINCT GroupKey, MaterialId, SiteMaterialUSageId FROM ReplenishedSku) r
ON r.GroupKey = a.GroupKey AND r.MaterialId = a.MaterialId
JOIN IH#sku s ON s.Id = r.Sitematerialusageid
ORDER BY 1, 2, DateFrom
|
| EV#Inventories |
|---|
SELECT smu.*, WorkcentreName, WorkcentreCode, SiteName, SiteCode, i.StockType, i.Weight, i.DateFrom,
i.InsertDate, i.UpdateDate
FROM Inventories i
JOIN EV#WarehouseSKU smu ON smu.SiteMaterialUsageId = i.Sitematerialusageid
LEFT JOIN IH#SiteWorkcentres s ON s.LocationId = smu.LocationId AND
NVL(smu.ConsignmentLocationId, 0) = NVL(i.ConsignmentLocationId, 0)
|
| EV#InventoryProfiles |
|---|
SELECT s.LocationCode, s.MaterialCode, s.LocationName, s.MaterialName, cs.LocationName ConsignmentCustomerName,
cs.LocationCode ConsignmentCustomerCode, WorkcentreCode, WorkcentreName, SiteName, SiteCode, ip.*
FROM InventoryProfiles ip
JOIN IH#sku s ON s.Id = ip.Sitematerialusageid
LEFT JOIN Locations cs ON cs.Id = ip.ConsignmentLocationId
JOIN IH#Workcentres wc ON wc.LocationId = s.LocationId
|
| EV#Journeys |
|---|
SELECT j.Id JourneyId, s.SiteName FromSite, t.LocationName ToLocationName, f.LocationName FromLocationName,
m.WorkcentreName FromWorkcentreName, IsDEfault, isInternal, QuantityLegs, TimePeriod
FROM Journeys j
JOIN Sites s ON (s.Id = j.FromSiteId)
JOIN Locations f ON f.Id = j.FromLocationId
JOIN Locations t ON t.Id = j.ToLocationId
JOIN IH#MainWarehouses m ON m.SiteId = s.Id
|
| EV#LastReplenishmentOrderLines |
|---|
SELECT LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode, EndUseDescription, EndCustomerCode,
EndCustomerName, DeliveryDate, DespatchDate, FinalWeight
FROM LastReplenishmentOrders o
JOIN EV#SiteMaterialUsages smu ON o.SiteMaterialUsageId = smu.Id
|
| EV#LatestSupplierInventories |
|---|
SELECT l.LocationName, l.LocationCode, MaterialName, MaterialCode, s.SiteName SupplierSiteName,
s.SiteCode SupplierSiteCode, s.WorkcentreName SupplierWorkcentreName,
s.WorkcentreCode SupplierWorkcentreCode, wh.LocationCode WarehouseCode, wh.LocationName WarehouseName,
WarehouseSkuId, InternalStock, ExternalStock
FROM Ih#latestsupplierinventories i
JOIN Materials m ON m.Id = i.MaterialId
LEFT JOIN Locations l ON l.Id = i.CustomerId
JOIN IH#SiteWorkcentres s ON s.WorkcentreId = i.SupplierId
LEFT JOIN Locations wh ON wh.Id = i.WarehouseId
|
| EV#MaterialProperties |
|---|
SELECT MaterialId, MaterialName, MaterialCode,
core.asCsv(ParameterArray(Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10, Code11,
Code12, Code13, Code14, Code15, Code16, Code17, Code18, Code19, Code20, Code21,
Code22, Code23, Code24, Code25, Code26, Code27, Code28, Code29,
Code30)) MaterialCodes,
core.asCsv(ParameterArray(Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9,
Value10, Value11, Value12, Value13, Value14, Value15, Value16, Value17,
Value18, Value19, Value20, Value21, Value22, Value23, Value24, Value25,
Value26, Value27, Value28, Value29, Value30)) MaterialNames
FROM Materialpropsspec
|
| EV#MaterialRuns |
|---|
SELECT SiteName, SiteCode, WorkcentreName, WorkcentreCode, BlockRunCode, mr.NominalCapacity, mr.Quantity,
StartDate, FinishDate, mrp.ProductName RunProperties, mr.Id MaterialRunId
FROM MaterialRuns mr
JOIN IH#workcentres wc ON wc.WorkcentreId = mr.WorkcentreId
JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = mr.Id
WHERE TRUNC(Finishdate) >= core.getTruncatedInternalDate
|
| EV#MaterialSupercessions |
|---|
SELECT ms.Id, ms.SiteMaterialUsageId, ms.OnSiteMaterialUsageId, ms.TYPE, ms.SupercessionRuleId, ms.StartDate,
ms.GeneratedFromId, ms.Percentage, ms.LevelNo, ms.DisableSupersededItems, smut.LocationId ToLocationId,
lf.LocationName FromLocationName, lf.LocationCode FromLocationCode, lt.LocationName ToLocationName,
lt.LocationCode ToLocationCode, fm.MaterialName FromMaterialName, fm.MaterialCode FromMaterialCode,
euf.EndUseCode EndUseCodeFrom, euf.EndUseDescription EndUseFrom, tm.MaterialName ToMaterialName,
tm.MaterialCode ToMaterialCode, eut.EndUseCode EndUseCodeTo, eut.EndUseDescription EndUseTo,
fm.Id FromMaterialId, tm.Id ToMaterialId, ecf.LocationCode FromEndCustomerCode,
ect.LocationCode ToEndCustomerCode, smuf.Status, smut.Status TargetStatus
FROM IH#MaterialSupercessions ms
JOIN SiteMaterialUsages smuf ON (ms.SiteMaterialUsageId = smuf.Id)
JOIN SiteMaterialUsages smut ON (ms.OnSiteMaterialUsageId = smut.Id)
JOIN Locations lf ON lf.Id = smuf.LocationId
JOIN Locations lt ON lt.Id = smut.LocationId
JOIN Materials fm ON (fm.Id = smuf.MaterialId)
JOIN Materials tm ON (tm.Id = smut.MaterialId)
LEFT JOIN EndUses euf ON euf.Id = smuf.EndUseId
LEFT JOIN EndUses eut ON eut.Id = smut.EndUseId
LEFT JOIN Locations ecf ON ecf.Id = NVL(smuf.EndCustomerId, smuf.LocationId)
LEFT JOIN Locations ect ON ect.Id = NVL(smut.EndCustomerId, smut.LocationId)
|
| EV#MaterialUnits |
|---|
SELECT m.MaterialCode, m.MaterialName, UnitName, UnitDescription, mu.*
FROM IH#AllMaterialUnits mu
JOIN Materials m ON m.Id = mu.MaterialId
JOIN Units u ON u.Id = mu.UnitId
|
| EV#MonthlyExchangeRates |
|---|
SELECT cf.CurrencyName FromCurrency, ct.CurrencyName ToCurrency, v.*
FROM IH#MonthlyExchangeRates v
JOIN Currencies cf ON (cf.Id = v.FromCurrencyId)
JOIN Currencies ct ON (ct.Id = v.ToCurrencyId)
|
| EV#OrderLines |
|---|
SELECT ob.Ordercode, ol.Linenocode, dsmu.LocationName DestinationLocationName,
dsmu.LocationCode DestinationLocationCode, dsmu.MaterialName DestinationMaterialName,
dsmu.MaterialCode DestinationMaterialCode, wc.LocationName SourceLocationName,
wc.LocationCode SourceLocationCode, ssmu.MaterialName SourceMaterialName,
ssmu.MaterialCode SourceMaterialCode, wc.WorkcentreName, wc.WorkcentreCode, ols.OrderLineStatusCode,
ols.OrderLineStatusName, DespatchDate, ConsumptionDate, DeliveryDate, RequestedDate, mr.BlockRunCode,
mr.Finishdate RunFinishDate, FinalWeight
FROM OrderLines ol
JOIN OrderBooks ob ON ob.Id = ol.OrderBookId
JOIN OrderLineStatuses ols ON ols.Id = ol.ORderLineStatusID
JOIN EV#SiteMaterialUsages dsmu ON dsmu.Id = ol.SiteMaterialUsageId
JOIN IH#Workcentres wc ON wc.WorkcentreId = ol.WorkcentreId
LEFT JOIN EV#SiteMaterialUsages ssmu ON ssmu.Id = ol.SourceSiteMaterialUsageId
LEFT JOIN OrderOperations oo ON oo.OrderLineId = ol.Id
LEFT JOIN MaterialRuns mr ON mr.Id = oo.MaterialRunId
|
| EV#RealInventoryProfiles |
|---|
SELECT s.MaterialId, s.LocationCode, s.MaterialCode, s.LocationName, s.MaterialName,
cs.LocationName ConsignmentCustomerName, cs.LocationCode ConsignmentCustomerCode, WorkcentreCode,
WorkcentreName, SiteName, SiteCode, ip.*
FROM RealInventoryProfilesIPlanView ip
JOIN IH#sku s ON s.Id = ip.Sitematerialusageid
LEFT JOIN Locations cs ON cs.Id = ip.ConsignmentLocationId
JOIN IH#Workcentres wc ON wc.LocationId = s.LocationId
|
| EV#RealInventoryProfileSnapshots |
|---|
SELECT ScenarioSessionId, ws.*, DateFrom, Opening, OrdersIn, OrdersOut, Closing, SafetyStock FROM RealInventoryProfileSnapshot r JOIN EV#WarehouseSkus ws ON ws.Id = r.SiteMaterialUsageId |
| EV#RebalancedOrderLines |
|---|
SELECT OrderCode, LineNoCode, p.Started, rol.*
FROM RebalancedOrderLines rol
JOIN OrderLines ol ON ol.Id = rol.OrderLineId
JOIN OrderBooks ob ON ob.Id = ol.OrderBookId
LEFT JOIN Processes p ON p.Id = rol.ProcessId
|
| EV#ReleasedAllocation |
|---|
SELECT UserName, SessionName, ScenarioName, TRUNC(SourcePeriod, 'month') SourceMonth, TRUNC(SourcePeriod, 'IW') SourceWeek,
TRUNC(DeliveryPeriod, 'month') DeliveryMonth, TRUNC(DeliveryPeriod, 'IW') DeliveryWeek,
SiteName, SiteCode, WorkcentreTypeName, WorkcentreName, WorkcentreCode,
System Allocation, NonMoveableWeight, IsLastStage
FROM IHSA#SourcingAllocation sa
JOIN Ih#Scenarios s
ON s.ScenarioSessionId = sa.ScenarioSessionId
AND NVL(sa.ScenarioId, s.Id) = s.Id
JOIN IH#SiteWorkcentres wc
ON wc.WorkcentreID = sa.WorkcentreId
|
| EV#ReplenishedCustomerDemands |
|---|
SELECT a.SiteMaterialUsageId, s.LocationCode, s.MaterialCode, s.LocationName, s.MaterialName, EndUseCode,
EndCustomer, SiteName, SiteCode, Demand, Forecast, Orders, Consumption, NettedOrders, DateFrom,
a.ConsumptionType, TRUNC(DateFrom, 'month') DateFromMonth
FROM ReplenishedCustomerDemands a
JOIN IH#sku s ON s.Id = a.Sitematerialusageid
LEFT JOIN Sites s ON s.Id = a.SiteId
WHERE EXISTS (SELECT 1 FROM ReplenishedCustomerSku rs WHERE rs.SiteMaterialUsageId = a.SiteMaterialUsageId)
AND NVL(a.SiteId, 0) = CASE WHEN a.ConsumptionType IN ('Forecast', 'Allocation') THEN 0 ELSE a.SiteId END
|
| EV#ReplenishedRequestedDate |
|---|
WITH
repruns AS (SELECT sr.MaterialRunId, sr.SiteId, SiteName, SiteCode, WorkcentreCode, mr.Blockruncode,
ProductName RunProductName, sr.Duration, CalculatedFinishDate FinishDate,
LEAD(TRUNC(CalculatedFinishDate))
OVER (PARTITION BY SiteCode, ProductName ORDER BY sr.StartDate, sr.FinishDate) NextFinishDate,
LAG(TRUNC(CalculatedFinishDate))
OVER (PARTITION BY SiteCode, ProductName ORDER BY sr.StartDate, sr.FinishDate) PrevFinishDate,
LEAD(sr.Duration)
OVER (PARTITION BY SiteCode, ProductName ORDER BY sr.StartDate, sr.FinishDate) NextDuration,
LAG(sr.Duration)
OVER (PARTITION BY SiteCode, ProductName ORDER BY sr.StartDate, sr.FinishDate) PrevDuration,
ROW_NUMBER() OVER (PARTITION BY SiteCode, ProductName ORDER BY sr.StartDate, sr.FinishDate) OrderNo
FROM Sourceruns sr
JOIN Sites s ON sr.SiteId = s.Id
JOIN workcentres wc ON wc.Id = WorkcentreId
JOIN materialRuns mr ON mr.Id = sr.MaterialRunId
JOIN materialrunproducts mrp ON mr.Id = mrp.MaterialRunId)
SELECT OrderCode, LineNoCode, RunProductName, SiteCode, WorkcentreCode, BlockRunCode, LocationCode,
LocationName, MaterialCode, RequestedDate, rr.FinishDate, PrevFinishDate, NextFinishDate, PrevDuration,
NextDuration, o.OperationDuration,
CASE
WHEN EXISTS (SELECT 1
FROM repruns rp
WHERE rp.SiteId = rr.SiteId
AND rp.RunProductName = rr.RunProductName
AND rp.FinishDate < rr.FinishDate
AND rp.Duration >= o.OperationDuration
AND RequestedDate < rr.FinishDate
AND RequestedDate > rp.FinishDate) THEN 'Late'
WHEN EXISTS (SELECT 1
FROM repruns rp
WHERE rp.SiteId = rr.SiteId
AND rp.RunProductName = rr.RunProductName
AND rp.FinishDate > rr.FinishDate
AND rp.BlockRunCode != rr.BlockRunCode
AND rp.Duration >= o.OperationDuration
AND RequestedDate > rp.FinishDate) THEN 'Early'
ELSE 'OnTime' END Description, ol.siteMaterialUsageId
FROM LastReplenishmentOperations o
JOIN LastReplenishmentOrders ol ON ol.Id = o.OrderLineId
JOIN repruns rr ON rr.MaterialRunId = o.MaterialRunId
JOIN materials m ON m.Id = ol.MaterialId
JOIN locations l ON l.Id = ol.LocationId
|
| EV#ReplenishedSubstitutedSku |
|---|
SELECT f.LocationName FromLocationName, f.LocationCode FromLocationCode, t.LocationName ToLocationName,
t.LocationCode ToLocationCode, f.MaterialName FromMaterialName, f.MaterialCode FromMaterialCode,
t.MaterialName ToMaterialName, t.MaterialCode ToMaterialCode, rs.*
FROM Replenishedsubstitutedsku rs
JOIN EV#SiteMaterialUsages f ON f.id = rs.SiteMaterialUsageId
JOIN EV#SiteMaterialUsages t ON t.id = rs.OnSiteMaterialUsageId
|
| EV#ReplenishmentReports |
|---|
SELECT s.MaterialId, s.LocationCode, s.MaterialCode, s.LocationName, s.MaterialName, WorkcentreCode,
WorkcentreName, SiteName, SiteCode, rr.*
FROM ReplenishmentReports rr
JOIN IH#sku s ON s.Id = rr.WarehouseSkuId
JOIN IH#Workcentres wc ON wc.LocationId = s.LocationId
|
| EV#RequestedDateTotal |
|---|
SELECT WorkcentreCode, RunProductName, BlockRunCode, FinishDate,
SUM(DECODE(Description, 'OnTime', 1, 0)) OnTime, SUM(DECODE(Description, 'Late', 1, 0)) Later,
SUM(DECODE(Description, 'Early', 1, 0)) Earlier
FROM EV#ReplenishedRequestedDate
GROUP BY WorkcentreCode, RunProductName, BlockRunCode, FinishDate
ORDER BY 1, 2, 4
|
| EV#RequestedInventoryProfiles |
|---|
SELECT ip.SiteMaterialUSageId, ip.ConsignmentLocationId, DateFrom DateFrom, ip.Opening,
DECODE((SELECT VALUE FROM SYSTEMPARAMETERS WHERE ParameterName = 'RPClosingCalcMethod'), 'DeliveryDate',
PlannedInventory, FIRST_VALUE(Opening)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom) +
SUM(TentativeOrdersIn + FirmOrdersIn)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -
(TentativeORdersIn + FirmOrdersIn) - SUM(Consumption)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) Closing,
DECODE((SELECT VALUE FROM SYSTEMPARAMETERS WHERE ParameterName = 'RPClosingCalcMethod'), 'DeliveryDate',
Opening, FIRST_VALUE(Opening)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom) +
SUM(RequestedOrdersIn + FirmOrdersIn)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -
SUM(Consumption + RequestedOrdersOut - TentativeOrdersOut)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -
(RequestedOrdersIn + FirmOrdersIn) +
(Consumption + RequestedOrdersOut - TentativeOrdersOut)) IdealOpening,
DECODE((SELECT VALUE FROM SYSTEMPARAMETERS WHERE ParameterName = 'RPClosingCalcMethod'), 'DeliveryDate',
Opening, FIRST_VALUE(Opening)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom) +
SUM(NVL(FinalOrders, 0) + FirmOrdersIn)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -
SUM(Consumption + RequestedOrdersOut - TentativeOrdersOut)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -
(NVL(FinalOrders, 0) + FirmOrdersIn) +
(Consumption + RequestedOrdersOut - TentativeOrdersOut)) RequestedOpening,
FirmOrdersIn FirmOrdersIn, RequestedOrdersIn IdealOrdersIn, NVL(ol.FinalOrders, 0) RequestedDateOrdersIn,
NVL(old.DeliveryOrders, 0) DeliveryOrdersIn,
SUM(RequestedOrdersIn)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom) CumulativeIdealOrders,
SUM(NVL(ol.FinalOrders, 0))
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom) CumulativeRequestedOrders,
SUM(NVL(old.DeliveryOrders, 0))
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom) CumulativeDeliveryOrders,
(ip.ConsumptionOrders - TentativeOrdersOut) FirmOrdersOut, RequestedOrdersOut TentativeOrdersOut,
ConsumptionForecast ForecastDemand,
DECODE((SELECT VALUE FROM SYSTEMPARAMETERS WHERE ParameterName = 'RPClosingCalcMethod'), 'DeliveryDate',
PlannedInventory, FIRST_VALUE(Opening)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom) +
SUM(RequestedOrdersIn + FirmOrdersIn)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -
(RequestedOrdersIn + FirmOrdersIn) -
SUM(Consumption + RequestedOrdersOut - TentativeOrdersOut)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) IdealClosing,
DECODE((SELECT VALUE FROM SYSTEMPARAMETERS WHERE ParameterName = 'RPClosingCalcMethod'), 'DeliveryDate',
PlannedInventory, FIRST_VALUE(Opening)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom) +
SUM(NVL(FinalOrders, 0))
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -
(NVL(FinalOrders, 0) + FirmOrdersIn) -
SUM(Consumption + RequestedOrdersOut - TentativeOrdersOut)
OVER (PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) RequestedClosing,
SafetyStock SafetyStock
FROM InventoryProfiles ip
LEFT JOIN (SELECT SiteMaterialUsageId, o.Toconsignmentlocationid ConsignmentLocationId, RequestedDate,
SUM(FinalWeight) FinalOrders
FROM OrderLines o
WHERE OrderLineStatusID = (SELECT TO_NUMBER(ol.Id)
FROM OrderLineStatuses ol, SystemParameters sp
WHERE ParameterName = 'ReplenishmentDefaultTentativeStatus'
AND ol.OrderLineStatusName = sp.Value)
GROUP BY SiteMaterialUsageId, o.Toconsignmentlocationid, RequestedDate) ol
ON ol.RequestedDate = ip.DateFrom AND ol.SiteMaterialUsageId = ip.SiteMaterialUsageId AND
NVL(ol.ConsignmentLocationId, 0) = NVL(ip.ConsignmentLocationId, 0)
LEFT JOIN (SELECT SiteMaterialUsageId, o.Toconsignmentlocationid ConsignmentLocationId, DeliveryDate,
SUM(FinalWeight) DeliveryOrders
FROM OrderLines o
WHERE OrderLineStatusID = (SELECT TO_NUMBER(ol.Id)
FROM OrderLineStatuses ol, SystemParameters sp
WHERE ParameterName = 'ReplenishmentDefaultTentativeStatus'
AND ol.OrderLineStatusName = sp.Value)
GROUP BY SiteMaterialUsageId, o.Toconsignmentlocationid, DeliveryDate) OLD
ON old.DeliveryDate = ip.DateFrom AND old.SiteMaterialUsageId = ip.SiteMaterialUsageId AND
NVL(old.ConsignmentLocationId, 0) = NVL(ip.ConsignmentLocationId, 0)
ORDER BY 1, 2, 3
|
| EV#RPCustomerDemandNoSuper |
|---|
SELECT *
FROM EV#ReplenishedCustomerDemands uh
WHERE NOT EXISTS (SELECT 1
FROM IH#ActiveSupercessions ms
WHERE ms.OnSiteMaterialUsageId = uh.SiteMaterialUsageId
OR ms.SiteMaterialUsageId = uh.SiteMaterialUsageId)
|
| EV#RPSourceRuns |
|---|
SELECT SiteName, SiteCode, WorkcentreName, WorkcentreCode,
NVL(mr.BlockRunCode, TO_CHAR(sr.MaterialRunId)) BlockRunCode, OriginalCapacity, Capacity,
OriginalDuration, Duration, sr.Rate, sr.StartDate, sr.FinishDate, CalculatedFinishDate,
mrp.ProductName RunProperties, sr.MaterialRunId
FROM SourceRuns sr
LEFT JOIN MaterialRuns mr ON mr.id = sr.MaterialRunId
JOIN IH#workcentres wc ON wc.WorkcentreId = sr.WorkcentreId
LEFT JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = sr.MaterialRunId
|
| EV#RPSourceRuns2 |
|---|
SELECT SiteName, SiteCode, WorkcentreCode, WorkcentreName, BlockrunCode, ProductName, sr.materialrunid,
InitialDuration, OriginalDuration, NVL(OperationDuration, 0) OperationDuration, Duration,
OriginalDuration - NVL(OperationDuration, 0) FreeDuration, sr.OriginalStartDate, sr.OriginalFinishDate,
sr.StartDate, sr.FinishDate, sr.CalculatedFinishDate, mrp.ProductName RunProductName, sr.Rate,
OriginalCapacity, Capacity, OperationWeight
FROM SourceRuns sr
LEFT JOIN (SELECT MaterialRunId, SUM(OperationDuration) OperationDuration, SUM(oo.Quantity) OperationWeight
FROM LastReplenishmentOperations oo
JOIN LastReplenishmentOrders ol ON ol.Id = oo.OrderLineId
WHERE ol.OrderLineStatusId = (SELECT ols.Id
FROM OrderLineStatuses ols, SystemParameters sp
WHERE ParameterName = 'ReplenishmentDefaultTentativeStatus'
AND ols.OrderLineStatusName = sp.Value)
GROUP BY MaterialRunId) t ON t.MaterialRunId = sr.MaterialRunId
JOIN IH#workcentres wc ON wc.WorkcentreId = sr.WorkcentreId
LEFT JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = sr.MaterialRunId
|
| EV#SelectiveData |
|---|
SELECT s.*, HistoryStartDate, StartDate, Successed, FirstPassId, SecondPassId, UseTradingDays
FROM SelectiveData sd
JOIN Ev#sitematerialusages s ON s.Id = sd.SiteMaterialUsageId
|
| EV#SiteMaterialUsages |
|---|
SELECT s.*, smu.Status, smu.Replenished, smu.ReplenishmentFlag,
NVL(m.ForecastStartDate, smu.ForecastStartDate) ForecastStartDate,
NVL(m.ForecastFinishDate, smu.ForecastFinishDate) ForecastFinishDate, smu.ForecastStatusId
FROM EV#Skus s
JOIN SiteMaterialUsages smu ON smu.Id = s.Id
JOIN Materials m ON smu.MaterialId = m.Id
|
| EV#SiteWarehouseSku |
|---|
WITH
skus AS (SELECT smu.Id SiteMaterialUsageId, l.SiteId, smu.LocationId, smu.MaterialId, wc.Id AS WorkcentreId,
m.MaterialTypeId, IsTool, IsFinishedGoods, SiteName, SiteCode, l.LocationName,
l.LocationCode, m.MaterialName, m.MaterialCode, mt.MaterialTypeName, wc.WorkcentreName,
wc.WorkcentreCode, Replenished
FROM SiteMaterialUsages smu
JOIN Locations l ON l.Id = smu.LocationId
JOIN Materials m ON m.Id = smu.MaterialId
JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId
JOIN Workcentres wc ON wc.LocationId = smu.LocationId
JOIN Sites s ON s.Id = l.SiteId
WHERE EXISTS (SELECT 1
FROM IH#Workcentres wc2
WHERE wc2.LocationId = smu.LocationId AND wc2.HasInventory = 1))
SELECT SiteMaterialUsageId, SiteId, LocationId, MaterialId, WorkcentreId, MaterialTypeId, IsTool,
IsFinishedGoods, SiteName, LocationName, LocationCode, MaterialName, MaterialCode, MaterialTypeName,
WorkcentreName, WorkcentreCode, NULL ConsignmentLocationId, NULL ConsigmentCustomerName,
NULL ConsignmentCustomerCode, Replenished
FROM skus
UNION ALL
SELECT s.SiteMaterialUsageId, s.SiteId, LocationId, MaterialId, WorkcentreId, MaterialTypeId, IsTool,
IsFinishedGoods, SiteName, s.LocationName, s.LocationCode, MaterialName, MaterialCode, MaterialTypeName,
WorkcentreName, WorkcentreCode, cp.CustomerId ConsignmentLocationId,
l.LocationName ConsigmentCustomerName, l.LocationCode ConsignmentCustomerCode, cp.Replenished
FROM Skus S
JOIN ConsignmentParameters cp ON cp.SiteMaterialUsageId = S.SiteMaterialUsageId
JOIN Locations l ON l.Id = cp.CustomerId
|
| EV#SkuForecastedFlagLogs |
|---|
SELECT LocationCode, MaterialCode, EndCustomerCode, l.OldValue, l.NewValue, Description, InsertUserId, TimeStamp
FROM SkuValuesLogs l
JOIN EV#SiteMaterialUsages smu ON l.SiteMaterialUsageId = smu.Id
WHERE l.FieldName = 'STATUS'
|
| EV#Skus |
|---|
SELECT smu.Id, l.LocationName, l.LocationCode, MaterialName, MaterialCode, eu.endusecode, eu.EndUseDescription,
ec.Locationcode EndCustomerCode, ec.LocationName EndCustomerName
FROM SiteMaterialUsages smu
JOIN Locations l ON (smu.LocationId = l.Id)
JOIN Materials m ON smu.MaterialId = m.Id
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId
|
| EV#SkuStatusChangedByForecast |
|---|
SELECT s.*, t.StartDate ForecastStartDateOn, f.StartDate ForecastStartDateOff
FROM EV#Skus s
JOIN SiteMaterialUsages smu ON s.Id = smu.Id
LEFT JOIN Forecasts t ON t.Id = smu.TurnOnForecastId
LEFT JOIN Forecasts f ON f.Id = smu.TurnOffForecastId
|
| EV#SkuValuesLog |
|---|
SELECT s.*, FieldName, OldValue, NewValue, Description, TimeStamp
FROM Skuvalueslogs l
JOIN EV#Skus s ON s.Id = l.SiteMaterialUsageId AND ConsignmentLocationId IS NULL
|
| EV#SNODemands |
|---|
SELECT UserName, SessionName, ScenarioName, TRUNC(DateFrom, 'month') DeliveryMonth, TRUNC(DateFrom, 'IW') DeliveryWeek,
Forecast, NonMoveableFirm Orders, Inventory, Demand, MandatoryDemand,
OptionalDemand, Netted, Aggregated, SNODemand, Revenue, Margin, Allocation
FROM SNODemands sd
JOIN Ih#scenarios s
ON s.ScenarioSessionId = sd.ScenarioSessionId
AND s.Id = sd.ScenarioId
|
| EV#SNOForecast |
|---|
SELECT UserName, SessionName, fb.SnapshotState,
TRUNC(fb.DateFrom, 'month') DeliveryMonth, TRUNC(fb.DateFrom, 'IW') DeliveryWeek,
fb.System, fb.Customer,
CASE WHEN fb.SnapshotState = 0 THEN 0 ELSE NVL(sd.NonMoveableFirm, 0) END Orders,
CASE WHEN fb.SnapshotState = 0 THEN fb.Customer ELSE NVL(sd.Demand, 0) END Demand,
CASE WHEN fb.SnapshotState = 0 THEN 0 ELSE NVL(sd.MandatoryDemand, 0) END MandatoryDemand,
CASE WHEN fb.SnapshotState = 0 THEN fb.Customer ELSE NVL(sd.Netted, 0) END Netted,
CASE WHEN fb.SnapshotState = 0 THEN fb.Customer ELSE NVL(sd.Aggregated, 0) END Aggregated,
CASE WHEN fb.SnapshotState = 0 THEN fb.Customer ELSE NVL(sd.SNODemand, 0) END SNODemand
FROM ForecastBodySnapshots fb
LEFT JOIN SNODemands sd
ON fb.SnapshotState = 1
AND sd.ScenarioSessionId = fb.ScenarioSessionId
AND sd.ScenarioId = -1
AND sd.Id = fb.Id
AND sd.CoProductId IS NULL
AND sd.DateFrom = fb.DateFrom
JOIN Ih#scenarios s
ON s.ScenarioSessionId = fb.ScenarioSessionId
|
| EV#SNPDemands |
|---|
SELECT si.SNPItem, si.LocationCode, si.MaterialCode,
d.DateFrom, d.Forecast, d.NonMoveableFirm, d.MoveableFirm,
d.Demand, d.Netted, d.Aggregated, d.TotalDemand, d.SNODemand,
d.OptionalDemand, d.MandatoryDemand,
si.SiteMaterialUsageId, d.ScenarioSessionId, d.ScenarioId, d.Id SNPItemId,
d.PreAllocatedDemand
FROM SnoDemands d
JOIN EV#SnpItems si
ON si.Id = d.Id
AND si.ScenarioSessionId = d.ScenarioSessionId
|
| EV#SNPForecast |
|---|
SELECT si.SNPItem, si.LocationCode, si.MaterialCode,
fb.DateFrom, fb.Customer,
GREATEST(sd.NonMoveableFirm - sd.MoveableFirm, 0) NonMoveableFirm,
sd.MoveableFirm, sd.NonMoveableFirm Orders,
sd.Netted, sd.Aggregated, NVL(ea.PreAllocated, 0) PreAllocated,
sd.Demand, sd.TotalDemand, sd.SNODemand,
si.Id, fb.ScenarioSessionId, sd.PreAllocatedDemand
FROM ForecastBodySnapshots fb
JOIN SNODemands sd
ON sd.ScenarioSessionId = fb.ScenarioSessionId
AND sd.ScenarioId = -1
AND sd.Id = fb.Id
AND sd.CoProductId IS NULL
AND sd.DateFrom = fb.DateFrom
LEFT JOIN
(
SELECT ScenarioSessionId, ScenarioId, Id, DeliveryDate,
SUM(Allocation) PreAllocated
FROM ExternalAllocationSnapshots
GROUP BY ScenarioSessionId, ScenarioId, Id, DeliveryDate
) ea
ON ea.ScenarioSessionId = sd.ScenarioSessionId
AND ea.ScenarioId = sd.ScenarioId
AND ea.Id = sd.Id
AND ea.DeliveryDate = sd.DateFrom
JOIN EV#SNPItems si
ON si.Id = fb.Id
AND si.ScenarioSessionId = fb.ScenarioSessionId
JOIN ScenarioSessions ss ON ss.Id = fb.ScenarioSessionId
WHERE fb.SnapshotState = 1
|
| EV#SNPInventorySnapshots |
|---|
SELECT smu.*, ScenarioName, UserName, i.DateFrom, PropertyValueId, InitialInventory, AvailableInventory, InventoryDeficit, DEMAND, Allocation, SafetyStock, OriginalSafetyStock FROM IHSA#InventorySnapshots i JOIN IH#Scenarios s ON s.USerId = i.ScenarioSessionId AND s.Id = i.ScenarioId JOIN EV#AllSiteMaterialUsages smu ON smu.Id = i.Sitematerialusageid AND NVL(smu.ConsignmentLocationId,0) = NVL(i.ConsignmentLocationId,0) |
| EV#SNPItems |
|---|
SELECT LocationCode, MaterialCode, EndUseCode, EndCustomerCode, si.Description SNPItem, IsDemandRecord, IsOptional,
IsForecast, IsWarehouse, HasInventory, si.IncludedInPrenetting, si.Status, si.SiteMaterialUsageId,
si.ScenarioSessionId, si.Id
FROM SNOItemsShort si
JOIN EV#SiteMaterialUsages smu
ON smu.Id = si.SiteMaterialUsageId
JOIN ScenarioSessions ss
ON ss.ID = si.ScenarioSessionId
|
| EV#SNPLIndicatives |
|---|
WITH
PARAMETERS AS (SELECT TRUNC(core.getInternalDate) CurrentDate,
StartWeek - INTERVAL '1' MINUTE FinishFrozenDate, StartWeek, StartWeek - 1 FinishWeek,
ID AS ScenarioSessionId, UserName
FROM IH#ScenarioSessions),
RemainingAllocation AS (SELECT ScenarioSessionId, SiteID, GradeId,
(Diff * Duration / OriginalDuration) Indicative, StartMonth, FinishMonth,
FinishWeek, CurrentDate, OriginalDuration, StartMonth1, FinishMonth1,
Duration, Allocation, Orders, Diff
FROM (SELECT ScenarioSessionId, SiteId, GradeId, pp.CurrentDate, pp.FinishWeek,
DeliveryMonth StartMonth, LAST_DAY(deliverymonth) FinishMonth,
LAST_DAY(deliverymonth) - DeliveryMonth + 1 OriginalDuration,
GREATEST(pp.CurrentDate, DeliveryMonth) StartMonth1,
LEAST(LAST_DAY(deliverymonth), pp.FinishWeek) FinishMonth1,
LEAST(LAST_DAY(deliverymonth), pp.FinishWeek) -
GREATEST(pp.CurrentDate, DeliveryMonth) + 1 Duration,
SUM(Allocation) Allocation, SUM(OrdersWeight) Orders,
SUM(Allocation) - SUM(OrdersWeight) Diff
FROM IVMP#Indicatives i
CROSS JOIN PARAMETERS pp
WHERE DeliveryMonth BETWEEN TRUNC(pp.CurrentDate, 'month') AND TRUNC(pp.FinishWeek, 'month')
GROUP BY ScenarioSessionId, SiteId, GradeId, DeliveryMonth,
LAST_DAY(DeliveryMonth), pp.FinishWeek, pp.CurrentDate) t
WHERE Allocation > Orders)
SELECT UserName, SiteName, SiteId, GradeCode, t.GradeID, CurrentDate, FinishWeek, StartMonth, FinishMonth,
OriginalDuration, StartMonth1, FinishMonth1, Duration, Allocation, Orders, Diff, Indicative
FROM RemainingAllocation t
JOIN Sites s ON s.Id = t.SiteId
JOIN GradeProperties g ON g.GradeId = t.GradeId
JOIN Users u ON u.Id = t.ScenarioSessionId
ORDER BY SiteName, GradeCode
|
| EV#SNPLOpening |
|---|
WITH
PARAMETERS AS (SELECT TRUNC(core.getInternalDate) CurrentDate,
StartWeek - INTERVAL '1' MINUTE FinishFrozenDate, StartWeek, StartWeek - 1 FinishWeek,
Id ScenarioSessionId, UserName, SessionName
FROM IH#ScenarioSessions),
Opening AS (SELECT ScenarioSessionId, m.MaterialCode, l.LocationCode, gm.GradeId, l.SiteId,
parameters.CurrentDate DateFrom, mt.IsFinishedGoods, NVL(Opening, 0) Opening
FROM SiteMaterialUsages smu
CROSS JOIN PARAMETERS
JOIN Materials m ON m.Id = smu.MaterialId
JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId
JOIN GradeMaterials gm ON gm.MaterialId = m.Id
JOIN Locations l ON l.Id = smu.LocationId
JOIN WorkCentres wc ON wc.LocationId = l.Id
LEFT JOIN RealInventoryProfiles rip
ON rip.SiteMaterialUsageId = smu.Id AND rip.DateFrom = Parameters.CurrentDate)
SELECT UserName, SiteName, t.MaterialCode, t.LocationCode, GradeCode, DateFrom, Opening
FROM Opening t
JOIN Sites s ON s.Id = t.SiteId
JOIN GradeProperties g ON g.GradeId = t.GradeId
JOIN Users u ON u.Id = t.ScenarioSessionId
ORDER BY SiteName, GradeCode
|
| EV#SNPLOrders |
|---|
WITH
PARAMETERS AS (SELECT TRUNC(core.getInternalDate) CurrentDate,
StartWeek - INTERVAL '1' MINUTE FinishFrozenDate, StartWeek, StartWeek - 1 FinishWeek,
ID AS ScenarioSessionId, UserName
FROM IH#ScenarioSessions),
Orders AS (SELECT ScenarioSessionId, wc.SiteId, GradeId, FinalWeight OrdersWeight, DespatchDate,
pp.StartWeek, ob.OrderCode, ol.LineNoCode
FROM OrderBooks ob
JOIN OrderLines ol ON ol.OrderBookId = ob.Id
CROSS JOIN PARAMETERS pp
JOIN OrderLineStatuses ols ON ols.ID = ol.OrderLineStatusId
JOIN GradeMaterials gm ON gm.MaterialId = ol.MaterialId
JOIN IH#Workcentres wc ON wc.WorkcentreId = ol.WorkcentreId
WHERE ols.OrderLineStatusCode = 'Firm'
AND DespatchDate < pp.StartWeek
AND OrderType = 'Customer')
SELECT UserName, SiteName, SiteId, GradeCode, t.GradeID, StartWeek, DespatchDate, t.OrderCode, t.LineNoCode,
OrdersWeight Orders
FROM Orders t
JOIN Sites s ON s.Id = t.SiteId
JOIN GradeProperties g ON g.GradeId = t.GradeId
JOIN Users u ON u.Id = t.ScenarioSessionId
ORDER BY SiteName, GradeCode
|
| EV#SNPLRunCapacity |
|---|
WITH
PARAMETERS AS (SELECT TRUNC(core.getInternalDate) CurrentDate,
StartWeek - INTERVAL '1' MINUTE FinishFrozenDate, StartWeek, StartWeek - 1 FinishWeek,
ID AS ScenarioSessionId, UserName
FROM IH#ScenarioSessions),
RunCapacity AS (SELECT ScenarioSessionId, mr.BlockRunCode, SiteId, GradeId, pp.CurrentDate,
pp.FinishFrozenDate, mr.StartDate OriginalStartDate,
mr.FinishDate OriginalFinishDate, mr.FinishDate - mr.StartDate OriginalDuration,
GREATEST(mr.StartDate, pp.CurrentDate) StartDate,
LEAST(mr.FinishDate, pp.FinishFrozenDate) FinishDate,
LEAST(mr.FinishDate, pp.FinishFrozenDate) -
GREATEST(mr.StartDate, pp.CurrentDate) Duration, Quantity OriginalCapacity,
Quantity * (LEAST(mr.FinishDate, pp.FinishFrozenDate) -
GREATEST(mr.StartDate, pp.CurrentDate)) /
(mr.FinishDate - mr.StartDate) Capacity
FROM MaterialRuns mr
CROSS JOIN PARAMETERS pp
JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = mr.Id
JOIN IH#Workcentres wc ON mr.WorkcentreID = wc.WorkcentreId
JOIN GradeProperties gp ON gp.Gradecode = mrp.ProductName
WHERE (mr.StartDate BETWEEN pp.CurrentDate AND pp.FinishFrozenDate OR
mr.FinishDate BETWEEN pp.CurrentDate AND pp.FinishFrozenDate))
SELECT UserName, SiteName, GradeCode, BlockRunCode, CurrentDate, FinishFrozenDate, OriginalStartDate,
OriginalFinishDate, OriginalDuration, StartDate, FinishDate, Duration, OriginalCapacity, Capacity
FROM RunCapacity t
JOIN Sites s ON s.Id = t.SiteId
JOIN GradeProperties g ON g.GradeId = t.GradeId
JOIN Users u ON u.Id = t.ScenarioSessionId
ORDER BY SiteName, GradeCode
|
| EV#SNPLTotal |
|---|
WITH
PARAMETERS AS (SELECT TRUNC(core.getInternalDate) CurrentDate,
StartWeek - INTERVAL '1' MINUTE FinishFrozenDate, StartWeek, StartWeek - 1 FinishWeek,
Id AS ScenarioSessionId, UserName
FROM IH#ScenarioSessions),
Opening AS (SELECT ScenarioSessionId, gm.GradeId, l.SiteId, parameters.CurrentDate DateFrom,
mt.IsFinishedGoods, SUM(NVL(Opening, 0)) Opening
FROM SiteMaterialUsages smu
CROSS JOIN PARAMETERS
JOIN Materials m ON m.Id = smu.MaterialId
JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId
JOIN GradeMaterials gm ON gm.MaterialId = m.Id
JOIN Locations l ON l.Id = smu.LocationId
JOIN WorkCentres wc ON wc.LocationId = l.Id
LEFT JOIN Realinventoryprofiles rip
ON rip.SiteMaterialUsageId = smu.Id AND rip.DateFrom = Parameters.CurrentDate
GROUP BY ScenarioSessionId, parameters.CurrentDate, gm.GradeId, l.SiteId, mt.IsFinishedGoods),
RunCapacity AS (SELECT ScenarioSessionId, SiteId, GradeId, SUM(Capacity) Capacity
FROM (SELECT ScenarioSessionId, SiteId, GradeId, pp.CurrentDate, pp.FinishFrozenDate,
mr.StartDate OriginalStartDate, mr.FinishDate OriginalFinishDate,
mr.FinishDate - mr.StartDate OriginalDuration,
GREATEST(mr.StartDate, pp.CurrentDate) StartDate,
LEAST(mr.FinishDate, pp.FinishFrozenDate) FinishDate,
LEAST(mr.FinishDate, pp.FinishFrozenDate) -
GREATEST(mr.StartDate, pp.CurrentDate) Duration, Quantity OriginalCapacity,
Quantity * (LEAST(mr.FinishDate, pp.FinishFrozenDate) -
GREATEST(mr.StartDate, pp.CurrentDate)) /
(mr.FinishDate - mr.StartDate) Capacity
FROM MaterialRuns mr
CROSS JOIN PARAMETERS pp
JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = mr.Id
JOIN IH#Workcentres wc ON mr.WorkcentreID = wc.WorkcentreId
JOIN GradeProperties gp ON gp.Gradecode = mrp.ProductName
WHERE (mr.StartDate BETWEEN pp.CurrentDate AND pp.FinishFrozenDate OR
mr.FinishDate BETWEEN pp.CurrentDate AND pp.FinishFrozenDate))
GROUP BY ScenarioSessionId, SiteId, GradeId),
Orders AS (SELECT ScenarioSessionId, wc.SiteId, GradeId, SUM(FinalWeight) OrdersWeight
FROM OrderLines ol
CROSS JOIN PARAMETERS pp
JOIN OrderLineStatuses ols ON ols.ID = ol.OrderLineStatusId
JOIN GradeMaterials gm ON gm.MaterialId = ol.MaterialId
JOIN IH#Workcentres wc ON wc.WorkcentreId = ol.WorkcentreId
WHERE ols.Orderlinestatuscode = 'Firm' AND DespatchDate < pp.StartWeek AND OrderType = 'Customer'
GROUP BY ScenarioSessionId, wc.SiteId, GradeId),
RemainingAllocation AS (SELECT ScenarioSessionId, SiteID, GradeId,
SUM(Diff * Duration / OriginalDuration) Allocation
FROM (SELECT ScenarioSessionId, SiteId, GradeId, pp.CurrentDate, pp.FinishWeek,
DeliveryMonth StartMonth, LAST_DAY(deliverymonth) FinishMonth,
LAST_DAY(deliverymonth) - DeliveryMonth + 1 OriginalDuration,
GREATEST(pp.CurrentDate, DeliveryMonth) StartMonth1,
LEAST(LAST_DAY(deliverymonth), pp.FinishWeek) FinishMonth1,
LEAST(LAST_DAY(deliverymonth), pp.FinishWeek) -
GREATEST(pp.CurrentDate, DeliveryMonth) + 1 Duration,
SUM(Allocation) Allocation, SUM(OrdersWeight) Orders,
SUM(Allocation) - SUM(OrdersWeight) Diff
FROM IVMP#Indicatives i
CROSS JOIN PARAMETERS pp
WHERE DeliveryMonth BETWEEN TRUNC(pp.CurrentDate, 'month') AND TRUNC(pp.FinishWeek, 'month')
GROUP BY ScenarioSessionId, SiteId, GradeId, DeliveryMonth,
LAST_DAY(deliverymonth), pp.FinishWeek, pp.CurrentDate) t
WHERE Allocation > Orders
GROUP BY ScenarioSessionId, SiteID, GradeId),
Totals AS (SELECT ScenarioSessionId, Siteid, GradeID, Opening, 0 Capacity, 0 OrdersWeight, 0 Allocation
FROM Opening
UNION ALL
SELECT ScenarioSessionId, Siteid, GradeID, 0 Opening, Capacity, 0 OrdersWeight, 0 Allocation
FROM RunCapacity
UNION ALL
SELECT ScenarioSessionId, Siteid, GradeID, 0 Opening, 0 Capacity, OrdersWeight, 0 Allocation
FROM Orders
UNION ALL
SELECT ScenarioSessionId, Siteid, GradeID, 0 Opening, 0 Capacity, 0 OrdersWeight, Allocation
FROM RemainingAllocation)
SELECT UserName, SiteName, GradeCode, SiteId, t.GradeID, SUM(Opening) Opening, SUM(Capacity) Capacity,
SUM(OrdersWeight) Orders, SUM(Allocation) Indicatives,
SUM(Opening) + SUM(Capacity) - SUM(OrdersWeight) - SUM(Allocation) SNPOpening
FROM Totals t
JOIN Sites s ON s.Id = t.SiteId
JOIN GradeProperties g ON g.GradeId = t.GradeId
JOIN Users u ON u.Id = t.ScenarioSessionId
GROUP BY UserName, SiteName, GradeCode, t.SiteId, t.GradeID
ORDER BY SiteName, GradeCode
|
| EV#SNPOrders |
|---|
SELECT ob.OrderCode, ol.LineNoCode, ob.OrderCode || '-' || ol.LineNoCode CodeAndLine, si.Description SNPItem,
DeliveryPeriod, SourcePeriod, NVL2(WorkcentreCode, WorkcentreCode || '-', '') || SiteCode Source, OperationTypeName Operation,
a.Weight, a.RemainingWeight, a.IsFirm, a.StageNo, a.IsLastStage,
a.IsLate, NVL(mo.IsDemand, 0) IsDemand,
NVL(mo.IsIgnoredForNetting, 0) IsIgnoredForNetting,
a.ScenarioSessionId, a.CoProductId,
a.OrderLineId, a.OrderOperationId
FROM Snoallordersnapshots a
LEFT JOIN SNOMovableOrderSnapshots mo
ON mo.ScenarioSessionId = a.ScenarioSessionId
AND mo.ScenarioId = -1
AND mo.OrderLineId = a.OrderLineId
AND NVL(mo.OrderOperationId, 0) = NVL(a.OrderOperationId, 0)
JOIN SnoItemsShort si
ON si.ScenarioSessionId = a.ScenarioSessionId
AND NVL(si.CoProductId, 0) = NVL(a.CoProductId, 0)
AND si.Id = a.SnoItemId
LEFT JOIN OrderLines ol
ON ol.Id = a.OrderLineId
LEFT JOIN OrderBooks ob
ON ob.Id = ol.OrderBookId
LEFT JOIN Sites s
ON s.Id = a.SiteId
LEFT JOIN Workcentres wc
ON wc.Id = a.WorkcentreId
LEFT JOIN OperationTypes ot
ON ot.Id = a.OperationTypeId
|
| EV#SNPProductionWorkcentres |
|---|
SELECT ScenarioSessionId, ScenarioId, WorkcentreCode, DateFrom, AvailableCapacityHours, CapacityHours, OrdersHours, AllocationHours FROM Machineinformation mi join IH#SiteWorkcentres wc ON mi.WorkcentreId = wc.WorkcentreId Where MachineType = 'PM' |
| EV#SourcingAllocation |
|---|
SELECT UserName, SessionName, ScenarioName, TRUNC(SourceDate, 'month') SourceMonth, TRUNC(SourceDate, 'IW') SourceWeek, TRUNC(DeliveryDate, 'month') DeliveryMonth, TRUNC(DeliveryDate, 'IW') DeliveryWeek, SiteName, SiteCode, WorkcentreTypeName, WorkcentreName, WorkcentreCode, Allocation, CycleInventory, Revenue, Margin, ProductionCost, InventoryCost FROM SourcingAllocation sa JOIN Ih#Scenarios s ON s.ScenarioSessionId = sa.ScenarioSessionId AND s.Id = sa.ScenarioId JOIN IH#SiteWorkcentres wc ON wc.WorkcentreID = sa.WorkcentreId |
| EV#StagedInventoryProfiles |
|---|
SELECT s.LocationCode, s.MaterialCode, s.LocationName, s.MaterialName, cs.LocationName ConsignmentCustomerName,
cs.LocationCode ConsignmentCustomerCode, WorkcentreCode, WorkcentreName, SiteName, SiteCode, ip.*
FROM StagedInventoryProfiles ip
JOIN IH#sku s ON s.Id = ip.Sitematerialusageid
LEFT JOIN Locations cs ON cs.Id = ip.ConsignmentLocationId
JOIN IH#Workcentres wc ON wc.LocationId = s.LocationId
|
| EV#StockMonitoringInventoryDetails |
|---|
SELECT ws.LocationCode, ws.LocationName, ws.MaterialCode, ws.MaterialName,
ws.SiteMaterialUsageId AS WarehouseSkuId, 'Inventory' AS SourceType,
CAST(NULL AS VARCHAR2(100)) AS SupplierCode, CAST(NULL AS VARCHAR2(100)) AS SupplierName,
i.Id AS InventoryId, CAST(NULL AS NUMBER) AS SupplierInventoryId, i.DateFrom, i.Weight,
i.AvailableOnHandWeight, i.ConsignmentLocationId, CAST(NULL AS NUMBER) AS Quantity,
CAST(NULL AS VARCHAR2(100)) AS CustomerCode, CAST(NULL AS VARCHAR2(200)) AS CustomerName
FROM Inventories i
JOIN EV#WarehouseSku ws ON ws.SiteMaterialUsageId = i.SiteMaterialUsageId
WHERE i.DateFrom = TRUNC(core.getInternalDate)
UNION ALL
SELECT ws.LocationCode, ws.LocationName, ws.MaterialCode, ws.MaterialName,
ws.SiteMaterialUsageId AS WarehouseSkuId, 'SupplierInventory' AS SourceType,
w.WorkcentreCode AS SupplierCode, w.WorkcentreName AS SupplierName, CAST(NULL AS NUMBER) AS InventoryId,
si.Id AS SupplierInventoryId, si.DateFrom, CAST(NULL AS NUMBER) AS Weight,
CAST(NULL AS NUMBER) AS AvailableOnHandWeight, CAST(NULL AS NUMBER) AS ConsignmentLocationId,
si.Quantity, c.LocationCode AS CustomerCode, c.LocationName AS CustomerName
FROM SupplierInventories si
JOIN Workcentres w ON w.Id = si.WorkcentreId
JOIN EV#WarehouseSku ws ON ws.LocationId = si.LocationId AND ws.MaterialId = si.MaterialId
LEFT JOIN Locations c ON c.Id = si.CustomerId
WHERE si.DateFrom = TRUNC(core.getInternalDate)
|
| EV#StockMonitoringOpeningBreakdown |
|---|
WITH
inventory AS (SELECT ws.SiteMaterialUsageId AS WarehouseSkuId, ws.LocationCode, ws.LocationName,
ws.MaterialCode, ws.MaterialName, NVL(i.StandardStock, 0) AS StandardStock,
NVL(i.CustomerStock, 0) AS CustomerStock, NVL(i.InTransitStock, 0) AS InTransitStock,
NVL(i.StandardStock, 0) + NVL(i.CustomerStock, 0) +
NVL(i.InTransitStock, 0) AS InventoryOpening
FROM EV#WarehouseSku ws
LEFT JOIN IH#LatestInventories i ON i.SiteMaterialUsageId = ws.SiteMaterialUsageId),
supplier AS (SELECT si.WarehouseSkuId, si.SupplierId, w.WorkcentreCode AS SupplierCode,
w.WorkcentreName AS SupplierName, SUM(NVL(si.InternalStock, 0)) AS InternalStock,
SUM(NVL(si.ExternalStock, 0)) AS ExternalStock
FROM IH#LatestSupplierInventories si
JOIN Workcentres w ON w.Id = si.SupplierId
GROUP BY si.WarehouseSkuId, si.SupplierId, w.WorkcentreCode, w.WorkcentreName),
profile AS (SELECT rip.SiteMaterialUsageId AS WarehouseSkuId, SUM(rip.OverAllOpening) AS ProfileOpening
FROM RealInventoryProfilesIPlanView rip
WHERE rip.DateFrom = TRUNC(core.getInternalDate)
GROUP BY rip.SiteMaterialUsageId)
SELECT i.LocationCode, i.LocationName, i.MaterialCode, i.MaterialName, s.SupplierCode, s.SupplierName,
i.WarehouseSkuId, i.StandardStock, i.CustomerStock, i.InTransitStock, i.InventoryOpening,
s.InternalStock, s.ExternalStock,
SUM(NVL(s.InternalStock, 0)) OVER (PARTITION BY i.WarehouseSkuId) AS TotalInternalStock,
SUM(NVL(s.ExternalStock, 0)) OVER (PARTITION BY i.WarehouseSkuId) AS TotalExternalStock,
i.InventoryOpening +
SUM(NVL(s.InternalStock, 0)) OVER (PARTITION BY i.WarehouseSkuId) AS OpeningBeforeMovements,
p.ProfileOpening AS OpeningShownInStockMonitoring,
p.ProfileOpening - (i.InventoryOpening +
SUM(NVL(s.InternalStock, 0)) OVER (PARTITION BY i.WarehouseSkuId)) AS MovementAdjustment
FROM inventory i
LEFT JOIN supplier s ON s.WarehouseSkuId = i.WarehouseSkuId
LEFT JOIN profile p ON p.WarehouseSkuId = i.WarehouseSkuId
|
| EV#StockMovements |
|---|
SELECT sm.Id, sm.InsertDate, sm.DateFrom AS MovementDate, u.UserLogin, u.UserName, ws.Id AS WarehouseSkuId,
ws.LocationCode AS WarehouseCode, ws.MaterialCode AS ProductCode,
fcl.LocationCode AS FromConsignmentCustomerCode, tcl.LocationCode AS ToConsignmentCustomerCode,
sm.Weight, sm.Description
FROM StockMovements sm
JOIN EV#SiteMaterialUsages ws ON ws.Id = sm.SiteMaterialUsageId
LEFT JOIN Locations fcl ON fcl.Id = sm.FromConsignmentLocationId
LEFT JOIN Locations tcl ON tcl.Id = sm.ToConsignmentLocationId
LEFT JOIN Users u ON u.Id = sm.InsertUserId
|
| EV#supersededopeningprofiles |
|---|
SELECT smu.LocationName, smu.LocationCode, smu.MaterialName, smu.MaterialCode, smu.ConsignmentCustomerName,
smu.ConsignmentCustomerCode, r.*
FROM Ih#supersededopeningprofiles r
JOIN EV#AllSiteMaterialUsages smu
ON smu.Id = r.SiteMaterialUsageId AND NVL(smu.ConsignmentLocationId, 0) = NVL(r.ConsignmentLocationId, 0)
|
| EV#TentativeOrderLines |
|---|
SELECT LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode, EndUseDescription, EndCustomerCode,
EndCustomerName, WorkcentreName, WorkcentreCode, BlockRunCode, OrderLineStatusName, ol.*,
NVL(oo.MaterialRunId, 0) MaterialRunId
FROM OrderLines ol
JOIN EV#SiteMaterialUsages smu ON ol.SiteMaterialUsageId = smu.Id
LEFT JOIN OrderOperations oo ON oo.OrderLineId = ol.Id
LEFT JOIN MaterialRuns mr ON mr.Id = oo.MaterialRunId
JOIN OrderLineStatuses ols ON ols.Id = ol.OrderLineStatusId
JOIN Workcentres wc ON wc.id = NVL(oo.WorkcentreId, ol.WorkcentreId)
WHERE OrderLineStatusName IN
(SELECT Value FROM SystemParameters sp WHERE ParameterName = 'ReplenishmentDefaultTentativeStatus')
|
| EV#TodayInventories |
|---|
SELECT smu.*, i.StockType, i.Weight, i.DateFrom, i.InsertDate, i.UpdateDate
FROM Inventories i
JOIN EV#WarehouseSKU smu ON smu.SiteMaterialUsageId = i.Sitematerialusageid AND
NVL(smu.ConsignmentLocationId, 0) = NVL(i.ConsignmentLocationId, 0)
WHERE i.DateFrom = core.getTruncatedInternalDate() AND i.StockType = 'Standard'
|
| EV#TodayReplenishedInventories |
|---|
SELECT smu.*, i.StockType, i.Weight, i.DateFrom, i.InsertDate, i.UpdateDate
FROM Inventories i
JOIN EV#WarehouseSKU smu ON smu.SiteMaterialUsageId = i.Sitematerialusageid AND
NVL(smu.ConsignmentLocationId, 0) = NVL(i.ConsignmentLocationId, 0)
WHERE i.DateFrom = core.getTruncatedInternalDate() AND i.StockType = 'Standard' AND smu.Replenished = 1
|
| EV#ToolInventorySnapshots |
|---|
SELECT ScenarioSessionId, LocationCode, MaterialCode, DateFrom, Opening, Incoming, Outgoing, Closing, Usage, Available
FROM IHSA#DailyToolsInventory t
join EV#Skus smu
on smu.Id = t.SiteMaterialUsageId
order by 1,2,3,4
|
| EV#Toolsku |
|---|
SELECT s.*, SiteName, SiteCode, t.*
FROM IH#ToolSku t
JOIN EV#Skus s ON s.Id = t.SiteMaterialUsageId
JOIN Sites ON t.SiteId = Sites.Id
|
| EV#TransportTimeTable |
|---|
SELECT t.LocationName ToLocationName, t.LocationCode ToLocationCode, f.LocationName FromLocationName,
f.LocationCode FromLocationCode, j.JOURNEYCODE, j.TimePeriod DurationInDays, tt.*
FROM TransportTimeTable tt
JOIN IH#Journeys j ON tt.JourneyId = j.JourneyId
JOIN locations f ON f.ID = tt.FromLocationId
JOIN locations t ON t.Id = tt.ToLocationId
|
| EV#UsageHistories |
|---|
SELECT smu.Id SiteMaterialUsageId, LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode,
EndUseDescription, EndCustomerCode, EndCustomerName, DateFrom, Weight, AdjustedWeight, Price,
WorkcentreCode, WorkcentreName
FROM UsageHistories uh
JOIN EV#SiteMaterialUSages smu ON smu.Id = uh.SiteMaterialUsageID
LEFT JOIN Workcentres wc ON wc.Id = uh.WorkcentreId
|
| EV#UsageHistoriesNoSuper |
|---|
SELECT *
FROM EV#UsageHistories uh
WHERE NOT EXISTS (SELECT 1
FROM IH#ActiveSupercessions ms
WHERE ms.OnSiteMaterialUsageId = uh.SiteMaterialUsageId
OR ms.SiteMaterialUsageId = uh.SiteMaterialUsageId)
|
| EV#WarehouseSku |
|---|
SELECT SiteMaterialUsageId, ConsignmentLocationId, l.LocationName, l.LocationCode, MaterialName, MaterialCode,
cl.LocationName CustomerName, cl.LocationCode CustomerCode, Replenished, IsActiveSku, smu.GroupKey,
smu.LocationId, smu.MaterialId
FROM IH#WHSkus smu
JOIN Locations l ON (smu.LocationId = l.Id)
JOIN Materials m ON smu.MaterialId = m.Id
LEFT JOIN Locations cl ON cl.Id = smu.ConsignmentLocationId
|
| EV#WarehouseSkus |
|---|
SELECT smu.Id, l.LocationName, l.LocationCode, MaterialName, MaterialCode, eu.endusecode, eu.EndUseDescription,
ec.Locationcode EndCustomerCode, ec.LocationName EndCustomerName
FROM SiteMaterialUsages smu
JOIN Locations l ON (smu.LocationId = l.Id)
JOIN Materials m ON smu.MaterialId = m.Id
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId
WHERE EXISTS (SELECT 1 FROM IH#SiteWorkcentres wc WHERE wc.LocationId = smu.LocationId AND HasInventory = 1)
|
| EV#WeeklyForecastBodies |
|---|
SELECT fb.SiteMaterialUSageId, LocationName, LocationCode, MaterialName, MaterialCode, EndUseCode,
EndUseDescription, EndCustomerCode, EndCustomerName, s.DateFromIW AS DateFromWeek,
fb.DateFrom AS DateFromMonth, OriginalSystem * s.Coef AS OriginalSystem, SYSTEM * s.Coef AS SYSTEM,
Customer * c.Coef AS Customer, FINAL * f.Coef AS FINAL, smu.Status
FROM ForecastBodies fb
JOIN EV#SiteMaterialUSages smu ON smu.Id = fb.SiteMaterialUsageID
JOIN ForecastWeeklyCoefs s ON s.Id = fb.SystemWeeklyCoefId AND fb.DateFrom = s.DateFrom
JOIN ForecastWeeklyCoefs c ON c.Id = fb.SystemWeeklyCoefId AND fb.DateFrom = c.DateFrom
JOIN ForecastWeeklyCoefs f ON f.Id = fb.SystemWeeklyCoefId AND fb.DateFrom = f.DateFrom
WHERE fb.ForecastId = forecasting.getLatestForecast()
AND s.DateFromIW = f.DateFromIW
AND c.DateFromIw = f.DatefromIw
AND s.Datefrom = f.DateFrom
AND c.Datefrom = f.DateFrom
|
| EV#WorkcentreTimeTable |
|---|
SELECT fw.WorkcentreName FromWorkcentreName, fw.WorkcentreCode FromWorkcentreCode,
tw.WorkcentreName ToWorkcentreName, tw.WorkcentreCode ToWorkcentreCode, j.JOURNEYCODE,
j.TimePeriod DurationInDays, tt.*
FROM TransportTimeTable tt
JOIN IH#Journeys j ON tt.JourneyId = j.JourneyId
JOIN locations f ON NVL(f.TransportLocationId, f.ID) = tt.FromLocationId
JOIN locations t ON NVL(t.TransportLocationId, t.Id) = tt.ToLocationId
JOIN workcentres fw ON fw.LocationId = f.Id
JOIN workcentres tw ON tw.LocationId = t.Id
|
| EV#WrongConsignmentCustomer |
|---|
SELECT v.LocationName, v.LocationCode, v.MAterialName, v.MaterialCode, l.LocationName CustomerName,
l.LocationCode CustomerCode
FROM Consignmentparameters cp
JOIN EV#Skus v ON v.Id = cp.SiteMaterialUSageID
JOIN Locations l ON l.Id = cp.CustomerId
WHERE EXISTS (SELECT 1 FROM IH#Workcentres wc WHERE wc.LocationId = cp.CustomerId)
|
| EV#WrongConsignmentSku |
|---|
SELECT v.LocationName, v.LocationCode, v.MAterialName, v.MaterialCode, l.LocationName CustomerName,
l.LocationCode CustomerCode
FROM Consignmentparameters cp
JOIN EV#Skus v ON v.Id = cp.SiteMaterialUSageID
JOIN SiteMaterialUSages smu ON v.Id = smu.Id
JOIN Locations l ON l.Id = cp.CustomerId
WHERE NOT EXISTS (SELECT 1 FROM IH#Workcentres wc WHERE wc.LocationId = smu.LocationId)
|
| EVC#OverloadedStocks |
|---|
SELECT ip.*, ip.roundOrderUnits(ip.SiteMaterialUsageId, ip.ConsignmentLocationId, 0) MinORderQuantity
FROM EV#InventoryProfiles ip
WHERE DateFrom = (SELECT MAX(DateFrom) FROM InventoryProfiles)
AND PlannedInventory - SafetyStock > ip.roundOrderUnits(ip.SiteMaterialUsageId, ip.ConsignmentLocationId, 0)
|
| EVC#SourcePriorityDates |
|---|
WITH
q AS (SELECT SourceSiteMAterialUSageId, MIN(DateFrom - TimePeriod) DateFrom, MIN(DateTo - TimePeriod) DateTo
FROM Replenishedcustomersku
GROUP BY SourceSiteMAterialUSageId)
SELECT ip.*, q.DateFrom SourceDateFrom, q.DateTo SourceDateTo
FROM InventoryPRofiles ip
JOIN q ON ip.SiteMaterialUsageId = q.SourceSiteMaterialUsageId
WHERE ConsumptionForecast > 0 AND (ip.DateFrom < q.DateFrom OR ip.DateFrom > q.DateTo)
|
| EVC#StockViolations |
|---|
SELECT *
FROM EV#InventoryProfiles
WHERE tentativeordersout > 0 AND plannedinventory < 0
|
| EVC#StockViolationsRuns |
|---|
SELECT ol.Id, s.LocationName, s.MaterialName, ol.SiteMaterialUsageId, ol.MaterialId, ol.WorkcentreId,
ol.RequestedDate, ol.DeliveryDate, ol.FinalWeight
FROM OrderLines ol
JOIN IH#Sku s ON s.Id = ol.SiteMaterialUSageID
WHERE OrderLineStatusId = 1
AND RequestedDate < DeliveryDate
AND EXISTS (SELECT 1
FROM SourceRuns sr
JOIN SourceRunMaterials rm ON rm.materialrunid = sr.MaterialRunId
WHERE rm.MaterialId = ol.MAterialId
AND sr.Capacity > ip.roundOrderUnits(ol.Sitematerialusageid, ol.ToConsignmentLocationId, 1)
AND sr.Calculatedfinishdate < ol.Requesteddate
AND sr.WorkcentreID = ol.WorkcentreId)
AND EXISTS (SELECT 1
FROM IH#Workcentres wc
WHERE wc.WorkcentreTypeName = 'Paper Machine' AND wc.WorkcentreId = ol.WorkcentreId)
AND EXISTS (SELECT 1
FROM EV#REQUESTEDINVENTORYPROFILES ip
WHERE ip.SiteMaterialUSageId = ol.SiteMaterialUsageId
AND NVL(ip.Consignmentlocationid, 0) = NVL(ol.Toconsignmentlocationid, 0)
AND Closing < SafetyStock
AND datefrom BETWEEN ol.RequestedDate AND ol.DeliveryDate)
|
| ExcludedSAMaterialsIPlanView |
|---|
select * from materials m where exists(select 1 from expandedmaterials em,propertyvalues pv, excludedpropertiesfromsa sa where em.materialid = m.id and em.propertyvalueid = pv.id and sa.propertyid = pv.propertyid and sa.value = pv.value) |
| ExcludedSKUFromSAIPlanView |
|---|
select * from Sitematerialusages smu where exists(select 1 from expandedmaterials em,propertyvalues pv, excludedpropertiesfromsa sa where em.materialid = smu.materialid and em.propertyvalueid = pv.id and sa.propertyid = pv.propertyid and sa.value = pv.value) |
| ExpandedEndUseSKUIPlanView |
|---|
SELECT smu.Id SiteMaterialUsageId, smu.ForecastStatusId, EndUseId, m.*, l.*, MaterialName ProductName, MaterialCode ProductCode,
e.*, smu.Status, CurrencyName, ll.CurrencyId,
ec.*, smu.SkuProperty1, smu.SkuProperty2,
smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5
FROM SiteMaterialUsages smu
LEFT JOIN MaterialPropsSpec m
ON smu.MaterialId = m.MaterialId
LEFT JOIN Expandedlocationsspec l
ON smu.LocationId = l.LocationId
JOIN (SELECT loc.Id, NVL(loc.CurrencyId, dc.CurrencyId) CurrencyId
FROM Locations loc, (SELECT Id CurrencyId FROM Currencies WHERE IsInternal = 1) dc) ll
ON (ll.Id = smu.LocationId)
JOIN Currencies c
ON (c.ID = ll.CurrencyId)
JOIN MaterialTypes mt
ON (m.MaterialTypeId = mt.Id)
LEFT JOIN Enduses e
ON (e.ID = smu.EndUseId)
LEFT JOIN IH#EndCustomerHierarchies ec
ON ec.EndCustomerId = NVL(smu.EndCustomerId, smu.LocationId)
|
| GradeCostsIPlanView |
|---|
SELECT GradeId, GradeCode, WorkcentreId,
DateFrom, NVL(LEAD(DateFrom, 1) over( PARTITION BY GradeId, WorkcentreId order by DateFrom), to_date('01-01-2050', 'DD-MM-YYYY')) - 1 DateTo,
Cost, RuleWeighting
FROM
(
SELECT GradeId, GradeCode, WorkcentreId, DateFrom, Cost, RuleWeighting,
RANK() over(PARTITION BY GradeId, WorkcentreId ORDER BY RuleWeighting DESC) r
FROM
(
SELECT DISTINCT GradeId, GradeCode, cr.WorkcentreId, cr.Id, cr.effective AS DateFrom, cr.Cost, cr.RuleWeighting
FROM IH#DetailsMaterial e, CostRules cr, GradeMaterials gm
WHERE e.MaterialId = gm.MaterialId
AND cr.DetailId = e.DetailId
) t)
WHERE R = 1
|
| GridsIPlanView |
|---|
SELECT g.Name GridName, p.PageName, IsColumnsAsRows, 'Grids.' || g.Name || '.' || gc.FieldName LanguageKey, gc.* FROM Grids g JOIN GridColumns gc ON (g.Id = gc.GridId) LEFT JOIN Pages p ON (p.Id = g.PageId) |
| GroupedConsignmentSKUIPlanView |
|---|
SELECT *
FROM (SELECT SKuKey, SiteMaterialUsageId, cv.ConsignmentLocationId, cv.MaterialId, cv.LocationId,
cv.WarehouseLocationId, Replenished,
NVL(cv.AlternateProduct,cv.MaterialId) || '-' || NVL(cv.ConsignmentLocationId, 0) || '-' || WarehouseLocationId WarehouseGroupKey,
WarehouseLocationId AS GroupId,
SUM(Replenished)
over(PARTITION BY WarehouseLocationId, NVL(cv.AlternateProduct,cv.MaterialId), cv.ConsignmentLocationId) IncludedInGroup,
GroupKey
FROM IH#skus cv
WHERE WarehouseLocationID IS NOT NULL
/* Excluded because it join into warehouse group by alternate products. ? */
UNION ALL
SELECT SKuKey, SiteMaterialUsageId, cv.ConsignmentLocationId, cv.MaterialId, cv.LocationId,
cv.WarehouseLocationId, Replenished,
cv.AlternateProduct || '-' || NVL(cv.ConsignmentLocationId, 0) || '-' || cv.LocationId WarehouseGroupKey,
WarehouseLocationId AS GroupId,
SUM(Replenished) over(PARTITION BY cv.LocationId, cv.AlternateProduct, cv.ConsignmentLocationId) IncludedInGroup,
GroupKey
FROM IH#Skus cv
WHERE WarehouseLocationID IS NULL
AND cv.AlternateProduct IS NOT NULL
)
WHERE IncludedInGroup = 1
|
| HierarchyLevelsIPlanView |
|---|
SELECT Id, HierarchyLevelName,
REGEXP_REPLACE(HierarchyLevelName, '[^[:alnum:]_]', '') AS HierarchyName,
UPPER('H_' || REGEXP_REPLACE(HierarchyLevelName, '[^[:alnum:]_]', '')) AS HierarchyViewName,
UPPER('H_' || REGEXP_REPLACE(HierarchyLevelName, '[^[:alnum:]_]', '') || 'CODE') AS HierarchyViewCode,
HierarchyLevelName as HierarchyDesc,
'HierarchyCode' || ROW_NUMBER() Over(ORDER BY Id) FieldHierarchyCode,
'HierarchyName' || ROW_NUMBER() Over(ORDER BY Id) FieldHierarchyValue,
ROW_NUMBER() Over(ORDER BY Id) OrderNo,
HierarchyLevelNo,
'H' Prefix
FROM HierarchyLevels
|
| ICS#ReplenishmentLastClosingViolations |
|---|
WITH ProfileClosing AS (
SELECT ipf.SiteMaterialUsageId,
ipf.ConsignmentLocationId,
ipf.DateFrom,
ipf.Opening,
ipf.PlannedInventory,
ipf.TentativeOrdersIn,
ipf.FirmOrdersIn,
ipf.Consumption,
ipf.SafetyStock,
NVL(vi.VirtualIncoming, 0) VirtualIncoming,
CASE
WHEN p.RPClosingCalculationMethod = 'AfterDeliveryDate'
THEN FIRST_VALUE(ipf.Opening) OVER (
PARTITION BY ipf.SiteMaterialUsageId,
NVL(ipf.ConsignmentLocationId, 0)
ORDER BY ipf.DateFrom
)
+ SUM(ipf.TentativeOrdersIn + ipf.FirmOrdersIn) OVER (
PARTITION BY ipf.SiteMaterialUsageId,
NVL(ipf.ConsignmentLocationId, 0)
ORDER BY ipf.DateFrom
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
)
- (ipf.TentativeOrdersIn + ipf.FirmOrdersIn)
- SUM(ipf.Consumption) OVER (
PARTITION BY ipf.SiteMaterialUsageId,
NVL(ipf.ConsignmentLocationId, 0)
ORDER BY ipf.DateFrom
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
)
ELSE ipf.PlannedInventory
END ProfileClosing,
p.RPClosingCalculationMethod
FROM InventoryProfiles ipf
CROSS JOIN (
SELECT NVL(MIN(Value), 'DeliveryDate') RPClosingCalculationMethod
FROM SystemParameters
WHERE ParameterName = 'RPClosingCalculationMethod'
) p
LEFT JOIN (
SELECT ol.SiteMaterialUsageId,
NVL(ol.ToConsignmentLocationId, 0) ConsignmentLocationId,
ol.DeliveryDate,
SUM(ol.FinalWeight) VirtualIncoming
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
JOIN SystemParameters sp
ON sp.ParameterName = 'ReplenishmentDefaultTentativeStatus'
AND ols.OrderLineStatusName = sp.Value
WHERE ol.AlternateCode1 LIKE 'Virtual Order%'
GROUP BY ol.SiteMaterialUsageId,
NVL(ol.ToConsignmentLocationId, 0),
ol.DeliveryDate
) vi
ON vi.SiteMaterialUsageId = ipf.SiteMaterialUsageId
AND vi.ConsignmentLocationId = NVL(ipf.ConsignmentLocationId, 0)
AND vi.DeliveryDate = ipf.DateFrom
), CumulativeProfile AS (
SELECT pc.*,
SUM(pc.VirtualIncoming) OVER (
PARTITION BY pc.SiteMaterialUsageId,
NVL(pc.ConsignmentLocationId, 0)
ORDER BY pc.DateFrom
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) CumulativeVirtualIncoming
FROM ProfileClosing pc
), AdjustedProfile AS (
SELECT cp.*,
CASE
WHEN cp.RPClosingCalculationMethod = 'AfterDeliveryDate'
THEN cp.ProfileClosing
- cp.CumulativeVirtualIncoming
+ cp.VirtualIncoming
ELSE cp.ProfileClosing - cp.CumulativeVirtualIncoming
END Closing
FROM CumulativeProfile cp
), LastProfile AS (
SELECT pc.*,
ROW_NUMBER() OVER (
PARTITION BY pc.SiteMaterialUsageId,
NVL(pc.ConsignmentLocationId, 0)
ORDER BY pc.DateFrom DESC
) RowNumber
FROM AdjustedProfile pc
), EvaluatedProfile AS (
SELECT lp.*,
wh.LocationName,
wh.MaterialName,
wh.MaterialCode,
ip.roundOrderUnits(
lp.SiteMaterialUsageId,
lp.ConsignmentLocationId,
1) OneUnit
FROM LastProfile lp
JOIN EV#WarehouseSku wh
ON wh.SiteMaterialUsageId = lp.SiteMaterialUsageId
AND NVL(wh.ConsignmentLocationId, 0) =
NVL(lp.ConsignmentLocationId, 0)
WHERE lp.RowNumber = 1
)
SELECT LocationName,
MaterialName,
MaterialCode,
SiteMaterialUsageId,
ConsignmentLocationId,
DateFrom,
RPClosingCalculationMethod ClosingCalculationMethod,
Opening,
PlannedInventory,
TentativeOrdersIn,
FirmOrdersIn,
Consumption,
SafetyStock,
VirtualIncoming,
CumulativeVirtualIncoming,
ProfileClosing RawClosing,
OneUnit,
Closing,
CASE
WHEN Closing <= SafetyStock
THEN 'Closing less or equal SafetyStock'
WHEN Closing > SafetyStock + OneUnit
THEN 'Closing too high'
END Reason
FROM EvaluatedProfile
WHERE Closing <= SafetyStock
OR Closing > SafetyStock + OneUnit
|
| ICS#ReplenishmentRequestedDate |
|---|
SELECT DISTINCT
wh.LocationName,
wh.MaterialName,
wh.MaterialCode,
ol.Id OrderLineId,
ol.SiteMaterialUsageId,
ol.ToConsignmentLocationId ConsignmentLocationId,
sr.MaterialRunId,
ol.DeliveryDate,
ol.RequestedDate,
sr.FinishDate
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
JOIN SystemParameters sp
ON sp.ParameterName = 'ReplenishmentDefaultTentativeStatus'
AND ols.OrderLineStatusName = sp.Value
JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
JOIN IH#SourceRunProducts sr
ON sr.MaterialRunId = oo.MaterialRunId
JOIN EV#WarehouseSku wh
ON wh.SiteMaterialUsageId = ol.SiteMaterialUsageId
AND NVL(wh.ConsignmentLocationId, 0) =
NVL(ol.ToConsignmentLocationId, 0)
WHERE ol.Phase <> 4
AND ol.RequestedDate < ol.DeliveryDate
AND EXISTS (
SELECT 1
FROM IH#SourceRunProducts sr2
WHERE sr2.SiteId = sr.SiteId
AND sr2.ProductName = sr.ProductName
AND sr2.Capacity >
ip.roundOrderUnits(
ol.SiteMaterialUsageId,
ol.ToConsignmentLocationId,
1)
AND sr2.FinishDate < sr.FinishDate
)
|
| IE#Materials |
|---|
SELECT m.Id, m.MaterialCode ProductCode, s.MaterialCode SourceProductCode, mt.MaterialTypeName ProductType,
ms.MaterialTypeName SourceProductType, m.SourceMaterialId
FROM Materials m
JOIN MaterialTypes mt
ON (m.MaterialTypeId = mt.Id)
LEFT JOIN Materials s
ON (m.SourceMaterialId = s.Id)
LEFT JOIN MaterialTypes ms
ON (s.MaterialTypeId = ms.Id)
|
| IE#OrderLines |
|---|
SELECT ol.Id, ob.Ordercode, ol.LineNoCode, ob.OrderCode || '-' || ol.LineNoCode OrderLineCode, ols.OrderLineStatusName, wc.WorkcentreCode, l.LocationName, FinalWeight, ol.MaterialId, ol.LocationId, ol.WorkcentreId OrderLineStatusId, NVL(InitialOrderLineStatusId,0) InitialOrderLineStatusId, SkuKey, SourceSkuKey, DeliveryDate, ConsumptionDate, m.MaterialCode ProductCode, mt.MaterialTypeName ProductType, ols.OrderLineStatusCode, olsi.OrderLineStatusName InitialOrderLineStatus FROM OrderLines ol, OrderLineStatuses ols, Workcentres wc, Locations l, OrderBooks ob, Materials m, MaterialTypes mt, OrderLineStatuses olsi WHERE ol.OrderBookId = ob.Id AND ol.OrderLineStatusId = ols.Id AND wc.Id = ol.WorkcentreId AND l.Id = ol.LocationId AND m.Id = ol.MaterialId AND mt.Id = m.MaterialTypeId AND ol.InitialOrderLineStatusId = olsi.Id (+) |
| IE#Sku |
|---|
SELECT l.LocationCode Location, m.MaterialCode Product, MaterialTypeName, smu.LocationId, smu.MaterialId, m.MaterialTypeId, eu.Id EndUseId, smu.Status Forecasted, Replenished, EndCustomerId, smu.Id FROM SiteMaterialUsages smu JOIN Materials m ON (m.Id = smu.MaterialId) JOIN Locations l ON (l.Id = smu.LocationID) JOIN MaterialTypes mt ON (mt.Id = m.MaterialTypeId) LEFT JOIN endUses eu ON (eu.Id = smu.EndUseid) LEFT JOIN Locations e ON (e.Id = smu.EndCustomerID) |
| IE#SupercessionRules |
|---|
SELECT sr.Id, TestCode, StartDate, Percentage, AutoCreateSku, HierarchyLevels, HierarchyCodes, Properties,
FromPropertyCodes, ToPropertyCodes
FROM SupercessionRules sr
|
| IH#ActiveSupercessions |
|---|
WITH RankedSupercessions AS (
SELECT
ms.SiteMaterialUsageId,
ms.OnSiteMaterialUsageId,
ms.Id,
ms.Type,
ms.SupercessionRuleID,
ms.StartDate,
ms.Percentage,
smuon.MaterialId as ToMaterialId,
smufrom.MaterialId as FromMaterialId,
ROW_NUMBER() OVER (
PARTITION BY ms.SiteMaterialUsageId
ORDER BY ms.StartDate, ms.LevelNo DESC, ms.Id
) AS rn
FROM MaterialSupercessions ms
JOIN SiteMaterialUsages smuon ON ms.OnSiteMaterialUsageId = smuon.Id AND smuon.Status = 1
JOIN SiteMaterialUsages smufrom ON ms.SiteMaterialUsageId = smufrom.Id AND smufrom.Status = 0
WHERE ms.Type IN ('Supersession', 'Both', 'ReplaceLocation')
)
SELECT
SiteMaterialUsageId,
OnSiteMaterialUsageId,
Id,
Type,
SupercessionRuleID,
StartDate,
Percentage,
ToMaterialId,
FromMaterialId
FROM RankedSupercessions
WHERE rn = 1
|
| IH#ActualProductionRates |
|---|
WITH rates AS
(
SELECT r.*, d.MaterialId,
ROW_NUMBER() OVER (PARTITION BY r.WorkCentreId, r.OperationTypeId, d.MaterialId, r.Effective
ORDER BY r.RuleWeighting DESC) OrderNo
FROM IH#ProductionRates r
JOIN IH#DetailsMaterial d ON r.DetailId = d.DetailId
),
pairs AS
(
SELECT Id, WorkCentreId, MaterialId, ProductionRateCode, OperationTypeId, NettRate, EffectiveProductionRate,
TimeEfficiency, MaterialEfficiency, ConversionFactor,
Effective AS DateFrom,
NVL(LEAD(r.Effective) OVER(PARTITION BY WorkCentreId, OperationTypeId, MaterialId ORDER BY Effective) - 1, to_date('2100-01-01', 'YYYY-MM-DD')) DateTo
FROM rates r
WHERE OrderNo = 1
)
SELECT l.SiteId, r.*,
CASE WHEN core.getTruncatedInternalDate BETWEEN DateFrom AND DateTo THEN 1 ELSE 0 END IsActive
FROM pairs r
JOIN WorkCentres w on w.Id = r.WorkCentreId
JOIN Locations l on l.Id = w.LocationId
|
| IH#AllMaterialUnits |
|---|
SELECT m.Id MaterialId, UnitId, Dividend, Divisor FROM Materials m JOIN MaterialUnits mu ON mu.MaterialId = m.Id UNION ALL SELECT m.Id, u.Id, Dividend, Divisor FROM Materials m CROSS JOIN IH#WeightUnits u WHERE Dividend != -1 |
| IH#AllocationBodies |
|---|
SELECT a.SiteMaterialUsageId, DeliveryMonth, DeliveryWeek, a.SiteId, NVL(l.CalendarId, core.DefaultCalendarId) CalendarId,
Customer Allocation,
SUM(Customer) OVER (PARTITION BY SiteMaterialUsageId, DeliveryMonth, a.SiteId) MonthlyAllocation,
SUM(Customer) OVER (PARTITION BY SiteMaterialUsageId, DeliveryWeek, a.SiteId) WeeklyAllocation
FROM (
SELECT SiteMaterialUsageId, DeliveryMonth, DeliveryWeek, l.SiteId, SUM(Customer) Customer
FROM AllocationBodies ab
JOIN WorkCentres wc on wc.Id = ab.WorkCentreId
JOIN Locations l on l.Id = wc.LocationId
GROUP BY SiteMaterialUsageId, DeliveryMonth, DeliveryWeek, l.SiteId
) a
JOIN SiteMaterialUsages smu
ON smu.Id = a.SiteMaterialUsageId
JOIN locations l ON l.Id = smu.LocationId
|
| IH#AllocationForNetting |
|---|
SELECT SiteMaterialUsageid, t.workcentreId, wc.SiteId, SourceWeek, SourceMonth, ConversionFactor, SUM(Allocation) Allocation, SUM(Orders) Orders,
SUM(DECODE(WorkcentreTypeName, 'Paper Machine', Allocation, 0)) ApplicableAllocation,
SUM(DECODE(WorkcentreTypeName, 'Paper Machine', Orders, 0)) ApplicableOrders
FROM (SELECT ab.SiteMaterialUsageId, ab.WorkcentreId, ab.SourceWeek, ab.SourceMonth, Customer Allocation, 0 Orders, NVL(r.ConversionFactor, 1) ConversionFactor
FROM AllocationBodies ab
JOIN SiteMaterialUsages smu
ON smu.id = ab.SiteMaterialUsageId
LEFT JOIN IH#ActualProductionRates r
ON r.WorkCentreId = ab.Workcentreid
AND r.MaterialId = smu.MaterialId
AND ab.SourceWeek BETWEEN r.DateFrom AND r.DateTo
UNION ALL
SELECT ol.SiteMaterialUsageId, ol.WorkcentreId, TRUNC(NVL(ConsumptionDate, DespatchDate), 'IW') SourceWeek,
TRUNC(NVL(ConsumptionDate, DespatchDate), 'month') SourceMonth, 0 Allocation, FinalWeight Orders, NVL(ConversionFactor, 1) ConversionFactor
FROM OrderLines ol
JOIN OrderLineStatuses OLs
ON ols.Id = ol.OrderLineStatusId
LEFT JOIN IH#ActualProductionRates r
ON r.WorkcentreId = ol.Workcentreid
AND r.MaterialId = ol.MaterialId
AND NVL(ol.ConsumptionDate, ol.DespatchDate) BETWEEN r.DateFrom AND r.DateTo
WHERE ols.OrderLineStatusCode IN ('Firm', 'Completed')) t
JOIN IH#Workcentres wc
ON wc.WorkcentreId = t.WorkcentreId
GROUP BY SiteMaterialUsageid, t.workcentreId, wc.SiteId, SourceWeek,
SourceMonth, ConversionFactor
|
| IH#AlternateMaterials |
|---|
SELECT smu.Id, l.LocationCode, m.MaterialCode ProductCode, smu.LocationId, smu.MaterialId, NULL ConsignmentLocationId, COALESCE(lam.MaterialName, am.MaterialName) ExistingAlternateName, COALESCE(lam.MaterialName, am.MaterialName, m.MaterialName) MaterialName, 'Normal sku (customer and free stock)' Annotation FROM SiteMaterialUsages smu JOIN Materials m ON (m.Id = smu.MaterialId) JOIN Locations l ON (l.Id = smu.LocationId) LEFT JOIN AlternateMaterials am ON (smu.MaterialId = am.MaterialId AND am.LocationId IS NULL) LEFT JOIN AlternateMaterials lam ON (smu.MaterialId = lam.MaterialId AND lam.LocationId = smu.LocationId) UNION ALL SELECT t.ID, LocationCode, ProductCode, t.Locationid, t.MaterialId, ConsignmentLocationId, COALESCE(lam.MaterialName, am.MaterialName) ExistingAlternateName, COALESCE(lam.MaterialName, am.MaterialName, t.MaterialName) MaterialName, 'Consignment Sku' Annotation FROM ( SELECT smu.Id, l.LocationCode, m.MaterialCode ProductCode, cm.MaterialName, smu.LocationId, smu.MaterialId, cp.CustomerId ConsignmentLocationId, cp.SiteMaterialUsageId, cp.CustomerId, cm.Id CustomerMaterialId, cl.LocationCode CustomerCode, cm.MaterialCode CustomerProductCode, ROW_NUMBER() OVER (PARTITION BY cp.SiteMaterialUsageId, cp.CustomerId ORDER BY csmu.Status DESC) r FROM Consignmentparameters cp JOIN SiteMaterialUsages smu ON (smu.Id = cp.SiteMaterialUsageID) JOIN Materials m ON (m.Id = smu.MaterialId) JOIN Locations l ON (l.Id = smu.LocationId) JOIN Materials cm ON (NVL(cm.SourceMaterialId, cm.Id) = smu.MaterialId) JOIN Locations cl ON (cp.Customerid = cl.Id) JOIN SiteMaterialUsages csmu ON (csmu.LocationId = cp.CustomerId AND csmu.MaterialId = cm.Id) ) t LEFT JOIN AlternateMaterials am ON (am.MaterialId = t.CustomerMaterialId AND am.LocationId IS NULL) LEFT JOIN AlternateMaterials lam ON (t.CustomerMaterialId = lam.MaterialId AND lam.LocationId = t.ConsignmentLocationId) WHERE t.R = 1 |
| IH#AreaPageActions |
|---|
SELECT p.Id PageId, a.Id ActionId, p.PagePath, p.PageDescription, p.PageHint,
NVL(a.Title, a.ActionDescription) Description, a.ActionHint
FROM IH#Pages p
JOIN Actions a ON a.PageId = p.Id
WHERE a.IsDefault = 0
ORDER BY PagePath, PageDescription, Description
|
| IH#AverageGradePrices |
|---|
SELECT ep.DateFrom,
NVL(LEAD(ep.DateFrom, 1) over( PARTITION BY GradeId order by DateFrom), to_date('01-01-2050', 'DD-MM-YYYY')) - 1 DateTo,
gm.GradeId, gm.Gradecode, Avg(Price) Price
FROM IH#ExpandedPrices ep, GradeMaterials gm, SiteMaterialUsages smu
WHERE smu.MaterialId = gm.MaterialId
AND ep.SiteMaterialUsageId = smu.Id
GROUP BY ep.DateFrom, gm.GradeId, gm.Gradecode
|
| IH#BackOrders |
|---|
SELECT ol.SiteMaterialUsageId, core.getInternalMonth() AS DeliveryDate, ol.PeriodType, ol.LocationId,
NVL(oo.Workcentreid, ol.WorkcentreId) WorkcentreId, FinalWeight,
GREATEST(0, ol.FinalWeight - GREATEST(ol.WeightComplete, ol.DeliveryWeight, ol.StockWeight)) BackOrders
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
LEFT JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
AND oo.IsLastOperation = 1
LEFT JOIN IH#ActiveSupercessions ms
ON ms.SiteMaterialUsageId = ol.SiteMaterialUsageId
WHERE ols.OrderLineStatusCode IN ('Firm')
AND ol.DeliveryDate BETWEEN core.getBackOrderStartPeriod AND core.getInternalMonth() - 1
AND GREATEST(0, ol.FinalWeight - GREATEST(ol.WeightComplete, ol.DeliveryWeight, ol.StockWeight)) > 0
|
| IH#BaseUnits |
|---|
SELECT u.Id UnitId, u.UnitTypeId, ut.UnitTypeName, u.UnitName, u.UnitDescription, u.IsBaseUnit, u.MaterialTypeId FROM Units u JOIN UnitTypes ut ON ut.Id = u.UnitTypeId WHERE IsBaseUnit = 1 |
| IH#BOMMaterials |
|---|
SELECT b.Id, b.BomCode, dm.MaterialCode, dm.MaterialName, sm.MaterialCode SourceMaterialcode, sm.MaterialName SourceMaterialName, bm.Multiplier, bm.Divider, dm.MaterialId MaterialId, sm.MaterialId SourceMaterialId, dm.MaterialTypeName, sm.MaterialTypeName SourceMaterialTypeName FROM BOm b JOIN Productionconfigurations pc ON pc.bomId = b.Id JOIN Materialpropsspec dm ON pc.MaterialId = dm.MaterialId JOIN BOMMaterials bm ON bm.bomId = b.Id JOIN Materialpropsspec sm ON sm.MaterialId = bm.MaterialId |
| IH#BSODemandAnalysis |
|---|
SELECT OperatorUserId, WorkCentreId, GradeId, OrdersWeight, OrdersDuration,
OriginalAllocationsWeight, OriginalAllocationsDuration, RemainingAllocationsWeight, RemainingAllocationsDuration,
NVL(NominalDuration,-1) NominalDuration, NVL(AdjustedDuration,-1) AdjustedDuration,
OptimizedDuration, OptimizedWeight
FROM (
SELECT OperatorUserId, WorkCentreId, GradeId,
sum(OrdersWeight) as OrdersWeight,
sum(OrdersDuration) as OrdersDuration,
sum(OriginalAllocationsWeight) as OriginalAllocationsWeight,
sum(OriginalAllocationsDuration) as OriginalAllocationsDuration,
sum(RemainingAllocationsWeight) as RemainingAllocationsWeight,
sum(RemainingAllocationsDuration) as RemainingAllocationsDuration,
sum(NominalDuration) as NominalDuration,
SUM(AdjustedDuration) AS AdjustedDuration,
sum(OptimizedDuration) as OptimizedDuration,
SUM(OptimizedWeight) AS OptimizedWeight
FROM (
SELECT OperatorUserId, i.WorkCentreId, i.GradeId,
DECODE(i.OrderLineId, 0, 0, i.RemainingWeight) OrdersWeight,
DECODE(i.OrderLineId, 0, 0, i.RemainingDuration) OrdersDuration,
DECODE(i.OrderLineId, 0, i.OriginalWeight, 0) OriginalAllocationsWeight,
DECODE(i.OrderLineId, 0, i.OriginalDuration, 0) OriginalAllocationsDuration,
DECODE(i.OrderLineId, 0, i.RemainingWeight, 0) RemainingAllocationsWeight,
DECODE(i.OrderLineId, 0, i.RemainingDuration, 0) RemainingAllocationsDuration,
NULL NominalDuration, NULL AdjustedDuration,
0 OptimizedDuration, 0 OptimizedWeight
FROM IH#BSOInput i
WHERE i.IsLiveRun = 0
UNION ALL
SELECT w.OperatorUserId, p.WorkCentreid, p.GradeId, 0, 0, 0, 0, 0, 0, NominalDuration, AdjustedDuration, 0, 0
FROM IH#BSOPrograms p
JOIN BSOWorkCentreData w ON w.WorkCentreId = p.WorkCentreId
UNION ALL
SELECT w.OperatorUserId, r.WorkCentreId, r.GradeId,
0, 0, 0, 0, 0, 0, NULL, NULL,
r.InitialDuration - r.SwitchoverDuration,
(r.InitialDuration - r.SwitchoverDuration) / 60 * NVL(r.Rate,0)
FROM OptimizedRuns r
JOIN BSOWorkCentreData w ON w.WorkCentreId = r.WorkCentreId
WHERE r.CampaignType = 1
AND r.IsLiveRun = 0
AND r.FsBlock = 0
AND r.OppBlock = 0
AND r.IsShut = 0
)
GROUP BY OperatorUserId, WorkCentreId, GradeId
) t
WHERE t.GradeId IS NOT NULL
|
| IH#BSOGenerationPeriod |
|---|
WITH params AS
(
SELECT NVL(MAX(Value), 'NoRestriction') DemandDurationBehaviour,
core.getInternalDate InternalDate,
to_date('01-01-2050', 'DD-MM-YYYY') MaxDate
FROM SystemParameters
WHERE ParameterName = 'BSODemandDurationBehaviour'
),
dates AS
(
SELECT OperatorUserId, WorkCentreId,
MIN(StartDate) StartDate, MAX(DemandDate) DemandDate, MAX(FinishDate) RunDate
FROM (
SELECT OperatorUserId, WorkCentreId, DateFrom DemandDate, NULL StartDate, NULL FinishDate
FROM BSOOrdersData
WHERE IsLiveRun = 0
UNION ALL
SELECT OperatorUserId, WorkCentreId, DECODE(LiveAllocationPeriod, 'Month', last_day(DateFrom), DateFrom + 7) DemandDate, NULL StartDate, NULL FinishDate
FROM BSOAllocationData
CROSS JOIN (SELECT Value LiveAllocationPeriod FROM SystemParameters WHERE ParameterName = 'LiveAllocationPeriod')
WHERE IsLiveRun = 0
UNION ALL
SELECT w.OperatorUserId, p.WorkCentreId, NULL, MIN(p.StartDate) StartDate, MAX(p.FinishDate) FinishDate
FROM BSOPrograms p
JOIN BSOWorkCentreData w ON w.WorkCentreId = p.WorkCentreId
GROUP BY w.OperatorUserId, p.WorkCentreId
) d
GROUP BY OperatorUserId, WorkCentreId
)
SELECT OperatorUserId, WorkCentreId, NVL(StartDate, params.InternalDate) StartDate,
NVL(CASE DemandDurationBehaviour
WHEN 'OnlyConsiderDemands' THEN DemandDate
WHEN 'OnlyConsiderRuns' THEN RunDate
WHEN 'OnlyConsiderDemandsOrRuns' THEN LEAST(DemandDate, RunDate)
WHEN 'NoRestriction' THEN params.MaxDate
END, params.MaxDate) FinishDate
FROM dates
CROSS JOIN params
|
| IH#BSOGroupingProperties |
|---|
SELECT DISTINCT GradeId, pv.PropertyValueCode GroupProperties FROM ExpandedMaterials em JOIN GradeMaterials gm ON em.MaterialId = gm.MaterialId JOIN PropertyValues pv ON pv.Id = em.PropertyValueID JOIN Properties p ON p.Id = pv.PropertyId WHERE p.PropertyName = (SELECT MIN(VALUE) FROM SystemParameters WHERE ParameterName = 'BSOGroupingProperty') |
| IH#BSOInput |
|---|
SELECT i.OperatorUserId, i.WorkCentreId, i.DateFrom + 12/24 DateFrom, i.GradeId, i.FinishingId,
i.OriginalDuration, i.OriginalWeight, i.RemainingDuration, i.RemainingWeight, i.Priority, i.OrderLineId, i.Rate, i.IsLiveRun,
i.OperationTypeId, i.NextWorkcentreId, i.NextOperationTypeId, i.NextSourcePeriod, i.NextWeight, i.NextCoef, DemandControlAllocationWeight,
TRUNC(p.StartDate) StartDate, TRUNC(p.FinishDate) FinishDate
FROM (
SELECT OperatorUserId, o.WorkCentreId, o.DateFrom, o.GradeId, o.FinishingId,
o.Duration OriginalDuration, o.Weight OriginalWeight, o.Duration RemainingDuration, o.Weight RemainingWeight,
99 Priority, o.OrderLineId, o.Rate, o.IsLiveRun, OperationTypeId, NextWorkcentreId, NULL NextSourcePeriod, NextOperationTypeId, NULL NextWeight, NULL NextCoef,
0 DemandControlAllocationWeight
FROM BSOOrdersData o
WHERE o.Duration > 0
UNION ALL
SELECT OperatorUserId, a.WorkCentreId, a.DateFrom + t.Id DateFrom, a.GradeId, a.FinishingId,
a.Duration/7 OriginalDuration, a.Duration * Rate/60/7 OriginalWeight,
a.RemainingDuration/7 RemainingDuration, a.RemainingDuration * Rate/60/7 RemainingWeight,
a.Priority, 0 OrderLineId, a.Rate, a.IsLiveRun, a.OperationTypeId, a.NextWorkcentreId,
a.NextSourcePeriod, a.NextOperationTypeId, a.NextWeight / 7 NextWeight, a.NextCoef,
a.OriginalWeight / 7 DemandControlAllocationWeight
FROM BSOAllocationData a, (SELECT Level - 1 Id FROM dual CONNECT BY level <= 7) t
WHERE a.Duration > 0
AND EXISTS (SELECt 1 FROM SystemParameters WHERE ParameterName = 'LiveAllocationPeriod' And Value IN ('Week', 'WeekMonth'))
UNION ALL
SELECT OperatorUserId, a.WorkCentreId, t.DateFrom DateFrom, a.GradeId, a.FinishingId,
a.Duration/DaysInMonth OriginalDuration, a.Duration * Rate/60/DaysInMonth OriginalWeight,
a.RemainingDuration/DaysInMonth RemainingDuration, a.RemainingDuration * Rate/60/DaysInMonth RemainingWeight,
a.Priority, 0 OrderLineId, a.Rate, a.IsLiveRun, a.OperationTypeId, a.NextWorkcentreId,
a.NextSourcePeriod, a.NextOperationTypeId, a.NextWeight / DaysInMonth NextWeight, a.NextCoef,
a.OriginalWeight / DaysInMonth DemandControlAllocationWeight
FROM BSOAllocationData a JOIN (
SELECT DateFrom, DateFromMonth, CAST(TO_CHAR(LAST_DAY(DateFromMonth), 'DD') AS INT) DaysInMonth
FROM CalendarSources
WHERE CalendarId = (SELECT VALUE FROM SystemParameters WHERE ParameterName = 'DefaultCalendar')
) t
ON TRUNC(a.DateFrom, 'month') = t.DateFromMonth
WHERE a.Duration > 0
AND EXISTS (SELECt 1 FROM SystemParameters WHERE ParameterName = 'LiveAllocationPeriod' And Value IN ('Month'))
) i
JOIN IH#BSOGenerationPeriod p
ON i.WorkCentreId = p.WorkCentreId
AND i.OperatorUserId = p.OperatorUserId
AND i.DateFrom BETWEEN TRUNC(p.StartDate) AND TRUNC(p.FinishDate)
|
| IH#BSOPrograms |
|---|
SELECT p.Id, p.WorkCentreId, g.SequenceNo, g.GradeId,
NVL(g.Duration * GREATEST(0, SUM(g.Duration) OVER (PARTITION BY p.Id) - p.ShutLength) / NULLIF(SUM(g.Duration) OVER (PARTITION BY p.Id),0),0) NominalDuration,
NVL(g.Duration * GREATEST(0, p.DurationAdj - p.ShutLength) / NULLIF(SUM(g.Duration) OVER (PARTITION BY p.Id),0),0) AdjustedDuration
FROM BSOPrograms p
JOIN BSOProgramGrades g ON g.BSOProgramId = p.Id
ORDER BY g.SequenceNo
|
| IH#CalendarDailyCoefs |
|---|
SELECT CalendarId, TO_char(last_day(DateFrom), 'DD') Day, DateFrom, MonthDate, WeekDate, IsWorkingDay, DECODE(MonthSum, 0, 0, WeekSum / MonthSum) AS Coef, WeekSum, MonthSum, TO_char(last_day(DateFrom), 'DD') TotalDays FROM ( SELECT CalendarId, DateFrom, DateFromMonth AS MonthDate, DateFromIW AS WeekDate, IsWorkingDay, SUM(IsWorkingDay) over(PARTITION BY CalendarId, DateFromMonth, DateFromIW) AS WeekSum, SUM(IsWorkingDay) over(PARTITION BY CalendarId, DateFromMonth) AS MonthSum FROM CalendarSources cs) |
| IH#CalendarMtdCoefs |
|---|
SELECT c.CalendarId, SUM(IsWorkingDay) MonthSum, SUM(case when DateFrom < core.getTruncatedInternalDate then IsWorkingDay else 0 end) CurrentSum, SUM(case when DateFrom < core.getTruncatedInternalDate then IsWorkingDay else 0 end) /SUM(IsWorkingDay) MtdCoef FROM CalendarSources c Where c.DateFromMonth = trunc(core.getTruncatedInternalDate, 'month') group by c.CalendarId |
| IH#CalendarSourcesComparison |
|---|
SELECT c.CalendarName, cs.DateFrom, cs.IsReceivingDay, cs.IsWorkingDay FROM Calendars c JOIN CalendarSources cs ON cs.CalendarId = c.Id |
| IH#CalendarWeeklyCoefs |
|---|
SELECT c.*, SUM(WeekMonthCoef) OVER (PARTITION BY CalendarId, WeekDate) totalWeekCoef FROM ( SELECT DISTINCT CalendarId, DateFromMonth MonthDate, DateFromIW WeekDate, WeekMonthCoef FROM CalendarSources ) c |
| IH#CalendarWeekMonthSources | Coefficients for weekly/month periods. |
|---|
SELECT CalendarId,
CASE
WHEN DateFromIW > DateFromMonth THEN
DateFromIW
ELSE
DateFromMonth
END DateFrom, SUM(IsWorkingDay) WorkingDays, SUM(1) TotalDays,
DECODE(SUM(1), 7, 1, SUM(IsWorkingDay) / MIN(WeekWorkingDays)) PeriodCoef
FROM (SELECT CalendarId, DateFrom, DateFromIW, DateFromMonth, IsWorkingDay,
SUM(IsWorkingDay) OVER(PARTITION BY CalendarId, DateFromIW) WeekWorkingDays
FROM CalendarSources)
GROUP BY CalendarId,
CASE
WHEN DateFromIW > DateFromMonth THEN
DateFromIW
ELSE
DateFromMonth
END
|
| IH#CompanyGradeSafetyStock |
|---|
SELECT c.CompanyName, m.MaterialName, m.MaterialCode, gp.GradeCode, DateFrom, SafetyStock FROM inventoryprofiles ip JOIN Companies c ON ip.companyId = c.Id JOIN materials m ON m.Id = ip.MaterialId JOIN GradeMaterials gm ON gm.MaterialID = m.Id JOIN Gradeproperties gp ON gp.GradeId = gm.GradeId |
| IH#CompanySafetyStocks |
|---|
SELECT c.CompanyName, m.MaterialName, m.MaterialCode, ip.ConsignmentLocationId, gp.GradeCode, DateFrom, SafetyStock,
core.AsCsv(SET(CAST(COLLECT(DISTINCT ssm.Safetystockmethodname ORDER BY ssm.Safetystockmethodname) AS
ParameterArray))) SafetyStockMethods, MIN(LowQuantity) minLowQuantity,
MIN(HighQuantity) MinHighQuantity, COUNT(1) SkuQuantity,
core.AsCsv(SET(CAST(COLLECT(DISTINCT to_char(LowQuantity)) AS ParameterArray))) LowQuantityValues,
core.AsCsv(SET(CAST(COLLECT(DISTINCT to_char(HighQuantity)) AS ParameterArray))) HighQuantityValues
FROM inventoryprofiles ip
JOIN Companies c
ON ip.companyId = c.Id
JOIN materials m
ON m.Id = ip.MaterialId
JOIN GradeMaterials gm
ON gm.MaterialID = m.Id
JOIN Gradeproperties gp
ON gp.GradeId = gm.GradeId
JOIN Locations l
ON l.CompanyId = c.Id
JOIN IH#Skus smu
ON smu.LocationId = l.ID
AND smu.MaterialId = m.Id
AND NVL(smu.ConsignmentLocationId, 0) = NVL(ip.ConsignmentLocationID,0)
JOIN Safetystockmethods ssm
ON ssm.Id = COALESCE(c.Safetystockmethodid, l.SafetyStockMethodId, smu.SafetyStockMethodId, core.DefaultSafetyStockMethodId)
WHERE smu.Replenished = 1
GROUP BY c.CompanyName, m.MaterialName, m.MaterialCode, ip.ConsignmentLocationId, gp.GradeCode, DateFrom, SafetyStock
|
| IH#ConfigurationSources |
|---|
SELECT pc.Id AS ProductionConfigurationId, pc.ProductRouteId, pc.MaterialId, prs.OperationTypeId, ValidSources,
PrimaryValidSources, DECODE(NVL(IsValid,0) ,0, NULL, BomId) BomId, prs.OrderNo, NVL(c.IsLastCoProductStage, 0) IsLastCoProductStage,
NVL(Multiplier, 1) Multiplier, NVL(divider, 1) Divider, InputUnitId, OutputUnitId, prs.IsLastStage,
NVL(Multiplier, 1) || '^' || InputUnitId || '/' || NVL(divider, 1) || '^' || OutputUnitId || '-' || NVL(c.IsLastCoProductStage, 0) ConversionHash,
pc.CoProductPriceList, pc.CoProductPercentage
FROM IH#Productionconfigurations pc
JOIN IH#ProductRoutes pr
ON pr.Id = pc.ProductRouteId
JOIN IH#Productroutestages prs
ON prs.ProductRouteId = pr.Id
LEFT JOIN IH#ValidBOM b
On b.Id = pc.BomId
LEFT JOIN IH#ValidSources vs
ON vs.ProductionConfigurationId = pc.Id
AND vs.OperationTypeId = prs.OperationTypeId
LEFT JOIN OperationTypeConversions c
ON c.ProductionConfigurationId = pc.Id
AND c.OperationTypeId = prs.OperationTypeId
ORDER BY pc.MaterialId, prs.OrderNo
|
| IH#ConsumptionProfiles |
|---|
SELECT SiteMaterialUsageId, ConsignmentLocationId, DateFrom,
First_value(Opening) OVER(PARTITION BY SiteMaterialUSageId, ConsignmentLocationId ORDER BY DateFrom)
+ NVL(SUM(FirmOrdersIn + TentativeOrdersIn) OVER(PARTITION BY SiteMaterialUSageId, ConsignmentLocationId
ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING),0)
- NVL(SUM(ConsumptionForecast + TentativeOrdersOut + ConsumptionOrders) OVER(PARTITION BY SiteMaterialUSageId, ConsignmentLocationId
ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING),0) Opening,
FirmOrdersIn, TentativeOrdersIn, Consumption, TentativeOrdersOut, ConsumptionOrders, ConsumptionForecast, PlannedInventory,
First_value(Opening) OVER(PARTITION BY SiteMaterialUSageId, ConsignmentLocationId ORDER BY DateFrom)
+ NVL(SUM(FirmOrdersIn + TentativeOrdersIn) OVER(PARTITION BY SiteMaterialUSageId, ConsignmentLocationId
ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND p.ClosingMethod PRECEDING),0)
- NVL(SUM(ConsumptionForecast + TentativeOrdersOut + ConsumptionOrders) OVER(PARTITION BY SiteMaterialUSageId, ConsignmentLocationId
ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 0 PRECEDING),0) Closing
FROM InventoryProfiles ip
CROSS JOIN (SELECT UseTentativeOrders, DECODE(RPClosingCalculationMethod, 'AfterDeliveryDate', 1, 0) ClosingMethod FROM IH#ReplenishmentParameters) p
/*WHERE ip.SiteMaterialUsageId =2*/
ORDER BY DateFrom
|
| IH#ConvertedExchangeRates |
|---|
SELECT er.DateFrom, er.DateTo, er.Currencyid FromCurrencyId, er2.CurrencyId ToCurrencyId, er.Multiplier FromMultiplier, er.Divider FromDivider, er2.Multiplier ToMultiplier, er2.Divider TODivider FROM ExpandedExchangeRates er JOIN ExpandedExchangeRates er2 ON er.DateFrom BETWEEN er2.DateFrom AND er2.DateTo |
| IH#CoProductLists |
|---|
SELECT MaterialId, SUM(Percentage) Percentage, core.asCsv(CAST(COLLECT(CoProductMaterialId || ':' || TO_CHAR(Percentage, 'TM9','NLS_NUMERIC_CHARACTERS=''.,''') || ':' || TO_CHAR(PricePercentage, 'TM9', 'NLS_NUMERIC_CHARACTERS=''.,''') ORDER BY CoProductMaterialId) AS ParameterArray), ';') CoProductPriceList FROM CoProducts GROUP BY MaterialId |
| IH#CustomerAdditiveConsumption |
|---|
SELECT p.SiteMaterialUsageId, p.ConsignmentLocationId, p.SourceSiteMaterialUsageId,
NVL2(p.SiteMaterialUsageId, p.SiteMaterialUsageId || '-' || NVL(p.ConsignmentLocationId, 0), '') SkuKey,
NVL2(p.SourceSiteMaterialUsageId, p.SourceSiteMaterialUsageId || '-' || NVL(p.ConsignmentLocationId, 0), '') SourceSkuKey,
a.DateFrom, a.Forecast, Demand, Orders, NettedOrders, Portion, TotalTimePeriod, IsDirect, Consumption,
p.DateFrom SourcingStartDate, p.DateTo SourcingFinishDate, p.TargetProductionSites,
CASE
WHEN a.DateFrom BETWEEN p.DateFrom AND p.DateTo THEN
a.Consumption * (p.Portion / 100)
ELSE
NULL
END PortionConsumption,
LEAD(CASE
WHEN a.DateFrom BETWEEN p.DateFrom AND p.DateTo THEN
a.Consumption * (p.Portion / 100)
ELSE
NULL
END, TotalTimePeriod, 0) OVER(PARTITION BY p.SiteMaterialUsageId, p.ConsignmentLocationId, p.SourceSiteMaterialUsageId ORDER BY a.DateFrom) WarehouseConsumption
FROM IH#EndPointSkuPortions p
JOIN ReplenishedCustomerDemands a
ON a.Sitematerialusageid = p.SiteMaterialUsageId
AND NVL(a.SiteId,0) IN (SELECT to_number(Column_Value) from TABLE(core.StringToArray(p.TargetProductionSites))
UNION ALL
SELECT 0 FROM dual
where a.ConsumptionType IN ('Forecast', 'Allocation'))
ORDER BY 1, 3, 4
|
| IH#CustomerEndConsumption |
|---|
SELECT p.SiteMaterialUsageId, p.ConsignmentLocationId, p.SourceSiteMaterialUsageId,
NVL2(p.SiteMaterialUsageId, p.SiteMaterialUsageId || '-' || NVL(p.ConsignmentLocationId, 0), '') SkuKey,
NVL2(p.SourceSiteMaterialUsageId, p.SourceSiteMaterialUsageId || '-' || NVL(p.ConsignmentLocationId, 0), '') SourceSkuKey,
a.DateFrom, a.Forecast, Demand, Orders, NettedOrders,
Portion, TotalTimePeriod, IsDirect, Consumption, p.DateFrom SourcingStartDate, p.DateTo SourcingFinishDate,
CASE WHEN a.DateFrom BETWEEN p.DateFrom AND p.DateTo THEN a.Consumption * (p.Portion / 100) ELSE NULL END PortionConsumption,
LEAD(CASE WHEN a.DateFrom BETWEEN p.DateFrom AND p.DateTo THEN a.Consumption * (p.Portion / 100) ELSE NULL END, TotalTimePeriod, 0)
OVER(PARTITION BY p.SiteMaterialUsageId, p.ConsignmentLocationId, p.SourceSiteMaterialUsageId
ORDER BY a.DateFrom) WarehouseConsumption
FROM IH#EndPointSkuPortions2 p
JOIN ReplenishedCustomerDemands a
ON a.Sitematerialusageid = p.SiteMaterialUsageId
AND NVL(a.SiteId,0) IN (SELECT to_number(Column_Value) from TABLE(core.StringToArray(p.TargetProductionSites))
UNION ALL
SELECT 0 FROM dual
where a.ConsumptionType IN ('Forecast', 'Allocation'))
ORDER BY 1,3,4
|
| IH#CustomerSkuCalendars |
|---|
SELECT smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, NULL ConsignmentLocationId, EndUseId,
NVL(EndCustomerId, LocationId) EndCustomerId, NVL(ccl.CalendarId, core.DefaultCalendarId) CalendarId, NVL(ccl.ForecastRangeId, 0) RangeId
FROM SiteMaterialUsages smu
JOIN Locations ccl
ON (smu.LocationId = ccl.Id)
AND NOT EXISTS (SELECT * FROM workcentres wc WHERE wc.LocationId = smu.LocationId)
|
| IH#CustomerSkuCharacteristics |
|---|
SELECT smu.Id as SiteMaterialUsageId, EndUseId, NVL(EndCustomerId, LocationId) EndCustomerId,
MaterialId, LocationId, smu.Status,
smu.ReplenishmentFlag,
cr.Id as CustomerRankId, cr.CustomerRankDesc,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5, smu.SkuProperties,
smu.DerivedCharacteristic1, smu.DerivedCharacteristic2, smu.DerivedCharacteristic3, smu.DerivedCharacteristic4, smu.DerivedCharacteristic5
FROM SiteMaterialUsages smu
JOIN Locations l ON l.Id = smu.LocationId
JOIN Companies c ON c.Id = l.CompanyId
JOIN Materials m ON m.Id = smu.MaterialId
CROSS JOIN (SELECT TO_NUMBER(MIN(Value)) DefaultCustomerRankId from SystemParameters where ParameterName = 'DefaultRank') p
LEFT JOIN CustomerRanks cr ON COALESCE(smu.CustomerRankId, l.CustomerRankId, c.CustomerRankId, p.DefaultCustomerRankId) = cr.Id
WHERE NOT EXISTS(SELECT 1 FROM WorkCentres w WHERE w.LocationId = smu.LocationId)
|
| IH#CustomerSkus |
|---|
SELECT smu.Id as SiteMaterialUsageId, OnSiteMaterialUsageId, EndUseId, NVL(EndCustomerId, LocationId) as EndCustomerId,
MaterialId, LocationId, smu.Status, smu.TurnOffForecastId, smu.TurnOnForecastId, smu.NeedCheckForecastId,
smu.AlternateProduct, smu.ExistingAlternateProduct,
NVL(smu.UpperPercentile, core.DefaultSKUUpperPercentile) UpperPercentile, NVL(smu.LowerPercentile, core.DefaultSKULowerPercentile) LowerPercentile,
smu.ForecastStartDate, smu.ForecastFinishDate, NVL(mr.ForecastMethodId, core.DefaultForecastMethodId) ForecastMethodId,
sr.ForecastMethodId SecondPassForecastMethodId,
smu.ForecastMethodRuleId, smu.SecondPassRuleId,
DECODE(smu.DefaultCustomerForecast, 'NotSet', l.DefaultCustomerForecast, smu.DefaultCustomerForecast) DefaultCustomerForecast,
smu.HistoryStartDate, smu.ReplenishmentFlag, cr.Id as CustomerRankId, cr.CustomerRankDesc,
NVL(smu.NettingAlgorithm, core.DefaultNettingAlgorithm) NettingAlgorithm,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5, smu.SkuProperties,
smu.DerivedCharacteristic1, smu.DerivedCharacteristic2, smu.DerivedCharacteristic3, smu.DerivedCharacteristic4, smu.DerivedCharacteristic5,
smu.InhibitProduction, NVL(smu.DDQContingency, 0) DDQContingency,
NVL(smu.MaxCapacity,0) MaxCapacity,
ep.Price,
ep.CurrencyId,
ep.PriceSource,
smu.SkuKey, ConsumptionType, smu.SNPExclusionPeriod
FROM SiteMaterialUsages smu
JOIN Locations l ON l.Id = smu.LocationId
JOIN Companies c ON c.Id = l.CompanyId
JOIN Materials m ON m.Id = smu.MaterialId
LEFT JOIN ForecastMethodRules mr ON mr.Id = smu.ForecastMethodRuleId
LEFT JOIN SecondPassRules sr ON sr.Id = smu.SecondPassRuleId
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId
LEFT JOIN CustomerRanks cr ON COALESCE(smu.CustomerRankId, l.CustomerRankId, c.CustomerRankId, core.DefaultCustomerRankId) = cr.Id
LEFT JOIN IH#ExpandedPrices ep ON (ep.SiteMaterialUsageId = smu.Id AND core.getTruncatedInternalDate between ep.DateFrom and ep.DateTo)
WHERE NOT EXISTS(SELECT 1 FROM WorkCentres w WHERE w.LocationId = smu.LocationId)
|
| IH#CustomerSourcePriorities |
|---|
SELECT sp.Id, sp.SiteMaterialUsageId, sp.DestinationLocationId, sp.DestinationMaterialId,
sp.SourceSiteMaterialUsageId, sp.SourceLocationId, sp.SourceMaterialId,
DECODE(sp.IsConsignmentStock, 0, sp.ConsignmentLocationId, sp.DestinationLocationId) ConsignmentLocationId,
sp.WorkCentreId, sp.Priority, sp.Portion, sp.SourcePriorityRuleId, sp.JourneyId, sp.MaterialTypeId,
sp.IsConsignmentStock, sp.RPJourneyId, sp.DateFrom, sp.DateTo, s.Replenished
FROM SourcePriorities sp
JOIN (SELECT ID AS SiteMaterialUsageId, NULL CustomerId, Replenished
FROM SiteMaterialUsages smu
UNION ALL
SELECT SiteMaterialUsageId, CustomerId, Replenished
FROM ConsignmentParameters cp) s
ON s.SiteMaterialUsageId = sp.SourceSiteMaterialUsageId
AND NVL(s.CustomerId,0) = DECODE(sp.IsConsignmentStock, 0, NVL(sp.ConsignmentLocationId,0), sp.DestinationLocationId)
WHERE sp.Priority = 1
AND sp.IsActive = 1
AND EXISTS(SELECT 1 FROM SiteMaterialUsages smu WHERE smu.Id = sp.SiteMaterialUsageId AND smu.Status = 1)
AND NOT EXISTS(SELECT 1 FROM WorkCentres w WHERE w.LocationId = sp.ConsignmentLocationId)
|
| IH#CustomerWarehousePriorities |
|---|
SELECT *
FROM (SELECT SiteMaterialUsageId CustomerSkuId, SourceSiteMaterialUsageId WarehouseSkuId, Priority,
wc.LocationId WarehouseLocationId, sp.WorkcentreId WarehouseWorkcentreId,
ROW_NUMBER() OVER(PARTITION BY SiteMaterialUsageId ORDER BY Priority) r
FROM SourcePriorities sp
JOIN IH#Warehouses wc
ON wc.LocationId = SourceLocationId
WHERE sp.IsActive = 1
AND NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE DestinationLocationId = wc.LocationID))
WHERE r = 1
|
| IH#CycleAvailableDuration |
|---|
SELECT wc.SiteId, mr.WorkcentreId, ct.CycleTypeId, wc.WorkcentreTypeId, wc.WorkcentreTypeName, WorkcentreName, SiteName, CycleType, TRUNC(mr.StartDate, 'IW') DateFrom, SUM(AvailableDuration) AvailableDuration FROM IH#RunAvailableDuration mr JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = mr.Id JOIN IH#Workcentres wc ON mr.WorkcentreId = wc.WorkcentreId JOIN IH#CycleTypes ct ON ct.DetailId = mrp.DetailId GROUP BY wc.SiteId, mr.WorkcentreId, ct.CycleTypeId, wc.WorkcentreTypeId, wc.WorkcentreTypeName, WorkcentreName, SiteName, CycleType, TRUNC(mr.StartDate, 'IW') |
| IH#CycleFixedPeriods |
|---|
WITH p AS
(
SELECT Trunc(MAX(core.getInternalDate), 'IW') StartWeek FROM dual
)
SELECT ct.CycleTypeId,
ct.CycleType,
ct.DetailId,
p.StartWeek,
p.StartWeek + ct.FixedPeriodInWeeks * 7 CycleFixedPeriodWeek,
ct.Frequency,
ct.WeekTolerance,
ct.Priority,
ct.ProducingDay,
ct.GroupName,
ct.FixedPeriodInWeeks
FROM IH#CycleTypes ct
CROSS JOIN p
|
| IH#CycleProductionPeriods |
|---|
WITH p AS
(
SELECT MAX(core.getInternalDate) StartDate, NVL(MAX(mr.FinishDate), MAX(core.getInternalDate)) FinishDate
FROM (SELECT MAX(FinishDate) FinishDate FROM MaterialRuns) mr
)
SELECT DateWeek StartPeriod,
DateWeek + 7 EndPeriod,
ROW_NUMBER() OVER(Order by DateWeek) - 1 PeriodNumber,
7 PeriodLength
FROM (SELECT DISTINCT TRUNC(Column_value, 'IW') DateWeek
FROM TABLE((SELECT core.DateGenerator(p.StartDate, p.FinishDate) FROM p))
)
|
| IH#CycleTypeMaterials |
|---|
SELECT CycleTypeId, MaterialId, DetailId
FROM
(
SELECT ct.Id CycleTypeId, m.MaterialId, m.DetailId,
DENSE_RANK() OVER (PARTITION BY ct.Id, m.MaterialId ORDER BY m.DetailId) r
FROM IH#DetailsMaterial m
JOIN CycleTypes ct ON ct.Detailid = m.DetailId
)
WHERE r = 1
|
| IH#CycleTypes |
|---|
SELECT d.PropertiesCode CycleType, ct.Id CycleTypeId,
DetailId, Frequency, WeekTolerance, ct.Priority, ProducingDay, GroupName, FixedPeriodInWeeks
FROM CycleTypes ct
JOIN Ih#hierarchypropertydetails d
ON d.ID = ct.DetailId
|
| IH#CycleUtilisation |
|---|
WITH m AS
(
SELECT ct.Id CycleTypeId, m.MaterialId, m.DetailId,
DENSE_RANK() OVER (PARTITION BY ct.Id, m.MaterialId ORDER BY m.DetailId) ct_m,
DENSE_RANK() OVER (PARTITION BY ct.Id, m.DetailId ORDER BY m.MaterialId) ct_d
FROM IH#DetailsMaterial m
JOIN CycleTypes ct ON ct.Detailid = m.DetailId
),
orders AS
(
SELECT Trunc(COALESCE(oo.FinishTime, oo.DueDate, ol.DespatchDate), 'IW') DateFrom,
oo.WorkCentreId,
ol.SourceMaterialId,
m.CycleTypeId,
oo.MaterialRunId,
oo.StartTime,
oo.FinishTime,
DECODE(ols.OrderOperationStatusCode, 'System', 0, 1) IsFirm,
oo.Quantity,
oo.OperationDuration
FROM OrderLines ol
JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
JOIN OrderOperationStatuses ols
ON ols.Id = oo.OrderOperationStatusId
JOIN m ON m.MaterialId = ol.SourceMaterialId AND m.ct_m = 1
WHERE ols.OrderOperationStatusCode IN ('System', 'Firm', 'Completed')
),
durations AS
(
SELECT ol.DateFrom,
ol.WorkCentreId,
ol.CycleTypeId,
ol.MaterialRunId,
CASE WHEN ol.IsFirm = 0 THEN 0
ELSE ol.OperationDuration / 60
END OrdersHours,
CASE WHEN ol.IsFirm = 1 THEN 0
ELSE ol.OperationDuration / 60
END TentativeHours,
CASE WHEN ol.IsFirm = 0 THEN 0 ELSE ol.Quantity END OrdersWeight,
CASE WHEN ol.IsFirm = 1 THEN 0 ELSE ol.Quantity END TentativeWeight
FROM orders ol
WHERE (ol.StartTime IS NULL OR ol.FinishTime IS NULL)
UNION ALL
SELECT sp.StartPeriod DateFrom,
ol.WorkCentreId,
ol.CycleTypeId,
ol.MaterialRunId,
CASE WHEN ol.IsFirm = 0 THEN 0
ELSE (
(CASE WHEN Sign(sp.EndPeriod - ol.FinishTime) = -1 THEN sp.EndPeriod ELSE ol.FinishTime END)
-
(CASE WHEN Sign(sp.StartPeriod - ol.StartTime) = -1 THEN ol.StartTime ELSE sp.StartPeriod END)
) * 24
END OrdersHours,
CASE WHEN ol.IsFirm = 1 THEN 0
ELSE (
(CASE WHEN Sign(sp.EndPeriod - ol.FinishTime) = -1 THEN sp.EndPeriod ELSE ol.FinishTime END)
-
(CASE WHEN Sign(sp.StartPeriod - ol.StartTime) = -1 THEN ol.StartTime ELSE sp.StartPeriod END)
) * 24
END TentativeHours,
CASE WHEN ol.IsFirm = 0 THEN 0 ELSE ol.Quantity END OrdersWeight,
CASE WHEN ol.IsFirm = 1 THEN 0 ELSE ol.Quantity END TentativeWeight
FROM orders ol
CROSS JOIN IH#CycleProductionPeriods sp
WHERE (ol.StartTime IS NOT NULL AND ol.FinishTime IS NOT NULL)
AND ol.StartTime <= sp.EndPeriod
AND ol.FinishTime >= sp.StartPeriod
),
runs AS
(
SELECT Trunc(mr.StartDate, 'IW') DateFrom,
mr.WorkCentreId,
mrp.MaterialRunId,
m.CycleTypeId,
mr.InitialDuration / 60 DurationHours
FROM MaterialRuns mr
JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = mr.Id
JOIN m ON m.DetailId = mrp.DetailId AND m.ct_d = 1
),
o AS
(
SELECT DateFrom,
WorkCentreId,
CycleTypeId,
SUM(OrdersHours) OrdersHours,
SUM(TentativeHours) TentativeHours,
SUM(OrdersWeight) OrdersWeight,
SUM(TentativeWeight) TentativeWeight
FROM durations
GROUP BY DateFrom, WorkCentreId, CycleTypeId
),
r AS
(
SELECT DateFrom,
WorkCentreId,
CycleTypeId,
SUM(DurationHours) DurationHours,
SUM(DurationHours - NVL(TotalOrders,0)) NotUsedRunHours,
SUM(NVL(TotalOrders,0)) AssignOnRunHours
FROM runs
LEFT JOIN (SELECT MaterialRunId, SUM(OrdersHours + TentativeHours) TotalOrders
FROM durations
GROUP BY MaterialRunId) oo ON oo.MaterialRunId = runs.MaterialRunId
GROUP BY DateFrom, WorkCentreId, CycleTypeId
)
SELECT DateFrom SourcePeriod,
WorkCentreId,
CycleTypeId,
SUM(OrdersHours) OrdersHours,
SUM(TentativeHours) TentativeOrdersHours,
SUM(OrdersWeight) OrdersWeight,
SUM(TentativeWeight) TentativeOrdersWeight,
SUM(DurationHours) DurationHours,
SUM(NotUsedRunHours) UnUsedRunHours,
SUM(AssignOnRunHours) UsedRunHours
FROM
(
SELECT o.DateFrom,
o.WorkCentreId,
o.CycleTypeId,
o.OrdersHours,
o.TentativeHours,
o.OrdersWeight,
o.TentativeWeight,
0 DurationHours,
0 NotUsedRunHours,
0 AssignOnRunHours
FROM o
UNION ALL
SELECT r.DateFrom,
r.WorkCentreId,
r.CycleTypeId,
0 OrdersHours,
0 TentativeHours,
0 OrdersWeight,
0 TentativeWeight,
r.DurationHours,
r.NotUsedRunHours,
r.AssignOnRunHours
FROM r
)
GROUP BY DateFrom, WorkCentreId, CycleTypeId
|
| IH#DailyAllocationDistribution |
|---|
SELECT ab.SiteMaterialUsageId, cs.DateFrom, cs.DateFromMonth, cs.IsWorkingDay, cs.MonthSum, cs.WeekSum,
Allocation, WeeklyAllocation, MonthlyAllocation, SiteId,
CASE WHEN DeliveryWeek IS NULL
THEN DECODE(cs.MonthSum, 0, 0, ab.MonthlyAllocation * cs.IsWorkingDay / cs.MonthSum)
ELSE DECODE(cs.WeekSum, 0, 0, ab.WeeklyAllocation * cs.IsWorkingDay / cs.WeekSum)
END Demand
FROM IH#AllocationBodies ab
JOIN
(SELECT c.CalendarId, c.DateFromMonth, c.DateFromIW, c.DateFrom, c.IsWorkingDay,
SUM(IsWorkingDay) OVER(PARTITION BY CalendarId, DateFromMonth) MonthSum,
SUM(IsWorkingDay) OVER(PARTITION BY CalendarId, DateFromIW) WeekSum
FROM CalendarSources c) CS
ON cs.CalendarId = ab.CalendarId
AND cs.DateFromIW = NVL(ab.DeliveryWeek, cs.DateFromIw)
AND cs.DateFromMonth = NVL(ab.DeliveryMonth, cs.DateFromMonth)
|
| IH#DailyDemandDistribution |
|---|
WITH p AS (SELECT NVL(MIN(VALUE), 'Forecast') ReplenishmentDemandType
FROM SystemParameters WHERE PArameterName = 'ReplenishmentDemandType')
SELECT SiteMaterialusageId, DateFrom, DateFromMonth, IsWorkingDay, MonthSum, WeekSum,
WeeklyAllocation WeeklyDemand, MonthlyAllocation MonthlyDemand, DEMAND, NVL(smu.ConsumptionType, p.ReplenishmentDemandType) ConsumptionType,
SiteId
FROM IH#DailyAllocationDistribution a
JOIN SiteMaterialUSages smu
ON smu.Id = a.SiteMaterialUsageId
CROSS JOIN p
WHERE NVL(smu.ConsumptionType, p.ReplenishmentDemandType) = 'Allocation'
UNION ALL
SELECT SiteMaterialUsageId, DateFrom, DateFromMonth, IsWorkingDay, MonthSum, WeekSum,
WeeklyForecast WeeklyDemand, MonthlyForecast MonthlyDemand, DEMAND, NVL(smu.ConsumptionType, p.ReplenishmentDemandType) ConsumptionType,
NULL SiteId
FROM IH#DailyForecastDistribution a
JOIN SiteMaterialUSages smu
ON smu.Id = a.SiteMaterialUsageId
CROSS JOIN p
WHERE NVL(smu.ConsumptionType, p.ReplenishmentDemandType) = 'Forecast'
|
| IH#DailyForecastDistribution |
|---|
SELECT fb.SiteMaterialUsageId, cs.DateFrom, cs.DateFromMonth, cs.IsWorkingDay, cs.MonthSum, cs.WeekSum, FINAL WeeklyForecast, MonthlyForecast, CASE WHEN NVL(WeeklyEdited,0) = 0 THEN DECODE(cs.MonthSum, 0, 0, fb.MonthlyForecast * cs.IsWorkingDay / cs.MonthSum) ELSE DECODE(cs.WeekSum, 0, 0, fb.Final * cs.IsWorkingDay / cs.WeekSum) END Demand FROM IH#ForecastBodies fb, (SELECT c.*, SUM(IsWorkingDay) OVER(PARTITION BY CalendarId, DateFromMonth) MonthSum FROM CalendarSources c) CS WHERE cs.CalendarId = fb.CalendarId AND cs.DateFromIW = fb.DateFromIW AND cs.DateFromMonth = fb.DateFrom |
| IH#DailyRange |
|---|
SELECT DateFrom, TRUNC(DateFrom, 'IW') DateWeek, TRUNC(Datefrom, 'month') DateMonth FROM CalendarSources WHERE CalendarId IN (SELECT VALUE FROM SystemParameters WHERE ParameterName = 'DefaultCalendar') |
| IH#DataSourceFields |
|---|
SELECT ds.Name DataSourceName, ds.Title, ds.Description DataSourceDescription, DataSourceId,
dsf.Id, dsf.Name, dsf.Description, Expression, IsCustomField, DataType, Category,
EntityType, OrderNo, NVL(Filtered, DefaultFiltered) Filtered,
Helper, HelperColumn,
Partition, ParentField, Function,
UnitTypeId, UnitId, CurrencyId, IsCurrency, IsMandatory,
IncludeNullCondition, DefaultFiltered
FROM DataSources ds join DataSourceFields dsf on ds.Id = dsf.DataSourceId
|
| IH#DataSources |
|---|
SELECT ds.Name DataSourceName, ds.DEscription DataSourceDescription, ds.Query, DF.* FROM DataSources ds, DataSourcefields DF WHERE ds.Id = df.DataSourceId |
| IH#DefaultOperationTypes |
|---|
select WorkcentreId, DefaultOperationTypeId
FROM
(
SELECT WorkCentreId, COUNT(*) QuantityOfOperations, MIN(OperationTypeId) DefaultOperationTypeId
FROM Ih#ValidOperationSources
GROUP BY WorkCentreId
)
Where QuantityOfOperations = 1
|
| IH#DefaultWeeklyCoefs |
|---|
SELECT DISTINCT CalendarId, RangeId, t.MonthDate, t.WeekDate,
DECODE(SUM(t.x) OVER(PARTITION BY CalendarId, RangeId, MonthDate), 0, 0,
SUM(t.x) OVER(PARTITION BY CalendarId, RangeId, MonthDate, WeekDate) / SUM(t.x)
OVER(PARTITION BY CalendarId, RangeId, MonthDate)) Coef, WeekSum
FROM (SELECT CalendarId, RangeId, TO_char(DateFrom, 'DD') DAY, DateFrom, MonthDate, WeekDate, IsWorkingDay,
v.Coef, WeekSum,
SUM(DECODE(IsWorkingDay, 0, v.Coef, 0)) OVER(PARTITION BY CalendarId, RangeId, MonthDate) SS,
CASE
WHEN isWorkingday = 0 THEN
0
ELSE
v.Coef * 1 /
(1 - SUM(DECODE(IsWorkingDay, 0, v.Coef, 0)) OVER(PARTITION BY CalendarId, RangeId, MonthDate))
END x
FROM IH#CalendarDailyCoefs CS
LEFT JOIN IH#ForecastRangeValues v
ON TO_char(DateFrom, 'DD') BETWEEN v.DayFrom AND v.DayTo
) t
|
| IH#DerivedCharacteristics |
|---|
SELECT Id,
CharacteristicName AS PropertyName,
CharacteristicName AS PropertyDesc,
UPPER('DC_' || REGEXP_REPLACE(CharacteristicName, '[^[:alnum:]_]', '')) PropertyViewName,
'DerivedCharacteristic' || ROW_NUMBER() Over(ORDER BY Id) FieldProperty,
HierarchyLevelNO OrderNo,
'DC' Prefix
FROM DerivedCharacteristics
|
| IH#DerivedRulesSku |
|---|
SELECT siteMaterialUsageId, Derivedcharacteristicid, CharacteristicValue
FROM
(
SELECT r.Id, r.derivedcharacteristicid, r.Ruleweighting, CharacteristicValue, t.Column_Value siteMaterialUsageId,
ROW_NUMBER() OVER(PARTITION BY r.DerivedCharacteristicId, t.Column_Value ORDER BY r.RuleWeighting DESC) rr
FROM DerivedCharacteristicRules r, TABLE(ip.getDerivedSkus(r.Id, 1)) t
)
WHERE rr = 1
|
| IH#DescribedUserPermissions |
|---|
SELECT U.ID UserId, UserName, PageDescription, ActionName, ActionDescription, ActionHint,
listagg(RoleDescription, ', ') within group(order by RoleDescription) ROLES
FROM RolesActions ra
JOIN ROLES r
ON (r.Id = ra.roleId)
JOIN Actions a
ON (a.Id = ra.ActionId)
JOIN Usersroles ur
ON (ur.RoleId = ra.RoleID)
JOIN Pages p
ON (p.Id = a.PageId)
JOIN USERS u
ON (u.Id = ur.UserID)
WHERE cloud > 0
GROUP BY u.Id, UserName, PageDescription, ActionName, ActionHint, ActionDescription
|
| IH#DetailsDescription |
|---|
WITH q AS
(
SELECT *
FROM HierarchyPropertyDetails UNPIVOT
EXCLUDE NULLS
(VALUE FOR PROPERTY IN(
HierarchyCode1, HierarchyCode2, HierarchyCode3, HierarchyCode4, HierarchyCode5,
HierarchyCode6, HierarchyCode7, HierarchyCode8, HierarchyCode9, HierarchyCode10,
HierarchyCode11, HierarchyCode12, HierarchyCode13, HierarchyCode14, HierarchyCode15,
Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10,
Code11, Code12, Code13, Code14, Code15, Code16, Code17, Code18, Code19, Code20,
Code21, Code22, Code23, Code24, Code25, Code26, Code27, Code28, Code29, Code30,
LocationCode, ProductCode))
)
SELECT q.Id, core.asCsv(CAST(COLLECT(Description || ': ' || VALUE ORDER BY OrderNo) AS ParameterArray), ' ') DESCRIPTION
FROM q
JOIN Ih#modelcharacteristics2 h
ON UPPER(h.FieldCode) = Upper(Property)
GROUP BY q.Id
|
| IH#DetailsLocation |
|---|
SELECT d.Id DetailId, ld.LocationId FROM LocationDetails ld JOIN HierarchyPropertyDetails d ON ld.HierarchyHash = d.HierarchyHash AND ld.HierarchyBits = d.HierarchyBits |
| IH#DetailsMaterial |
|---|
SELECT d.Id DetailId, md.MaterialId, m.MaterialTypeId, md.PropertyBits, m.MaterialCode FROM MaterialDetails md JOIN Materials m ON m.Id = md.MaterialId JOIN HierarchyPropertyDetails d ON md.PropertyHash = d.PropertyHash AND md.PropertyBits = d.PropertyBits |
| IH#DetailsPropertyValue |
|---|
WITH m AS
(
SELECT DISTINCT
p.Code1, p.Code2, p.Code3, p.Code4, p.Code5, p.Code6, p.Code7, p.Code8, p.Code9, p.Code10,
p.Code11, p.Code12, p.Code13, p.Code14, p.Code15, p.Code16, p.Code17, p.Code18, p.Code19, p.Code20,
p.Code21, p.Code22, p.Code23, p.Code24, p.Code25, p.Code26, p.Code27, p.Code28, p.Code29, p.Code30
FROM MaterialPropsSpec p
)
SELECT m.*, d.Id DetailId
FROM HierarchyPropertyDetails d, m
WHERE 1=1
AND NVL(d.Code1, '!$NONE$!') IN (m.Code1, '!$NONE$!')
AND NVL(d.Code2, '!$NONE$!') IN (m.Code2, '!$NONE$!')
AND NVL(d.Code3, '!$NONE$!') IN (m.Code3, '!$NONE$!')
AND NVL(d.Code4, '!$NONE$!') IN (m.Code4, '!$NONE$!')
AND NVL(d.Code5, '!$NONE$!') IN (m.Code5, '!$NONE$!')
AND NVL(d.Code6, '!$NONE$!') IN (m.Code6, '!$NONE$!')
AND NVL(d.Code7, '!$NONE$!') IN (m.Code7, '!$NONE$!')
AND NVL(d.Code8, '!$NONE$!') IN (m.Code8, '!$NONE$!')
AND NVL(d.Code9, '!$NONE$!') IN (m.Code9, '!$NONE$!')
AND NVL(d.Code10, '!$NONE$!') IN (m.Code10, '!$NONE$!')
AND NVL(d.Code11, '!$NONE$!') IN (m.Code11, '!$NONE$!')
AND NVL(d.Code12, '!$NONE$!') IN (m.Code12, '!$NONE$!')
AND NVL(d.Code13, '!$NONE$!') IN (m.Code13, '!$NONE$!')
AND NVL(d.Code14, '!$NONE$!') IN (m.Code14, '!$NONE$!')
AND NVL(d.Code15, '!$NONE$!') IN (m.Code15, '!$NONE$!')
AND NVL(d.Code16, '!$NONE$!') IN (m.Code16, '!$NONE$!')
AND NVL(d.Code17, '!$NONE$!') IN (m.Code17, '!$NONE$!')
AND NVL(d.Code18, '!$NONE$!') IN (m.Code18, '!$NONE$!')
AND NVL(d.Code19, '!$NONE$!') IN (m.Code19, '!$NONE$!')
AND NVL(d.Code20, '!$NONE$!') IN (m.Code20, '!$NONE$!')
AND NVL(d.Code21, '!$NONE$!') IN (m.Code21, '!$NONE$!')
AND NVL(d.Code22, '!$NONE$!') IN (m.Code22, '!$NONE$!')
AND NVL(d.Code23, '!$NONE$!') IN (m.Code23, '!$NONE$!')
AND NVL(d.Code24, '!$NONE$!') IN (m.Code24, '!$NONE$!')
AND NVL(d.Code25, '!$NONE$!') IN (m.Code25, '!$NONE$!')
AND NVL(d.Code26, '!$NONE$!') IN (m.Code26, '!$NONE$!')
AND NVL(d.Code27, '!$NONE$!') IN (m.Code27, '!$NONE$!')
AND NVL(d.Code28, '!$NONE$!') IN (m.Code28, '!$NONE$!')
AND NVL(d.Code29, '!$NONE$!') IN (m.Code29, '!$NONE$!')
AND NVL(d.Code30, '!$NONE$!') IN (m.Code30, '!$NONE$!')
|
| IH#DetailsReportFilter |
|---|
SELECT Id, FieldName, VALUE FROM Hierarchypropertydetails d UNPIVOT EXCLUDE NULLS (VALUE FOR FieldName IN(locationCode, ProductCode, ENDUseCode, EndCustomerCode, Code1, CODE2, Code3, CODE4, Code5, Code6, CODE7, Code8, CODE9, Code10, Code11, CODE12, Code13, CODE14, Code15, Code16, CODE17, Code18, CODE19, Code20, Code21, CODE22, Code23, CODE24, Code25, Code26, CODE27, Code28, CODE29, Code30, HierarchyCode1, HierarchyCode2, HierarchyCode3, HierarchyCode4, HierarchyCode5, HierarchyCode6, HierarchyCode7, HierarchyCode8, HierarchyCode9, HierarchyCode10, HierarchyCode11, HierarchyCode12, HierarchyCode13, HierarchyCode14, HierarchyCode15, Property1, Property2, Property3, Property4, Property5, Property6, Property7, Property8, Property9, Property10, Property11, Property12, Property12, Property14, Property15, EndCustomerCode, EndCustomerHierarchyCode1, EndCustomerHierarchyCode2, EndCustomerHierarchyCode3, EndCustomerHierarchyCode4, EndCustomerHierarchyCode5, EndCustomerHierarchyCode6, EndCustomerHierarchyCode7, EndCustomerHierarchyCode8, EndCustomerHierarchyCode9, EndCustomerHierarchyCode10, EndCustomerHierarchyCode11, EndCustomerHierarchyCode12, EndCustomerHierarchyCode13, EndCustomerHierarchyCode14, EndCustomerHierarchyCode15 )) |
| IH#DetailsSku |
|---|
SELECT d.Id DetailId, smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, smu.EndUseId, smu.EndCustomerId
FROM HierarchyPropertyDetails d
JOIN MaterialDetails md ON md.PropertyBits = d.PropertyBits AND md.PropertyHash = d.PropertyHash
JOIN LocationDetails ld ON ld.HierarchyBits = d.HierarchyBits AND ld.HierarchyHash = d.HierarchyHash
LEFT JOIN EndUseDetails ed ON ed.EndUseBits = d.EndUseBits AND ed.EndUseHash = d.EndUseHash
LEFT JOIN LocationDetails cd ON cd.HierarchyBits = d.EndCustomerHierarchyBits AND cd.HierarchyHash = d.EndCustomerHierarchyHash
JOIN SiteMaterialUsages smu
ON smu.MaterialId = md.MaterialId
AND smu.LocationId = ld.LocationId
AND NVL(smu.EndUseId,0) = NVL(ed.EndUseId,0)
AND NVL(smu.EndCustomerId,smu.LocationId) = NVL(cd.LocationId,smu.LocationId)
|
| IH#EndCustomerHierarchies |
|---|
SELECT LocationId EndCustomerId, LocationCode EndCustomerCode, LocationName EndCustomerName, HierarchyCode1 EndCustomerHierarchyCode1, HierarchyCode2 EndCustomerHierarchyCode2, HierarchyCode3 EndCustomerHierarchyCode3, HierarchyCode4 EndCustomerHierarchyCode4, HierarchyCode5 EndCustomerHierarchyCode5, HierarchyCode6 EndCustomerHierarchyCode6, HierarchyCode7 EndCustomerHierarchyCode7, HierarchyCode8 EndCustomerHierarchyCode8, HierarchyCode9 EndCustomerHierarchyCode9, HierarchyCode10 EndCustomerHierarchyCode10, HierarchyCode11 EndCustomerHierarchyCode11, HierarchyCode12 EndCustomerHierarchyCode12, HierarchyCode13 EndCustomerHierarchyCode13, HierarchyCode14 EndCustomerHierarchyCode14, HierarchyCode15 EndCustomerHierarchyCode15 FROM ExpandedLocationsSpec |
| IH#EndPointSkuPortions |
|---|
SELECT m.MaterialName, l.LocationName, lrs.SiteMaterialUsageId SourceSiteMaterialUSageId, lrs.ConsignmentLocationId, rs.SitematerialusageId,
DECODE(rs.StartSkuId, lrs.SiteMaterialUsageID, 1, 0) IsDirect, lrs.MaterialId, lrs.GroupKey, rs.TargetProductionSites,
rs.DateFrom, rs.DateTo, MAX(lrs.TotalTimePeriod + rs.TimePeriod) TotalTimePeriod, SUM(rs.Portion) Portion
FROM (SELECT PointId, SiteMaterialUsageId, ConsignmentLocationId, TotalTimePeriod, GroupKey, LocationId, MaterialId
FROM (SELECT rs.*,
ROW_NUMBER() OVER(PARTITION BY PointId, SiteMaterialUsageId, ConsignmentLocationId ORDER BY totalTimePeriod DESC) R
FROM ReplenishedSku rs
WHERE 1=1
AND NVL(PriorityPath,1) = 1
) t
WHERE t.r = 1) lrs
JOIN (SELECT rp.Id PointId, rp.SiteMaterialUsageId StartSkuId, rcs.SiteMaterialUsageId, rcs.DateFrom, rcs.DateTo,
Portion, rcs.TimePeriod, TargetProductionSites
FROM ReplenishedCustomerSku rcs
JOIN ReplenishedPoints rp
ON rp.SiteMaterialUsageId = rcs.SourceSitematerialusageid) rs
ON rs.PointID = lrs.PointId
JOIN Locations l
ON lrs.LocationId = l.Id
JOIN Materials m
ON lrs.MaterialId = m.Id
GROUP BY m.MaterialName, l.LocationName, lrs.SiteMaterialUsageId, lrs.ConsignmentLocationId, rs.Sitematerialusageid,
DECODE(rs.StartSkuId, lrs.SiteMaterialUsageID, 1, 0), lrs.MaterialId, lrs.GroupKey, rs.TargetProductionSites, rs.DateFrom, rs.DateTo
|
| IH#EndPointSkuPortions2 |
|---|
SELECT m.MaterialName, l.LocationName, lrs.SiteMaterialUsageId SourceSiteMaterialUSageId,
lrs.ConsignmentLocationId, rs.SitematerialusageId, PriorityPath,
DECODE(rs.StartSkuId, lrs.SiteMaterialUsageID, 1, 0) IsDirect, lrs.MaterialId, lrs.GroupKey,
rs.TargetProductionSites, rs.DateFrom, rs.DateTo, MAX(lrs.TotalTimePeriod + rs.TimePeriod) TotalTimePeriod,
SUM(rs.Portion) Portion
FROM (
SELECT PointId, SiteMaterialUsageId, ConsignmentLocationId, TotalTimePeriod, GroupKey, LocationId,
MaterialId, PriorityPath2 PriorityPath
FROM (SELECT rs.*, NVL(PriorityPath, 1) PriorityPath2,
ROW_NUMBER() OVER(PARTITION BY PointId, SiteMaterialUsageId, ConsignmentLocationId ORDER BY totalTimePeriod DESC) R
FROM ReplenishedSku rs
WHERE 1 = 1) t
WHERE t.r = 1
) lrs
JOIN (
SELECT rp.Id PointId, rp.SiteMaterialUsageId StartSkuId, rcs.SiteMaterialUsageId, rcs.DateFrom,
rcs.DateTo, Portion, rcs.TimePeriod, rp.TargetProductionSites
FROM ReplenishedCustomerSku rcs
JOIN ReplenishedPoints rp
ON rp.SiteMaterialUsageId = rcs.SourceSitematerialusageid
) rs
ON rs.PointID = lrs.PointId
JOIN Locations l
ON lrs.LocationId = l.Id
JOIN Materials m
ON lrs.MaterialId = m.Id
GROUP BY m.MaterialName, l.LocationName, lrs.SiteMaterialUsageId, lrs.ConsignmentLocationId,
rs.Sitematerialusageid, DECODE(rs.StartSkuId, lrs.SiteMaterialUsageID, 1, 0), lrs.MaterialId,
lrs.GroupKey, rs.TargetProductionSites, rs.DateFrom, PriorityPath, rs.DateTo
|
| IH#EOrderingOrderLines |
|---|
SELECT Id EntityId from OrderLines ol
WHERE NOT EXISTS (SELECT 1
FROM Workcentres wc
where ol.LocationID = wc.LocationID)
AND ol.IsConfirmed = 1
|
| IH#EOTOrderLines |
|---|
SELECT Id EntityId from OrderLines ol
WHERE NOT EXISTS (SELECT 1
FROM Workcentres wc
where ol.LocationID = wc.LocationID)
AND ReAtpRequired = 0
AND IsConfirmed = 1
|
| IH#ExpandedDetails | Transposed HierarchyPropertyDetails for using as list field-value. |
|---|
WITH q AS
(SELECT *
FROM HierarchyPropertyDetails UNPIVOT
EXCLUDE NULLS(VALUE FOR PROPERTY IN(HierarchyCode1, HierarchyCode2,
HierarchyCode3, HierarchyCode4,
HierarchyCode5, HierarchyCode6,
HierarchyCode7, HierarchyCode8,
HierarchyCode9, HierarchyCode10,
HierarchyCode11, HierarchyCode12,
HierarchyCode13, HierarchyCode14,
HierarchyCode15, LocationCode,
Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10,
Code11, Code12, Code13, Code14, Code15, Code16, Code17, Code18, Code19, Code20,
Code21, Code22, Code23, Code24, Code25, Code26, Code27, Code28, Code29, Code30,
Productcode)))
SELECT q.Id, h.DescriptiveFieldName, h.Description, VALUE
FROM q
JOIN Ih#modelcharacteristics2 h
ON UPPER(h.FieldCode) = Upper(Property)
ORDER BY 1
|
| IH#ExpandedHierarchies |
|---|
SELECT HierarchyId, MAX(Latitude) Latitude, MAX(Longitude) Longitude, MAX(DECODE(OrderNo, 1, HierarchyCode, NULL)) AS HierarchyCode1, MAX(DECODE(OrderNo, 1, HierarchyName, NULL)) AS HierarchyName1, MAX(DECODE(OrderNo, 2, HierarchyCode, NULL)) AS HierarchyCode2, MAX(DECODE(OrderNo, 2, HierarchyName, NULL)) AS HierarchyName2, MAX(DECODE(OrderNo, 3, HierarchyCode, NULL)) AS HierarchyCode3, MAX(DECODE(OrderNo, 3, HierarchyName, NULL)) AS HierarchyName3, MAX(DECODE(OrderNo, 4, HierarchyCode, NULL)) AS HierarchyCode4, MAX(DECODE(OrderNo, 4, HierarchyName, NULL)) AS HierarchyName4, MAX(DECODE(OrderNo, 5, HierarchyCode, NULL)) AS HierarchyCode5, MAX(DECODE(OrderNo, 5, HierarchyName, NULL)) AS HierarchyName5, MAX(DECODE(OrderNo, 6, HierarchyCode, NULL)) AS HierarchyCode6, MAX(DECODE(OrderNo, 6, HierarchyName, NULL)) AS HierarchyName6, MAX(DECODE(OrderNo, 7, HierarchyCode, NULL)) AS HierarchyCode7, MAX(DECODE(OrderNo, 7, HierarchyName, NULL)) AS HierarchyName7, MAX(DECODE(OrderNo, 8, HierarchyCode, NULL)) AS HierarchyCode8, MAX(DECODE(OrderNo, 8, HierarchyName, NULL)) AS HierarchyName8, MAX(DECODE(OrderNo, 9, HierarchyCode, NULL)) AS HierarchyCode9, MAX(DECODE(OrderNo, 9, HierarchyName, NULL)) AS HierarchyName9, MAX(DECODE(OrderNo, 10, HierarchyCode, NULL)) AS HierarchyCode10, MAX(DECODE(OrderNo, 10, HierarchyName, NULL)) AS HierarchyName10, MAX(DECODE(OrderNo, 11, HierarchyCode, NULL)) AS HierarchyCode11, MAX(DECODE(OrderNo, 11, HierarchyName, NULL)) AS HierarchyName11, MAX(DECODE(OrderNo, 12, HierarchyCode, NULL)) AS HierarchyCode12, MAX(DECODE(OrderNo, 12, HierarchyName, NULL)) AS HierarchyName12, MAX(DECODE(OrderNo, 13, HierarchyCode, NULL)) AS HierarchyCode13, MAX(DECODE(OrderNo, 13, HierarchyName, NULL)) AS HierarchyName13, MAX(DECODE(OrderNo, 14, HierarchyCode, NULL)) AS HierarchyCode14, MAX(DECODE(OrderNo, 14, HierarchyName, NULL)) AS HierarchyName14, MAX(DECODE(OrderNo, 15, HierarchyCode, NULL)) AS HierarchyCode15, MAX(DECODE(OrderNo, 15, HierarchyName, NULL)) AS HierarchyName15 FROM (SELECT eh.HierarchyId, h.HierarchyCode, h.HierarchyName, hl.OrderNo, Latitude, Longitude FROM ExpandedHierarchies eh, Hierarchies h, HierarchyLevelsIPlanView hl WHERE h.Id = eh.ParentHierarchyId AND h.HierarchyLevelId = hl.Id) GROUP BY HierarchyId |
| IH#ExpandedHierarchyDetails | Transposed HierarchyPropertyDetails for using in SupercessionRules. |
|---|
WITH q AS
(
SELECT *
FROM HierarchyPropertyDetails UNPIVOT
EXCLUDE NULLS
(VALUE FOR PROPERTY IN(
HierarchyCode1, HierarchyCode2, HierarchyCode3, HierarchyCode4, HierarchyCode5,
HierarchyCode6, HierarchyCode7, HierarchyCode8, HierarchyCode9, HierarchyCode10,
HierarchyCode11, HierarchyCode12, HierarchyCode13, HierarchyCode14, HierarchyCode15,
LocationCode))
)
SELECT q.Id, core.asCsv(CAST(COLLECT(h.DescriptiveFieldName ORDER BY OrderNo) AS ParameterArray)) Fields,
core.asCsv(CAST(COLLECT(VALUE ORDER by OrderNo) AS ParameterArray)) FieldValues
FROM q
JOIN Ih#modelcharacteristics2 h
ON UPPER(h.FieldCode) = Upper(Property)
GROUP BY q.Id
|
| IH#ExpandedLocations |
|---|
SELECT LocationId, LocationName, LocationCode, MAX(DECODE(OrderNo, 1, HierarchyCode, NULL)) AS HierarchyCode1, MAX(DECODE(OrderNo, 1, HierarchyName, NULL)) AS HierarchyName1, MAX(DECODE(OrderNo, 2, HierarchyCode, NULL)) AS HierarchyCode2, MAX(DECODE(OrderNo, 2, HierarchyName, NULL)) AS HierarchyName2, MAX(DECODE(OrderNo, 3, HierarchyCode, NULL)) AS HierarchyCode3, MAX(DECODE(OrderNo, 3, HierarchyName, NULL)) AS HierarchyName3, MAX(DECODE(OrderNo, 4, HierarchyCode, NULL)) AS HierarchyCode4, MAX(DECODE(OrderNo, 4, HierarchyName, NULL)) AS HierarchyName4, MAX(DECODE(OrderNo, 5, HierarchyCode, NULL)) AS HierarchyCode5, MAX(DECODE(OrderNo, 5, HierarchyName, NULL)) AS HierarchyName5, MAX(DECODE(OrderNo, 6, HierarchyCode, NULL)) AS HierarchyCode6, MAX(DECODE(OrderNo, 6, HierarchyName, NULL)) AS HierarchyName6, MAX(DECODE(OrderNo, 7, HierarchyCode, NULL)) AS HierarchyCode7, MAX(DECODE(OrderNo, 7, HierarchyName, NULL)) AS HierarchyName7, MAX(DECODE(OrderNo, 8, HierarchyCode, NULL)) AS HierarchyCode8, MAX(DECODE(OrderNo, 8, HierarchyName, NULL)) AS HierarchyName8, MAX(DECODE(OrderNo, 9, HierarchyCode, NULL)) AS HierarchyCode9, MAX(DECODE(OrderNo, 9, HierarchyName, NULL)) AS HierarchyName9, MAX(DECODE(OrderNo, 10, HierarchyCode, NULL)) AS HierarchyCode10, MAX(DECODE(OrderNo, 10, HierarchyName, NULL)) AS HierarchyName10, MAX(DECODE(OrderNo, 11, HierarchyCode, NULL)) AS HierarchyCode11, MAX(DECODE(OrderNo, 11, HierarchyName, NULL)) AS HierarchyName11, MAX(DECODE(OrderNo, 12, HierarchyCode, NULL)) AS HierarchyCode12, MAX(DECODE(OrderNo, 12, HierarchyName, NULL)) AS HierarchyName12, MAX(DECODE(OrderNo, 13, HierarchyCode, NULL)) AS HierarchyCode13, MAX(DECODE(OrderNo, 13, HierarchyName, NULL)) AS HierarchyName13, MAX(DECODE(OrderNo, 14, HierarchyCode, NULL)) AS HierarchyCode14, MAX(DECODE(OrderNo, 14, HierarchyName, NULL)) AS HierarchyName14, MAX(DECODE(OrderNo, 15, HierarchyCode, NULL)) AS HierarchyCode15, MAX(DECODE(OrderNo, 15, HierarchyName, NULL)) AS HierarchyName15 FROM (SELECT el.LocationId, l.LocationName, l.LocationCode, h.HierarchyCode, h.HierarchyName, HierarchyLevelId, hl.OrderNo FROM ExpandedLocations el JOIN Hierarchies h ON h.Id = el.HierarchyId JOIN Hierarchylevelsiplanview hl ON hl.Id = h.HierarchyLevelId JOIN Locations l ON l.Id = el.LocationId ) GROUP BY LocationId, LocationName, LocationCode UNION ALL SELECT l.Id, LocationName, LocationCode, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL from locations l Where HierarchyId is null |
| IH#ExpandedPrices |
|---|
SELECT SiteMaterialUsageId, DateFrom, DateTo, CurrencyId, Price, PriceRuleId, Note, 'Price rules' as PriceSource
FROM ExpandedPrices
WHERE 'PriceRules' = (SELECT NVL(MIN(VALUE),'PriceRules') FROM SystemParameters WHERE ParameterName = 'PriceRuleType')
UNION ALL
SELECT SiteMaterialUsageId, DateFrom, DateTo, CurrencyId, Price, NULL as PriceRuleId, NULL as Note, 'Average prices' as PriceSource
FROM AverageExpandedPrices ap
WHERE 'PriceRules' != (SELECT NVL(MIN(VALUE),'PriceRules') FROM SystemParameters WHERE ParameterName = 'PriceRuleType')
UNION ALL
SELECT SiteMaterialUsageId, DateFrom, DateTo, CurrencyId, Price, PriceRuleId, Note, 'Price rules over average prices' as PriceSource
FROM ExpandedPrices ep
WHERE 'PriceRules' != (SELECT NVL(MIN(VALUE),'PriceRules') FROM SystemParameters WHERE ParameterName = 'PriceRuleType')
AND NOT EXISTS (SELECT 1 FROM AverageExpandedPrices ap
Where SiteMaterialUsageId = ep.SiteMaterialUsageId
AND core.getTruncatedInternalDate BETWEEN DateFrom AND DateTo)
|
| IH#ExpandedProperties |
|---|
SELECT PropertyValueId,
MAX(DECODE(OrderNo, 1, PropertyValueCode, NULL)) AS Code1, MAX(DECODE(OrderNo, 1, VALUE, NULL)) AS Value1,
MAX(DECODE(OrderNo, 2, PropertyValueCode, NULL)) AS Code2, MAX(DECODE(OrderNo, 2, VALUE, NULL)) AS Value2,
MAX(DECODE(OrderNo, 3, PropertyValueCode, NULL)) AS Code3, MAX(DECODE(OrderNo, 3, VALUE, NULL)) AS Value3,
MAX(DECODE(OrderNo, 4, PropertyValueCode, NULL)) AS Code4, MAX(DECODE(OrderNo, 4, VALUE, NULL)) AS Value4,
MAX(DECODE(OrderNo, 5, PropertyValueCode, NULL)) AS Code5, MAX(DECODE(OrderNo, 5, VALUE, NULL)) AS Value5,
MAX(DECODE(OrderNo, 6, PropertyValueCode, NULL)) AS Code6, MAX(DECODE(OrderNo, 6, VALUE, NULL)) AS Value6,
MAX(DECODE(OrderNo, 7, PropertyValueCode, NULL)) AS Code7, MAX(DECODE(OrderNo, 7, VALUE, NULL)) AS Value7,
MAX(DECODE(OrderNo, 8, PropertyValueCode, NULL)) AS Code8, MAX(DECODE(OrderNo, 8, VALUE, NULL)) AS Value8,
MAX(DECODE(OrderNo, 9, PropertyValueCode, NULL)) AS Code9, MAX(DECODE(OrderNo, 9, VALUE, NULL)) AS Value9,
MAX(DECODE(OrderNo, 10, PropertyValueCode, NULL)) AS Code10, MAX(DECODE(OrderNo, 10, VALUE, NULL)) AS Value10,
MAX(DECODE(OrderNo, 11, PropertyValueCode, NULL)) AS Code11, MAX(DECODE(OrderNo, 11, VALUE, NULL)) AS Value11,
MAX(DECODE(OrderNo, 12, PropertyValueCode, NULL)) AS Code12, MAX(DECODE(OrderNo, 12, VALUE, NULL)) AS Value12,
MAX(DECODE(OrderNo, 13, PropertyValueCode, NULL)) AS Code13, MAX(DECODE(OrderNo, 13, VALUE, NULL)) AS Value13,
MAX(DECODE(OrderNo, 14, PropertyValueCode, NULL)) AS Code14, MAX(DECODE(OrderNo, 14, VALUE, NULL)) AS Value14,
MAX(DECODE(OrderNo, 15, PropertyValueCode, NULL)) AS Code15, MAX(DECODE(OrderNo, 15, VALUE, NULL)) AS Value15,
MAX(DECODE(OrderNo, 16, PropertyValueCode, NULL)) AS Code16, MAX(DECODE(OrderNo, 16, VALUE, NULL)) AS Value16,
MAX(DECODE(OrderNo, 17, PropertyValueCode, NULL)) AS Code17, MAX(DECODE(OrderNo, 17, VALUE, NULL)) AS Value17,
MAX(DECODE(OrderNo, 18, PropertyValueCode, NULL)) AS Code18, MAX(DECODE(OrderNo, 18, VALUE, NULL)) AS Value18,
MAX(DECODE(OrderNo, 19, PropertyValueCode, NULL)) AS Code19, MAX(DECODE(OrderNo, 19, VALUE, NULL)) AS Value19,
MAX(DECODE(OrderNo, 20, PropertyValueCode, NULL)) AS Code20, MAX(DECODE(OrderNo, 20, VALUE, NULL)) AS Value20,
MAX(DECODE(OrderNo, 21, PropertyValueCode, NULL)) AS Code21, MAX(DECODE(OrderNo, 21, VALUE, NULL)) AS Value21,
MAX(DECODE(OrderNo, 22, PropertyValueCode, NULL)) AS Code22, MAX(DECODE(OrderNo, 22, VALUE, NULL)) AS Value22,
MAX(DECODE(OrderNo, 23, PropertyValueCode, NULL)) AS Code23, MAX(DECODE(OrderNo, 23, VALUE, NULL)) AS Value23,
MAX(DECODE(OrderNo, 24, PropertyValueCode, NULL)) AS Code24, MAX(DECODE(OrderNo, 24, VALUE, NULL)) AS Value24,
MAX(DECODE(OrderNo, 25, PropertyValueCode, NULL)) AS Code25, MAX(DECODE(OrderNo, 25, VALUE, NULL)) AS Value25,
MAX(DECODE(OrderNo, 26, PropertyValueCode, NULL)) AS Code26, MAX(DECODE(OrderNo, 26, VALUE, NULL)) AS Value26,
MAX(DECODE(OrderNo, 27, PropertyValueCode, NULL)) AS Code27, MAX(DECODE(OrderNo, 27, VALUE, NULL)) AS Value27,
MAX(DECODE(OrderNo, 28, PropertyValueCode, NULL)) AS Code28, MAX(DECODE(OrderNo, 28, VALUE, NULL)) AS Value28,
MAX(DECODE(OrderNo, 29, PropertyValueCode, NULL)) AS Code29, MAX(DECODE(OrderNo, 29, VALUE, NULL)) AS Value29,
MAX(DECODE(OrderNo, 30, PropertyValueCode, NULL)) AS Code30, MAX(DECODE(OrderNo, 30, VALUE, NULL)) AS Value30
FROM (SELECT em.PropertyValueId, pv.PropertyValueCode,
pv.Value, pv.PropertyId, p.OrderNo
FROM ExpandedPropertyValues em, PropertyValues pv, Propertiesiplanview p
WHERE pv.Id = em.ParentPropertyValueId
AND pv.PropertyId = p.Id)
GROUP BY PropertyValueId
|
| IH#ExpandedPropertyValues |
|---|
SELECT ep.PropertyValueId, pv.PropertyValueCode, Value, pv.PropertyId, p.PropertyName FROM Expandedpropertyvalues ep jOIN PropertyValues pv ON (pv.Id = ep.ParentPropertyvalueid) JOIN Properties p ON (p.Id = pv.PropertyId) ORDER BY 1 |
| IH#FinForecastBudgets |
|---|
WITH mer AS (SELECT er.FromCurrencyId, er.DateFrom, (1 / (er.FromMultiplier / er.FromDivider)) * er.ToMultiplier / er.ToDivider Coef FROM MonthlyExchangeRates er WHERE er.ToCurrencyId = (SELECT MIN(c.Id) FROM Currencies c WHERE c.IsInternal = 1)), converted AS (SELECT fb.DateFrom, fb.SiteMaterialUsageId, Final, Round(fb.ForecastedPrice * er.Coef, 4) FinalPrice, Round(fb.NominalCost * erc.Coef, 4) NominalCost, NVL(last_value(DECODE(NominalCostAdjustment, 0, NULL, NominalCostAdjustment) IGNORE NULLS) OVER(PARTITION BY fb.SitematerialUsageId ORDER BY fb.DateFrom rows BETWEEN unbounded preceding AND 0 preceding), 0) NCA, NVL(last_value(DECODE(ValueAddAdjustment, 0, NULL, ValueAddAdjustment) IGNORE NULLS) OVER(PARTITION BY fb.SitematerialUsageId ORDER BY fb.DateFrom rows BETWEEN unbounded preceding AND 0 preceding), 0) VAA FROM IH#ForecastBudgets fb JOIN mer er ON er.FromCurrencyId = fb.PriceCurrencyId AND fb.DateFrom = er.DateFrom JOIN mer erc ON erc.FromCurrencyId = fb.CostCurrencyId AND fb.DateFrom = erc.DateFrom ), calculated AS (SELECT DateFrom, SiteMaterialUsageId, FINAL, FinalPrice + (FinalPrice - NominalCost) * NVL(VAA, 0) / 100 + NominalCost * NVL(NCA, 0) / 100 FinalPrice, NominalCost * (100 + NVL(NCA, 0)) / 100 NominalCost, (FinalPrice - NominalCost) * (100 + NVL(VAA, 0)) / 100 ValueAdd FROM converted c ) SELECT c.DateFrom, c.SiteMaterialUsageId, NVL(c.Final * c.FinalPrice, 0) BudgetRevenue, NVL(c.Final * c.NominalCost, 0) BudgetNominalCost, NVL(c.Final * c.ValueAdd, 0) BudgetValueAdd FROM calculated c |
| IH#FlatForecastChangeDetails |
|---|
SELECT fc.ForecastChangeId, f.CommentLink, core.asCsv(fc.Value1) Value1, core.asCsv(fc.Value2) Value2, core.asCsv(fc.Value3) Value3, core.asCsv(fc.Value4) Value4, core.asCsv(fc.Value5) Value5, core.asCsv(fc.Value6) Value6, core.asCsv(fc.Value7) Value7, core.asCsv(fc.Value8) Value8, core.asCsv(fc.Value9) Value9, core.asCsv(fc.Value10) Value10, core.asCsv(fc.Value11) Value11, core.asCsv(fc.Value12) Value12, core.asCsv(fc.Value13) Value13, core.asCsv(fc.Value14) Value14, core.asCsv(fc.Value15) Value15, core.asCsv(fc.Value16) Value16, core.asCsv(fc.Value17) Value17, core.asCsv(fc.Value18) Value18, core.asCsv(fc.Value19) Value19, core.asCsv(fc.Value20) Value20, core.asCsv(fc.Value21) Value21, core.asCsv(fc.Value22) Value22, core.asCsv(fc.Value23) Value23, core.asCsv(fc.Value24) Value24, core.asCsv(fc.Value25) Value25, core.asCsv(fc.Value26) Value26, core.asCsv(fc.Value27) Value27, core.asCsv(fc.Value28) Value28, core.asCsv(fc.Value29) Value29, core.asCsv(fc.Value30) Value30, core.asCsv(fc.hierarchyName1) HierarchyNam1, core.asCsv(fc.hierarchyName2) HierarchyName2, core.asCsv(fc.hierarchyName3) HierarchyName3, core.asCsv(fc.hierarchyName4) HierarchyName4, core.asCsv(fc.hierarchyName5) HierarchyName5, core.asCsv(fc.hierarchyName6) HierarchyName6, core.asCsv(fc.hierarchyName7) HierarchyName7, core.asCsv(fc.hierarchyName8) HierarchyName8, core.asCsv(fc.hierarchyName9) HierarchyName9, core.asCsv(fc.hierarchyName10) HierarchyName10, core.asCsv(fc.hierarchyName11) HierarchyName11, core.asCsv(fc.hierarchyName12) HierarchyName12, core.asCsv(fc.hierarchyName13) HierarchyName13, core.asCsv(fc.hierarchyName14) HierarchyName14, core.asCsv(fc.hierarchyName15) HierarchyName15, core.asCsv(fc.Property1) Property1, core.asCsv(fc.Property2) Property2, core.asCsv(fc.Property3) Property3, core.asCsv(fc.Property4) Property4, core.asCsv(fc.Property5) Property5, core.asCsv(fc.Property6) Property6, core.asCsv(fc.Property7) Property7, core.asCsv(fc.Property8) Property8, core.asCsv(fc.Property9) Property9, core.asCsv(fc.Property10) Property10, core.asCsv(fc.Property11) Property11, core.asCsv(fc.Property12) Property12, core.asCsv(fc.Property13) Property13, core.asCsv(fc.Property14) Property14, core.asCsv(fc.Property15) Property15, core.asCsv(fc.FullLocationCode) FullLocationCode, core.asCsv(fc.FullLocationName) FullLocationName, core.asCsv(fc.LocationCode) LocationCode, core.asCsv(fc.LocationName) LocationName, core.asCsv(fc.ProductCode) ProductCode, core.asCsv(fc.AlternateProduct) AlternateProduct, core.asCsv(fc.CurrencyDescription) CurrencyDescription, core.asCsv(fc.CurrencyName) CurrencyName, core.asCsv(fc.EndUseDescription) EndUseDescription, core.asCsv(fc.MaterialTypeName) MaterialTypeName FROM IH#FlatForecastChanges fc JOIN ForecastChanges f ON (f.Id = fc.ForecastChangeId) |
| IH#FlatForecastChanges |
|---|
SELECT ForecastChangeId,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE1', VALUE)) AS PArameterArray) AS Value1,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE2', VALUE)) AS PArameterArray) AS Value2,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE3', VALUE)) AS PArameterArray) AS Value3,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE4', VALUE)) AS PArameterArray) AS Value4,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE5', VALUE)) AS PArameterArray) AS Value5,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE6', VALUE)) AS PArameterArray) AS Value6,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE7', VALUE)) AS PArameterArray) AS Value7,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE8', VALUE)) AS PArameterArray) AS Value8,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE9', VALUE)) AS PArameterArray) AS Value9,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE10', VALUE)) AS PArameterArray) AS Value10,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE11', VALUE)) AS PArameterArray) AS Value11,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE12', VALUE)) AS PArameterArray) AS Value12,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE13', VALUE)) AS PArameterArray) AS Value13,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE14', VALUE)) AS PArameterArray) AS Value14,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE15', VALUE)) AS PArameterArray) AS Value15,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE16', VALUE)) AS PArameterArray) AS Value16,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE17', VALUE)) AS PArameterArray) AS Value17,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE18', VALUE)) AS PArameterArray) AS Value18,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE19', VALUE)) AS PArameterArray) AS Value19,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE20', VALUE)) AS PArameterArray) AS Value20,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE21', VALUE)) AS PArameterArray) AS Value21,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE22', VALUE)) AS PArameterArray) AS Value22,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE23', VALUE)) AS PArameterArray) AS Value23,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE24', VALUE)) AS PArameterArray) AS Value24,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE25', VALUE)) AS PArameterArray) AS Value25,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE26', VALUE)) AS PArameterArray) AS Value26,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE27', VALUE)) AS PArameterArray) AS Value27,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE28', VALUE)) AS PArameterArray) AS Value28,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE29', VALUE)) AS PArameterArray) AS Value29,
CAST(COLLECT(DECODE(m.FieldName, 'VALUE30', VALUE)) AS PArameterArray) AS Value30,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME1', VALUE)) AS PArameterArray) AS HierarchyName1,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME2', VALUE)) AS PArameterArray) AS HierarchyName2,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME3', VALUE)) AS PArameterArray) AS HierarchyName3,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME4', VALUE)) AS PArameterArray) AS HierarchyName4,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME5', VALUE)) AS PArameterArray) AS HierarchyName5,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME6', VALUE)) AS PArameterArray) AS HierarchyName6,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME7', VALUE)) AS PArameterArray) AS HierarchyName7,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME8', VALUE)) AS PArameterArray) AS HierarchyName8,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME9', VALUE)) AS PArameterArray) AS HierarchyName9,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME10', VALUE)) AS PArameterArray) AS HierarchyName10,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME11', VALUE)) AS PArameterArray) AS HierarchyName11,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME12', VALUE)) AS PArameterArray) AS HierarchyName12,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME13', VALUE)) AS PArameterArray) AS HierarchyName13,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME14', VALUE)) AS PArameterArray) AS HierarchyName14,
CAST(COLLECT(DECODE(m.FieldName, 'HIERARCHYNAME15', VALUE)) AS PArameterArray) AS HierarchyName15,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY1', VALUE)) AS PArameterArray) AS PROPERTY1,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY2', VALUE)) AS PArameterArray) AS PROPERTY2,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY3', VALUE)) AS PArameterArray) AS PROPERTY3,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY4', VALUE)) AS PArameterArray) AS PROPERTY4,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY5', VALUE)) AS PArameterArray) AS PROPERTY5,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY6', VALUE)) AS PArameterArray) AS PROPERTY6,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY7', VALUE)) AS PArameterArray) AS PROPERTY7,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY8', VALUE)) AS PArameterArray) AS PROPERTY8,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY9', VALUE)) AS PArameterArray) AS PROPERTY9,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY10', VALUE)) AS PArameterArray) AS PROPERTY10,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY11', VALUE)) AS PArameterArray) AS PROPERTY11,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY12', VALUE)) AS PArameterArray) AS PROPERTY12,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY13', VALUE)) AS PArameterArray) AS PROPERTY13,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY14', VALUE)) AS PArameterArray) AS PROPERTY14,
CAST(COLLECT(DECODE(m.FieldName, 'PROPERTY15', VALUE)) AS PArameterArray) AS Property15,
CAST(COLLECT(DECODE(m.FieldName, 'ENDUSEDESCRIPTION', VALUE)) AS PArameterArray) AS ENDUSEDESCRIPTION,
CAST(COLLECT(DECODE(m.FieldName, 'PRODUCTNAME', VALUE)) AS PArameterArray) AS PRODUCTNAME,
CAST(COLLECT(DECODE(m.FieldName, 'PRODUCTCODE', VALUE)) AS PArameterArray) AS PRODUCTCODE,
CAST(COLLECT(DECODE(m.FieldName, 'LOCATIONNAME', VALUE)) AS PArameterArray) AS LOCATIONNAME,
CAST(COLLECT(DECODE(m.FieldName, 'LOCATIONCODE', VALUE)) AS PArameterArray) AS LOCATIONCODE,
CAST(COLLECT(DECODE(m.FieldName, 'FULLLOCATIONNAME', VALUE)) AS PArameterArray) AS FULLLOCATIONNAME,
CAST(COLLECT(DECODE(m.FieldName, 'FULLLOCATIONCODE', VALUE)) AS PArameterArray) AS FULLLOCATIONCODE,
CAST(COLLECT(DECODE(m.FieldName, 'ALTERNATEPRODUCT', VALUE)) AS PArameterArray) AS ALTERNATEPRODUCT,
CAST(COLLECT(DECODE(m.FieldName, 'MATERIALTYPENAME', VALUE)) AS PArameterArray) AS MATERIALTYPENAME,
CAST(COLLECT(DECODE(m.FieldName, 'CURRENCYNAME', VALUE)) AS PArameterArray) AS CURRENCYNAME,
CAST(COLLECT(DECODE(m.FieldName, 'CURRENCYDESCRIPTION', VALUE)) AS PArameterArray) AS CURRENCYDESCRIPTION
FROM ForecastChangeDetails d JOIN IH#MappedFields m ON (UPPER(d.FieldName) = UPPER(m.FieldViewName))
GROUP BY ForecastChangeId
|
| IH#FlatSku |
|---|
SELECT Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Value11, Value12, Value13,
Value14, Value15, Value16, Value17, Value18, Value19, Value20,
Value21, Value22, Value23, Value24, Value25, Value26, Value27, Value28, Value29, Value30,
HierarchyName1, HierarchyName2, HierarchyName3, HierarchyName4, HierarchyName5, HierarchyName6,
HierarchyName7, HierarchyName8, HierarchyName9, HierarchyName10, HierarchyName11, HierarchyName12,
HierarchyName13, HierarchyName14, HierarchyName15, eu.Property1, eu.Property2, eu.Property3, eu.Property4, eu.Property5,
eu.Property6, eu.Property7, eu.Property8, eu.Property9, eu.Property10, eu.Property11, eu.Property12, eu.Property13, eu.Property14,
eu.Property15, l.LocationCode, m.MaterialCode ProductCode, l.LocationName, m.MaterialName ProductName,
ExistingAlternateProduct ALTERNATEPRODUCT, CurrencyDescription, CurrencyName, mt.MaterialTypeName, eu.EndUseDescription,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5,
l.LocationCode || ' ' || l.LocationName FullLocationCode,
l.LocationName || ' ' || l.LocationCode FullLocationName
FROM IH#CustomerSkus smu
JOIN Materials m
ON m.Id = smu.MaterialId
JOIN MaterialTypes mt
ON mt.ID = m.MaterialTypeId
JOIN MaterialPropsSpec ms
ON ms.MaterialId = m.Id
JOIN (SELECT t.ID, LocationName, LocationCode, CurrencyDescription, CurrencyName
FROM (SELECT loc.Id, LocationName, LocationCode, loc.CurrencyId
FROM Locations loc
WHERE CurrencyId IS NOT NULL
UNION ALL
SELECT loc.Id, LocationName, LocationCode,
(SELECT MIN(Id) CurrencyId FROM Currencies WHERE IsInternal = 1) CurrencyId
FROM Locations loc
WHERE loc.CurrencyId IS NULL) t
LEFT JOIN Currencies c
ON (c.Id = t.CurrencyId)) l
ON l.Id = smu.LocationId
LEFT JOIN ExpandedLocationsSpec es
ON es.LocationId = l.Id
LEFT JOIN EndUses eu
ON (eu.Id = smu.EndUseId)
|
| IH#ForecastBodies |
|---|
SELECT SiteMaterialUsageId, fb.DateFrom, DateFromIW, CalendarId, WeeklyEdited, fb.Final MonthlyForecast, SUM(fb.Final * fc.Coef) FINAL FROM ForecastBodies fb, ForecastWeeklyCoefs fc WHERE fc.Id = fb.FinalWeeklyCoefId AND fc.Datefrom = fb.DateFrom GROUP BY SiteMaterialUsageId, fb.DateFrom, DateFromIW, fb.Final, WeeklyEdited, CalendarId |
| IH#ForecastBudgets |
|---|
SELECT fs.Name ForecastSnapshotName,
b.Id, b.DateFrom, b.ForecastSnapshotId, b.SiteMaterialUsageId, b.FinalWeeklyCoefId,
DECODE(fs.IsConstrained, 1, b.Final - b.UnAllocated, b.Final) Final,
b.ForecastStatusId, b.SystemPriceCurrencyId, b.PriceCurrencyId, b.SystemPrice, b.ForecastedPrice, b.CostCurrencyId,
b.NominalCost, b.NominalCostAdjustment, b.ValueAddAdjustment, b.UnAllocated
FROM ForecastSnapshotBodies b
JOIN ForecastSnapshots fs
ON fs.Id = b.ForecastSnapshotId
AND IsBudget = 1
|
| IH#ForecastChangeDetails |
|---|
SELECT ForecastChangeId,
' AND ' || core.asCsv(CAST(COLLECT(FieldName || ' IN ( ' || ValueList || ')') AS PArameterArray), ' AND ') FILTER,
core.asCsv(CAST(COLLECT(FieldName) AS PArameterArray), ',') Fields,
core.asCsv(CAST(COLLECT(ValueList) AS PArameterArray), ',') FieldValues
FROM
(
SELECT ForecastChangeId, FieldName,
core.AsCsv(CAST(COLLECT('''' || Value || '''') AS PArameterArray), ', ') AS FilterValueList,
core.AsCsv(CAST(COLLECT(VALUE) AS PArameterArray), ';') AS ValueList
FROM ForecastChangeDetails
GROUP BY ForecastChangeId, FieldName
)
GROUP BY ForecastChangeId
|
| IH#ForecastedLocations |
|---|
SELECT *
FROM Locations l
WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.locationId = l.Id)
AND EXISTS (SELECT 1
FROM IH#CustomerSkus smu
WHERE smu.Locationid = l.Id
AND Status = 1)
|
| IH#ForecastedPrices |
|---|
SELECT fb.DateFrom, LAST_DAY(fb.DateFrom) AS DateTo,
fb.SiteMaterialUsageId, fb.SystemPrice, fb.ForecastedPrice, fb.PriceCurrencyId, fb.SystemPriceCurrencyId
FROM ForecastBodies fb
|
| IH#ForecastMethods |
|---|
SELECT fm.Id ID, fm.ForecastMethodTypeId, fm.Internal, fm.ForecastMethodName, fm.ForecastMethodDesc, fmt.ForecastMethodTypeName,
CASE WHEN fmt.ForecastMethodTypeName in ('DynamicRegression', 'MachineLearning') OR NVL(p.ParameterValue,0) = 1 THEN 1 ELSE 0 End allowTrends,
CASE WHEN fmt.ForecastMethodTypeName in ('DynamicRegression') THEN 1 ELSE 0 End requireTrends,
CASE WHEN fmt.ForecastMethodTypeName in ('LaunchProfile') THEN 1 ELSE 0 End allowProfile
FROM ForecastMethods fm
JOIN ForecastMethodTypes fmt
ON (fm.ForecastMethodTypeId = fmt.Id)
LEFT JOIN IH#MethodParameters p ON p.Id = fm.Id ANd ParameterName = 'IncludeMachineLearning'
ORDER BY 1
|
| IH#ForecastRangeValues |
|---|
SELECT v.RangeId, DayFrom, DayTo, Percentage / 100 / (DayTo-DayFrom + 1) Coef FROM ForecastRangeValues v UNION ALL SELECT 0, 1, 31, 100 FROM dual |
| IH#Forecasts |
|---|
SELECT f.*, add_months(f.StartDate, f.Horizon - 1) EndDate,
LAG(ID, 1) OVER(ORDER BY StartDate) PreviousForecastId,
LAG(StartDate, 1) OVER(ORDER BY StartDate) PreviousStartDate
FROM Forecasts f
|
| IH#ForecastSampleMethods |
|---|
SELECT ForecastSampleId, core.AsCsv(CAST(COLLECT(MethodName) AS ParameterArray), '; ') Methods FROM Forecastsamplemethods sm GROUP BY ForecastSampleId |
| IH#ForecastSnapshots |
|---|
SELECT 'Snapshot' TYPE, fs.ID, fs.NAME, fs.DESCRIPTION, fs.IsBudget, fs.IsShowOnGraph, fs.StartDate, fs.FinishDate, Trunc(fs.StartDate, 'IW') StartWeek, Trunc(Last_Day(fs.FinishDate), 'IW') FinishWeek, fs.Id OrderCondition, ufs.Name UnconstrainedName, fs.UnconstrainedSnapshotId, fs.IsConstrained FROM ForecastSnapshots fs LEFT JOIN Forecastsnapshots ufs ON (fs.UnconstrainedSnapshotid = ufs.ID) UNION ALL SELECT 'Forecast' TYPE, 0 ID, 'Monthly Forecast', 'Monthly Forecast' Description, 0 IsBudget, 0 IsShowOnGraph, NULL, NULL, NULL, NULL, -1 OrderCondition, NULL UnconstrainedName, NULL UnconstrainedSnapshotId, 0 IsConstrained FROM dual UNION ALL SELECT 'Forecast' TYPE, -1 ID, 'Monthly Forecast - Customer', 'Monthly Forecast - Customer' Description, 0 IsBudget, 0 IsShowOnGraph, NULL, NULL, NULL, NULL, -1 OrderCondition, NULL UnconstrainedName, NULL UnconstrainedSnapshotId, 0 IsConstrained FROM dual UNION ALL SELECT 'Forecast' TYPE, -2 ID, 'Monthly Forecast - System', 'Monthly Forecast - System' Description, 0 IsBudget, 0 IsShowOnGraph, NULL, NULL, NULL, NULL, -1 OrderCondition, NULL UnconstrainedName, NULL UnconstrainedSnapshotId, 0 IsConstrained FROM dual |
| IH#GridColumns |
|---|
SELECT g.Name GridName, gc.* FROM GridColumns gc JOIN grids g ON g.Id = gc.GridId |
| IH#GroupedProductRouteStages |
|---|
SELECT ProductRouteId, COUNT(1) quantity FROM ProductRouteStages prs WHERE EXISTS (SELECT 1 FROM ProductionConfigurations pc WHERE pc.ProductRouteId = prs.ProductRouteId) GROUP BY ProductRouteId HAVING COUNT(1) > 1 |
| IH#GroupedReplenishedSku |
|---|
SELECT r.GroupId, r.GroupType, r.MaterialId, r.ConsignmentLocationId, r.GroupKey, MIN(HighQuantity) HighQuantity, MIN(lowQuantity) LowQuantity, MIN(DaysOfSupply) DaysOfSupply, MIN(MaxDaysOfSupply) MaxDaysOfSupply, MAX(TransportTime) TransportTime, MIN(SafetyStockMethodId) SafetyStockMethodId, MIN(MaxSafetyStockMethodId) MaxSafetyStockMethodId, MIN(ForecastMethodId) ForecastMethodId, GREATEST(1, MAX(ReplenishmentFrequency)) ReplenishmentFrequency, GREATEST(1, MAX(MaxReplenishmentFrequency)) MaxReplenishmentFrequency, MIN(HistoryStartDate) HistoryStartDate FROM GroupedSku R JOIN Replenishedsku rs ON r.SiteMaterialUsageId = rs.SiteMaterialUsageId AND NVL(r.ConsignmentLocationId,0) = NVL(rs.ConsignmentLocationId,0) JOIN Replenishedpoints rp ON rs.PointId = rp.Id WHERE isSelected = 1 GROUP BY r.GroupId, r.GroupType, r.MaterialId, r.ConsignmentlocationId, r.GroupKey |
| IH#GroupedSku |
|---|
SELECT l.LocationName, l.LocationCode, m.MaterialName, m.MaterialCode, cl.LocationCode ConsignmentCustomerCode, cl.LocationName ConsignmentCustomerName, gs.GroupKey, smu.SiteMaterialUsageId, smu.MaterialId, gs.LocationId, smu.Replenished, SafetyStockMethodName, smu.UpperPercentile, smu.LowerPercentile, gs.DaysOfSupply, gs.HighQuantity, gs.LowQuantity, gs.TransportTime, gs.ReplenishmentFrequency FROM GroupedSku gs JOIN SafetyStockMethods ssm ON ssm.id = gs.SafetyStockMethodId JOIN IH#skus smu ON smu.SiteMaterialUsageId = gs.SiteMaterialUSageId AND NVL(smu.ConsignmentLocationId,0) = NVL(gs.ConsignmentLocationId, 0) JOIN Materials m ON m.Id = smu.MaterialId JOIN Locations l ON l.Id = smu.LocationId LEFT JOIN Locations cl ON cl.Id = gs.ConsignmentLocationId |
| IH#HierarchyPropertyDetails |
|---|
SELECT d.*,
RTRIM(NVL2(HierarchyCode1, HierarchyCode1 || ' / ', '') ||
NVL2(HierarchyCode2, HierarchyCode2 || ' / ', '') ||
NVL2(HierarchyCode3, HierarchyCode3 || ' / ', '') ||
NVL2(HierarchyCode4, HierarchyCode4 || ' / ', '') ||
NVL2(HierarchyCode5, HierarchyCode5 || ' / ', '') ||
NVL2(HierarchyCode6, HierarchyCode6 || ' / ', '') ||
NVL2(HierarchyCode7, HierarchyCode7 || ' / ', '') ||
NVL2(HierarchyCode8, HierarchyCode8 || ' / ', '') ||
NVL2(HierarchyCode9, HierarchyCode9 || ' / ', '') ||
NVL2(HierarchyCode10, HierarchyCode10 || ' / ', '') ||
NVL2(HierarchyCode11, HierarchyCode11 || ' / ', '') ||
NVL2(HierarchyCode12, HierarchyCode12 || ' / ', '') ||
NVL2(HierarchyCode13, HierarchyCode13 || ' / ', '') ||
NVL2(HierarchyCode14, HierarchyCode14 || ' / ', '') ||
NVL2(HierarchyCode15, HierarchyCode15 || ' / ', '') ||
NVL2(LocationCode, LocationCode || ' / ', '') ||
NVL2(Code1, Code1 || ' / ', '') ||
NVL2(Code2, Code2 || ' / ', '') ||
NVL2(Code3, Code3 || ' / ', '') ||
NVL2(Code4, Code4 || ' / ', '') ||
NVL2(Code5, Code5 || ' / ', '') ||
NVL2(Code6, Code6 || ' / ', '') ||
NVL2(Code7, Code7 || ' / ', '') ||
NVL2(Code8, Code8 || ' / ', '') ||
NVL2(Code9, Code9 || ' / ', '') ||
NVL2(Code10, Code10 || ' / ', '') ||
NVL2(Code11, Code11 || ' / ', '') ||
NVL2(Code12, Code12 || ' / ', '') ||
NVL2(Code13, Code13 || ' / ', '') ||
NVL2(Code14, Code14 || ' / ', '') ||
NVL2(Code15, Code15 || ' / ', '') ||
NVL2(Code16, Code16 || ' / ', '') ||
NVL2(Code17, Code17 || ' / ', '') ||
NVL2(Code18, Code18 || ' / ', '') ||
NVL2(Code19, Code19 || ' / ', '') ||
NVL2(Code20, Code20 || ' / ', '') ||
NVL2(Code21, Code21 || ' / ', '') ||
NVL2(Code22, Code22 || ' / ', '') ||
NVL2(Code23, Code23 || ' / ', '') ||
NVL2(Code24, Code24 || ' / ', '') ||
NVL2(Code25, Code25 || ' / ', '') ||
NVL2(Code26, Code26 || ' / ', '') ||
NVL2(Code27, Code27 || ' / ', '') ||
NVL2(Code28, Code28 || ' / ', '') ||
NVL2(Code29, Code29 || ' / ', '') ||
NVL2(Code30, Code30 || ' / ', '') ||
NVL2(ProductCode, ProductCode || ' / ', ''),
' / ') Description,
core.AsCsv(ParameterArray(Code1, CODE2, Code3, CODE4, Code5, Code6, CODE7, Code8, CODE9, Code10,
Code11, CODE12, Code13, CODE14, Code15, Code16, CODE17, Code18, CODE19, Code20,
Code21, CODE22, Code23, CODE24, Code25, Code26, CODE27, Code28, CODE29, Code30), '#!#', 1) PropertiesCode,
core.AsCsv(ParameterArray(HierarchyCode1, HierarchyCode2, HierarchyCode3, HierarchyCode4, HierarchyCode5,
HierarchyCode6, HierarchyCode7, HierarchyCode8, HierarchyCode9, HierarchyCode10,
HierarchyCode11, HierarchyCode12, HierarchyCode13, HierarchyCode14, HierarchyCode15), '#!#', 1) HierarchiesCode,
STANDARD_HASH(
ProductCode || CHR(31) ||
Code1 || CHR(31) || Code2 || CHR(31) || Code3 || CHR(31) ||
Code4 || CHR(31) || Code5 || CHR(31) || Code6 || CHR(31) ||
Code7 || CHR(31) || Code8 || CHR(31) || Code9 || CHR(31) ||
Code10 || CHR(31) || Code11 || CHR(31) || Code12 || CHR(31) ||
Code13 || CHR(31) || Code14 || CHR(31) || Code15 || CHR(31) ||
Code16 || CHR(31) || Code17 || CHR(31) || Code18 || CHR(31) ||
Code19 || CHR(31) || Code20 || CHR(31) || Code21 || CHR(31) ||
Code22 || CHR(31) || Code23 || CHR(31) || Code24 || CHR(31) ||
Code25 || CHR(31) || Code26 || CHR(31) || Code27 || CHR(31) ||
Code28 || CHR(31) || Code29 || CHR(31) || Code30 || CHR(31) ||
-- Hierarchy group: LocationCode, HierarchyCode1..15
LocationCode || CHR(31) ||
HierarchyCode1 || CHR(31) || HierarchyCode2 || CHR(31) || HierarchyCode3 || CHR(31) ||
HierarchyCode4 || CHR(31) || HierarchyCode5 || CHR(31) || HierarchyCode6 || CHR(31) ||
HierarchyCode7 || CHR(31) || HierarchyCode8 || CHR(31) || HierarchyCode9 || CHR(31) ||
HierarchyCode10 || CHR(31) || HierarchyCode11 || CHR(31) || HierarchyCode12 || CHR(31) ||
HierarchyCode13 || CHR(31) || HierarchyCode14 || CHR(31) || HierarchyCode15 || CHR(31) ||
-- End-use group: EndUseCode, Property1..15
EndUseCode || CHR(31) ||
Property1 || CHR(31) || Property2 || CHR(31) || Property3 || CHR(31) ||
Property4 || CHR(31) || Property5 || CHR(31) || Property6 || CHR(31) ||
Property7 || CHR(31) || Property8 || CHR(31) || Property9 || CHR(31) ||
Property10 || CHR(31) || Property11 || CHR(31) || Property12 || CHR(31) ||
Property13 || CHR(31) || Property14 || CHR(31) || Property15 || CHR(31) ||
-- End-customer hierarchy group: EndCustomerCode, EndCustomerHierarchyCode1..15
EndCustomerCode || CHR(31) ||
EndCustomerHierarchyCode1 || CHR(31) || EndCustomerHierarchyCode2 || CHR(31) || EndCustomerHierarchyCode3 || CHR(31) ||
EndCustomerHierarchyCode4 || CHR(31) || EndCustomerHierarchyCode5 || CHR(31) || EndCustomerHierarchyCode6 || CHR(31) ||
EndCustomerHierarchyCode7 || CHR(31) || EndCustomerHierarchyCode8 || CHR(31) || EndCustomerHierarchyCode9 || CHR(31) ||
EndCustomerHierarchyCode10 || CHR(31) || EndCustomerHierarchyCode11 || CHR(31) || EndCustomerHierarchyCode12 || CHR(31) ||
EndCustomerHierarchyCode13 || CHR(31) || EndCustomerHierarchyCode14 || CHR(31) || EndCustomerHierarchyCode15, 'SHA256') DetailsHash
FROM HierarchyPropertyDetails d
|
| IH#IdealProfiles |
|---|
SELECT siteMaterialUsageId, ConsignmentLocationId, DateFrom,
(First_value(Opening)
OVER(PARTITION BY SiteMaterialUsageId, ConsignmentLocationId ORDER BY DateFrom) +
NVL(SUM(FirmOrdersIn + RequestedOrdersIn)
OVER(PARTITION BY SiteMaterialUsageId,
ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) -
NVL(SUM(RequestedOrdersOut + Consumption - TentativeOrdersOut)
OVER(PARTITION BY SiteMaterialUsageId,
ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0)) Opening,
FirmOrdersIn FirmOrdersIn, RequestedOrdersIn TentativeOrdersIn,
(ip.ConsumptionOrders - TentativeOrdersOut) FirmOrdersOut, RequestedOrdersOut TentativeOrdersOut,
ConsumptionForecast ForecastDemand,
(First_value(Opening)
OVER(PARTITION BY SiteMaterialUsageId, ConsignmentLocationId ORDER BY DateFrom) +
NVL(SUM(FirmOrdersIn + RequestedOrdersIn)
OVER(PARTITION BY SiteMaterialUsageId,
ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED
PRECEDING AND ClosingMethod PRECEDING), 0) -
NVL(SUM(RequestedOrdersOut + Consumption - TentativeOrdersOut)
OVER(PARTITION BY SiteMaterialUsageId,
ConsignmentLocationId ORDER BY DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 0 PRECEDING), 0)) Closing,
SafetyStock SafetyStock, MaxSafetyStock MaxSafetyStock, IsReceivingDate, IsRunAvailable
FROM InventoryProfiles ip
CROSS JOIN (SELECT DECODE(RPClosingCalculationMethod, 'AfterDeliveryDate', 1, 0) ClosingMethod FROM IH#ReplenishmentParameters) p
|
| IH#IdenticalConfigurations |
|---|
SELECT DENSE_RANK() OVER (Order by t.ConfigurationHash, t.BomId, CoProductPriceList) AS Id,
case when ROW_NUMBER() OVER(PARTITION by t.ConfigurationHash, t.BomId, CoProductPriceList order by ProductionConfigurationId) != 1
then 1 else 0 end IsIdentical,
t.*
FROM
(
SELECT ProductionConfigurationId, BomId, CoProductPriceList, ProductRouteId, MaterialId,
core.asCsv(CAST(COLLECT(ot.OperationTypeName || ':' || ValidSources || ':' || ConversionHash ORDER BY OrderNo) AS ParameterArray), ';') ConfigurationHash
FROM IH#ConfigurationSources c
JOIN OperationTypes ot ON ot.Id = c.OperationTypeId
GROUP BY ProductionConfigurationId, BomId, CoProductPriceList, ProductRouteId, MaterialId
) t
|
| IH#InitialSourceHashes |
|---|
SELECT SiteMaterialUsageId,
LISTAGG(WorkcentreList, ';') WITHIN GROUP(ORDER BY SiteMaterialUsageId, OperationTypeId) InitialSourceHash
FROM (SELECT SiteMaterialUsageId, OperationTypeId,
OperationTypeId || ':' || LISTAGG(WorkcentreId, ',') WITHIN GROUP(ORDER BY WorkcentreId) WorkcentreList
FROM Ih#initialsources
GROUP BY SiteMaterialUsageId, OperationTypeId)
GROUP BY SiteMaterialUsageId
|
| IH#InitialSourceRules |
|---|
SELECT
sr.Id,
sr.detailId,
sr.RuleWeighting,
sr.IsActive,
ot.Id AS OperationTypeId,
ot.OperationTypeName,
core.asCsv(CAST(COLLECT(wc.WorkcentreName) AS ParameterArray)) AS Workcentres,
core.asCsv(CAST(COLLECT(s.SiteName) AS ParameterArray)) AS Sites
FROM InitialSourceRules sr
CROSS JOIN (Select * from OperationTypes where exists(select 1 from InitialSourceRuleSources s where s.OperationTypeId = OperationTypes.Id)) ot
LEFT JOIN InitialSourceRuleSources srs
ON srs.InitialSourceRuleId = sr.Id
AND srs.OperationTypeId = ot.Id
LEFT JOIN Workcentres wc
ON wc.Id = srs.WorkcentreId
LEFT JOIN Sites s
ON s.Id = srs.SiteId
GROUP BY
sr.Id,
sr.detailId,
sr.RuleWeighting,
sr.IsActive,
ot.Id,
ot.OperationTypeName
ORDER BY sr.Id, ot.Id
|
| IH#InitialSourceRuleSources |
|---|
SELECT sr.InitialSourceRuleId, w.WorkcentreID, w.SiteId, NVL(sr.OperationTypeId, w.OperationTypeId) OperationTypeId FROM Initialsourcerulesources sr JOIN Ih#SiteworkcentreOperations w ON (w.SiteId = sr.SiteId) AND (sr.OperationTypeId IS NULL OR w.OperationTypeId = sr.OperationTypeId) WHERE sr.SiteId IS NOT NULL AND w.IsProductionSource = 1 UNION SELECT sr.InitialSourceRuleId, w.WorkcentreID, w.SiteId, sr.OperationTypeId FROM InitialSourceRuleSources sr JOIN Ih#workcentres w ON (w.WorkcentreId = sr.WorkcentreId) WHERE sr.WorkcentreId IS NOT NULL AND w.IsProductionSource = 1 |
| IH#InitialSources |
|---|
SELECT s.Id, s.SiteMaterialUsageId, s.WorkcentreId, OperationTypeId, OperationTypeName, l.LocationName, m.MaterialName, eu.EnduseDescription Enduse, ec.LocationName EndCustomer, WorkcentreName, SiteName FROM initialsources s JOIN SiteMaterialUsages smu ON (smu.Id = s.SiteMaterialUsageId) JOIN Locations l ON (l.Id = smu.LocationId) JOIN Materials m ON (m.Id = smu.MaterialId) LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId JOIN IH#Workcentres wc ON (wc.WorkcentreId = s.WorkcentreId) LEFT JOIN OperationTypes ot ON ot.ID = s.OperationTypeId |
| IH#Inventories |
|---|
SELECT l.LocationCode WarehouseCode, l.LocationName WarehouseName, m.MaterialCode, m.MaterialName, i.* FROM Inventories i JOIN SiteMaterialUsages smu ON i.SiteMaterialUsageID = smu.Id JOIN Locations l ON smu.LocationId = l.Id JOIN Materials m ON m.Id = smu.MaterialId |
| IH#InventoryProfiles |
|---|
SELECT l.LocationName, s.SiteName, c.CompanyName, MaterialName, cl.LocationName CustomerName, ip.* FROM InventoryProfiles ip JOIN Materials m ON m.Id = ip.MaterialId LEFT JOIN Locations l ON l.ID = ip.LocationId LEFT JOIN Locations cl ON cl.ID = ip.ConsignmentLocationId LEFT JOIN Sites s ON s.ID = ip.SiteId LEFT JOIN Companies c ON c.ID = ip.CompanyId |
| IH#Journeys |
|---|
SELECT j.JourneyId, j.JourneyCode, j.FromLocationId, j.ToLocationId, sl.SiteId FromSiteId, tl.SiteId ToSiteId,
j.FromTransportRouteId, j.ToTransportRouteId,
j.Cost, j.TimePeriod, j.QuantityLegs, j.IsDefault, j.IsInternal, tm.TransportMethodCode, tm.TransportMethodName,
j.TransportMethodId, sl.SiteId SourceSiteId, tl.SiteId TargetSiteId, Priority,
NVL(ScheduleId, core.DefaultScheduleId) ScheduleId, j.CargoVolume, j.CargoUnitId,
RANK() OVER(PARTITION BY FromLocationId, ToLocationId ORDER BY IsDefault DESC, DECODE(SIGN(Priority), -1, ABS(Priority) * 999, Priority),
Cost, QuantityLegs, TimePeriod) JourneyRank,
j.JourneyId || '-' || j.FromLocationId || '-' || j.ToLocationId AS JourneyKey
FROM (SELECT j.Id AS JourneyId, j.JourneyCode, ftr.FromLocationId, ttr.ToLocationId, ftr.Id AS FromTransportRouteId,
ttr.Id AS ToTransportRouteId, ftr.Cost + j.Cost + ttr.Cost AS Cost,
ftr.TimePeriod + j.TimePeriod + ttr.TimePeriod AS TimePeriod, j.QuantityLegs + 2 AS QuantityLegs,
j.IsDefault, j.IsInternal, ttr.TransportMethodId, ttr.Priority, ttr.ScheduleId, ttr.CargoVolume,
ttr.CargoUnitId
FROM TransportRoutes ftr, Journeys j, TransportRoutes ttr, Locations ftl, Locations ttl
WHERE ftr.TransportMethodId = j.FirstTransportMethodId
AND j.LastTransportMethodId = ttr.TransportMethodId
AND ftr.ToLocationid IN (ftl.Id, ftl.TransportLocationId)
AND ftl.Id = j.FromLocationId
AND j.ToLocationId IN (ttl.Id, ttl.TransportLocationId)
AND ttl.Id = ttr.FromLocationId
UNION ALL
SELECT j.Id AS JourneyId, j.JourneyCode, j.FromLocationId, j.ToLocationId, NULL AS FromTransportRouteId,
NULL AS ToTransportRouteId, j.Cost, j.TimePeriod, j.QuantityLegs, j.IsDefault, j.IsInternal,
tr.TransportMethodId, tr.Priority, tr.ScheduleId, tr.CargoVolume, tr.CargoUnitId
FROM Journeys j, JourneyRoutes jr, TransportRoutes tr
WHERE j.FirstTransportMethodId IS NULL
AND j.LastTransportMethodId IS NULL
AND j.IsInternal = 0
AND j.Id = jr.JourneyId
AND jr.TransportRouteId = tr.Id
AND jr.OrderNo = (SELECT MAX(jr2.OrderNo) FROM JourneyRoutes jr2 WHERE jr2.JourneyId = jr.JourneyId)
UNION ALL
SELECT j.Id AS JourneyId, j.JourneyCode, j.FromLocationId, j.ToLocationId, NULL AS FromTransportRouteId,
NULL AS ToTransportRouteId, j.Cost, j.TimePeriod, j.QuantityLegs, j.IsDefault, j.IsInternal,
tr.TransportMethodId, tr.Priority, tr.ScheduleId, tr.CargoVolume, tr.CargoUnitId
FROM Journeys j, JourneyRoutes jr, TransportRoutes tr
WHERE j.FirstTransportMethodId IS NULL
AND j.LastTransportMethodId IS NULL
AND j.IsInternal = 1
AND j.Id = jr.JourneyId
AND jr.TransportRouteId = tr.Id) j
JOIN TransportMethods tm
ON j.TransportMethodId = tm.Id
LEFT JOIN Locations sl
ON sl.Id = j.FromLocationId
LEFT JOIN Locations tl
ON tl.Id = j.ToLocationId
|
| IH#LastAverageProcessLogs |
|---|
WITH RawLogs AS (
SELECT Id, Action, Description,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration_MS
FROM ProcessLogs
WHERE ProcessId IN (SELECT MAX(Id) FROM Processes)
)
SELECT Action,
COUNT(*) as Executions,
ROUND(SUM(Duration_MS) / 1000, 2) as Total,
ROUND(AVG(Duration_MS) / 1000, 2) as AvgSeconds
FROM RawLogs
WHERE Duration_MS IS NOT NULL
GROUP BY Action
ORDER BY Total DESC
|
| IH#LastDDQLog |
|---|
SELECT TaskId, ID, LogTimeStamp, LogSource, LogText FROM ( SELECT DENSE_RANK() OVER(ORDER BY TaskId DESC) r, l.* FROM DDQLOg l ) WHERE r = 1 ORDER BY ID |
| IH#LastForecastLogs |
|---|
Select Id, Action, Description, Stamp, Stamp - Lag(Stamp) OVER (ORDER BY Id,Stamp) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration
from ProcessLogs
Where ProcessId IN (Select Max(Id) from
Processes Where ProcessType = 'Forecast')
Order by Id
|
| IH#LastProcessLogs |
|---|
Select Id, Action, Description, Stamp, Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration
from ProcessLogs
Where ProcessId IN (Select Max(Id) from
Processes)
Order by Id
|
| IH#LastReplenishmentLogs |
|---|
Select Id, Action, Description, Stamp, Stamp - Lag(Stamp) OVER (ORDER BY Id,Stamp) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration
from ProcessLogs
Where ProcessId IN (Select Max(Id) from
Processes Where ProcessType = 'Replenishment')
Order by Id
|
| IH#LastReplenishmentTraceLogs |
|---|
Select Id, Action, Description, Stamp, Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration,
(Stamp - First_Value(Stamp) OVer (Order by Id, Stamp)) TotalTime
from ProcessLogs
Where ProcessId IN (Select Max(Id) from
Processes Where ProcessType = 'Replenishment')
AND Action = 'ReplenishmentTrace'
Order by Id
|
| IH#LastSlowProcessLog |
|---|
WITH MarkedLogs AS (
SELECT Id, Action, Description, Stamp, Diff, Duration,
CASE WHEN Duration > 3000 THEN 1 ELSE 0 END as is_slow
FROM IH#LastProcessLogs
),
ContextLogs AS (
SELECT m.*,
LEAD(is_slow) OVER (ORDER BY Id, Stamp) as prev_row_was_slow, -- Neighbor above
LAG(is_slow) OVER (ORDER BY Id, Stamp) as next_row_was_slow -- Neighbor below
FROM MarkedLogs m
)
SELECT Id, Action, Description, Stamp, Diff, Duration
FROM ContextLogs
WHERE is_slow = 1 -- Slow operation itself
OR prev_row_was_slow = 1 -- Row immediately before the slow operation
OR next_row_was_slow = 1 -- Row immediately after the slow operation
ORDER BY Id, Stamp
|
| IH#LatestInventories |
|---|
WITH inventory AS
(
SELECT Id, SiteMaterialUsageId, ConsignmentLocationId, stockType, Weight,
Datefrom
FROM Inventories i
WHERE i.DateFrom = (SELECT MAX(i2.DateFrom) FROM Inventories i2
WHERE i2.SiteMaterialUsageId = i.SiteMaterialUsageId
AND NVL(i2.ConsignmentLocationId,0) = NVL(i.ConsignmentLocationId,0)
AND i2.StockType = i.StockType
AND i2.DateFrom <= core.GetTruncatedInternalDate
)
)
SELECT SiteMaterialUsageId, ConsignmentLocationId,
Standard_Stock AS StandardStock,
Standard_StockDate AS StandardStockDate,
Customer_Stock AS CustomerStock, Customer_StockDate AS CustomerStockDate,
InTransit_Stock AS InTransitStock, InTransit_StockDate AS InTransitStockDate,
Quarantine_Stock AS QuarantineStock, Quarantine_StockDate AS QuarantineStockDate
FROM Inventory
PIVOT (MIN(Weight) AS Stock,
MIN(DateFrom) AS StockDate
FOR StockType IN ('Standard' AS STANDARD, 'Customer' AS Customer,
'InTransit' AS InTransit, 'Quarantine' AS Quarantine))
|
| IH#LatestSupplierInventories |
|---|
WITH t AS
(
SELECT si.DateFrom, si.MaterialId, si.WorkcentreId SupplierId, NVL(si.LocationId, sp.WarehouseLocationId) WarehouseId,
csku.Id as CustomerSkuId,
si.CustomerId, si.Quantity
FROM SupplierInventories si
LEFT JOIN SiteMaterialUsages csku
ON csku.LocationId = si.CustomerId
AND csku.MaterialId = si.MaterialId
LEFT JOIN IH#CustomerWarehousePriorities sp
ON sp.CustomerSkuId = csku.Id
WHERE DateFrom = core.getTruncatedInternalDate
)
SELECT t.MaterialId, t.SupplierId, t.WarehouseId, t.CustomerId,
smu.Id WarehouseSkuId, NVL(tsmu.Id, smu.Id) as GroupWarehouseSkuId, CustomerSkuId,
SUM(DECODE(SupplierType, 'internal', Quantity, 0)) InternalStock,
SUM(DECODE(SupplierType, 'internal', 0, Quantity)) ExternalStock
FROM t
JOIN WorkCentres wc
ON wc.Id = t.SupplierId
JOIN WorkCentreTypes wct
ON wct.Id = wc.WorkcentreTypeId
LEFT JOIN SiteMaterialUsages smu
ON smu.LocationId = t.WarehouseId
AND smu.MaterialId = t.MaterialId
LEFT JOIN SiteMaterialUsages tsmu
ON tsmu.GroupKey = smu.GroupKey
AND tsmu.Replenished = 1
AND smu.Replenished = 0
GROUP BY t.MaterialId, t.SupplierId, t.WarehouseId, t.CustomerId, smu.Id, tsmu.Id, t.CustomerSkuId
|
| IH#LaunchProfilePatterns | Launch profile patterns |
|---|
WITH pattern_values AS
(
SELECT p.Id, p.PatternName,
TO_NUMBER(raw_values.Column_Value, '9999999999999999999999999999999999999D9999', 'NLS_NUMERIC_CHARACTERS=''.,''') Value
FROM LaunchProfilePatterns p,
TABLE(core.splitString(p.Patternvalues, ';')) raw_values
WHERE p.PatternValues IS NOT NULL
)
SELECT v.Id, v.PatternName, v.Value,
SUM(v.Value) OVER (PARTITION by v.Id) TotalValue,
v.Value / SUM(v.Value) OVER (PARTITION by v.Id) Coef,
ROW_NUMBER() over (partition by v.Id order by ROWNUM) PeriodNo,
COUNT(1) over () LastPeriod
FROM pattern_values v
|
| IH#LaunchProfiles | Launch profiles |
|---|
SELECT l.Id LaunchProfileId, StartMonth, add_months(StartMonth, PeriodNo - 1) LaunchMonth, Periods, PeriodNo, VALUE, Volume,
VALUE / SUM(VALUE) OVER(PARTITION BY l.Id) * (Volume / u.Dividend * u.Divisor) Forecast,
CASE WHEN p.PeriodNo = l.Periods THEN 1 ELSE 0 END IsLastPeriod
FROM LaunchProfiles l
JOIN IH#LaunchProfilePatterns p
ON p.Id = l.PatternId
JOIN Units u
ON u.Id = l.UnitId
WHERE p.PeriodNo <= l.Periods
ORDER BY 1, PeriodNo
|
| IH#LiveOptimizedRuns |
|---|
SELECT mr.WorkCentreId, mr.StartDate, mr.FinishDate, mr.TargetStartDate,
mb.BlockCode, mr.RunCode, mr.MaterialBlockId, mr.Id,
mr.MaterialBlockId SequenceNo,
DENSE_RANK() OVER (PARTITION BY mr.WorkCentreId ORDER BY mr.StartDate, mr.Id) PositionNo,
mr.InitialDuration,
(mr.FinishDate - GREATEST(NVL(mr.TargetStartDate, mr.StartDate), mr.StartDate)) * 24 * 60 Duration,
NVL(mr.SwitchoverDuration,0) AS SwitchoverDuration, mr.ProcessRate Rate,
mrp.GradeId, mrp.GradeCode,
MAX(DECODE(mrs.RunStatusCode, 'Open', 0, 1))
OVER (PARTITION BY mr.WorkCentreId ORDER BY mr.StartDate ROWs BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) IsReadOnly,
mr.RunType,
mrs.RunStatusCode,
DECODE(mr.RunType, 'opportunistic', 1, 0) OppBlock,
DECODE(mr.RunType, 'floatingShut', 1, 0) FSBlock,
DECODE(mrs.RunStatusCode, 'Frozen', 1, 0) IsFrozen
FROM MaterialRuns mr
JOIN MaterialBlocks mb ON mb.Id = mr.MaterialBlockId
JOIN MaterialRunStatuses mrs ON mrs.Id = mr.MaterialRunStatusId
LEFT JOIN (SELECT mrp.MaterialRunId, gp.GradeId, gp.GradeCode,
DENSE_RANK() OVER (PARTITION BY mrp.MaterialRunId ORDER BY GradeId) r
FROM MaterialRunProducts mrp, GradeProperties gp
WHERE mrp.ProductName = gp.GradeCode) mrp ON mrp.MaterialRunId = mr.Id AND mrp.r = 1
ORDER BY mr.WorkCentreId, mr.StartDate, mr.Id
|
| IH#LiveProductionPlans |
|---|
SELECT WorkcentreName, InitialDuration / 60 Hours, p.* FROM ProductionPlans p JOIN Workcentres wc ON wc.Id = p.WorkcentreId ORDER BY OperatorUserId, WorkcentreId, SourcePeriod, StartDate |
| IH#LocationMasterRoutes |
|---|
SELECT d.LocationId, mr.Id MasterRouteId, mr.FromSiteId, mr.TimePeriod, wc.Id WorkcentreId, mr.RouteCategory,
mr.RuleWeighting,
ROW_NUMBER() OVER (PARTITION BY d.LocationId, mr.FromSiteId
ORDER BY mr.RuleWeighting DESC, mr.Cost, mr.TimePeriod, mr.Id DESC) r
FROM MasterRoutes mr
JOIN IH#DetailsLocation d
ON (d.DetailId = mr.DetailId)
JOIN Sites s
ON s.Id = mr.FromSiteId
JOIN Locations l ON l.SiteId = s.Id
JOIN Workcentres wc
ON wc.LocationId = l.Id
|
| IH#Locations |
|---|
SELECT l.Id, l.LocationName, l.LocationCode, l.LocationCode || ' ' || l.LocationName FullLocationName,
l.LocationName || ' ' || l.LocationCode FullLocationCode, CompanyName, l.Capacity, l.AllocatedStock, l.DefaultCustomerForecast,
l.OrderAutoConfirmPeriod, CustomerRankDesc, cl.CalendarName, sm.SafetystockmethodDesc,
tl.LocationName TransportLocation, sl.LocationName StockLocation, wl.LocationName WarehouseLocation, s.SiteName,
cur.CurrencyName, l.CustomerRankId, l.SafetyStockMethodId,
NVL(l.CalendarId, core.DefaultCalendarId) CalendarId,
l.CompanyId, l.StockLocationId, l.WarehouseLocationId, l.SiteId, l.CurrencyId, l.TransportLocationId,
l.ForecastRangeId, NVL(l.UseTradingDays, core.UseTradingDays) UseTradingDays,
rl.ReplacedLocations, rl.ReplacedByLocation,
(SELECT NVL(MIN(1),0) FROM dual WHERE EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = l.Id)) HasWorkcentre,
HierarchyName1, HierarchyName2, HierarchyName3, HierarchyName4, HierarchyName5,
HierarchyName6, HierarchyName7, HierarchyName8, HierarchyName9, HierarchyName10,
HierarchyName11, HierarchyName12, HierarchyName13, HierarchyName14, HierarchyName15,
HierarchyCode1, HierarchyCode2, HierarchyCode3, HierarchyCode4, HierarchyCode5,
HierarchyCode6, HierarchyCode7, HierarchyCode8, HierarchyCode9, HierarchyCode10,
HierarchyCode11, HierarchyCode12, HierarchyCode13, HierarchyCode14, HierarchyCode15,
l.LocationStatus
FROM Locations l
LEFT JOIN ExpandedLocationsSpec es
ON (es.LocationId = l.Id)
LEFT JOIN CustomerRanks cr
ON (cr.Id = NVL(l.CustomerRankId, core.DefaultCustomerRankId))
LEFT JOIN SafetyStockMethods sm
ON (sm.Id = NVL(l.SafetyStockMethodId, core.DefaultSafetyStockMethodId))
LEFT JOIN Calendars cl
ON (cl.Id = NVL(l.CalendarId, core.DefaultCalendarId))
LEFT JOIN Companies c
ON (c.Id = l.CompanyId)
LEFT JOIN Locations tl
ON (tl.Id = l.TransportLocationId)
LEFT JOIN Locations sl
ON (sl.Id = l.StockLocationId)
LEFT JOIN Locations wl
ON (wl.Id = l.WarehouseLocationId)
LEFT JOIN Sites s
ON (s.Id = l.SiteId)
LEFT JOIN Currencies cur
ON (cur.Id = NVL(l.CurrencyId, core.InternalCurrencyId))
LEFT JOIN IH#ReplacedLocations rl
ON (rl.ToLocationId = l.Id)
LEFT JOIN IH#ReplacedByLocation rl
ON (rl.FromLocationId = l.Id)
|
| IH#LocationStockStatus |
|---|
SELECT r.LocationId, DateFrom, OverallOpening, OverallClosing, r.SafetyStock, r.SafetyStockPercentWarning,
CASE
WHEN DECODE(p.StockStateField, 'Closing', OverAllClosing, OverallOpening) = 0
AND r.SafetyStock = 0
AND r.OriginalConsumption > 0
THEN 1
WHEN DECODE(p.StockStateField, 'Closing', OverAllClosing, OverallOpening) < 0
THEN 1
WHEN (SELECT VALUE FROM SystemParameters WHERE ParameterName = 'StockLevelAtZeroWarning') = 'InventoryLessOrEqualZero'
AND r.SafetyStock > 0
AND DECODE(p.StockStateField, 'Closing', OverAllClosing, OverallOpening) = 0
THEN 1
WHEN r.SafetyStock > 0
AND r.SafetyStockPercentWarning > 0
AND DECODE(p.StockStateField, 'Closing', OverAllClosing, OverallOpening) < r.SafetyStock * r.SafetyStockPercentWarning / 100
THEN 2
WHEN r.SafetyStock > 0
AND OverallOpening < r.SafetyStock
THEN 3
WHEN wp.Value IN ('Warning', 'Limit')
AND r.MaxCapacity > 0
AND DECODE(p.StockStateField, 'Closing', OverAllClosing, OverallOpening) > r.MaxCapacity
THEN 4
WHEN r.MaxSafetyStock IS NOT NULL
AND OverallOpening > r.MaxSafetyStock
THEN 5
ELSE 9
END StockStatus
FROM (
SELECT s.LocationId, s.WorkcentreId, DateFrom, SUM(OverallOpening) OverallOpening,
SUM(OverallClosing) OverallClosing, SUM(SafetyStock) SafetyStock, SUM(MaxSafetyStock) MaxSafetyStock, MIN(l.Capacity) MaxCapacity,
MIN(s.SafetyStockPercentWarning) SafetyStockPercentWarning, SUM(OriginalConsumption) OriginalConsumption
FROM RealInventoryProfiles v JOIN IH#WHSkus s
ON s.SiteMaterialUsageId = v.SiteMaterialUsageId
AND NVL(S.ConsignmentLocationId,0) = NVL(v.ConsignmentLocationId,0)
JOIN Locations l ON l.Id = s.LocationId
GROUP BY s.LocationId, s.WorkcentreId, DateFrom
) r
JOIN IH#WorkcentrePArameters wp ON wp.ParameterName = 'MaxCapacityBehaviour' AND r.WorkcentreId = wp.WorkcentreID
CROSS JOIN (SELECT NVL(MIN(VALUE), 'Closing') StockStateField FROM SystemParameters WHERE ParameterName = 'RPStockStateField') p
|
| IH#MainWarehouses |
|---|
SELECT *
FROM (
SELECT s.Id SiteId, wc.Id WorkcentreId, l.Id LocationId, l.LocationCode, l.LocationName, s.SiteCode, s.SiteName,
wc.WorkcentreCode, wc.WorkcentreName, To_Number(NVL(wp.Value, wpt.DefaultValue)) IsMainWarehouse,
COUNT(1) over(PARTITION BY siteid) Quantity, ROW_NUMBER() over(PARTITION BY siteid ORDER BY l.Id) ByOrder,
CASE
WHEN To_Number(NVL(wp.Value, wpt.DefaultValue)) = 1 THEN
1
WHEN COUNT(1) over(PARTITION BY siteid) = 1 THEN
1
WHEN ROW_NUMBER() over(PARTITION BY siteid ORDER BY l.Id) = 1
AND SUM(To_Number(NVL(wp.Value, wpt.DefaultValue))) over(PARTITION BY siteid) = 0 THEN
1
ELSE
0
END IsMain
FROM Locations l, Workcentres wc, WorkcentreTypes wct, Sites s, WorkCentreParameters wp, WorkCentreParameterTypes wpt
WHERE wct.HasInventory = 1
AND wc.WorkcentreTypeId = wct.Id
AND wc.LocationId = l.Id
AND l.SiteId = s.Id
AND wc.ID = wp.WorkCentreId
AND wp.ParameterTypeId = wpt.ID
AND wpt.ParameterName = 'IsMainWarehouse'
)
WHERE IsMain = 1
|
| IH#MappedCharacteristics |
|---|
SELECT PropertyViewName ViewName, PropertyViewCode ViewCode,
'Code' || OrderNo FieldCode
FROM Propertiesiplanview
UNION ALL
SELECT HierarchyViewName ViewName, HierarchyViewCode ViewCode,
'HierarchyCode' || OrderNo FieldCode
FROM HierarchyLevelsIPlanView
UNION ALL
SELECT 'ProductCode' ViewName, 'ProductCode' ViewCode,
'MaterialCode' FieldCode
FROM dual
|
| IH#MappedFields |
|---|
SELECT UPPER(PropertyViewName) AS FieldViewName, UPPER(FieldPropertyValue) FieldName FROM PropertiesIPlanView UNION ALL SELECT UPPER(PropertyViewCode), UPPER(FieldPropertyCode) FROM PropertiesIPlanView UNION ALL SELECT UPPER(HierarchyViewCode), UPPER(FieldHierarchyCode) FROM Hierarchylevelsiplanview UNION ALL SELECT UPPER(HierarchyViewName), UPPER(FieldHierarchyValue) FROM Hierarchylevelsiplanview UNION ALL SELECT UPPER(PropertyViewName), UPPER(FieldProperty) FROM EndUsePropertiesIPlanView UNION ALL SELECT 'ENDUSEDESCRIPTION', 'ENDUSEDESCRIPTION' FROM dual UNION ALL SELECT 'PRODUCTNAME', 'PRODUCTNAME' FROM dual UNION ALL SELECT 'LOCATIONNAME', 'LOCATIONNAME' FROM dual UNION ALL SELECT 'FULLLOCATIONNAME', 'FULLLOCATIONNAME' FROM dual UNION ALL SELECT 'PRODUCTCODE', 'PRODUCTCODE' FROM dual UNION ALL SELECT 'LOCATIONCODE', 'LOCATIONCODE' FROM dual UNION ALL SELECT 'FULLLOCATIONCODE', 'FULLLOCATIONCODE' FROM dual UNION ALL SELECT 'ALTERNATEPRODUCT', 'ALTERNATEPRODUCT' FROM dual UNION ALL SELECT 'CURRENCYDESCRIPTION', 'CURRENCYDESCRIPTION' FROM dual UNION ALL SELECT 'CURRENCYNAME', 'CURRENCYNAME' FROM dual UNION ALL SELECT 'MATERIALTYPENAME', 'MATERIALTYPENAME' FROM dual UNION ALL SELECT 'ENDCUSTOMERNAME', 'ENDCUSTOMERNAME' FROM dual UNION ALL SELECT 'ENDCUSTOMERCODE', 'ENDCUSTOMERCODE' FROM dual |
| IH#MasterRoutes |
|---|
SELECT mr.Id, SiteName, SiteCode, COST, TimePeriod, HierarchyCode1, HierarchyCode2, HierarchyCode3, HierarchyCode4, HierarchyCode5, HierarchyCode6, HierarchyCode7, HierarchyCode8, HierarchyCode9, HierarchyCode10, HierarchyCode11, HierarchyCode12, HierarchyCode13, HierarchyCode14, HierarchyCode15, FromSiteId, DetailId, mr.RuleWeighting FROM MasterRoutes mr JOIN HierarchyPropertyDetails d ON d.Id = mr.DetailId JOIN Sites s ON mr.Fromsiteid = s.Id |
| IH#MaterialBlocks |
|---|
SELECT mb.Id, BlockCode, WorkcentreCode, WorkcentreId, mb.InsertUserId, mb.InsertDate, mb.UpdateUserId, mb.UpdateDate FROM MaterialBlocks mb JOIN WorkCentres wc ON wc.Id = mb.WorkcentreId |
| IH#MaterialCharacteristics |
|---|
SELECT m.MaterialId, d.Id CharacteristicId, m.MaterialTypeId,
d.Characteristic1, d.Characteristic2, d.Characteristic3, d.Characteristic4, d.Characteristic5,
d.Characteristic6, d.Characteristic7, d.Characteristic8, d.Characteristic9, d.Characteristic10
FROM MaterialPropsSpec m
JOIN Materials mf ON (mf.Id = m.MaterialId)
LEFT JOIN PropertyCharacteristics d
ON (
(d.Code1 IS NULL OR d.Code1 = m.code1)
AND (d.Code2 IS NULL OR d.Code2 = m.code2)
AND (d.Code3 IS NULL OR d.Code3 = m.code3)
AND (d.Code4 IS NULL OR d.Code4 = m.code4)
AND (d.Code5 IS NULL OR d.Code5 = m.code5)
AND (d.Code6 IS NULL OR d.Code6 = m.code6)
AND (d.Code7 IS NULL OR d.Code7 = m.code7)
AND (d.Code8 IS NULL OR d.Code8 = m.code8)
AND (d.Code9 IS NULL OR d.Code9 = m.code9)
AND (d.Code10 IS NULL OR d.Code10 = m.code10)
AND (d.Code11 IS NULL OR d.Code11 = m.code11)
AND (d.Code12 IS NULL OR d.Code12 = m.code12)
AND (d.Code13 IS NULL OR d.Code13 = m.code13)
AND (d.Code14 IS NULL OR d.Code14 = m.code14)
AND (d.Code15 IS NULL OR d.Code15 = m.code15)
AND (d.Code16 IS NULL OR d.Code16 = m.code16)
AND (d.Code17 IS NULL OR d.Code17 = m.code17)
AND (d.Code18 IS NULL OR d.Code18 = m.code18)
AND (d.Code19 IS NULL OR d.Code19 = m.code19)
AND (d.Code20 IS NULL OR d.Code20 = m.code20)
AND (d.Code21 IS NULL OR d.Code21 = m.code21)
AND (d.Code22 IS NULL OR d.Code22 = m.code22)
AND (d.Code23 IS NULL OR d.Code23 = m.code23)
AND (d.Code24 IS NULL OR d.Code24 = m.code24)
AND (d.Code25 IS NULL OR d.Code25 = m.code25)
AND (d.Code26 IS NULL OR d.Code26 = m.code26)
AND (d.Code27 IS NULL OR d.Code27 = m.code27)
AND (d.Code28 IS NULL OR d.Code28 = m.code28)
AND (d.Code29 IS NULL OR d.Code29 = m.code29)
AND (d.Code30 IS NULL OR d.Code30 = m.code30)
)
|
| IH#MaterialHashCodes |
|---|
SELECT em.MaterialId, MaterialName, MaterialCode, MaterialProperties, m.MaterialTypeId, core.AsCsv(CAST(COLLECT(pv.PropertyValueCode ORDER BY p.OrderNo) AS ParameterArray), ' | ') MaterialHashCode FROM Expandedmaterials em JOIN PropertyValues pv ON pv.Id = em.Propertyvalueid JOIN Propertiesiplanview p ON p.Id = pv.PropertyId JOIN MAterials m ON m.Id = em.MaterialId GROUP BY em.MaterialId, MaterialName, MaterialCode, MaterialProperties, m.MaterialTypeId |
| IH#MaterialRunCapacities |
|---|
SELECT mr.Id, RunCode, BlockRunCode, wc.Workcentreid, WorkcentreCode, WorkcentreName, SiteCode, SiteName,
wc.SiteId, StartDate, FinishDate,
TRUNC(FinishDate, 'IW') FinishWeek,
TRUNC(FinishDate, 'month') FinishMonth,
mr.NominalCapacity,
Quantity Capacity,
NVL(FirmOrdersWeight, 0) FirmOrdersWeight, NVL(TentativeOrdersWeight, 0) TentativeOrdersWeight,
Quantity - NVL(FirmOrdersWeight, 0) FreeFirmCapacity,
Quantity - NVL(FirmOrdersWeight, 0) - NVL(TentativeOrdersWeight, 0) FreeCapacity
FROM MaterialRuns mr
LEFT JOIN (SELECT oo.MaterialRunId,
SUM(CASE
WHEN ols.OrderLineStatusCode IN ('Firm', 'Completed') THEN
GREATEST(0, oo.Quantity - oo.QuantityComplete)
ELSE
0
END) FirmOrdersWeight,
SUM(CASE
WHEN ols.OrderLineStatusCode IN ('System') THEN
GREATEST(0, oo.Quantity - oo.QuantityComplete)
ELSE
0
END) TentativeOrdersWeight
FROM OrderOperations oo
JOIN OrderLines ol
ON ol.Id = oo.OrderLineId
JOIN Orderlinestatuses ols
ON ols.Id = ol.OrderLineStatusId
WHERE oo.MaterialRunId IS NOT NULL
GROUP BY oo.MaterialRunId) r
ON mr.Id = r.MaterialRunId
JOIN IH#WorkCentres wc
ON wc.WorkcentreId = mr.WorkcentreId
|
| IH#MaterialRunDurations |
|---|
SELECT mr.Id, RunCode, BlockRunCode, wc.Workcentreid, WorkcentreCode, WorkcentreName, SiteCode, SiteName,
wc.SiteId, StartDate, FinishDate,
TRUNC(FinishDate, 'IW') FinishWeek,
TRUNC(FinishDate, 'month') FinishMonth,
ProcessRate,
NVL(r.Quantity,0) OrderOperationQuantity,
mr.InitialDuration - NVL(r.DurationInMinutes,0) FreeDuration,
mr.NominalCapacity,
mr.Quantity,
DECODE(ProcessRate, 0, 0, NVL(r.Quantity,0) + (mr.InitialDuration - NVL(r.DurationInMinutes,0)) * ProcessRate/60) Capacity,
DECODE(ProcessRate, 0, 0, (mr.InitialDuration - NVL(r.DurationInMinutes,0)) * ProcessRate/60) FreeCapacity
FROM MaterialRuns mr
JOIN MaterialRunStatuses mrs ON mrs.Id = mr.MaterialRunStatusId
JOIN IH#Workcentres wc ON mr.WorkcentreId = wc.workcentreId
LEFT JOIN
(
SELECT oo.MaterialRunId,
SUM(DECODE(r.EffectiveProductionRate, 0, DECODE(oo.Rate, 0, 0, oo.Quantity / oo.Rate * 60), oo.Quantity / r.EffectiveProductionRate * 60)) DurationInMinutes,
SUM(oo.Quantity) Quantity
FROM OrderOperations oo
JOIN OrderLines ol ON ol.Id = oo.OrderLineId
JOIN OrderLineStatuses ols ON ols.Id = ol.OrderLineStatusId
AND ols.OrderLineStatusCode != 'Cancelled'
JOIN IH#ActualProductionRates r ON r.MaterialId = ol.MaterialId
AND r.WorkCentreId = oo.WorkCentreid
AND oo.DueDate BETWEEN r.DateFrom AND r.DateTo
JOIN MaterialRuns mr ON mr.Id = oo.MaterialRunId
JOIN MaterialRunStatuses mrs ON mrs.Id = mr.MaterialRunStatusId
WHERE mrs.RunStatusCode NOT IN ('NonValid', 'Complete', 'Started')
GROUP BY oo.MaterialRunId
) r ON r.MaterialRunId = mr.Id
WHERE mrs.RunStatusCode NOT IN ('NonValid', 'Complete', 'Started')
|
| IH#MaterialRuns |
|---|
SELECT mr.Id,
w.WorkcentreCode,
w.WorkcentreName,
mb.BlockCode,
mr.RunCode,
mrs.RunStatusName,
mrs.RunStatusCode,
mr.RunType,
mr.NominalCapacity,
mr.Quantity,
mr.WasteTime,
mr.ProcessRate,
mr.StartDate,
mr.FinishDate,
DECODE(NVL(wp.Value,100), 100, mr.FinishDate, GreaTest(mr.StartDate, NVL(mr.TargetStartDate, mr.StartDate)) + NVL(wp.Value,100) * mr.InitialDuration / 1440 / 100) CalculatedFinishDate,
mr.InitialDuration,
mr.SwitchoverDuration,
mr.MaterialBlockId,
mr.InsertUserId,
mr.InsertDate,
mr.UpdateUserId,
mr.UpdateDate,
mr.MaterialRunStatusId,
mr.WorkCentreId,
mr.TargetStartDate,
mr.UpdateOrderDates,
mr.BlockRunCode,
mr.IsChanged,
MIN(mr.StartDate) OVER (PARTITION BY mr.MaterialBlockId) BlockStartDate,
MAX(mr.FinishDate) OVER (PARTITION BY mr.MaterialBlockId) BlockFinishDate,
CASE WHEN w.DDQLocked = 1 AND mr.StartDate >= wrp.FrozenPeriodEnd THEN 1 ELSE 0 END AS DDQLocked,
QuantityComplete,
CASE
WHEN ProcessRate = 0 THEN 0
ELSE LEAST(InitialDuration, QuantityComplete / (ProcessRate / 60))
END CompletedDuration,
CASE
WHEN ProcessRate = 0 THEN InitialDuration
ELSE GREATEST(0, InitialDuration - (QuantityComplete / (ProcessRate / 60)))
END RemainingDuration,
ProductionUpdateTimeStamp,
LEAD(mrs.RunStatusCode, 1) OVER (PARTITION BY mr.WorkcentreId ORDER BY mr.StartDate, mr.FinishDate) NextRunStatusCode,
LEAD(mr.Id) OVER (PARTITION BY mr.WorkcentreId ORDER BY mr.StartDate, mr.FinishDate) NextRunId,
LAG(mr.Id) OVER (PARTITION BY mr.WorkcentreId ORDER BY mr.StartDate, mr.FinishDate) PrevRunId
FROM MaterialRuns mr
JOIN MaterialBlocks mb
ON mb.Id = mr.MaterialBlockId
JOIN WorkCentres w ON w.Id = mr.WorkCentreId
JOIN MaterialRunStatuses mrs on mrs.ID = mr.MaterialRunStatusId
JOIN (SELECT wp.WorkCentreId, wp.Value
FROM IH#WorkcentreParameters wp
WHERE wp.parametername = 'RunOutputDelay') wp ON mr.WorkCentreId = wp.WorkCentreId
LEFT JOIN WorkCentreROParameters wrp ON wrp.WorkCentreId = w.Id
|
| IH#MaterialRunsDates |
|---|
SELECT mr.Id,
mr.MaterialBlockId,
mr.RunCode,
mr.StartDate,
mr.FinishDate,
DECODE(NVL(wp.Value,100), 100, mr.FinishDate, GreaTest(mr.StartDate, NVL(mr.TargetStartDate, mr.StartDate)) + NVL(wp.Value,100) * mr.InitialDuration / 1440 / 100) CalculatedFinishDate,
mr.MaterialRunStatusId,
mr.WorkCentreId,
mr.TargetStartDate,
mr.BlockRunCode,
MIN(mr.StartDate) OVER (PARTITION BY mr.MaterialBlockId) BlockStartDate,
MAX(mr.FinishDate) OVER (PARTITION BY mr.MaterialBlockId) BlockFinishDate
FROM MaterialRuns mr
JOIN (SELECT wp.WorkCentreId, wp.Value
FROM IH#WorkcentreParameters wp
WHERE wp.parametername = 'RunOutputDelay') wp ON mr.WorkCentreId = wp.WorkCentreId
|
| IH#Materials |
|---|
SELECT m.Id, m.MaterialName, m.MaterialCode, mt.MaterialTypeName, sm.MaterialName SourceMaterialName,
sm.MaterialCode SourceMaterialCode,
smt.MaterialTypeName SourceMaterialTypeName,
um.MaterialName UsedWithMaterialName,
um.MaterialCode UsedWithMaterialCode,
s.SiteName, s.SiteCode,
m.ForecastStartDate, m.ForecastFinishDate,
m.ReplenishmentStartDate, m.ReplenishmentFinishDate, mt.IsTool,
em.Value1, em.Value2, em.Value3, em.Value4, em.Value5, em.Value6, em.Value7, em.Value8, em.Value9, em.Value10,
em.Value11, em.Value12, em.Value13, em.Value14, em.Value15, em.Value16, em.Value17, em.Value18, em.Value19, em.Value20,
em.Value21, em.Value22, em.Value23, em.Value24, em.Value25, em.Value26, em.Value27, em.Value28, em.Value29, em.Value30,
em.Code1, em.Code2, em.Code3, em.Code4, em.Code5, em.Code6, em.Code7, em.Code8, em.Code9, em.Code10,
em.Code11, em.Code12, em.Code13, em.Code14, em.Code15, em.Code16, em.Code17, em.Code18, em.Code19, em.Code20,
em.Code21, em.Code22, em.Code23, em.Code24, em.Code25, em.Code26, em.Code27, em.Code28, em.Code29, em.Code30,
em.Characteristic1, em.Characteristic2, em.Characteristic3, em.Characteristic4, em.Characteristic5,
em.Characteristic6, em.Characteristic7, em.Characteristic8, em.Characteristic9, em.Characteristic10,
m.MaterialTypeId, m.SourceMaterialId, m.SiteId, m.UsedWithMaterialId, ProductRoutes
FROM Materials m
JOIN MaterialPropsSpec em
ON (em.MaterialId = m.Id)
JOIN MaterialTYpes mt
ON (mt.Id = m.MaterialTypeId)
LEFT JOIN Materials sm
ON (sm.Id = m.SourceMaterialId)
LEFT JOIN MaterialTypes smt
ON (smt.Id = sm.MaterialTypeId)
LEFT JOIN Sites s
ON (s.Id = m.SiteId)
LEFT JOIN Materials um
ON (um.Id = m.UsedWithMaterialId)
LEFT JOIN (SELECT MaterialId, core.AsCsv(CAST(COLLECT(DISTINCT ProductRouteName) AS ParameterArray)) ProductRoutes
FROM IH#ProductionConfigurations mpr
JOIN ProductRoutes pr
ON pr.Id = mpr.ProductRouteId
GROUP BY Materialid) r ON r.MaterialId = m.Id
|
| IH#MaterialSubstitutions |
|---|
SELECT ms.*,
euf.LocationId,
eut.LocationId ToLocationId,
l.LocationName,
l.LocationCode,
fm.MaterialName FromMaterialName,
fm.MaterialCode FromMaterialCode,
tm.MaterialName ToMaterialName,
tm.MaterialCode ToMaterialCode,
fm.Id FromMaterialId,
tm.Id ToMaterialId
FROM MaterialSupercessions ms
JOIN SiteMaterialUsages euf ON (ms.SiteMaterialUsageId = euf.Id)
JOIN SiteMaterialUsages eut ON (ms.OnSiteMaterialUsageId = eut.Id)
JOIN Locations l on l.Id = euf.LocationId
JOIN Materials fm ON (fm.Id = euf.MaterialId)
JOIN Materials tm ON (tm.Id = eut.MaterialId)
WHERE Type IN ('Substitution', 'Both')
|
| IH#MaterialSupercessions |
|---|
wITH RankedSupercessions AS (
SELECT
ms.SiteMaterialUsageId,
ms.OnSiteMaterialUsageId,
MIN(ms.Id) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS Id,
MIN(ms.Type) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS Type,
MIN(ms.SupercessionRuleId) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS SupercessionRuleId,
MIN(ms.StartDate) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS StartDate,
MIN(ms.GeneratedFromId) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS GeneratedFromId,
MIN(ms.Percentage) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS Percentage,
MIN(ms.LevelNo) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS LevelNo,
MIN(ms.DisableSupersededItems) KEEP (DENSE_RANK FIRST ORDER BY ms.StartDate DESC, ms.LevelNo DESC) AS DisableSupersededItems
FROM MaterialSupercessions ms
WHERE ms.Type IN ('Supersession', 'Both', 'ReplaceLocation')
GROUP BY ms.SiteMaterialUsageId, ms.OnSiteMaterialUsageId
)
SELECT
rs.Id,
rs.SiteMaterialUsageId,
rs.OnSiteMaterialUsageId,
rs.Type,
rs.SupercessionRuleId,
rs.StartDate,
rs.GeneratedFromId,
rs.Percentage,
rs.LevelNo,
rs.DisableSupersededItems,
fromsku.MaterialId AS FromMaterialId,
tosku.MaterialId AS ToMaterialId,
fromsku.Status,
tosku.Status AS TargetStatus
FROM RankedSupercessions rs
JOIN SiteMaterialUsages fromsku ON fromsku.Id = rs.SiteMaterialUsageId
JOIN SiteMaterialUsages tosku ON tosku.Id = rs.OnSiteMaterialUsageId
|
| IH#MaterialTypeProperties |
|---|
SELECT mtp.MaterialTypeId, MaterialTypeName, mtp.HierarchyLevelNo, p.* FROM MaterialTypeProperties mtp JOIN Propertiesiplanview p ON p.Id = mtp.PropertyId JOIN MaterialTypes mt ON mt.Id = mtp.MaterialTypeId |
| IH#MaterialTypeRoundingUnits |
|---|
SELECT mt.Id MaterialTypeId, MaterialTypeName, u.Id MaterialTypeUnitId, u.UnitDescription MaterialTypeUnitDesc, qumt.UnitId QuantityMAterialTypeUnitId, qumt.UnitDescription QuantityMAterialTypeUnitDesc, qu.UnitId DefaultQuantityUnitId, qu.UnitDescription DefaultQuantityUnitDesc, wu.UnitId DefaultWeightUnitId, wu.UnitDescription DefaultWeightUnitDesc, COALESCE(u.Id, qumt.UnitId, qu.UnitId, wu.UnitId) UnitId, 'Precendences: MaterialTypeUnitDesc --> QuantityMAterialTypeUnitDesc --> DefaultQuantityUnitDesc --> DefaultWeightUnitDesc ' Precendences FROM MaterialTYpes mt LEFT JOIN Units u ON u.Id = mt.RoundingUnitId LEFT JOIN IH#BaseUnits wu ON wu.UnitTypeName = 'Weight' LEFT JOIN IH#BaseUnits qumt ON qumt.UnitTypeName = 'Quantity' AND qumt.MaterialTypeId = mt.Id LEFT JOIN IH#BaseUnits qu ON qu.UnitTypeName = 'Quantity' AND qu.MAterialTypeId IS NULL |
| IH#MethodParameters |
|---|
SELECT fm.Id ID, fm.Internal, fm.ForecastMethodName, fmt.ForecastMethodTypeName, NVL(fp.ParameterName, 'Dummy') ParameterName, NVL2(fpv.Value, fpv.Value, fp.DefaultValue) AS ParameterValue FROM ForecastMethods fm JOIN ForecastMethodTypes fmt ON (fm.ForecastMethodTypeId = fmt.Id) LEFT JOIN ForecastMethodTypeParameters fmtp ON (fmtp.ForecastMethodTypeId = fmt.Id) LEFT JOIN ForecastParameters fp ON (fmtp.ParameterId = fp.Id) LEFT JOIN ForecastParameterValues fpv ON (fpv.ForecastParameterId = fp.Id AND fpv.ForecastMethodId = fm.Id) ORDER BY 1 |
| IH#MethodTypeParameters |
|---|
SELECT fmt.Id Id, fmt.ForecastMethodTypeName, fp.ParameterName FROM ForecastMethodTypes fmt JOIN ForecastMethodTypeParameters fmtp ON (fmtp.ForecastMethodTypeId = fmt.Id) JOIN ForecastParameters fp ON fp.Id = fmtp.ParameterId ORDER BY 2,3 |
| IH#ModelCharacteristics |
|---|
SELECT HierarchyName NAME, HierarchyDesc Description, HierarchyViewName FieldViewName, HierarchyViewCode FieldViewCode, FieldHierarchyCode FieldCode, FieldHierarchyValue FieldValue, 'Hierarchy' TYPE, HierarchyDesc OriginalName, 100 + OrderNo OrderNo, HierarchyLevelNo, 1 IsConfigured, 'HierarchyCode' EntityType, HierarchyName as FieldName, Prefix FROM HierarchyLevelsIPlanView UNION ALL SELECT 'LocationCode' NAME, 'Location' Description, 'LocationName' FieldViewName, 'LocationCode' FieldViewCode, 'LocationCode' FieldCode, 'LocationName' FieldValue, 'Location' TYPE, 'Location' OriginalName, 200 OrderNo, 0 HierarchyLevelNo, 1 IsConfigured, 'LocationCode' EntityType, 'Location' FieldName, '' Prefix FROM dual UNION ALL SELECT PropertyName NAME, PropertyDesc Description, PropertyViewName FieldViewName, PropertyViewCode FieldViewCode, FieldPropertyCode FieldCode, FieldPropertyValue FieldValue, 'Property' TYPE, OriginalPropertyName OriginalName, 300 + OrderNo OrderNo, OrderNo HierarchyLevelNo, NVL(mtp.PropertyId, 0) IsConfigured, 'PropertyCode' EntityType, PropertyName as FieldName, Prefix FROM PropertiesIPlanView p LEFT JOIN (SELECT DISTINCT PropertyId FROM MaterialTypeProperties) mtp ON mtp.PropertyId = p.Id UNION ALL SELECT 'ProductCode' NAME, 'Product' Description, 'ProductName' FieldViewName, 'ProductCode' FieldViewCode, 'ProductCode' FieldCode, 'ProductName' FieldValue, 'Product' TYPE, 'Material' OriginalName, 400 OrderNo, 0 HierarchyLevelNo, 1 IsConfigured, 'ProductCode' EntityType, 'Product' as FieldName, '' Prefix FROM dual UNION ALL SELECT PropertyName NAME, PropertyDesc Description, PropertyViewName FieldViewName, PropertyViewName FieldViewCode, FieldProperty FieldCode, FieldProperty FieldValue, 'EndUseProperty' TYPE, PropertyDesc OriginalName, 500 + OrderNo OrderNo, OrderNo HierarchyLevelNo, 1 IsConfigured, 'EndUseCode' EntityType, PropertyName as FieldName, Prefix FROM EndUsePropertiesIPlanView UNION ALL SELECT 'EndUseCode' NAME, 'Product' Description, 'EndUseDescription' FieldViewName, 'EndUseCode' FieldViewCode, 'EndUseCode' FieldCode, 'EndUseDescription' FieldValue, 'EndUse' TYPE, 'EndUse' OriginalName, 500 OrderNo, 0 HierarchyLevelNo, 1 IsConfigured, 'EndUseCode' EntityType, 'EndUse' as FieldName, '' Prefix FROM dual UNION ALL SELECT 'EndCustomerCode' NAME, 'EndCustomer' Description, 'EndCustomerName' FieldViewName, 'EndCustomerCode' FieldViewCode, 'EndCustomerCode' FieldCode, 'EndCustomerName' FieldValue, 'EndCustomer' TYPE, 'EndCustomer' OriginalName, 600 OrderNo, 0 HierarchyLevelNo, 1 IsConfigured, 'EndCustomerCode' EntityType, 'EndCustomer' FieldName, '' Prefix FROM dual UNION ALL SELECT PropertyName NAME, PropertyDesc Description, PropertyViewName FieldViewName, PropertyViewName FieldViewCode, FieldProperty FieldCode, FieldProperty FieldValue, 'SkuProperty' TYPE, PropertyDesc OriginalName, 700 + OrderNo OrderNo, OrderNo HierarchyLevelNo, 1 IsConfigured, 'SkuProperty' EntityType, PropertyName FieldName, Prefix FROM SkuPropertiesIPlanView UNION ALL SELECT PropertyName NAME, PropertyDesc Description, PropertyViewName FieldViewName, PropertyViewName FieldViewCode, FieldProperty FieldCode, FieldProperty FieldValue, 'ProductCharacteristic' TYPE, PropertyDesc OriginalName, 800 + OrderNo OrderNo, OrderNo HierarchyLevelNo, 1 IsConfigured, 'ProductCharacteristic' EntityType, PropertyName, Prefix FROM IH#ProductCharacteristics UNION ALL SELECT HierarchyName NAME, HierarchyDesc Description, HierarchyViewName FieldViewName, HierarchyViewCode FieldViewCode, FieldHierarchyCode FieldCode, FieldHierarchyValue FieldValue, 'EndCustomerHierarchy' TYPE, HierarchyDesc OriginalName, 900 + OrderNo OrderNo, HierarchyLevelNo, 1 IsConfigured, 'EndCustomerCode' EntityType, HierarchyLevelName, Prefix FROM EndCustomerLevelsIPlanView UNION ALL SELECT PropertyName NAME, PropertyDesc Description, PropertyViewName FieldViewName, PropertyViewName FieldViewCode, FieldProperty FieldCode, FieldProperty FieldValue, 'DerivedCharacteristic' TYPE, PropertyDesc OriginalName, 1000 + OrderNo OrderNo, OrderNo HierarchyLevelNo, 1 IsConfigured, 'DerivedCharacteristic' EntityType, PropertyName, Prefix FROM IH#DerivedCharacteristics UNION ALL SELECT PropertyName NAME, PropertyDesc Description, PropertyViewName FieldViewName, PropertyViewName FieldViewCode, FieldProperty FieldCode, FieldProperty FieldValue, 'SiteProperty' TYPE, PropertyDesc OriginalName, 1100 + OrderNo OrderNo, OrderNo HierarchyLevelNo, 1 IsConfigured, 'SiteProperty' EntityType, PropertyName, Prefix FROM SitePropertiesIPlanView |
| IH#ModelCharacteristics2 |
|---|
SELECT HierarchyLevelName NAME, HierarchyLevelName || ' Code' Description, HierarchyViewCode DescriptiveFieldName,
FieldHierarchyCode FieldCode, 'Hierarchy' EntityType, 'hierarchy' AttributeName, 1 RequireCode,
'Code' EntityTypeName, Prefix, 100 + OrderNo OrderNo, 1 IsConfigured
FROM HierarchyLevelsIPlanView
UNION ALL
SELECT HierarchyLevelName NAME, HierarchyLevelName Description, HierarchyViewName DescriptiveFieldName,
FieldHierarchyValue FieldCode, 'Hierarchy' EntityType, NULL AttributeName, 0 RequireCode,
'Value' EntityTypeName, Prefix, 100 + OrderNo OrderNo, 1 IsConfigured
FROM HierarchyLevelsIPlanView
UNION ALL
SELECT 'LocationCode' NAME, 'Location Code' Description, 'LocationCode' DescriptiveFieldName,
'LocationCode' FieldCode, 'Location' EntityType, 'location' AttributeName, 0 RequireCode,
'Code' EntityTypeName, '' Prefix, 200 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT 'LocationName' NAME, 'Location Name' Description, 'LocationName' DescriptiveFieldName,
'LocationName' FieldCode, 'Location' EntityType, NULL AttributeName, 0 RequireCode,
'Value' EntityTypeName, '' Prefix, 200 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT 'ProductCode' NAME, 'Product Code' Description, 'ProductCode' DescriptiveFieldName,
'ProductCode' FieldCode, 'Product' EntityType, 'product' AttributeName, 0 RequireCode,
'Code' EntityTypeName, '' Prefix, 400 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT 'ProductName' NAME, 'Product Name' Description, 'ProductName' DescriptiveFieldName,
'ProductName' FieldCode, 'Product' EntityType, NULL AttributeName, 0 RequireCode,
'Value' EntityTypeName, '' Prefix, 400 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT OriginalPropertyName Name, OriginalPropertyName || ' Code' Description, PropertyViewCode DescriptiveFieldName,
FieldPropertyCode FieldCode, 'Property' EntityType, 'property' AttributeName, 1 RequireCode,
'Code' EntityTypeName, 'P' Prefix, 300 + OrderNo OrderNo, NVL2(mtp.PropertyId, 1, 0) IsConfigured
FROM PropertiesIPlanView p
LEFT JOIN (SELECT DISTINCT PropertyId FROM MaterialTypeProperties) mtp
ON mtp.PropertyId = p.Id
UNION ALL
SELECT OriginalPropertyName Name, OriginalPropertyName Description, PropertyViewName DescriptiveFieldName,
FieldPropertyValue FieldCode, 'Property' EntityType, NULL AttributeName, 0 RequireCode,
'Value' EntityTypeName, 'P' Prefix, 300 + OrderNo OrderNo, NVL2(mtp.PropertyId, 1, 0) IsConfigured
FROM PropertiesIPlanView p
LEFT JOIN (SELECT DISTINCT PropertyId FROM MaterialTypeProperties) mtp
ON mtp.PropertyId = p.Id
UNION ALL
SELECT PropertyName Name, PropertyDesc Description, PropertyViewName DescriptiveFieldName,
FieldProperty FieldCode, 'EndUseProperty' EntityType, 'endUseProperty' AttributeName, 1 RequireCode,
'Code' EntityTypeName, Prefix, 500 + OrderNo OrderNo, 1 IsConfigured
FROM EndUsePropertiesIPlanView
UNION ALL
SELECT 'EndUseCode' NAME, 'End Use Code' Description, 'EndUseCode' DescriptiveFieldName,
'EndUseCode' FieldCode, 'EndUse' EntityType, 'endUse' AttributeName, 0 RequireCode,
'Code' EntityTypeName, '' Prefix, 600 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT 'EndUseDescription' NAME, 'End Use Description' Description, 'EndUseDescription' DescriptiveFieldName,
'EndUseDescription' FieldCode, 'EndUse' EntityType, 'endUse' AttributeName, 0 RequireCode,
'Description' EntityTypeName, '' Prefix, 600 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT 'EndCustomerCode' NAME, 'EndCustomer Code' Description, 'EndCustomerCode' DescriptiveFieldName,
'EndCustomerCode' FieldCode, 'EndCustomer' EntityType, 'endCustomer' AttributeName, 0 RequireCode,
'Code' EntityTypeName, '' Prefix, 800 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT 'EndCustomerName' NAME, 'EndCustomer Name' Description, 'EndCustomerName' DescriptiveFieldName,
'EndCustomerName' FieldCode, 'EndCustomer' EntityType, NULL AttributeName, 0 RequireCode,
'Value' EntityTypeName, '' Prefix, 800 + 0 OrderNo, 1 IsConfigured
FROM dual
UNION ALL
SELECT HierarchyLevelName NAME, HierarchyLevelName || ' Code' Description, HierarchyViewCode DescriptiveFieldName,
FieldHierarchyCode FieldCode, 'EndCustomerHierarchy' EntityType, 'endCustomerHierarchy' AttributeName, 1 RequireCode,
'Code' EntityTypeName, Prefix, 700 + OrderNo OrderNo, 1 IsConfigured
FROM EndCustomerLevelsIPlanView
UNION ALL
SELECT HierarchyLevelName NAME, HierarchyLevelName Description, HierarchyViewName DescriptiveFieldName,
FieldHierarchyValue FieldCode, 'EndCustomerHierarchy' EntityType, NULL AttributeName, 0 RequireCode,
'Value' EntityTypeName, Prefix, 700 + OrderNo OrderNo, 1 IsConfigured
FROM EndCustomerLevelsIPlanView
UNION ALL
SELECT PropertyName NAME, PropertyName Description, PropertyViewName DescriptiveFieldName,
PropertyViewName FieldCode, 'ProductCharacteristic' EntityType, 'characteristic' AttributeName, 1 RequireCode,
'Code' EntityTypeName, Prefix, 900 + OrderNo OrderNo, 1 IsConfigured
FROM IH#ProductCharacteristics
UNION ALL
SELECT PropertyName NAME, PropertyName Description, PropertyViewName DescriptiveFieldName,
PropertyViewName FieldCode, 'SiteProperty' EntityType, NULL AttributeName, 0 RequireCode,
'Code' EntityTypeName, Prefix, 1000 + OrderNo OrderNo, 1 IsConfigured
FROM SitePropertiesIPlanView
UNION ALL
SELECT PropertyName NAME, PropertyName Description, PropertyViewName DescriptiveFieldName,
PropertyViewName FieldCode, 'DerivedCharacteristic' EntityType, NULL AttributeName, 0 RequireCode,
'Code' EntityTypeName, Prefix, 1100 + OrderNo OrderNo, 1 IsConfigured
FROM IH#DerivedCharacteristics
UNION ALL
SELECT PropertyName NAME, PropertyName Description, PropertyViewName DescriptiveFieldName,
PropertyViewName FieldCode, 'SkuProperty' EntityType, 'skuProperty' AttributeName, 1 RequireCode,
'Code' EntityTypeName, Prefix, 1200 + OrderNo OrderNo, 1 IsConfigured
FROM SkuPropertiesIPlanView
|
| IH#MonthlyAllSupersededHistory |
|---|
SELECT NVL(OnSiteMaterialUsageId, uh.siteMaterialUsageId) SiteMaterialUsageId, uh.DateFrom,
SUM(AdjustedHistoryWeight * NVL(ms.PERCENTAGE,100) / 100) AllSupersededHistory
FROM IH#MonthlyUsageHistories uh
LEFT JOIN IH#MaterialSupercessions ms
ON ms.SiteMaterialUsageId = uh.SiteMaterialUsageId
GROUP BY NVL(ms.OnSiteMaterialUsageId, uh.SiteMaterialUsageId), DateFrom
|
| IH#MonthlyExchangeRates |
|---|
SELECT v.*,
(FromDivider * ToMultiplier) / (FromMultiplier * ToDivider) RateRatio,
(FromMultiplier / FromDivider) / (ToMultiplier / ToDivider) InverseRateRatio
FROM MonthlyExchangeRates v
|
| IH#MonthlyPrices |
|---|
SELECT siteMaterialUsageId, CurrencyId,
TRUNC(DateFrom, 'month') MonthFrom,
DECODE(DateTo, TO_DATE('01-01-2050', 'DD-MM-YYYY'), DateTo,
add_months(
TRUNC(NVL(LEAD(DateFrom, 1) OVER(PARTITION BY SITEMaterialUsageId, CurrencyId ORDER BY DateFrom), DateTo), 'Month'), -1)) MonthTo,
Price
FROM (SELECT siteMaterialUsageId, CurrencyId, DateFrom, DateTo,
ROW_NUMBER() OVER(PARTITION BY SITEMaterialUsageId, CurrencyId, TRUNC(DAteFrom, 'month') ORDER BY DateFrom DESC) r,
Price
FROM IH#ExpandedPrices)
WHERE r = 1
|
| IH#MonthlySupersededHistory |
|---|
SELECT NVL(ms.OnSiteMaterialUsageId, uh.SiteMaterialUsageId) SiteMaterialUSageID, DateFrom,
SUM(CASE WHEN ms.StartDate IS NULL THEN Weight
WHEN DateFrom <= ms.Startdate OR ms2.StartDate IS NULL THEN Weight * ms.PERCENTAGE / 100
ELSE 0 END) SupersededHistory,
SUM(CASE WHEN ms.StartDate IS NULL THEN mtdHistory
WHEN DateFrom <= ms.Startdate OR ms2.StartDate IS NULL THEN mtdHistory * ms.PERCENTAGE / 100
ELSE 0 END) mtdSupersededHistory,
SUM(CASE WHEN ms.StartDate IS NULL THEN AdjustedHistoryWeight
WHEN DateFrom <= ms.Startdate OR ms2.StartDate IS NULL THEN AdjustedHistoryWeight * ms.PERCENTAGE / 100
ELSE 0 END) AdjustedSupersededHistory
FROM IH#MonthlyUsageHistories uh
LEFT JOIN IH#MaterialSupercessions ms
ON ms.SITEMATERIALUSAGEID = uh.SiteMaterialUsageId
AND ms.StartDate <= uh.DateFrom
LEFT JOIN (SELECT SiteMaterialusageId, Min(StartDate) StartDate
FROM IH#MaterialSupercessions
GROUP BY SiteMAterialUsageId) ms2
ON ms2.SITEMATERIALUSAGEID = NVL(ms.OnSiteMaterialUsageId, uh.SiteMaterialUsageId)
GROUP BY NVL(ms.OnSiteMaterialUsageId, uh.SiteMaterialUsageId), DateFrom
ORDER BY 1,2
|
| IH#MonthlyUsageHistories |
|---|
SELECT hd.SiteMaterialUSageId, HistoryDate HistoryStartDate, TRUNC(DateFrom, 'mm') DateFrom,
NVL(SUM(Weight),0) Weight,
NVL(SUM(DECODE(SIGN(dateFrom - core.getTruncatedInternalDate), -1, weight, 0)), 0) mtdHistory,
NVL(SUM(AdjustedWeight),0) OriginalAdjustedWeight,
GREATEST(0, SUM(NVL(AdjustedWeight, Weight))) HistoryWeight,
SUM(NVL(AdjustedWeight, Weight)) AdjustedHistoryWeight
FROM UsageHistories hd
JOIN IVDP#HistoryStartDate smu
ON smu.SiteMaterialUSageId = hd.SiteMaterialUSageId
GROUP BY hd.SiteMaterialUSageId, HistoryDate, TRUNC(DateFrom, 'mm')
|
| IH#MonthlyUsageHistories_FBH |
|---|
SELECT hd.SiteMaterialUSageId, NULL HistoryStartDate, TRUNC(DateFrom, 'mm') DateFrom,
NVL(SUM(Weight),0) Weight,
NVL(SUM(DECODE(SIGN(dateFrom - i.internalDate), -1, weight, 0)), 0) mtdHistory,
NVL(SUM(AdjustedWeight),0) OriginalAdjustedWeight,
GREATEST(0, SUM(NVL(AdjustedWeight, Weight))) HistoryWeight,
SUM(NVL(AdjustedWeight, Weight)) AdjustedHistoryWeight
FROM UsageHistories hd
CROSS JOIN (SELECT MIN(TRUNC(core.getInternalDate)) internalDate FROM DUAL) i
GROUP BY hd.SiteMaterialUSageId, TRUNC(DateFrom, 'mm')
|
| IH#NavigationTasks |
|---|
SELECT TaskName, ds.Id DataSourceId, nt.IsUnrestricted, nt.Source, nt.IsSystem
FROM NavigationTasks nt
JOIN DataSources ds ON (UPPER(ds.Name) = UPPER(nt.Source))
|
| IH#NegativeDemandCalendarDays |
|---|
WITH
c AS (SELECT r.SourceSiteMaterialUsageId, a.SiteMaterialUsageId, TRUNC(a.DateFrom - r.TimePeriod) DateFrom,
LAST_VALUE(DECODE(a.Consumption, 0, NULL, a.Consumption) IGNORE NULLS)
OVER (PARTITION BY a.SiteMaterialUsageId ORDER BY a.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) Consumption,
r.Portion
FROM ReplenishedCustomerDemands a, ReplenishedCustomerSKU r
WHERE a.SiteMaterialUsageId = r.SiteMaterialUsageId
AND NVL(a.SiteId, 0) =
CASE WHEN a.ConsumptionType IN ('Forecast', 'Allocation') THEN 0 ELSE a.SiteId END
AND a.DateFrom >= TRUNC(SYSDATE) - r.TimePeriod
AND a.DateFrom BETWEEN r.DateFrom AND r.DateTo),
cc AS (SELECT SourceSiteMaterialUsageId, SiteMaterialUSageId, DateFrom, Portion,
IgnoreNegativeInventoryDays, Consumption DailyConsumption,
SUM(Consumption)
OVER (PARTITION BY SiteMaterialUsageId ORDER BY DateFrom ROWS BETWEEN CURRENT ROW AND w.IgnoreNegativeInventoryDays - 1 FOLLOWING) Consumption
FROM c
JOIN SiteMaterialUSages smu ON smu.Id = c.SourceSiteMaterialUsageID
JOIN IH#NegativeDemandWarehouses w ON w.LocationId = smu.LocationId
WHERE 1 = 1 AND w.IgnoreNegativeInventory = 1 AND w.IgnoreNegativeInventoryMethod = 'WorkingDays')
SELECT LocationName, MaterialName, DateFrom, IgnoreNegativeInventoryDays,
NVL(SUM(DailyConsumption * Portion / 100), 0) DailyConsumption,
NVL(SUM(Consumption * Portion / 100), 0) Consumption
FROM cc
JOIN EV#SiteMaterialUsages smu ON smu.ID = cc.SourceSiteMAterialUsageID
GROUP BY LocationName, MaterialName, DateFrom, IgnoreNegativeInventoryDays, Portion
ORDER BY 1, 2, 3
|
| IH#NegativeDemandWarehouses |
|---|
SELECT *
FROM (SELECT w.LocationName, w.LocationCode, w.LocationId, ParameterName, VALUE
FROM Ih#warehouses w
JOIN IH#WorkcentreParameters p ON p.WorkcentreId = w.WorkcentreID
WHERE ParameterName IN ('IgnoreNegativeInventory', 'IgnoreNegativeInventoryDays',
'IgnoreNegativeInventoryMethod')) PIVOT ( MIN(VALUE) FOR ParameterName IN ('IgnoreNegativeInventory' AS IgnoreNegativeInventory, 'IgnoreNegativeInventoryDays' AS IgnoreNegativeInventoryDays, 'IgnoreNegativeInventoryMethod' AS IgnoreNegativeInventoryMethod ) )
|
| IH#NegativeDemandWorkingDays |
|---|
SELECT LocationName, MaterialName, DateFrom, IsWorkingDay, SumIsWorking, IgnoreNegativeInventoryDays,
DailyConsumption, SumConsumption, CASE
WHEN SumIsWorking = t.IgnoreNegativeInventoryDays AND IsWorkingDay = 1
THEN SumConsumption
ELSE NULL END Consumption
FROM (SELECT ip.SourceSiteMaterialUSageID, ip.IgnoreNegativeInventoryDays, ip.DateFrom,
a.Consumption DailyConsumption,
SUM(a.Consumption * p.Portion / 100)
OVER (PARTITION BY ip.DateFrom, ip.SourceSiteMaterialUSageID, a.Sitematerialusageid ORDER BY a.Datefrom) SumConsumption,
a.IsWorkingDay,
SUM(a.IsWorkingDay)
OVER (PARTITION BY ip.DateFrom, ip.SourceSiteMaterialUSageID, a.Sitematerialusageid ORDER BY a.Datefrom) SumIsWorking
FROM (SELECT DISTINCT ip.SiteMaterialUsageId SourceSiteMaterialUsageID, DateFrom,
IgnoreNegativeInventoryDays
FROM InventoryProfiles ip
JOIN IH#NegativeDemandWarehouses w ON w.LocationId = ip.LocationId
WHERE w.IgnoreNegativeInventory = 1 AND w.IgnoreNegativeInventoryMethod = 'WorkingDays') ip
JOIN ReplenishedCustomerSKU p ON p.SourceSiteMaterialUsageId = ip.SourceSiteMaterialUsageId
JOIN ReplenishedCustomerDemands a
ON a.SiteMaterialUsageId = p.Sitematerialusageid AND a.DateFrom >= p.DateFrom - p.TimePeriod AND
a.DateFrom >= ip.DateFrom
ORDER BY 1, 3, 7) t
JOIN EV#SiteMAterialUSages smu ON smu.ID = t.SourceSiteMaterialUSageID
WHERE SumIsWorking <= t.IgnoreNegativeInventoryDays
ORDER BY 1, 2, 3
|
| IH#NettProductionRates |
|---|
SELECT pr.*,
DECODE(rt.ProductionRateType, 'Nett', pr.Rate, pr.Rate * pr.MaterialEfficiency / 100) NettRate
FROM ProductionRates pr
CROSS JOIN (SELECT NVL(Min(Value), 'Nett') ProductionRateType FROM SystemParameters WHERE ParameterName = 'ProductionRateType') rt
|
| IH#NominalCosts |
|---|
SELECT ec.SiteMaterialUsageId, s.LocationName, s.MaterialName, s.Enduse, s.EndCustomer, ec.Datefrom, ec.Cost, c.CurrencyName FROM ExpandedNominalCosts ec JOIN IH#Sku s ON s.Id = ec.SiteMaterialUsageId LEFT JOIN Currencies c ON c.Id = NVL(ec.CurrencyId, core.InternalCurrencyId) |
| IH#NonUsedViews |
|---|
SELECT v.view_name AS ViewName, o.status
FROM user_views v
JOIN user_objects o ON v.view_name = o.object_name AND o.object_type = 'VIEW'
WHERE NOT EXISTS (SELECT 1
FROM user_dependencies d
WHERE d.referenced_name = v.view_name AND d.referenced_type = 'VIEW')
ORDER BY v.view_name
|
| IH#NormalSkuStockStatus |
|---|
WITH Params AS (
SELECT
NVL(MAX(CASE WHEN ParameterName = 'RPStockStateField' THEN VALUE END), 'Closing') AS StockStateField,
MAX(CASE WHEN ParameterName = 'StockLevelAtZeroWarning' THEN VALUE END) AS StockLevelAtZeroWarning
FROM SystemParameters
WHERE ParameterName IN ('RPStockStateField', 'StockLevelAtZeroWarning')
),
BaseData AS (
SELECT r.*, s.SafetyStockPercentWarning, s.MaxCapacity, s.MaxCapacityBehaviour, p.StockLevelAtZeroWarning,
CASE WHEN p.StockStateField = 'Closing' THEN r.OverallClosing ELSE r.OverallOpening END AS TargetStock
FROM RealInventoryProfilesIPlanView r
JOIN IH#WHStockMonitoring s
ON s.SiteMaterialUsageId = r.SiteMaterialUsageId
AND NVL(s.ConsignmentLocationId, 0) = NVL(r.ConsignmentLocationId, 0)
CROSS JOIN Params p
)
SELECT
SiteMaterialUsageId, ConsignmentLocationId, DateFrom, OverallOpening, OverallClosing,
SafetyStock, SafetyStockPercentWarning, MaxSafetyStock, MaxCapacity, 0 AS Superseded,
CASE
WHEN TargetStock = 0 AND SafetyStock = 0 AND OriginalConsumption > 0 THEN 1
WHEN TargetStock < 0 THEN 1
WHEN StockLevelAtZeroWarning = 'InventoryLessOrEqualZero' AND SafetyStock > 0 AND TargetStock = 0 THEN 1
WHEN SafetyStock > 0 AND SafetyStockPercentWarning > 0 AND TargetStock < (SafetyStock * SafetyStockPercentWarning / 100) THEN 2
WHEN SafetyStock > 0 AND TargetStock < SafetyStock THEN 3
WHEN MaxCapacityBehaviour IN ('Warning', 'Limit') AND MaxCapacity > 0 AND TargetStock > MaxCapacity THEN 4
WHEN MaxSafetyStock IS NOT NULL AND TargetStock > MaxSafetyStock THEN 5
ELSE 9
END AS StockStatus
FROM BaseData
|
| IH#ObsoleteForecastCoefs |
|---|
SELECT Id
FROM ForecastWeeklyCoefs
MINUS (SELECT SystemWeeklyCoefId AS Id
FROM ForecastBodies
UNION ALL
SELECT CustomerWeeklyCoefId AS Id
FROM ForecastBodies
UNION ALL
SELECT FinalWeeklyCoefId AS Id
FROM ForecastBodies
UNION ALL
SELECT SystemWeeklyCoefId AS Id
FROM ArchivedForecastBodies
UNION ALL
SELECT CustomerWeeklyCoefId AS Id
FROM ArchivedForecastBodies
UNION ALL
SELECT FinalWeeklyCoefId AS Id
FROM ArchivedForecastBodies
UNION ALL
SELECT FinalWeeklyCoefId AS Id
FROM ForecastSnapshotBodies
)
|
| IH#OpeningRealProfiles | View for calculation opening/closing values in real inventory profiles |
|---|
WITH BaseData AS (
SELECT ip.SiteMaterialUSageID, ip.ConsignmentLocationId,
ip.DateFrom, ip.OrdersIn, ip.TentativeOrdersIn, ip.OrdersOut,ip.TentativeOrdersOut,
ip.Consumption, ip.SafetyStock, p.ClosingMethod,
-- 1. Take the base Opening
FIRST_VALUE(ip.Opening) OVER(PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom) AS BaseOpening,
-- 2. Calculate cumulative sums strictly up to the previous row (1 PRECEDING)
-- Since all PARTITION and ORDER BY clauses are identical, Oracle sorts everything only once!
NVL(SUM(ip.OrdersIn) OVER(PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumIn_Prev,
NVL(SUM(ip.OrdersOut) OVER(PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumOut_Prev,
NVL(SUM(ip.TentativeOrdersIn) OVER(PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumTentIn_Prev,
NVL(SUM(ip.TentativeOrdersOut) OVER(PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumTentOut_Prev,
NVL(SUM(ip.Consumption) OVER(PARTITION BY ip.SiteMaterialUSageId, ip.ConsignmentLocationId ORDER BY ip.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumCons_Prev
FROM RealInventoryProfiles ip
CROSS JOIN (SELECT DECODE(MAX(RPClosingCalculationMethod), 'AfterDeliveryDate', 1, 0) AS ClosingMethod
FROM IH#ReplenishmentParameters
) p
)
SELECT
bd.SiteMaterialUSageID, bd.ConsignmentLocationId, bd.DateFrom,
calc.OverAllOpening, bd.OrdersIn, bd.TentativeOrdersIn,bd.OrdersOut,
bd.TentativeOrdersOut, bd.Consumption,
-- CumulativeConsumption: Sum through the previous row plus consumption in the current row
(bd.SumCons_Prev + bd.Consumption) AS CumulativeConsumption,
-- Closing: Opening plus current OrdersIn (only when ClosingMethod = 0) minus current OrdersOut
(calc.Opening + CASE WHEN bd.ClosingMethod = 0 THEN bd.OrdersIn ELSE 0 END - bd.OrdersOut) AS Closing,
-- OverallClosing: OverallOpening plus current receipts (when ClosingMethod = 0) minus all current expenses
(calc.OverAllOpening + CASE WHEN bd.ClosingMethod = 0 THEN (bd.OrdersIn + bd.TentativeOrdersIn) ELSE 0 END
- (bd.OrdersOut + bd.Consumption + bd.TentativeOrdersOut)) AS OverallClosing,
bd.SafetyStock
FROM BaseData bd
CROSS APPLY (
SELECT
(bd.BaseOpening + bd.SumIn_Prev - bd.SumOut_Prev) AS Opening,
(bd.BaseOpening + bd.SumIn_Prev + bd.SumTentIn_Prev - bd.SumOut_Prev - bd.SumCons_Prev - bd.SumTentOut_Prev) AS OverAllOpening
FROM DUAL
) calc
|
| IH#OrderDuration |
|---|
SELECT ol.Id AS OrderLineId,
oo.Id AS OrderOperationId,
oo.OperationNo,
oo.MaterialRunId,
oo.DueDate,
oo.WorkCentreId,
NVL(oo.MaterialId, ol.MaterialId) AS SourceMaterialId,
oo.OperationTypeId,
oo.OrderOperationStatusId,
ol.SourceWeight,
oo.Quantity,
NVL(oo.QuantityComplete,0) AS QuantityComplete,
mrs.RunStatusCode,
oos.OrderOperationStatusCode,
oos.OrderOperationStatusName,
CASE WHEN mrs.RunStatusCode IN ('Complete', 'Started') THEN oo.Quantity
WHEN oos.OrderOperationStatusCode = 'Completed' THEN 0
ELSE GREATEST(0, oo.Quantity - NVL(oo.QuantityComplete,0))
END AS RemainingQuantity,
oo.OperationDuration AS Duration,
oo.OperationCompletedDuration AS CompletedDuration,
CASE WHEN mrs.RunStatusCode IN ('Complete', 'Started') THEN oo.OperationDuration
WHEN oos.OrderOperationStatusCode = 'Completed' THEN 0
ELSE GREATEST(0, oo.OperationDuration - NVL(oo.OperationCompletedDuration,0))
END AS RemainingDuration
FROM OrderLines ol
JOIN OrderOperations oo ON oo.OrderLineId = ol.Id
JOIN OrderOperationStatuses oos ON oos.Id = oo.OrderOperationStatusId
JOIN WorkCentres w ON w.Id = oo.WorkCentreId
JOIN WorkCentreTypes wt ON wt.Id = w.WorkCentreTypeId AND wt.IsProductionSource = 1
LEFT JOIN MaterialRuns mr ON mr.Id = oo.MaterialRunId
LEFT JOIN MaterialRunStatuses mrs ON mrs.Id = mr.MaterialRunStatusId
WHERE oos.OrderOperationStatusCode != 'Cancelled'
|
| IH#OrderInformationCategories |
|---|
SELECT CategoryInfo, ItemType, IsSelected, IsEditable FROM OrderInformationCategories UNION ALL SELECT DISTINCT i.Type CategoryInfo, d.Type ItemType, 0 IsSelected, 0 IsEditable FROM Orderinformation i JOIN OrderInformationItems d ON d.OrderInformationId = i.Id WHERE NOT EXISTS (SELECT 1 FROM OrderInformationCategories c where c.CategoryInfo = i.Type and c.ItemType = d.Type) |
| IH#OrderInformationConfig |
|---|
SELECT CategoryInfo || '.' || ItemType DictionaryKey, IsSelected, IsEditable FROM OrderInformationCategories WHERE IsSelected + IsEditable > 0 |
| IH#OrderInquiryPrices |
|---|
SELECT smu.Id AS SiteMaterialUsageId, DECODE(smu.Status, 1, fp.DateFrom, ep.DateFrom) DateFrom, DECODE(smu.Status, 1, fp.DateTo, ep.DateTo) DateTo, DECODE(smu.Status, 1, fp.PriceCurrencyId, ep.CurrencyId) CurrencyId, DECODE(smu.Status, 1, fp.ForecastedPrice, ep.Price) Price FROM SiteMaterialUsages smu LEFT JOIN IH#ForecastedPrices fp ON fp.SiteMaterialUsageId = smu.id AND smu.Status = 1 LEFT JOIN IH#ExpandedPrices ep ON ep.SiteMaterialUsageId = smu.id AND smu.Status = 0 WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = smu.LocationId) AND DECODE(smu.Status, 1, fp.ForecastedPrice, ep.Price) IS NOT NULL |
| IH#OrderLineDeliveryWeights |
|---|
SELECT OrderLineId, SUM(CASE WHEN ds.DeliveryStatusCode IN ('InTransit', 'Delivered', 'SeparatedDelivered') THEN Weight ELSE 0 END) DispatchedWeight,
SUM(CASE WHEN ds.DeliveryStatusCode IN ('Delivered', 'SeparatedDelivered') THEN Weight ELSE 0 END) DeliveredWeight
FROM Deliveries d
JOIN DeliveryStatuses ds
ON ds.Id = d.DeliveryStatusId
GROUP BY OrderLineId
|
| IH#OrderLines |
|---|
SELECT OrderCode, OrderLineStatusCode, ol.* FROM OrderLines ol JOIN OrderBooks ob ON ob.Id = ol.OrderBookId JOIN OrderLineStatuses ols ON ols.Id = ol.OrderLineStatusId |
| IH#OrderOperationDuration |
|---|
SELECT oo.OrderLineId,
oo.Id AS OrderOperationId,
oo.WorkCentreId,
oo.MaterialRunId,
oo.StartTime StartDate,
oo.FinishTime FinishDate,
oo.Quantity,
oo.QuantityComplete,
oo.OperationDuration AS Duration,
CASE WHEN NVL(oo.QuantityComplete, 0) <= 0 OR NVL(oo.Rate, 0) <= 0 THEN 0 ELSE oo.QuantityComplete / oo.Rate * 60 END AS DurationComplete
FROM OrderOperations oo
JOIN OrderOperationStatuses ols on ols.Id = oo.OrderOperationStatusId
WHERE ols.OrderOperationStatusCode != 'Cancelled'
AND MaterialRunId IS NOT NULL
|
| IH#OrderOperationMajorTools |
|---|
SELECT OrderOperationId, MIN(ToolMaterialId) KEEP(DENSE_RANK FIRST ORDER BY IsMajorTool DESC) AS MajorToolMaterialId FROM OrderOperationTools GROUP BY OrderOperationId |
| IH#OrderOperationMovements |
|---|
SELECT smu.Id SiteMaterialUSageId, smu.MaterialId, NVL(oo.DueDate, ol.DespatchDate) DueDate, m.Quantity, ol.Id OrderLineId, oo.Id OrderOperationId, smu.Id || '-0' SkuKey FROM OrderOperationMaterials m JOIN OrderOperations oo ON oo.Id = m.Orderoperationid JOIN IH#Workcentres wc ON wc.WorkcentreId = oo.WorkcentreId JOIN Ih#mainwarehouses w ON w.SiteId = wc.SiteId JOIN SiteMaterialUsages smu ON smu.LocationId = w.LocationId AND smu.MaterialId = m.MaterialId JOIN OrderLines ol ON ol.ID =oo.ordeRLineId |
| IH#OrderOperations |
|---|
SELECT OrderCode, LineNoCode, OperationNo, WorkcentreName, WorkcentreCode, BlockCode, RunCode, OrderOperationStatusCode, OrderOperationStatusName, OrderLineStatusCode, OrderLineStatusName, OperationTypeName, OrderBookId, OrderLineId, oo.Id OrderOperationId, oo.WorkcentreId, OrderLineStatusId, OrderOperationStatusId, oo.UnitId, OperationTypeId, oo.Quantity, oo.QuantityComplete, oo.OperationDuration, oo.OperationCompletedDuration, oo.StartTime, oo.FinishTime, oo.Rate, oo.ProcessDuration, oo.IsLastOperation, oo.MaterialRunId from OrderOperations oo JOIN OrderLines ol ON ol.Id = oo.OrderLineId JOIN OrderBooks ob ON ob.Id = ol.OrderBookId JOIN Workcentres wc ON (wc.Id = oo.WorkcentreId) JOIN OrderOperationStatuses oos ON (oos.Id = oo.OrderOperationStatusId) JOIN OrderLineStatuses ols ON (ols.Id = ol.OrderLineStatusId) JOIN OperationTypes ot ON ot.Id = oo.OperationTypeId LEFT JOIN MaterialRuns mr ON (mr.Id = oo.MaterialRunId) LEFT JOIN MaterialBlocks mb ON (mb.Id = mr.MaterialBlockId) |
| IH#OrdersForExternalSystem |
|---|
SELECT e.* FROM Entitiesforexternalsystem e LEFT JOIN OrderOperations oo ON oo.OrderLineId = e.EntityId LEFT JOIN Ih#workcentreparameters wp ON wp.WorkcentreId = oo.WorkcentreId AND ParameterName = 'SuspendOrderStatusMessages' WHERE EntityType = 'OrderLine' AND NVL(wp.Value,0) = 0 |
| IH#OverrideWorkCentres |
|---|
SELECT wc.Id WorkcentreId, wc.WorkcentreName, wc.WorkcentreCode, mwh.WorkcentreId MainWarehouseId, wp.Value, NVL(owc.Id, mwh.WorkcentreId) OverrideWarehouseId, NVL(owc.WorkcentreName, mwh.WorkcentreName) OverrideWarehouseCode, NVL(owc.WorkcentreCode,mwh.WorkcentreName) OverrideWarehouseName, NVL(owc.LocationId, mwh.LocationId) OverrideWarehouseLocationId, l.SiteId FROM Workcentres wc JOIN WorkcentreTypes wct on wct.Id = wc.WorkcentreTypeId JOIN Locations l ON l.Id = wc.LocationId JOIN IH#MAINWAREHOUSES mwh ON mwh.SiteId = l.SiteId LEFT JOIN IH#WorkcentreParameters wp ON wp.WorkcentreId = wc.Id AND ParameterName = 'PMOverrideWarehouse' AND VALUE != 'undefined' LEFT JOIN Workcentres owc ON owc.Workcentrecode = wp.Value WHERE wct.IsProductionSource = 1 |
| IH#PageElements |
|---|
SELECT REGEXP_SUBSTR(t.DictionaryKey, '[^.]+', 1, 2) AS PageName,
REGEXP_SUBSTR(t.DictionaryKey, '[^.]+', 1, 3) AS ElementName,
t.DictionaryValue Text,
DictionaryKey
FROM DbDictionaries t
JOIN Languages l on l.Id = t.LanguageId and l.Internal = 1
Where DictionaryKey like 'Pages.%text'
|
| IH#PageParameters |
|---|
SELECT pp.Id, PageId, PageName, pp.ParameterName, pp.ParameterDescription, ParameterType, DataType, MINVALUE, MAXVALUE, DependOn,
DependBehaviour, DependValues, pp.OrderNo, GroupName, Separator, DECODE(COALESCE(pp.Value, pp.DefaultValue),
'{SYSDATE}', to_char(Trunc(core.getInternalDate, 'month'), 'YYYY-MM-DD'),
COALESCE(pp.Value, pp.DefaultValue)) AS VALUE, pp.ParameterHint, pp.ActionId, pp.BundleId, pp.IsDevMode
FROM PageParameters pp
JOIN Pages p ON (pp.PageId = p.Id)
|
| IH#Pages |
|---|
SELECT p.Id, p.PageDescription, p.PageName, p.PageHint,
RTRIM(a.PageDescription ||' / '||sg.PageDescription, ' / ') PagePath
FROM Pages p
LEFT JOIN Pages a ON a.PageName = p.Area
LEFT JOIN Pages sg ON sg.PageName = p.SubGroup
WHERE (p.ShowAlways = 1 OR a.Id IS NOT NULL)
ORDER BY PagePath, PageDescription
|
| IH#PriceParameters |
|---|
SELECT PriceRuleType, HistoryPricePeriods, OrdersPricePeriods, OrdersPriceFuturePeriods, PriceWeighting,
PriceWeighting OrdersWeighting, 100 - PriceWeighting HistoryWeighting,
add_months(TRUNC(core.getTruncatedInternalDate, 'month'), -HistoryPricePeriods) HistoryStartMonth,
add_months(TRUNC(core.getTruncatedInternalDate, 'month'), -1) HistoryFinishMonth,
add_months(TRUNC(core.getTruncatedInternalDate, 'month'), -OrdersPricePeriods) OrdersStartMonth,
DECODE(OrdersPriceFuturePeriods, 0, DATE '2050-01-01',
add_months(TRUNC(core.getTruncatedInternalDate, 'month'), OrdersPriceFuturePeriods)) OrdersFinishMonth
FROM (SELECT ParameterName, VALUE FROM systemparameters)
pivot(MIN(VALUE)
FOR parametername IN('OrdersPricePeriods' OrdersPricePeriods, 'OrdersPriceFuturePeriods' OrdersPriceFuturePeriods,
'HistoryPricePeriods' HistoryPricePeriods, 'PriceRuleType' PriceRuleType,
'PriceWeightingForOrdersAndHistory' PriceWeighting
))
|
| IH#Prices |
|---|
SELECT es.SiteMaterialUsageId, es.PriceRuleId, es.Datefrom, es.DateTo, es.Note, s.LocationName, s.MaterialName, s.EndUse, s.EndCustomer, s.LocationCode, s.MaterialCode, s.EndUseCode, s.EndCustomerCode, es.Price, c.CurrencyName, pr.Price AS RulePrice, prc.CurrencyName AS RuleCurrencyName, CASE WHEN core.getTruncatedInternalDate BETWEEN DateFrom AND DateTo THEN 1 ELSE 0 END IsActive FROM IH#ExpandedPrices es JOIN IH#Sku s ON (s.Id = es.SiteMaterialUsageId) LEFT JOIN Currencies c ON (c.Id = NVL(es.CurrencyId, core.InternalCurrencyId)) LEFT JOIN PriceRules pr ON pr.Id = es.PriceRuleId LEFT JOIN Currencies prc ON prc.Id = NVL(pr.CurrencyId, core.InternalCurrencyId) |
| IH#ProcessLogs |
|---|
SELECT PRocessName, ProcessType, p.userId, l.*, Stamp - Lag(Stamp) OVER(PARTITION BY ProcessId ORDER BY Stamp) Diff FROM Processes p LEFT JOIN ProcessLogs l ON l.ProcessId = p.Id ORDER BY l.Stamp, l.ID |
| IH#ProcessStatuses |
|---|
WITH p AS (SELECT t.Id AS TaskId,
t.TaskName,
t.Description AS TaskDesc,
t.IsSystemTask,
pp.Id AS ProcessPartId,
pp.ProcessPartName,
pp.ProcessPartDesc,
pp.OrderNo,
ps.UserId,
ps.Done,
ps.Total,
CASE pp.ProcessPartType
WHEN 0 THEN 'Simple'
WHEN 1 THEN 'Complex'
WHEN 2 THEN 'TotalUnknown'
ELSE 'Complex'
END AS ProcessPartType,
DECODE(ps.Total, 0, 0, Round(ps.Done / ps.Total * 100, 0)) AS Percentage,
ps.ProcessId
FROM ProcessStatuses ps
JOIN ProcessParts pp ON pp.Id = ps.ProcessPartId
JOIN Tasks t ON t.Id = pp.TaskId
UNION ALL
SELECT t.Id AS TaskId,
t.TaskName,
t.Description AS TaskDesc,
t.IsSystemTask,
NULL AS ProcessPartId,
ps.ProcessPartName,
ps.ProcessPartName AS ProcessPartDesc,
ps.OrderNo,
ps.UserId,
ps.Done,
ps.Total,
CAST(NULL AS VARCHAR2(20)) AS ProcessPartType,
DECODE(ps.Total, 0, 0, Round(ps.Done / ps.Total * 100, 0)) AS Percentage,
ps.ProcessId
FROM ProcessStatuses ps
JOIN Tasks t ON t.Id = ps.TaskId
WHERE NVL(ps.ProcessPartId,0) = 0),
s AS (SELECT p.*,
CASE
WHEN p.Done = p.Total AND p.Total > 0 THEN 'Completed'
WHEN p.Done = 0 AND p.Total = 0 THEN 'Pending'
WHEN p.ProcessPartType = 'TotalUnknown'
AND p.Done = 0 AND p.Total = 1 THEN 'Running'
WHEN p.ProcessPartType = 'TotalUnknown' THEN 'NotReached'
WHEN p.Total > 0 AND p.Done < p.Total THEN 'Running'
ELSE 'NotReached'
END AS StageState
FROM p)
SELECT s.TaskId,
s.TaskName,
NVL(tt.TaskDesc, s.TaskDesc) AS TaskDesc,
s.IsSystemTask,
s.ProcessPartId,
s.ProcessPartName,
NVL(tpp.ProcessPartDesc, s.ProcessPartDesc) AS ProcessPartDesc,
s.OrderNo,
s.UserId,
s.Done,
s.Total,
s.ProcessPartType,
s.StageState,
CASE WHEN s.StageState = 'Running'
AND s.ProcessPartType = 'TotalUnknown' THEN 1 ELSE 0 END AS IsIndeterminate,
s.Percentage,
NVL(tt.LanguageId, tpp.LanguageId) AS LanguageId,
s.ProcessId
FROM s
LEFT JOIN IT#Tasks tt ON tt.TaskId = s.TaskId
LEFT JOIN IT#ProcessParts tpp ON tpp.ProcessPartId = s.ProcessPartId
AND tpp.LanguageId = tt.LanguageId
|
| IH#ProductCharacteristics |
|---|
SELECT Id,
CharacteristicName AS PropertyName,
CharacteristicName AS PropertyDesc,
UPPER('PC_' || REGEXP_REPLACE(CharacteristicName, '[^[:alnum:]_]', '')) PropertyViewName,
'Characteristic' || ROW_NUMBER() Over(ORDER BY Id) FieldProperty,
HierarchyLevelNO OrderNo,
'PC' Prefix
FROM ProductCharacteristics
|
| IH#ProductCosts |
|---|
SELECT MaterialId, WorkcentreId, SiteId, Effective,
NVL(LEAD(Effective - 1) OVER (PARTITION BY MaterialId, WorkcentreId ORDER BY Effective), to_date('01-01-2050', 'DD-MM-RRRR')) NextEffective,
COST
FROM COSTRULES cr
JOIN Ih#detailsmaterial d
ON cr.DetailId = d.DetailId
JOIN Workcentres wc
ON wc.Id = cr.WorkcentreId
JOIN Locations l
ON l.Id = wc.LocationId
|
| IH#ProductionConfigurations |
|---|
SELECT 0 AS Id, 0 ProductRouteId, m.Id AS MaterialId, m.MaterialName, m.MaterialCode, '' Site, 1 Preferred, NULL BomId, c.CoProductPriceList, c.Percentage CoProductPercentage FROM Materials m JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId AND IsTool = 0 LEFT JOIN Ih#coproductlists c ON c.MaterialId = m.Id WHERE NOT EXISTS(SELECT 1 FROM ProductionConfigurations pc Where pc.MaterialId = m.Id) AND NOT EXISTS(SELECT 1 FROM CoProducts cp where cp.CoProductMaterialId = m.Id) UNION ALL SELECT pc.Id, pc.ProductRouteId, pc.MaterialId, m.MaterialName, m.MaterialCode, pc.site, pc.Preferred, pc.BomId, CoProductPriceList, c.Percentage CoProductPercentage FROM ProductionConfigurations pc JOIN Materials m JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId AND IsTool = 0 ON m.Id = pc.MaterialId LEFT JOIN Ih#coproductlists c ON c.MaterialId = m.Id Order By 1 |
| IH#ProductionPlan |
|---|
WITH q AS
(
SELECT mr.WorkCentreId, TRUNC(mr.StartDate, 'IW') SourcePeriod,
ct.CycleTypeId, ct.CycleType, ct.Priority,
SUM(mr.AvailableDuration) AllocationMinutes,
SUM(mr.OrdersDuration) OrdersMinutes,
SUM(mr.InitialDuration) DurationInMinutes
FROM IH#RunAvailableDuration mr
JOIN MaterialRunProducts mrp
ON mrp.MaterialRunId = mr.Id
JOIN IH#CycleTypes ct
ON ct.DetailId = mrp.DetailId
GROUP BY mr.WorkCentreId, TRUNC(mr.StartDate, 'IW'), ct.CycleTypeId, ct.CycleType, ct.Priority
HAVING SUM(mr.AvailableDuration) + SUM(mr.OrdersDuration) > 0
)
SELECT ROW_NUMBER() OVER(ORDER By WorkCentreId, SourcePeriod, Priority, RowNum) Id,
WorkCentreId,
CycleTypeId,
CycleType,
Priority,
SourcePeriod,
DurationInMinutes,
OrdersMinutes,
AllocationMinutes,
SourcePeriod + SUM(DurationInMinutes)
OVER(PARTITION BY WorkCentreId, SourcePeriod
ORDER BY Priority, ROWNUM) / 24 / 60 - (DurationInMinutes / 24 / 60) StartDate,
SourcePeriod + SUM(DurationInMinutes)
OVER(PARTITION BY WorkCentreId, SourcePeriod ORDER BY Priority, ROWNUM) / 24 / 60 FinishDate
FROM q
ORDER BY WorkCentreId, SourcePeriod, Priority
|
| IH#ProductionRates |
|---|
SELECT pr.Id, pr.WorkCentreId, pr.OperationTypeId, pr.DetailId, pr.ProductionRateCode,
pr.TimeEfficiency, pr.MaterialEfficiency, pr.ConversionFactor, pr.RuleWeighting,
pr.Rate GrossProductionRate,
NettRate NettProductionRate,
NettRate,
NettRate * pr.TimeEfficiency/100 EffectiveProductionRate,
pr.Effective, wc.SiteName, wc.SiteCode, wc.WorkCentreName, wc.WorkCentreCode, ot.OperationTypeName,
d.Code1, d.Code2, d.Code3, d.Code4, d.Code5, d.Code6, d.Code7, d.Code8, d.Code9, d.Code10,
d.Code11, d.Code12, d.Code13, d.Code14, d.Code15, d.Code16, d.Code17, d.Code18, d.Code19, d.Code20,
d.Code21, d.Code22, d.Code23, d.Code24, d.Code25, d.Code26, d.Code27, d.Code28, d.Code29, d.Code30, d.ProductCode,
NVL(LEAD(Effective) OVER(PARTITION BY pr.WorkCentreId, pr.OperationTypeId, pr.DetailId ORDER BY pr.Effective) - 1,
to_date('2100-01-01', 'YYYY-MM-DD')) EffectiveTo,
CASE
WHEN TRUNC(core.getInternalDate) >= Effective
AND TRUNC(core.getInternalDate) < NVL(LEAD(Effective) OVER(PARTITION BY pr.WorkcentreId, pr.OperationTypeId, pr.DetailId ORDER BY pr.Effective),
to_date('2100-01-01', 'YYYY-MM-DD'))
THEN 1 ELSE 0 END IsActive
FROM IH#NettProductionRates pr
JOIN HierarchyPropertyDetails d ON (d.Id = pr.DetailId)
JOIN IH#Workcentres wc ON wc.WorkCentreId = pr.WorkCentreId
LEFT JOIN OperationTypes ot ON ot.Id = pr.OperationTypeId
CROSS JOIN (SELECT NVL(Min(Value), 'Nett') ProductionRateType FROM SystemParameters WHERE ParameterName = 'ProductionRateType') rt
|
| IH#ProductionRatesValues |
|---|
SELECT d.Id AS DetailId, MAX(Value1) Value1, MAX(Value2) Value2, MAX(Value3) Value3, MAX(Value4) Value4, MAX(Value5) Value5, MAX(Value6) Value6, MAX(Value7) Value7, MAX(Value8) Value8, MAX(Value9) Value9, MAX(Value10) Value10, MAX(Value11) Value11, MAX(Value12) Value12, MAX(Value13) Value13, MAX(Value14) Value14, MAX(Value15) Value15, MAX(Value16) Value16, MAX(Value17) Value17, MAX(Value18) Value18, MAX(Value19) Value19, MAX(Value20) Value20, MAX(Value21) Value21, MAX(Value22) Value22, MAX(Value23) Value23, MAX(Value24) Value24, MAX(Value25) Value25, MAX(Value26) Value26, MAX(Value27) Value27, MAX(Value28) Value28, MAX(Value29) Value29, MAX(Value30) Value30 FROM HierarchyPropertyDetails d JOIN ProductionRates pr on d.Id = pr.DetailId JOIN MaterialPropsSpec m ON (d.Code1 IS NULL OR d.Code1 = m.code1) AND (d.Code2 IS NULL OR d.Code2 = m.code2) AND (d.Code3 IS NULL OR d.Code3 = m.code3) AND (d.Code4 IS NULL OR d.Code4 = m.code4) AND (d.Code5 IS NULL OR d.Code5 = m.code5) AND (d.Code6 IS NULL OR d.Code6 = m.code6) AND (d.Code7 IS NULL OR d.Code7 = m.code7) AND (d.Code8 IS NULL OR d.Code8 = m.code8) AND (d.Code9 IS NULL OR d.Code9 = m.code9) AND (d.Code10 IS NULL OR d.Code10 = m.code10) AND (d.Code11 IS NULL OR d.Code11 = m.code11) AND (d.Code12 IS NULL OR d.Code12 = m.code12) AND (d.Code13 IS NULL OR d.Code13 = m.code13) AND (d.Code14 IS NULL OR d.Code14 = m.code14) AND (d.Code15 IS NULL OR d.Code15 = m.code15) AND (d.Code16 IS NULL OR d.Code16 = m.code16) AND (d.Code17 IS NULL OR d.Code17 = m.code17) AND (d.Code18 IS NULL OR d.Code18 = m.code18) AND (d.Code19 IS NULL OR d.Code19 = m.code19) AND (d.Code20 IS NULL OR d.Code20 = m.code20) AND (d.Code21 IS NULL OR d.Code21 = m.code21) AND (d.Code22 IS NULL OR d.Code22 = m.code22) AND (d.Code23 IS NULL OR d.Code23 = m.code23) AND (d.Code24 IS NULL OR d.Code24 = m.code24) AND (d.Code25 IS NULL OR d.Code25 = m.code25) AND (d.Code26 IS NULL OR d.Code26 = m.code26) AND (d.Code27 IS NULL OR d.Code27 = m.code27) AND (d.Code28 IS NULL OR d.Code28 = m.code28) AND (d.Code29 IS NULL OR d.Code29 = m.code29) AND (d.Code30 IS NULL OR d.Code30 = m.code30) GROUP BY d.Id |
| IH#ProductionUtilisation |
|---|
WITH q AS
(
SELECT mi.OperatorUserId, OrderNo, wc.WorkcentreTypeId, WorkcentreTypeDesc, mi.WorkcentreId,
DateFrom, TimePeriod, PeriodLength * 24 PeriodHours,
SUM(NominalCapacityHours + ShutHours) TotalHours, SUM(ShutHours) ShutHours,
SUM(OrdersHours) OrdersHours,
SUM(TentativeOrdersHours) TentativeOrdersHours,
SUM(OrdersWeight) OrdersWeight,
SUM(TentativeOrdersWeight) TentativeOrdersWeight,
SUM(FixedCapacityHours) FixedHours,
SUM(UnusedRunHours) UnusedRunHours,
SUM(GREATEST(0, CapacityHours - FixedCapacityHours)) FreeCapacityHours
FROM ProductionInformationData mi
JOIN IH#Workcentres wc
ON wc.WorkcentreId = mi.workcentreId
JOIN IH#CycleProductionPeriods p ON p.startperiod = mi.DateFrom
WHERE wc.IsProductionSource = 1
GROUP BY mi.OperatorUserId, OrderNo, wc.WorkcentreTypeId, WorkcentreTypeDesc,
DateFrom, TimePeriod, PeriodLength, CUBE(mi.WorkcentreId)
)
SELECT OperatorUserId, q.WorkcentreTypeId, q.WorkcentreTypeDesc, q.OrderNo, q.WorkcentreId, WorkcentreName, WorkcentreCode, SiteCode,
SiteName, DateFrom, TimePeriod, PeriodHours, TotalHours, ShutHours,
OrdersHours, TentativeOrdersHours, OrdersWeight, TentativeOrdersWeight,
FixedHours, UnusedRunHours, FreeCapacityHours,
CASE WHEN UnusedRunHours + ShutHours + OrdersHours + TentativeOrdersHours > TotalHours THEN 1 ELSE 0 END IsOverbooked,
CASE WHEN UnusedRunHours + ShutHours + OrdersHours + TentativeOrdersHours = TotalHours THEN 1 ELSE 0 END IsBottleneck
FROM q
LEFT JOIN IH#Workcentres wc
ON wc.WorkcentreId = q.WorkcentreId
ORDER BY OperatorUserId, q.OrderNo,
DateFrom, TimePeriod, WorkcentreName NULLS FIRST, WorkcentreCode NULLS FIRST
|
| IH#ProductionWorkcentres |
|---|
SELECT WorkcentreCode, SiteCode, WorkcentreName, SiteName, WorkcentreTypeName, WorkcentreTypeDesc, wct.OrderNo WorkcentreTypeOrderNo, wc.Id WorkcentreId, SiteId, wct.HasInventory, wc.LocationId FROM Workcentres wc JOIN Locations l ON l.id = wc.LocationId JOIN Sites s ON s.Id = l.SiteId JOIN WorkcentreTypes wct ON wct.Id = wc.WorkcentreTypeId WHERE wct.IsProductionSource = 1 |
| IH#ProductRoutes |
|---|
SELECT 0 AS Id, 'Default' ProductRouteName
FROM WorkCentreTypes wct
JOIN OperationTypes ot
ON ot.WorkCentreTypeId = wct.Id
WHERE WorkCentreTypeName = 'Paper Machine'
AND NOT EXISTS(SELECT 1 FROM ProductRoutes)
UNION ALL
SELECT pr.Id, pr.ProductRouteName
FROM ProductRoutes pr
|
| IH#ProductRouteStages |
|---|
SELECT 0 AS ProductRouteId, 0 ProductRouteStageId, 'Default' ProductRouteName, 1 StageNo, WorkCentreTypeId, WorkCentreTypeName, 1 IsLastStage, 1 CreateCampaign, '1' StageCode, 'Default' OperationTypeName, ot.Id OperationTypeId, 1 OrderNo FROM WorkCentreTypes wct JOIN OperationTypes ot ON ot.WorkCentreTypeId = wct.Id WHERE WorkCentreTypeName = 'Paper Machine' AND NOT EXISTS(SELECT 1 FROM ProductRoutes) UNION ALL SELECT pr.Id ProductRouteId, prs.Id ProductRouteStageId, pr.ProductRouteName, prs.OrderNo, ot.WorkCentreTypeId, wt.WorkCentreTypeName, NVL(Lead(0) OVER (PARTITION BY prs.ProductRouteId ORDER BY prs.OrderNo),1) IsLastStage, CreateCampaign, StageCode, ot.OperationTypeName, prs.OperationTypeId, prs.OrderNo FROM ProductRoutes pr JOIN ProductRouteStages prs ON prs.ProductRouteId = pr.Id LEFT JOIN OperationTypes ot ON ot.Id = prs.OperationTypeId JOIN WorkCentreTypes wt ON wt.Id = ot.WorkCentreTypeId ORDER BY 1, StageNo |
| IH#ProductSiteCosts |
|---|
WITH c AS (
SELECT MaterialId, SiteId, Effective, AVG(COST) COST
FROM COSTRULES cr
JOIN Ih#detailsmaterial d
ON cr.DetailId = d.DetailId
JOIN Workcentres wc
ON wc.Id = cr.WorkcentreId
JOIN Locations l
ON l.Id = wc.LocationId
GROUP BY MaterialId, SiteId, Effective
)
SELECT MaterialId, SiteId, Effective,
NVL(LEAD(Effective - 1) OVER (PARTITION BY MaterialId, SiteId ORDER BY Effective), to_date('01-01-2050', 'DD-MM-RRRR')) NextEffective,
COST
FROM c
|
| IH#PublishedReports |
|---|
SELECT ds.ID, ds.Description || ' (' || u.UserName || ')' Description, ds.Title Title, ds.UserId, u.UserName,
DECODE(ds.Type, 'system', 'Data sources', 'quickreport', 'Quick Reports', 'user', 'Reports', 'Unknown') GroupDescription,
DECODE(ds.Type, 'system', 'Data sources', 'quickreport', 'Quick Reports', 'user', 'Reports', 'Unknown') GroupTitle,
1 IsCheckBox
FROM DataSources ds JOIN Users u ON (u.Id = ds.UserId)
WHERE (type = 'user' and ds.IsPublished = 1)
ORDER By ds.Description
|
| IH#RebalancedOrderLines |
|---|
SELECT rol.ProcessId, rol.OrderLineId, ob.OrderCode, ol.LineNoCode, mm.MaterialCode, ROUND(rol.NewAllocatedStockWeight + rol.DispatchedWeight,3) AllocatedStockWeight, ww.WorkcentreCode, rol.Comments, rol.TimeStamp, rol.NewAllocatedStockWeight - rol.AllocatedStockWeight Difference, rol.SiteMaterialUsageId FROM Rebalancedorderlines rol JOIN OrderLines ol ON ol.Id = rol.OrderLineId JOIN OrderBooks ob ON ob.Id = ol.OrderBookId JOIN Materials mm ON mm.Id = ol.MaterialId LEFT JOIN workcentres ww ON NVL(ol.workcentreid, ol.stockworkcentreid) = ww.id WHERE rol.NewAllocatedStockWeight IS NOT NULL ANd rol.IsSent = 0 |
| IH#ReferencePrices |
|---|
SELECT es.SiteMaterialUsageId, es.PriceRuleId, es.Datefrom, es.DateTo, es.Note,
s.LocationName, s.MaterialName, s.EndUse, s.EndCustomer,
s.LocationCode, s.MaterialCode, s.EndUseCode, s.EndCustomerCode,
es.Price, c.CurrencyName, pr.Price AS RulePrice, prc.CurrencyName AS RuleCurrencyName,
CASE WHEN core.getTruncatedInternalDate BETWEEN DateFrom AND DateTo THEN 1 ELSE 0 END IsActive
FROM ExpandedPrices es
JOIN IH#Sku s ON (s.Id = es.SiteMaterialUsageId)
LEFT JOIN Currencies c ON c.Id = NVL(es.CurrencyId, core.InternalCurrencyId)
LEFT JOIN PriceRules pr ON pr.Id = es.PriceRuleId
LEFT JOIN Currencies prc ON prc.Id = NVL(pr.CurrencyId, core.InternalCurrencyId)
|
| IH#RegularSkuCharacteristics |
|---|
SELECT smu.Id as SiteMaterialUsageId, EndUseId, NVL(EndCustomerId, LocationId) EndCustomerId,
MaterialId, LocationId, smu.Status,
smu.ReplenishmentFlag,
cr.Id as CustomerRankId, cr.CustomerRankDesc,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5, smu.SkuProperties,
smu.DerivedCharacteristic1, smu.DerivedCharacteristic2, smu.DerivedCharacteristic3, smu.DerivedCharacteristic4, smu.DerivedCharacteristic5
FROM SiteMaterialUsages smu
JOIN Locations l ON l.Id = smu.LocationId
JOIN Companies c ON c.Id = l.CompanyId
JOIN Materials m ON m.Id = smu.MaterialId
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId
LEFT JOIN CustomerRanks cr ON COALESCE(smu.CustomerRankId, l.CustomerRankId, c.CustomerRankId, core.DefaultCustomerRankId) = cr.Id
|
| IH#ReplacedByLocation |
|---|
SELECT r.FromLocationId, l.LocationCode ReplacedByLocation FROM Replacedlocations r JOIN locations l ON r.ToLocationId = l.id |
| IH#ReplacedLocations |
|---|
SELECT r.toLocationID, listagg(l.LocationName,', ') within group(order by l.LocationCode) ReplacedLocations FROM Replacedlocations r JOIN locations l ON r.FromLocationId = l.id GROUP BY r.Tolocationid |
| IH#ReplenishedCustomerSku |
|---|
SELECT l.LocationName, l.LocationCode, dm.MaterialName DestinationMaterialName, dm.MaterialCode DestinationMaterialCode, sm.MaterialName SourceMaterialName, sm.MaterialCode SourceMaterialCode, wc.WorkcentreCode, sl.LocationCode SourceLocationCode, sl.LocationName SourceLocationName, sl.Id SourceLocationId, sl.SiteId SourceSiteId, r.* FROM ReplenishedCustomerSKU r JOIN Materials dm ON dm.Id = r.MAterialId JOIN Materials sm ON sm.Id = r.SourceMAterialId JOIN Locations l ON l.ID = r.LocationId JOIN Workcentres wc ON wc.Id = r.WorkcentreId JOIN Locations sl ON sl.ID = wc.LocationId |
| IH#ReplenishedPoints |
|---|
SELECT MaterialName ProductName, MaterialCode ProductCode, l.LocationName, l.LocationCode, cl.LocationName ConsignmentLocationName, cl.LocationCode ConsignmentLocationCode, rp.* FROM Replenishedpoints rp JOIN Materials m ON m.Id = rp.MaterialId JOIN Locations l ON l.Id = rp.Locationid LEFT JOIN Locations cl ON cl.Id = rp.ConsignmentLocationid |
| IH#ReplenishedSku |
|---|
SELECT d.LocationName LocationName, dm.MaterialName ProductName, s.LocationName SourceLocation, sm.MaterialName SourceProduct, wc.WorkcentreName SourceWorkcentre, j.JourneyCode, j.TimePeriod, twc.WorkcentreName TransportWorkcentreName, c.CalendarName, DECODE(levelNo, 1, rp.Chainstartdate, NULL) ChainStartDate, fs.Sitename FromSite, ts.Sitename ToSite, rs.* FROM ReplenishedSku rs JOIN ReplenishedPoints rp ON rp.Id = rs.PointId JOIN Locations d ON rs.LocationId = d.Id JOIN Materials dm ON dm.Id = rs.Materialid LEFT JOIN Materials sm ON sm.Id = rs.SourceMaterialid LEFT JOIN Locations s ON s.Id = FromLocationId LEFT JOIN Workcentres wc ON wc.Id = FromWorkcentreId LEFT JOIN Journeys j ON j.Id = rs.JourneyId LEFT JOIN Calendars c ON c.ID = rs.CalendarId LEFT JOIN Workcentres twc ON twc.Id = TransportWorkcentreId LEFT JOIN Sites fs ON fs.Id = rs.FromSiteId LEFT JOIN Sites ts ON ts.Id = rs.ToSiteId ORDER BY rs.PointId, rs.ChainNo, rs.LevelNo |
| IH#Replenishedsubstitutedsku |
|---|
SELECT fl.LocationCode WarehouseCode, fl.LocationName WarehouseName,
fm.MaterialCode FromMaterialCode, fm.MaterialName FromMaterialName,
tm.MaterialCode ToMaterialCode, tm.MaterialName ToMaterialName,
fm.Id FromMaterialId,
tm.Id ToMaterialId,
rs.*
FROM Replenishedsubstitutedsku rs
JOIN SiteMaterialUsages fsmu ON rs.SiteMaterialUsageID = fsmu.Id
JOIN Locations fl ON fsmu.LocationId = fl.Id
JOIN SiteMaterialUsages tsmu ON rs.OnSiteMaterialUsageID = tsmu.Id
JOIN Materials fm ON fm.Id = fsmu.MaterialId
JOIN Materials tm ON tm.Id = tsmu.MaterialId
|
| IH#ReplenishmentHorizonSKU |
|---|
SELECT * FROM ( SELECT d.SiteMaterialUsageId, ReplenishmentHorizon, RuleWeighting, row_number() OVER (PARTITION BY d.SiteMaterialUsageId ORDER BY RuleWeighting DESC) r FROM ReplenishmentHorizonRules r JOIN IH#DetailsSku d ON d.DetailId = r.DetailId ) WHERE r = 1 |
| IH#ReplenishmentParameters |
|---|
SELECT RPClosingCalculationMethod, UseTentativeOrders, UseSupercessions
FROM
(
select ParameterName, VALUE from systemparameters
)
pivot
(
MIN(VALUE) for parametername in
('RPClosingCalculationMethod' RPClosingCalculationMethod,
'AllowDDQToUseTentativeOrders' UseTentativeOrders,
'UseSupercessionsInReplenishment' UseSupercessions
)
)
|
| IH#ReplenishmentTrace |
|---|
SELECT Id, Action, Description, Stamp, extract(SECOND FROM(Stamp - Lag(Stamp) OVER(ORDER BY Id, Stamp))) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration
FROM ProcessLogs
WHERE ProcessId IN (SELECT MAX(Id) FROM Processes WHERE ProcessType = 'Replenishment')
AND Action = 'ReplenishmentTrace'
ORDER BY Id
|
| IH#ReplenishmentTraceLog |
|---|
Select Id, ProcessId, Action, Description, Stamp, Stamp - Lag(Stamp) OVER (partition by ProcessId ORDER BY Id,Stamp) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration,
(Stamp - First_Value(Stamp) OVer (partition by ProcessId Order by Id, Stamp)) TotalTime
from ProcessLogs
Where ProcessId IN (Select Id from
Processes Where ProcessType = 'Replenishment')
AND Action = 'ReplenishmentTrace'
Order by Id
|
| IH#ReplenishmentTraceLogs |
|---|
Select Id, ProcessId, Action, Description, Stamp, Stamp - Lag(Stamp) OVER (ORDER BY Id,Stamp) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration,
(Stamp - First_Value(Stamp) OVer (Order by Id, Stamp)) TotalTime
from ProcessLogs
Where ProcessId IN (Select Id from
Processes Where ProcessType = 'Replenishment')
AND Action = 'ReplenishmentTrace'
Order by Id
|
| IH#ReportFilterEntries |
|---|
SELECT ReportFilterId,
LISTAGG(FieldName || '=' || core.Escape(Operation) || ' ' || TO_CHAR(core.Escape(FilterValues)), ';') WITHIN GROUP(ORDER BY FieldName) AS FilterEntryDescription,
LISTAGG(df.Description || ': ' || DECODE(e.Operation, 'notin', 'not in', e.Operation) || ' ' ||
TO_CHAR(FilterValues), '; ') WITHIN GROUP(ORDER BY FieldName) AS Characteristics
FROM ReportFilterEntries e
JOIN ReportFilters f
ON f.Id = e.ReportFilterId
JOIN DataSourceFields df
ON df.DataSourceId = f.DataSourceId
AND UPPER(df.Name) = UPPER(e.FieldName)
GROUP BY ReportFilterId
|
| IH#RequestedDateProfile |
|---|
SELECT ip.SiteMaterialUsageId, ip.ConsignmentLocationId, ip.DateFrom, RequestedOrdersIn, NVL(FinalWeight, 0) FinalWeight, NVL(DeliveryWeight, 0) DeliveryWeight, ol.RequestedDate, SUM(NVL(FinalWeight, 0)) OVER(PARTITION BY ip.SiteMaterialUsageId, ip.ConsignmentLocationId ORDER BY DateFrom) TotalFinalWeight, SUM(NVL(RequestedOrdersIn, 0)) OVER(PARTITION BY ip.SiteMaterialUsageId, ip.ConsignmentLocationId ORDER BY DateFrom) TotalRequestedOrdersIn FROM InventoryProfiles ip LEFT JOIN (SELECT SiteMaterialUsageId, ToConsignmentLocationId, RequestedDate, SUM(FinalWeight) FinalWeight FROM OrderLines WHERE OrderLineStatusId = 1 GROUP BY SiteMaterialUsageId, ToConsignmentLocationId, RequestedDate) ol ON (ol.Sitematerialusageid = ip.SiteMaterialUsageID AND NVL(ip.ConsignmentLocationId, 0) = NVL(ol.ToConsignmentLocationId, 0) AND ip.DateFrom = ol.RequestedDate) LEFT JOIN (SELECT SiteMaterialUsageId, ToConsignmentLocationId, DeliveryDate, SUM(FinalWeight) DeliveryWeight FROM OrderLines WHERE OrderLineStatusId = 1 GROUP BY SiteMaterialUsageId, ToConsignmentLocationId, DeliveryDate) dl ON (dl.Sitematerialusageid = ip.SiteMaterialUsageID AND NVL(ip.ConsignmentLocationId, 0) = NVL(dl.ToConsignmentLocationId, 0) AND ip.DateFrom = dl.DeliveryDate) ORDER BY 1, 2, 3 |
| IH#RPPrimarySource |
|---|
WITH s AS
(SELECT sp.SiteMaterialUsageId, sp.SourceSiteMaterialUsageId, sp.destinationMaterialId, smu.Replenished,
cl.LocationCode CustomerLocationCode, sl.LocationCode SourceWarehouseCode, sp.DateTo
FROM SourcePriorities sp
JOIN Locations cl
ON cl.Id = sp.DestinationLocationId
JOIN Locations sl
ON sp.SourceLocationID = sl.Id
JOIN SiteMaterialUSages smu
ON smu.Id = sp.SourceSitematerialusageid
WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationID = cl.ID)
AND Priority = 1
AND sp.IsActive = 1
)
SELECT CustomerLocationCode, m.Id MaterialId, m.MaterialCode ProductCode, SourceWarehouseCode, Replenished, DateTo, s.DestinationMaterialId
FROM s
JOIN Materials m
ON m.Id = s.DestinationMaterialId
WHERE s.Replenished = 1
UNION ALL
SELECT s.CustomerLocationCode, m.Id MaterialId, m.MaterialCode ProductCode, l.LocationCode SourceWarehouseCode, 0 Replenished, DateTo, s.DestinationMaterialId
FROM s
JOIN ReplenishedSubstitutedSku rs
ON rs.OnSiteMaterialUsageId = s.SourceSiteMaterialUsageId
JOIN SiteMaterialUsages smu
ON smu.Id = rs.SiteMaterialUsageId
JOIN SiteMaterialUsages tsmu
ON tsmu.Id = rs.OnSiteMaterialUsageId
JOIN Materials m
ON m.Id = smu.MaterialId
JOIN Locations l
ON l.Id = smu.LocationId
WHERE s.Replenished = 1
AND EXISTS (SELECT 1 from SourcePriorities sp where sp.SiteMaterialUsageId = smu.ID AND sp.IsActive = 1)
UNION ALL
SELECT s.CustomerLocationCode, m.Id MaterialId, m.MaterialCode ProductCode, l.LocationCode SourceWarehouseCode, 0 Replenished, DateTo, s.DestinationMaterialId
FROM s
JOIN IH#WarehouseGroupedSkus rs
ON rs.OnSiteMaterialUsageId = s.SourceSiteMaterialUsageId
JOIN SiteMaterialUsages smu
ON smu.Id = rs.SiteMaterialUsageId
JOIN SiteMaterialUsages tsmu
ON tsmu.Id = rs.OnSiteMaterialUsageId
JOIN Materials m
ON m.Id = smu.MaterialId
JOIN Locations l
ON l.Id = smu.LocationId
WHERE rs.Replenished = 0
AND EXISTS (SELECT 1 from SourcePriorities sp where sp.SiteMaterialUsageId = smu.ID AND sp.IsActive = 1)
|
| IH#RunAvailableCapacities |
|---|
SELECT mr.*, Quantity - NVL(FirmWeight,0) FirmAvailableCapacity, Quantity - NVL(TotalWeight,0) AvailableCapacity
FROM MaterialRuns mr
JOIN MaterialRunStatuses mrs
ON mr.MaterialRunStatusId = mrs.Id
LEFT JOIN (SELECT MaterialRunId,
SUM(CASE
WHEN ols.OrderOperationStatusCode IN ('Firm', 'Completed') THEN
oo.Quantity - oo.QuantityComplete
ELSE
0
END) FirmWeight,
SUM(CASE
WHEN ols.OrderOperationStatusCode IN ('System', 'Firm', 'Completed') THEN
oo.Quantity - oo.QuantityComplete
ELSE
0
END) TotalWeight
FROM OrderOperations oo
JOIN OrderOperationStatuses ols
ON ols.Id = oo.OrderOperationStatusId
GROUP BY MaterialRunId) orders
ON orders.MaterialRunID = mr.Id
|
| IH#RunAvailableDuration |
|---|
WITH operations AS
(
SELECT oo.WorkcentreId, ol.SourceMaterialId, MaterialRunId,
CASE WHEN ols.OrderOperationStatusCode = 'System' THEN 0 ELSE 1 END IsFirm,
oo.StartTime,
oo.FinishTime,
oo.Quantity,
oo.OperationDuration
FROM OrderOperations oo
JOIN OrderLines ol
ON ol.Id = oo.OrderLineId
JOIN OrderOperationStatuses ols
ON ols.Id = oo.OrderOperationStatusId
WHERE ols.OrderOperationStatusCode IN ('System', 'Firm', 'Completed')
),
durations AS
(
SELECT oo.WorkcentreId, MaterialRunId,
CASE WHEN oo.IsFirm = 0 THEN 0 ELSE OperationDuration END AS OrdersMinutes,
CASE WHEN oo.IsFirm = 1 THEN 0 ELSE OperationDuration END AS TentativeOrdersMinutes
FROM operations oo
),
total AS
(
SELECT WorkcentreId, MaterialRunId,
SUM(OrdersMinutes) OrdersMinutes,
SUM(TentativeOrdersMinutes) TentativeOrdersMinutes
FROM durations
GROUP BY WorkcentreId, MaterialRunId
)
SELECT mr.*,
mr.InitialDuration - NVL(o.OrdersMinutes,0) AvailableDuration,
NVL(o.OrdersMinutes,0) OrdersDuration,
NVL(o.TentativeOrdersMinutes,0) TentativeOrdersDuration
FROM MaterialRuns mr
LEFT JOIN total o
ON o.MaterialRunId = mr.Id
|
| IH#RunCapacityByPeriods |
|---|
WITH runs AS
(
SELECT mr.Id, mr.BlockRunCode, mr.RunCode, mr.IsFixed, mr.WorkCentreId, d.DateFrom, DateWeek, DateMonth, mr.StartDate, NVL(mr.TargetStartDate, mr.StartDate) + 1/1440*ra.OrdersDuration FreeStartDate,
mr.FinishDate, mr.TargetStartDate,
(
(CASE WHEN mr.FinishDate <= d.DateFrom + 1 THEN mr.FinishDate ELSE d.DateFrom + 1 END)
-
(CASE WHEN NVL(mr.TargetStartDate, mr.StartDate) + 1/1440*ra.OrdersDuration >= d.DateFrom THEN NVL(mr.TargetStartDate, mr.StartDate) + 1/1440*ra.OrdersDuration ELSE d.DateFrom END)
) * 24*60 / mr.InitialDuration AS InitialDuration,
GREATEST(0, (
(CASE WHEN mr.FinishDate <= d.DateFrom + 1 THEN mr.FinishDate ELSE d.DateFrom + 1 END)
-
(CASE WHEN NVL(mr.TargetStartDate, mr.StartDate) + 1/1440*ra.OrdersDuration >= d.DateFrom THEN NVL(mr.TargetStartDate, mr.StartDate) + 1/1440*ra.OrdersDuration ELSE d.DateFrom END)
)) * 24*60 DayDuration,
OrdersDuration,
(CASE WHEN mr.FinishDate <= d.DateFrom + 1 THEN mr.FinishDate ELSE d.DateFrom + 1 END) x1,
(CASE WHEN NVL(mr.TargetStartDate, mr.StartDate) + 1/1440*ra.OrdersDuration >= d.DateFrom THEN NVL(mr.TargetStartDate, mr.StartDate) + 1/1440*ra.OrdersDuration ELSE d.DateFrom END) x2,
mr.Quantity OriginalQuantity,
mr.NominalCapacity,
mr.InitialDuration AS OriginalInitialDuration,
mrp.ProductName as RunProperties
FROM MaterialRuns mr
JOIN MaterialRunProducts mrp ON mrp.MaterialRunId = mr.Id
JOIN IH#DailyRange d ON d.DateFrom BETWEEN TRUNC(mr.StartDate) AND TRUNC(mr.FinishDate)
JOIN Ih#runavailableduration ra ON ra.Id = mr.Id
WHERE mr.InitialDuration > 0
AND mr.RunType = 'production'
)
SELECT r.*, SiteId, r.InitialDuration * r.OriginalQuantity RunCapacity
FROM runs r
join IH#Workcentres wc on wc.WorkcentreID = r.WorkcentreId
ORDER BY r.WorkCentreId, r.DateMonth, r.DateWeek, r.StartDate
|
| IH#RunDurationByPeriod |
|---|
WITH shuts
AS
(
SELECT ws.WorkcentreId, ws.StartDate, ws.FinishDate, d.DateFrom,
(CASE
WHEN Trunc(ws.FinishDate) <= d.DateFrom THEN
ws.FinishDate
ELSE
d.DateFrom + 1
END - CASE
WHEN ws.StartDate >= d.DateFrom THEN
ws.StartDate
ELSE
d.DateFrom
END) * 24 * 60 duration
FROM WorkcentreShuts ws
JOIN IH#DailyRange d
ON (d.DateFrom BETWEEN TRUNC(ws.StartDate) AND TRUNC(ws.FinishDate))
),
runs AS
(
SELECT mr.Id, Workcentreid, BlockRunCode, mr.StartDate, mr.FinishDate, d.Datefrom, d.DateWeek, d.DateMonth,
(CASE
WHEN Trunc(mr.FinishDate) <= d.DateFrom THEN
mr.FinishDate
ELSE
d.DateFrom + 1
END - CASE
WHEN mr.StartDate >= d.DateFrom THEN
mr.StartDate
ELSE
d.DateFrom
END) * 24 * 60 Duration
FROM MaterialRuns mr
JOIN IH#DailyRange d
ON (d.DateFrom BETWEEN TRUNC(mr.StartDate) AND TRUNC(mr.FinishDate))
),
dailyruns AS
(
SELECT r.Id, r.WorkcentreId, BlockRunCode, r.StartDate, r.DateFrom, r.DateWeek, r.DateMonth,
r.Duration RunDuration,
NVL(s.Duration,0) ShutDuration,
CASE WHEN s.Duration = 1440 THEN 0
WHEN r.Duration > 1440 - NVL(s.Duration,0) THEN 1440 - NVL(s.Duration,0)
ELSE r.Duration END Duration,
CASE WHEN s.Duration = 1440 THEN 1
WHEN r.Duration > 1440 - NVL(s.Duration,0) THEN 2
ELSE 3 END case1,
SUM(CASE WHEN s.Duration = 1440 THEN 0
WHEN r.Duration > 1440 - NVL(s.Duration,0) THEN 1440 - NVL(s.Duration,0)
ELSE r.Duration END) OVER (PARTITION BY r.WorkcentreId, r.Id ORDER BY r.StartDate, r.Datefrom) TotalDuration,
NVL(SUM(CASE WHEN s.Duration = 1440 THEN 0
WHEN r.Duration > 1440 - NVL(s.Duration,0) THEN 1440 - NVL(s.Duration,0)
ELSE r.Duration END) OVER (PARTITION BY r.WorkcentreId, r.Id ORDER BY r.StartDate, r.Datefrom rows between unbounded preceding and 1 preceding),0) TotalDuration2
FROM runs r
LEFT JOIN shuts s ON r.WorkcentreId = s.WorkcentreId AND r.DateFrom = s.DateFrom
WHERE 1=1
--AND r.ID = 127
)
SELECT r.Id, r.WorkcentreId, r.BlockRunCode,
r.StartDate,r.DateFrom, r.DateWeek, r.DateMonth, r.RunDuration,
r.ShutDuration,
r.Duration,
a.OrdersDuration,
r.Duration - (
CASE WHEN r.TotalDuration > a.OrdersDuration THEN a.OrdersDuration
ELSE r.TotalDuration
END
-
CASE WHEN r.TotalDuration2 > a.OrdersDuration THEN a.OrdersDuration
ELSE r.TotalDuration2 END)
AvailableDuration
FROM DailyRuns r JOIN
Ih#runavailableduration a ON a.Id = r.Id
ORDER BY WorkcentreId, StartDate, DateFrom
|
| IH#RunInventoryProfiles |
|---|
SELECT OperatorUserId, GradeCode, DateFrom, Safetystock FROM Runinventoryprofiles rp JOIN Gradeproperties gp ON gp.GradeId = rp.GradeId |
| IH#RunMaterials |
|---|
SELECT mrp.MaterialRunId, mr.WorkcentreId, w.SiteId, d.Materialid
FROM MaterialRuns mr
JOIN Materialrunproducts mrp
ON mrp.MaterialRunId = mr.Id
JOIN IH#DetailsMaterial d
ON d.DetailId = mrp.DetailId
JOIN IH#Workcentres w
ON w.WorkcentreID = mr.WorkcentreID
|
| IH#RunProperties |
|---|
SELECT MaterialRunId, core.AsCsv(CAST(COLLECT(Properties) AS PArameterArray), '; ') Properties
FROM (SELECT RunProductId,
core.AsCsv(CAST(COLLECT(PropertyDesc || ': ' || PropertyValueCode ORDER BY rp.OrderNo) AS ParameterArray), ' ') Properties
FROM MaterialRunProperties mrp
JOIN (SELECT DISTINCT p.Id PropertyId, PropertyName, PropertyDesc, NVL(n.LevelNo, m.OrderNo * 10) OrderNO
FROM PropertiesIPlanView p
JOIN IH#ModelCharacteristics2 m
ON m.DescriptiveFieldName = p.PropertyViewCode
LEFT JOIN NAvigations n
ON p.PropertyViewCode = n.LevelName
AND TaskName = 'ProductionRatePicker') rp
ON rp.PropertyId = mrp.Propertyid
GROUP BY RunProductId) t
JOIN MaterialRunProducts mr
ON mr.Id = t.RunProductId
GROUP BY MaterialRunId
|
| IH#SafetyStockMethods |
|---|
SELECT s.Id, s.SafetyStockMethodName, t.SafetyStockMethodDesc, LanguageId, IsMaxMethod FROM SafetyStockMethods s LEFT JOIN IT#SafetyStockMethods t ON t.SafetyStockMethodId = s.Id |
| IH#SAGradePropertyMap |
|---|
SELECT gm.GradeId, m.PropertyValueID FROM Gradematerials gm JOIN Materials m ON m.Id = gm.MaterialId |
| IH#SAWeeklyCoefs |
|---|
SELECT t.*, DECODE(x, 1, 1, Coef2) Coef FROM
(
SELECT w1.DateFromWeek deliveryDate,
w1.DateFromMonth deliveryMonth,
w2.DateFromWeek SourceDate,
w2.DateFromMonth SourceMonth, w1.WeeklyCoef Coef1, w2.WeeklyCoef coef2,
COUNT(1) OVER (PARTITION BY w1.DateFromWeek, w1.DateFromMonth) x
FROM weeklymonthmapiplanview w1 JOIN
weeklymonthmapiplanview w2
ON w1.DateFromWeek = w2.DateFromWeek
AND w1.DateFromMonth >= w2.DateFromMonth
) t
|
| IH#ScenarioAllocation |
|---|
SELECT x.ScenarioId, x.ScenarioSessionId, x.WorkcentreId, x.SnpItemId, x.CoProductId, x.sourcePropertyValueId, x.SourceMaterialId,
x.DeliveryWeek, x.DeliveryMonth,
x.SourceWeek, x.SourceMonth,
DECODE(SUM(x.Allocation +x.NonMoveableWeight), 0, 0, SUM(x.Price * (Allocation + x.NonMoveableWeight)) / SUM(x.Allocation + x.NonMoveableWeight)) Price,
SUM(DECODE(IsLastStage, 1, (x.Allocation + x.NonMoveableWeight) * x.Price, 0)) PriceVolume,
SUM(DECODE(IsLastStage, 1, x.Allocation + x.NonMoveableWeight, 0)) TotalAllocation,
SUM(x.NonMoveableWeight) AS NonMoveableWeight,
SUM(x.Allocation) AS Allocation,
SUM(Revenue) AS Revenue,
SUM(Margin) AS Margin,
SUM(COST) AS COST
FROM (
SELECT a.ScenarioId, a.ScenarioSessionId, a.Id SnpItemId, a.CoProductId, a.SourcePropertyValueId, a.SourceMaterialId, a.WorkcentreId,
TRUNC(a.DeliveryDate, 'IW') DeliveryWeek, TRUNC(a.DeliveryDate, 'month') DeliveryMonth, TRUNC(a.SourceDate, 'IW') SourceWeek, TRUNC(a.SourceDate, 'month') SourceMonth,
0 AS NonMoveableWeight, a.Allocation AS Allocation, a.Price,
a.Revenue, (a.ProductionCost + a.InventoryCost + a.TransportCost) AS COST,
a.Margin AS margin, isLastStage
FROM SourcingAllocation a
WHERE a.WorkcentreId IS NOT NULL
UNION ALL
SELECT s.Id ScenarioId, so.ScenarioSessionId, so.SnoItemId AS SNPItemId, so.CoProductId,
NULL SourcePropertyValueId, NULL SourceMaterialId, so.WorkcentreId AS WorkcentreId,
TRUNC(so.DeliveryPeriod, 'IW') AS DeliveryWeek,
TRUNC(so.DeliveryPeriod, 'month') AS DeliveryMonth,
TRUNC(so.SourcePeriod, 'IW') AS SourceWeek,
TRUNC(so.SourcePeriod, 'month') AS SourceMonth,
so.Weight AS NonMoveableWeight, 0 AS Allocation, so.Price,
so.Revenue, so.TotalCost Cost, so.Margin, IsLastStage
FROM SNOAllOrderSnapshots so, Scenarios s,
(SELECT StartWeek Datefrom, Id as ScenarioSessionId FROM ScenarioSessions) SS
WHERE ss.ScenarioSessionId = so.ScenarioSessionId
AND s.ScenarioSessionId = so.ScenarioSessionId
AND so.IsFirm = 1
AND so.PropertyValueId IS NOT NULL
AND so.SourceType IN ('stock', 'production', 'supplier')
AND (so.DeliveryPeriod >= ss.DateFrom OR so.SourcePeriod >= ss.DateFrom)
AND so.SourcePeriod IS NOT NULL
) x
WHERE x.Allocation + x.NonMoveableWeight > 0
GROUP BY x.ScenarioId, x.ScenarioSessionId, x.SnpItemId, x.CoProductId, x.sourcePropertyValueId, x.SourceMaterialId, x.DeliveryWeek, x.DeliveryMonth, x.SourceWeek,
x.SourceMonth, x.WorkcentreId
|
| IH#ScenarioPaperMachines |
|---|
SELECT wc.* FROM IH#Workcentres wc LEFT JOIN IH#Workcentreparameters wp ON (wp.WorkcentreId = wc.WorkcentreId AND wp.ParameterName = 'ExcludeFromSA') WHERE wc.WorkcentreTypeName = 'Paper Machine' AND wp.Value = 0 |
| IH#ScenarioParameters |
|---|
SELECT sp.*
FROM SystemParameters sp
WHERE sp.ParameterName IN ('AllowUseSafetyStockInAllocations','DisregardSmallDemands',
'MinimumAllocationWeight','SNONettingAlternateCheck','SNONettingDemandDirection','SNONettingWeeksBackward',
'SNONettingWeeksForward','SNOProductionRatesForOutput','SNPExcludeDelistedDemand',
'SNPIgnoreWarehouseDemand','SNPStockDeficitForReplenishedSku','WeekPlaceAggregationSNODemand'
)
|
| IH#ScenarioPeriodSnapshots |
|---|
SELECT p.*,
CASE
WHEN ss.SnapshotPeriodType = 'WeekMonth2' AND PeriodLength < 7 AND LEAD(PeriodLength)
OVER(PARTITION BY p.ScenarioSessionId ORDER BY PEriodNumber) < 7 THEN
1
ELSE
0
END IsPartial,
DECODE(UseFixedPeriod, 0, 0, case when StartPeriod < FixedPeriodDate then 1 else 0 end) IsFixed
FROM ScenarioPeriodSnapshots p
JOIN ScenarioSessions SS
ON ss.Id = p.ScenarioSessionId
ORDER BY p.ScenarioSessionId, PeriodNumber
|
| IH#ScenarioRates |
|---|
SELECT s.ScenarioName, s.UserName, s.UserLogin, sr.ScenarioSessionId, sr.Scenarioid, WorkcentreName, WorkcentreCode,
DateFrom, d.PropertiesCode CycleType, sr.WorkcentreId, sr.PropertyValueId, sr.CycleTypeId, IsActive,
HasOrder, HasRun, Rate, COST, Conversionfactor, Materialefficiency, TIMEEFFICIENCY, OperationTypeId
FROM ScenarioRates sr
JOIN CycleTypeSnapshots ct
ON ct.Id = sr.CycleTypeId
AND ct.ScenarioSessionId = sr.ScenarioSessionId
AND ct.ScenarioId = sr.ScenarioId
JOIN Ih#hierarchypropertydetails d
ON d.ID = ct.DetailId
JOIN IH#Workcentres wc
ON wc.WorkcentreId = sr.WorkcentreId
JOIN IH#Scenarios s
ON s.UserId = sr.ScenarioSessionId
AND s.Id = sr.ScenarioId
|
| IH#Scenarios |
|---|
SELECT s.Id, ss.Id as ScenarioSessionId, ss.SnapshotUserId as UserId, UserName, UserLogin, SessionName, ScenarioName,
s.MaxEarlyPeriods, s.MaxLatePeriods, s.MaxEarlyPeriodsOrders, s.MaxLatePeriodsOrders, s.MaxEarlyPeriodsSFG, s.MaxReplenishPeriodsForSafetyStock,
s.UseUnlimitedPMCapacity, PenaliseDowntime, OptimizationMode, s.State,
ss.FixedPeriod, ss.Horizon, ss.StartWeek, ss.FinishWeek, ss.SnapshotPeriodType, s.IgnoreSourceLists,
s.UseOnlyPrimarySources, ss.UseFixedPeriod, s.IsFullLog, s.CrossSite, s.UseMinAllocation, s.IgnoreEmptyProductionOrders,
s.MovableOrdersMode, s.SNPStockCustomers,
s.Ranks, ss.ForecastSnapshotId, fs.Description ForecastSnapshotDescription,
s.IsToolPoolingEnabled, s.ToolPoolingFrozenPeriods,
s.WorkcentrePriorityTierLimit, s.EngineZipFilePath,
s.InsertDate, ss.ReadOnly, ss.UsedPriceSettings, s.MinRunHours
FROM Scenarios s
JOIN ScenarioSessions ss
ON ss.Id = s.ScenarioSessionId
JOIN USERS u
ON (ss.SnapshotUserId = u.Id)
LEFT JOIN IH#ForecastSnapshots fs
ON NVL(ss.ForecastSnapshotId,0) = fs.Id
|
| IH#ScenarioSessionParameters |
|---|
SELECT sp.*
FROM SystemParameters sp
WHERE sp.ParameterName IN ('DefaultCycleTypeFrequency','OrderDemandDateInSNP',
'SNPAnalyzeUnallocatedReasons','SNPExcludeOrdersFromDetermination','SNPInventoryLevel',
'SNPReleaseCreateOrders','SNPReleasedSequenceRunsMethod','SNPSafetyStock','SNPUseOverdueOrders', 'SNPUseOverdueOperations',
'SNPReduceWarehouseStockByDemand', 'SNPCycleType', 'ProductSubstitutionMode', 'SNPProductionSiteWarehouseUsage')
|
| IH#ScenarioSessions |
|---|
SELECT ss.*,
UserName, UserLogin,
DECODE(fs.Id, 0, TRUNC(ss.StartWeek, 'MONTH'), fs.StartDate) StartMonth,
DECODE(fs.Id, 0, TRUNC(ss.FinishWeek, 'month'), fs.FinishDate) FinishMonth,
fs.Name SnapshotName, ScenarioInsertDate
FROM ScenarioSessions SS JOIN USERS u ON u.Id = ss.SnapshotUserId
LEFT JOIN IH#ForecastSnapshots fs ON (fs.Id = NVL(ss.ForecastSnapshotId,0))
LEFT JOIN (
SELECT ScenarioSessionId, Max(InsertDate) ScenarioInsertDate
FROM Scenarios where State in ('Stored', 'Optimized')
group by ScenarioSessionId
) s
ON s.ScenarioSessionId = ss.Id
|
| IH#ScenarioWorkcentres |
|---|
SELECT wc.*, NVL(wp.Value, 0) IsExcludedFromSA FROM IH#Workcentres wc LEFT JOIN IH#Workcentreparameters wp ON (wp.WorkcentreId = wc.WorkcentreId AND wp.ParameterName = 'ExcludeFromSA') |
| IH#SecondPassRules |
|---|
WITH t AS (SELECT e.ReportFilterId, core.AsCsv(CAST(COLLECT(f.Description || ': ' || DECODE(e.Operation, 'notin', 'not in', e.Operation) || ' ' || to_char(FilterValues) order by f.Description) AS ParameterArray), '; ') Characteristics FROM ReportFilterEntries e JOIN Ih#DataSourceFields f ON e.fieldname = f.Name AND DataSourceName = 'IH$CustomerSkuCharacteristics' WHERE EXISTS (SELECT 1 FROM SecondPassRules r WHERE r.Reportfilterid = e.ReportFilterId) GROUP BY e.ReportFilterId), patterns AS ( SELECT SecondPAssRuleId, core.AsCsv(CAST(COLLECT(ForecastPatternName) AS PArameterArray)) Patterns FROM ExternalTrends r JOIN ForecastPatterns fp ON fp.Id = r.ForecastPatternId WHERE r.SecondPassRuleID IS NOT NULL GROUP BY SecondPAssRuleId) SELECT spr.Id, spr.ReportFilterId, spr.RuleWeighting, spr.CharacteristicsList, spr.ForecastMethodId, fp.Patterns, lpp.PatternName, lp.StartMonth, lp.Periods, lp.Volume Volume, UnitName, lp.Id as LaunchProfileId, fm.ForecastMethodName, fm.ForecastMethodDesc, t.Characteristics FROM SecondPassRules spr JOIN ForecastMethods fm ON fm.Id = spr.ForecastMethodId LEFT JOIN patterns fp ON fp.SecondPassRuleId = spr.Id LEFT JOIN t ON t.ReportFilterId = spr.ReportFilterId LEFT JOIN LaunchProfiles lp ON lp.SecondPassRuleId = spr.Id LEFT JOIN LaunchProfilePatterns lpp ON lpp.Id = lp.PatternId LEFT JOIN Units u ON u.Id = lp.UnitId |
| IH#SimpleSkus |
|---|
SELECT smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, NULL ConsignmentLocationId, smu.IsActiveSku,
(SELECT NVL(MIN(1),0) FROM dual WHERE EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = smu.LocationId)) isWarehouse,
smu.SkuKey, Status, Replenished
FROM SiteMaterialUsages smu
UNION ALL
SELECT cp.SiteMaterialUsageId, smu.LocationId, smu.MaterialId, cp.CustomerId AS ConsignmentLocationId, cp.IsActiveSku,
(SELECT NVL(MIN(1),0) FROM dual WHERE EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = smu.LocationId)) isWarehouse,
cp.SkuKey, 0 Status, cp.Replenished
FROM ConsignmentParameters cp
JOIN SiteMaterialUsages smu
ON (smu.Id = cp.SiteMaterialUsageId)
|
| IH#SimpleWarehouseSkus |
|---|
select * from IH#SimpleSkus v
WHERE EXISTS (Select 1 from Workcentres wc Where wc.LocationId = v.LocationId)
|
| IH#SiteDefaultOperationTypes |
|---|
select SiteId, DefaultOperationTypeId
FROM
(
SELECT SiteId, COUNT(*) QuantityOfOperations, MIN(OperationTypeId) DefaultOperationTypeId
FROM Ih#ValidOperationSources
GROUP BY SiteId
)
Where QuantityOfOperations = 1
|
| IH#SiteMonthlyHistories |
|---|
SELECT hd.SiteMaterialUSageId, hd.WorkcentreId,
TRUNC(DateFrom, 'mm') DateFrom,
NVL(SUM(Weight),0) Weight,
NVL(SUM(CASE WHEN DateFrom <= core.getTruncatedInternalDate then NVL(AdjustedWeight, Weight) else 0 end), 0) mtdHistory,
NVL(SUM(AdjustedWeight),0) OriginalAdjustedWeight,
GREATEST(0, SUM(NVL(AdjustedWeight, Weight))) HistoryWeight,
SUM(NVL(AdjustedWeight, Weight)) AdjustedHistoryWeight
FROM UsageHistories hd
GROUP BY hd.SiteMaterialUSageId, hd.WorkcentreId, TRUNC(DateFrom, 'mm')
|
| IH#Sites |
|---|
SELECT
s.*,
(SELECT NVL(MIN(1), 0) FROM dual
WHERE EXISTS (SELECT 1 FROM IH#Workcentres wc WHERE wc.SiteId = s.Id AND wc.IsProductionSource = 1)
AND EXISTS (SELECT 1 FROM IH#Workcentres wc WHERE wc.SiteId = s.Id AND wc.HasInventory = 1)
) AS IsProduction,
(SELECT NVL(MIN(1), 0) FROM dual
WHERE EXISTS (
SELECT 1
FROM IH#SiteWorkcentres wc
WHERE wc.SiteId = s.Id AND wc.HasInventory = 1
)
OR (
-- 1. at least one wokkcentre on site
EXISTS (
SELECT 1
FROM IH#SiteWorkcentres wc
WHERE wc.SiteId = s.Id
)
-- 2. and none, which does not satisfy external supplier condition
AND NOT EXISTS (
SELECT 1
FROM IH#SiteWorkcentres wc
WHERE wc.SiteId = s.Id
AND (wc.SupplierType NOT IN ('external', 'internal') OR wc.SupplierType = 'none')
)
)
) AS IsValid
FROM Sites s
|
| IH#SiteSupersededHistories |
|---|
WITH ActiveSupercessions AS (
SELECT ms.SiteMaterialUsageId,
ms.OnSiteMaterialUsageId,
ms.StartDate,
ms.Percentage
FROM IH#materialsupercessions ms
WHERE NOT EXISTS (
SELECT 1
FROM IH#materialsupercessions ms2
WHERE ms2.SiteMaterialUsageId = ms.SiteMaterialUsageId
AND ms2.StartDate > ms.StartDate
)
)
SELECT NVL(ms.OnSiteMaterialUsageId, uh.SiteMaterialUsageId) AS SiteMaterialUSageID,
uh.WorkcentreId,
uh.DateFrom,
SUM(uh.AdjustedHistoryWeight * NVL(ms.Percentage, 100) / 100) AS AdjustedSupersededHistory
FROM IH#SiteMonthlyHistories uh
LEFT JOIN ActiveSupercessions ms
ON uh.SiteMaterialUsageId = ms.SiteMaterialUsageId
AND uh.DateFrom >= ms.StartDate
GROUP BY NVL(ms.OnSiteMaterialUsageId, uh.SiteMaterialUsageId),
uh.WorkcentreId,
uh.DateFrom
ORDER BY 1, 2
|
| IH#SiteSupersededOrders |
|---|
WITH o AS
(
SELECT SiteMaterialUsageId, PeriodType, WorkCentreId, LocationId,
DeliveryDate, SUM(FinalWeight) FinalWeight,
SUM(CASE WHEN OnSiteMaterialUsageId IS NULL THEN FinalWeight ELSE 0 END) OrdersIncludeSupercessions
FROM
(
SELECT ol.SiteMaterialUsageId, ms.OnSiteMaterialUsageId,
ol.DeliveryDate, ol.PeriodType, ol.LocationId, NVL(oo.Workcentreid, ol.WorkcentreId) WorkcentreId,
FinalWeight
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
LEFT JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
AND oo.IsLastOperation = 1
LEFT JOIN IH#ActiveSupercessions ms
ON ms.SiteMaterialUsageId = ol.SiteMaterialUsageId
WHERE ols.OrderLineStatusCode IN ('Firm', 'Completed')
)
GROUP BY SiteMaterialUsageId, PeriodType, WorkCentreId, LocationId,DeliveryDate
UNION ALL
SELECT OnSiteMaterialUsageId, PeriodType, WorkCentreId, LocationId,
DeliveryDate, 0 FinalWeight, SUM(FinalWeight) OrdersIncludeSupercessions
FROM
(
SELECT ol.SiteMaterialUsageId, ms.OnSiteMaterialUsageId,
ol.DeliveryDate, ol.PeriodType, ol.LocationId, NVL(oo.Workcentreid, ol.WorkcentreId) WorkcentreId,
FinalWeight
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
LEFT JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
AND oo.IsLastOperation = 1
LEFT JOIN IH#ActiveSupercessions ms
ON ms.SiteMaterialUsageId = ol.SiteMaterialUsageId
WHERE ols.OrderLineStatusCode IN ('Firm', 'Completed')
)
WHERE OnSiteMaterialUsageId IS NOT NULL
GROUP BY OnSiteMaterialUsageId, PeriodType, WorkCentreId, LocationId, DeliveryDate
)
SELECT SiteMaterialUsageId, o.WorkcentreId, l.SiteId,
DECODE(o.PeriodType, 'day', TRUNC(o.DeliveryDate, 'mm'), c.MonthDate) DeliveryMonth,
SUM(DECODE(o.PeriodType, 'day', FinalWeight, FinalWeight * c.WeekMonthCoef)) Orders,
SUM(DECODE(o.PeriodType, 'day', OrdersIncludeSupercessions, OrdersIncludeSupercessions * c.WeekMonthCoef)) OrdersIncludeSupercessions
FROM o
JOIN Locations l
ON l.Id = o.LocationId
JOIN IH#CalendarWeeklyCoefs c
ON c.CalendarId = NVL(l.CalendarId, core.DefaultCalendarId)
AND TRUNC(DeLiveryDate, 'IW') = c.WeekDate
AND (o.PeriodType = 'week' OR TRUNC(DeliveryDate, 'mm') = c.MonthDate)
GROUP BY SiteMaterialUsageId, WorkcentreId, l.SiteId,
DECODE(o.PeriodType, 'day', TRUNC(o.DeliveryDate, 'mm'), c.MonthDate)
|
| IH#SiteTransportPeriods |
|---|
WITH routes AS
(SELECT CONNECT_BY_ROOT SiteId AS SiteId, FromLocationId, ToLocationId, TimePeriod, Connect_BY_ROOT FromLocationId f, ToLocationID t,
CONNECT_BY_ROOT FromLocationId || SYS_CONNECT_BY_PATH(ToLocationId, ' --> ') TransportPath,
LTRIM(SYS_CONNECT_BY_PATH(TimePeriod, '+'), '+') ListTimePeriods
FROM (SELECT t.*, ws.SiteId FROM TransportRoutes t JOIN IH#Warehouses ws ON ws.LocationId = t.FromLocationId) tr
CONNECT BY PRIOR ToLocationId = FromLocationId
START WITH FromLocationId IN (SELECT LocationId
FROM Ih#mainwarehouses MW
JOIN IH#Sites s
ON s.Id = mw.SITEID
AND s.IsProduction = 1))
SELECT SiteId ProductionSiteId, f SiteWarehouseId, t ToLocationId,
MIN((SELECT SUM(regexp_substr(ListTimePeriods, '[^+]+', 1, LEVEL)) AS RESULT
FROM dual
CONNECT BY regexp_substr(ListTimePeriods, '[^+]+', 1, LEVEL) IS NOT NULL)) TotalTimePeriod
FROM routes
GROUP BY SiteId, f, t
UNION ALL
SELECT SiteId, LocationId, LocationId, 0 TotalTimePeriod
FROM Ih#mainwarehouses mw
JOIN IH#Sites s
ON s.Id = mw.SITEID
AND s.IsProduction = 1
|
| IH#SiteWarehouseSku |
|---|
SELECT smu.Id SiteMaterialUsageId, l.SiteId, smu.LocationId, smu.MaterialId, wc.Id as WorkcentreId, m.MaterialTypeId,
IsTool, IsFinishedGoods
FROM SiteMaterialUsages smu
JOIN Locations l
ON l.Id = smu.LocationId
JOIN Materials m
ON m.Id = smu.MaterialId
JOIN MaterialTypes mt
ON mt.Id = m.MaterialTypeId
JOIN Workcentres wc
ON wc.LocationId = smu.LocationId
|
| IH#SiteWorkcentreOperations |
|---|
SELECT ot.Id OperationTypeId, OperationTypeName, WorkcentreId, WorkcentreName, SiteId, SiteName, IsProductionSource
FROM IH#SiteWorkcentres wc
JOIN OperationTypes ot
ON ot.WorkCentreTypeId = wc.WorkCentreTypeId
|
| IH#SiteWorkcentres |
|---|
SELECT WorkcentreCode, SiteCode, WorkcentreName, SiteName, WorkcentreTypeName, WorkcentreTypeDesc, wct.OrderNo WorkcentreTypeOrderNo, SupplierType, wc.Id WorkcentreId, SiteId, wct.HasInventory, wct.IsProductionSource, wc.LocationId, wc.WorkcentreTypeId, l.LocationCode, l.LocationName, s.SiteProperty1, s.SiteProperty2, s.SiteProperty3, s.SiteProperty4, s.SiteProperty5, wc.WorkcentreGroup, SIGN(SUM(wct.IsProductionSource) OVER(PARTITION BY s.Id)) IsProductionSite FROM Workcentres wc JOIN Locations l ON l.id = wc.LocationId JOIN WorkcentreTypes wct ON wct.Id = wc.WorkcentreTypeId LEFT JOIN Sites s ON s.Id = l.SiteId |
| IH#Sku |
|---|
SELECT smu.ID, smu.LocationId, smu.MaterialId,
l.LocationCode, l.LocationName, m.MaterialCode, m.MaterialName,
eu.EndUseCode, EndUseDescription EndUse, ec.LocationCode EndCustomerCode, ec.LocationName EndCustomer,
m.MaterialProperties, l.LocationProperties,
smu.Status,
NVL(smu.NettingAlgorithm, s.Value) NettingAlgorithm,
smu.ConsumptionType,
core.asCsv(ParameterArray(l.LocationName, m.MaterialName, EndUseDescription, ec.LocationName), ' | ', 1) SkuTitle,
core.asCsv(ParameterArray(l.LocationCode, m.MaterialCode, EndUseCode, ec.LocationCode), ' | ', 1) SkuCodeTitle
FROM SiteMaterialUSages smu
JOIN Materials m
ON (m.Id = smu.MaterialId)
JOIN Locations l
ON (l.Id = smu.LocationId)
LEFT JOIN Locations ec ON (ec.Id = smu.EndCustomerId)
LEFT JOIN EndUses eu ON (eu.Id = smu.EndUseId)
CROSS JOIN (Select Value from SystemParameters where ParameterName = 'DefaultNettingAlgorithm') s
|
| IH#SkuBaseCodes |
|---|
SELECT smu.Id SiteMaterialUsageId, MaterialCode ProductCode,
l.LocationCode, e.EndUseCode, ec.EndCustomerCode
FROM SiteMaterialUsages smu
JOIN Materials m
ON smu.MaterialId = m.Id
LEFT JOIN Locations l
ON smu.LocationId = l.Id
LEFT JOIN Enduses e
ON (e.ID = smu.EndUseId)
LEFT JOIN IH#EndCustomerHierarchies ec
ON ec.EndCustomerId = NVL(smu.EndCustomerId, smu.LocationId)
|
| IH#SkuFields |
|---|
SELECT smu.Id SiteMaterialUsageId, l.LocationCode, l.LocationName, MaterialCode ProductCode, MaterialName ProductName,
ec.LocationName EndCustomerName, ec.LocationCode EndCustomerCode, EndUseCode, EndUseDescription,
DECODE(ReplenishmentFlag, -1, 'Future', 0, 'Non-Replenished', 2, 'Delisted', 'Replenished') ReplenishmentFlag
FROM SiteMaterialUsages smu
JOIN Locations l
ON l.Id = smu.LocationId
JOIN Materials m
ON m.Id = smu.MaterialId
LEFT JOIN Locations ec
ON ec.Id = smu.EndCustomerId
LEFT JOIN EndUses eu
ON eu.Id = smu.EndUseId
|
| IH#SkuRoundUnits |
|---|
SELECT smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, NULL ConsignmentLocationId,
COALESCE(smu.OrderUnitId, ru.UnitId) RoundOrderUnitId, smu.MinOrderQuantity
FROM SiteMaterialUsages smu
JOIN Materials m
ON m.Id = smu.MaterialId
LEFT JOIN IH#MaterialTypeRoundingUnits ru
ON ru.MaterialTypeId = m.MaterialTypeId
UNION ALL
SELECT cp.SiteMaterialUsageId, smu.LocationId, smu.MaterialId, cp.CustomerId AS ConsignmentLocationId,
COALESCE(cp.OrderUnitId, smu.OrderUnitId, ru.UnitId) RoundOrderUnitId, cp.MinOrderQuantity
FROM ConsignmentParameters cp
JOIN SiteMaterialUsages smu
ON (smu.Id = cp.SiteMaterialUsageId)
JOIN Materials m
ON m.Id = smu.MaterialId
LEFT JOIN IH#MaterialTypeRoundingUnits ru
ON ru.MaterialTypeId = m.MaterialTypeId
|
| IH#Skus |
|---|
SELECT smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, NULL ConsignmentLocationId, EndUseId,
NVL(EndCustomerId, LocationId) EndCustomerId, m.MaterialTypeId,
NVL(smu.UpperPercentile, core.DefaultSKUUpperPercentile) UpperPercentile,
NVL(smu.LowerPercentile, core.DefaultSKULowerPercentile) LowerPercentile,
smu.DaysOfSupply,
smu.HighQuantity, smu.LowQuantity, smu.MinOrderQuantity, smu.OrderUnitId, COALESCE(smu.OrderUnitId, ru.UnitId) RoundOrderUnitId,
smu.MaxCapacity, smu.Replenished,
smu.Status, smu.HistoryStartDate, smu.ForecastStartDate, smu.ForecastFinishDate, smu.ReplenishmentStartDate, smu.ReplenishmentHorizon,
smu.ReplenishmentFinishDate, ForecastMethodRuleId, SecondPassRuleId,
COALESCE(smu.SafetyStockMethodId, ccl.SafetyStockMethodId, c.SafetyStockMethodId, core.DefaultSafetyStockMethodId) SafetystockmethodId,
cr.Id CustomerRankId, smu.ReplenishmentFrequency, smu.inhibitProduction,
smu.DDQContingency, smu.DefaultCustomerForecast, smu.NettingAlgorithm, smu.ConsumptionType, smu.AlternateProduct, cr.CustomerRankDesc,
smu.MaxDaysOfSupply, smu.MaxReplenishmentFrequency, smu.MaxSafetyStockMethodId,
NVL(ccl.CalendarId, core.DefaultCalendarId) CalendarId,
NVL2(smu.GroupKey, NVL(ccl.WarehouseLocationId, ccl.Id), NULL) GroupId,
smu.SkuKey, ccl.WarehouseLocationId, ccl.StockLocationId,
smu.LastInventoryDate,
ccl.SiteId, ccl.CompanyId,
smu.GroupKey,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5, smu.SkuProperties,
NVL(smu.SafetyStockPercentWarning, core.DefaultSafetyStockPercentWarning) SafetyStockPercentWarning,
smu.ReplenishmentFlag
FROM SiteMaterialUsages smu
JOIN Locations ccl ON (smu.LocationId = ccl.Id)
JOIN Companies c ON (c.Id = ccl.CompanyID)
JOIN Materials m ON m.Id = smu.MaterialId
LEFT JOIN CustomerRanks cr
ON COALESCE(smu.CustomerRankId, ccl.CustomerRankId, c.CustomerRankId, core.DefaultCustomerRankId) = cr.Id
LEFT JOIN IH#MaterialTypeRoundingUnits ru
ON ru.MaterialTypeId = m.MaterialTypeId
UNION ALL
SELECT cp.SiteMaterialUsageId, smu.LocationId, smu.MaterialId, cp.CustomerId AS ConsignmentLocationId, NULL AS EndUseId,
NULL AS EndCustomerId, m.MaterialTypeId,
NVL(smu.UpperPercentile, core.DefaultSKUUpperPercentile) UpperPercentile,
NVL(smu.LowerPercentile, core.DefaultSKULowerPercentile) LowerPercentile,
cp.DaysOfSupply, cp.HighQuantity,
cp.LowQuantity, cp.MinOrderQuantity, COALESCE(cp.OrderUnitId, smu.OrderUnitId) OrderUnitId,
COALESCE(cp.OrderUnitId, smu.OrderUnitId, ru.UnitId) RoundOrderUnitId,
cp.MaxCapacity, cp.Replenished, NULL AS Status,
NULL AS HistoryStartDate, NULL AS ForecastStartDate, NULL AS ForecastFinishDate, cp.ReplenishmentStartDate, cp.ReplenishmentHorizon,
cp.ReplenishmentFinishDate, ForecastMethodRuleId, SecondPassRuleId,
COALESCE(cp.SafetyStockMethodId, ccl.SafetyStockMethodId, c.SafetyStockMethodId, core.DefaultSafetyStockMethodId) SafetystockmethodId,
cr.Id AS CustomerRankId, cp.ReplenishmentFrequency, NULL AS inhibitProduction,
NULL AS DDQContingency, NULL AS DefaultCustomerForecast, NULL as NettingAlgorithm, NULL as ConsumptionType, cp.AlternateProduct, cr.CustomerRankDesc,
cp.MaxDaysOfSupply, cp.MaxReplenishmentFrequency, cp.MaxSafetyStockMethodId,
NVL(ccl.CalendarId, core.DefaultCalendarId) CalendarId,
NVL2(cp.GroupKey, NVL(ccl.WarehouseLocationId, ccl.Id), NULL) GroupId,
cp.SkuKey, ccl.WarehouseLocationId, ccl.StockLocationId,
cp.LastInventoryDate,
ccl.SiteId, ccl.CompanyId,
cp.GroupKey,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5, smu.SkuProperties,
NVL(cp.SafetyStockPercentWarning, core.DefaultSafetyStockPercentWarning) SafetyStockPercentWarning,
smu.ReplenishmentFlag
FROM ConsignmentParameters cp
JOIN SiteMaterialUsages smu
ON (smu.Id = cp.SiteMaterialUsageId)
JOIN Locations ccl
ON (smu.LocationId = ccl.Id)
JOIN Companies c
ON (c.Id = ccl.CompanyID)
JOIN Materials m
ON m.Id = smu.MaterialId
LEFT JOIN CustomerRanks cr
ON COALESCE(smu.CustomerRankId, ccl.CustomerRankId, c.CustomerRankId, core.DefaultCustomerRankId) = cr.Id
LEFT JOIN IH#MaterialTypeRoundingUnits ru
ON ru.MaterialTypeId = m.MaterialTypeId
|
| IH#SkuValuesLog |
|---|
WITH sku AS
(
SELECT smu.Id SiteMaterialUsageId, NULL ConsignmentLocationId,
smu.EndUseId, NVL(smu.EndCustomerId, smu.LocationId) EndCustomerId,
smu.MaterialId, smu.LocationId, smu.SkuKey, l.LocationCode, l.LocationName, m.MaterialCode, m.MaterialName,
NULL ConsignmentLocationCode, NULL ConsignmentLocationName,
eu.EndUseCode, eu.EndUseDescription, ec.LocationCode EndCustomerCode, ec.LocationName EndCustomerName
FROM SiteMaterialUsages smu
JOIN Locations l ON l.Id = smu.LocationId
JOIN Materials m ON m.Id = smu.MaterialId
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId
UNION ALL
SELECT smu.Id SiteMaterialUsageId, cp.CustomerId ConsignmentLocationId,
NULL EndUseId, NULL EndCustomerId,
smu.MaterialId, smu.LocationId, smu.SkuKey, l.LocationCode, l.LocationName, m.MaterialCode, m.MaterialName,
cl.LocationCode ConsignmentLocationCode, cl.LocationName ConsignmentLocationName,
NULL EndUseCode, NULL EndUseDescription, NULL EndCustomerCode, NULL EndCustomerName
FROM SiteMaterialUsages smu
JOIN ConsignmentParameters cp ON smu.Id = cp.SiteMaterialUsageId
JOIN Locations l ON l.Id = smu.LocationId
JOIN Materials m ON m.Id = smu.MaterialId
JOIN Locations cl ON cl.Id = cp.CustomerId
)
SELECT u.Id UserId, u.UserName, u.UserLogin, s.FieldName, s.OldValue, s.NewValue, s.Description, s.InsertDate, sku.*
FROM SkuValuesLogs s
JOIN sku
ON sku.SiteMaterialUsageId = s.SiteMaterialUsageId
AND NVL(sku.ConsignmentLocationId,0) = NVL(s.ConsignmentLocationId,0)
JOIN Users u
ON u.Id = s.InsertUserId
|
| IH#SkuWarehouseLocations |
|---|
SELECT smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, NULL ConsignmentLocationId, EndUseId,
NVL(EndCustomerId, LocationId) EndCustomerId,
NVL2(smu.GroupKey, NVL(ccl.WarehouseLocationId, ccl.Id), NULL) GroupId,
smu.SkuKey, ccl.WarehouseLocationId, ccl.StockLocationId
FROM SiteMaterialUsages smu
JOIN Locations ccl
ON (smu.LocationId = ccl.Id)
UNION ALL
SELECT cp.SiteMaterialUsageId, smu.LocationId, smu.MaterialId, cp.CustomerId AS ConsignmentLocationId, NULL AS EndUseId,
NULL AS EndCustomerId,
NVL2(cp.GroupKey, NVL(ccl.WarehouseLocationId, ccl.Id), NULL) GroupId,
cp.SkuKey, ccl.WarehouseLocationId, ccl.StockLocationId
FROM ConsignmentParameters cp
JOIN SiteMaterialUsages smu
ON (smu.Id = cp.SiteMaterialUsageId)
JOIN Locations ccl
ON (smu.LocationId = ccl.Id)
|
| IH#SkuWorkingDays |
|---|
WITH c AS (
SELECT CalendarId, DateFrom, IsWorkingDay,
GREATEST(0, SUM(IsWorkingday) OVER(PARTITION BY CalendarId, DateFromMonth ORDER BY DateFrom) - 1) WorkingDays,
SUM(IsWorkingDay) OVER(PARTITION BY CalendarId, DateFromMonth) TotalWorkingDays
FROM CalendarSources s
WHERE s.DATEFROMMONTH = TRUNC(core.getInternalDate, 'month')
)
SELECT s.SiteMaterialUSageId, s.CalendarId, c.DateFrom, WorkingDays, TotalWorkingDays
FROM IH#CustomerSkuCalendars s
JOIN c ON c.CalendarId = s.CalendarId
WHERE TRUNC(c.DateFrom, 'month') = TRUNC(core.getInternalDate, 'month')
|
| IH#SlowProcessLogs |
|---|
WITH RawLogs AS
(SELECT p.ProcessName, p.ProcessType, p.userId, l.Id, l.ProcessId, l.Action, l.Description, l.Stamp,
l.Stamp - LAG(l.Stamp) OVER(PARTITION BY l.ProcessId ORDER BY l.Stamp, l.Id) AS Diff
FROM Processes p
JOIN ProcessLogs l
ON p.Id = l.ProcessId),
BaseLogs AS
(SELECT r.*,
(EXTRACT(DAY FROM Diff) * 86400000) + (EXTRACT(HOUR FROM Diff) * 3600000) + (EXTRACT(MINUTE FROM Diff) * 60000) +
(EXTRACT(SECOND FROM Diff) * 1000) AS Duration
FROM RawLogs r),
ContextLogs AS
(SELECT b.*,
CASE WHEN Duration > 3000 THEN 1 ELSE 0 END AS is_slow,
CASE WHEN LEAD(Duration) OVER(PARTITION BY ProcessId ORDER BY Stamp, Id) > 3000 THEN 1 ELSE 0 END AS is_before_slow,
CASE WHEN LAG(Duration) OVER(PARTITION BY ProcessId ORDER BY Stamp, Id) > 3000 THEN 1 ELSE 0 END AS is_after_slow
FROM BaseLogs b)
SELECT ProcessName, ProcessType, ProcessId, Id, Action, Description, Stamp, Diff, Duration
FROM ContextLogs
WHERE is_slow = 1
OR is_before_slow = 1
OR is_after_slow = 1
ORDER BY ProcessId, Stamp, Id
|
| IH#SourcePriorities |
|---|
SELECT sp.id, sp.SiteMaterialUsageId, sp.SourceSiteMaterialUsageId, sp.DestinationLocationId, WorkcentreId, ConsignmentLocationId, dl.LocationName LocationName, dl.LocationCode LocationCode, dm.MaterialName MaterialName, dm.MaterialCode MaterialCode, eu.EndUseCode, ec.LocationCode EndCustomerCode, mt.MaterialTypeName, wc.WorkcentreName, wc.WorkcentreCode, cl.LocationName CustomerName, cl.LocationCode CustomerCode, IsConsignmentStock, sm.MaterialName SourceMaterialName, sm.MaterialCode SourceMaterialCode, Priority, Portion, JourneyCode Journey, SIGN(NVL(SourcePriorityRuleId,0)) FromRule, NVL(SourcePriorityRuleId,0) RuleId, j.FromSiteId, sp.DateFrom, sp.DateTo, sp.IsActive FROM SourcePriorities sp JOIN Workcentres wc ON (wc.Id = sp.WorkcentreId) JOIN Locations dl ON dl.ID = sp.DestinationLocationId JOIN Materials dm ON dm.ID = sp.DestinationMaterialId JOIN Locations sl on sl.Id = wc.LocationId JOIN SiteMaterialUsages smu ON smu.Id = sp.SiteMaterialUsageId JOIN Sites s ON s.Id = sl.SiteId LEFT JOIN Locations cl ON cl.ID = sp.ConsignmentLocationId LEFT JOIN MaterialTypes mt ON mt.Id = sp.MaterialTypeId LEFT JOIN Journeys j ON j.ID = sp.JourneyId LEFT JOIN Materials sm ON sm.ID = sp.SourceMaterialId LEFT JOIN EndUses eu on eu.Id = smu.EndUseId LEFT JOIN Locations ec on ec.Id = smu.EndCustomerId |
| IH#SourcePriorityRules |
|---|
SELECT sr.Id, d.DESCRIPTION Hierarchies, d.PropertiesCode Properties, d.LocationCode, d.ProductCode, MaterialTypeName, WorkcentreName, WorkcentreCode, SiteName, SiteCode, sr.Priority, RuleWeighting, JourneyCode FROM Sourcepriorityrules sr JOIN IH#Workcentres wc ON wc.WorkcentreId = sr.WorkcentreID JOIN Ih#hierarchypropertydetails d ON sr.DetailId = d.Id LEFT JOIN MaterialTypes mt ON mt.Id = sr.MaterialTypeId LEFT JOIN Journeys j ON j.id = sr.JourneyId |
| IH#SourceRunProducts |
|---|
SELECT mrp.ProductName, WorkcentreName, WorkcentreCode, sr.* FROM SourceRuns sr JOIN MAterialRunProducts mrp ON mrp.MAterialRunId = sr.MaterialRunId JOIN Workcentres wc ON sr.Workcentreid = wc.Id |
| IH#SplitMaterialRuns |
|---|
WITH runs AS
(SELECT Id, WorkcentreId, RunCode, StartDate OriginalStartDate,
DECODE(RunStatusCode, 'Started', StartDate + CompletedDuration / 1440, StartDate) StartDate,
MIN(DECODE(RunStatusCode, 'Started', StartDate, NULL)) OVER (PARTITION BY WorkcentreId) MinStartedDate,
TargetStartDate,
FinishDate, RunStatusName, RunStatusCode, ProductionUpdateTimeStamp, QuantityComplete, InitialDuration, CompletedDuration,
RemainingDuration, CASE WHEN RunStatusCode = 'Started' AND RunType = 'production' THEN RemainingDuration ELSE InitialDuration END Duration, RunType
FROM IH#MaterialRuns
UNION ALL
SELECT -Id, Workcentreid, RunCode, StartDate OriginalStartDate, StartDate,
MIN(DECODE(RunStatusCode, 'Started', StartDate, NULL)) OVER (PARTITION BY WorkcentreId) MinStartedDate,
TargetStartDate, FinishDate, RunStatusName, runStatusCode, ProductionUpdateTimeStamp,
QuantityComplete, InitialDuration, CompletedDuration, RemainingDuration,
CASE WHEN RunStatusCode = 'Started' AND RunType = 'production' THEN CompletedDuration ELSE InitialDuration END Duration, RunType
FROM IH#MaterialRuns
WHERE RunStatusCode = 'Started'
AND RunType = 'production'
AND CompletedDuration > 0)
SELECT DECODE(RunStatusCode, 'Started', SIGN(Id), 0) signId,
DECODE(RunStatusCode, 'Started', SIGN(Id) * to_number(to_char(ProductionUpdateTimeStamp,'YYYYMMDDHH24MISS')), 0) n,
case when RunStatusCode != 'Started' then StartDate else MinStartedDate end dd,
row_number() over(PARTITION BY WorkcentreId order by
DECODE(RunStatusCode, 'Started', MinStartedDate, StartDate),
DECODE(RunStatusCode, 'Complete', 0, 'Started', 1, 2) ASC,
DECODE(RunStatusCode, 'Started', SIGN(Id), 0),
DECODE(RunStatusCode, 'Started', SIGN(Id) * to_number(to_char(ProductionUpdateTimeStamp,'YYYYMMDDHH24MISS')), 0) desc NULLS LAST,
FinishDate ASC
) PositionNo ,
LEAST(COALESCE(
MAX(DECODE(RunStatusCode, 'Complete', FinishDate, NULL)) over (partition by WorkcentreId),
MIN(DECODE(RunStatusCode, 'Started', StartDate, NULL)) over (partition by WorkcentreId),
core.GetInternalDate)
) MinCompletedDate,
runs.*
FROM runs
|
| IH#StockMonitoringSku |
|---|
SELECT m.MaterialName ProductName, m.MaterialCode ProductCode, l.LocationCode, l.LocationName, s.AlternateProduct, NVL(cl.LocationCode, 'Free') ConsignmentCustomerCode, NVL(cl.LocationName, 'Free') ConsignmentCustomerName, WorkcentreName, WorkcentreCode, s.SiteMaterialUSageId, s.ConsignmentLocationId, mt.MaterialTypeName, s.MaterialId FROM (SELECT smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, NULL ConsignmentLocationId, smu.SkuKey, Status, Replenished, AlternateProduct FROM SiteMaterialUsages smu UNION ALL SELECT cp.SiteMaterialUsageId, smu.LocationId, smu.MaterialId, cp.CustomerId AS ConsignmentLocationId, cp.SkuKey, 0 Status, cp.Replenished, smu.AlternateProduct FROM ConsignmentParameters cp JOIN SiteMaterialUsages smu ON (smu.Id = cp.SiteMaterialUsageId) ) s JOIN Materials m ON m.Id = s.MaterialId JOIN Locations l ON l.Id = s.LocationId JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId JOIN Workcentres wc on wc.LocationId = s.LocationId LEFT JOIN Locations cl ON cl.Id = s.ConsignmentLocationId |
| IH#StockMovements |
|---|
WITH m AS
(SELECT
'Firm incoming orders' DESCRIPTION, SiteMaterialUsageId SkuId, SiteMaterialUsageId, SourceSiteMaterialUsageId, ol.Workcentreid, ol.Id,
DeliveryDate MovementDate, 1 IsFirm, 'OrderLine' MovementType,
GREATEST(0, ol.FinalWeight - GREATEST(ol.WeightComplete, ol.DeliveryWeight)) OrdersIn, 0 OrdersOut
FROM OrderLines ol, OrderLineStatuses ols
WHERE ol.orderlinestatusid = ols.id
AND ols.OrderLineStatusCode = 'Firm'
AND ol.DeliveryDate >= core.getTruncatedInternalDate - (SELECT Nvl(Min(sp.Value),0) FROM SystemParameters sp WHERE sp.ParameterName = 'UseUncompleteOrders')
UNION ALL
SELECT
'Completed incoming orders' DESCRIPTION, SiteMaterialUsageId SkuId, SiteMaterialUsageId, SourceSiteMaterialUsageId, ol.Workcentreid, ol.Id,
DeliveryDate MovementDate, 1 IsFirm, 'OrderLine' MovementType,
GREATEST(0, ol.FinalWeight - GREATEST(ol.WeightComplete, ol.DeliveryWeight)) OrdersIn, 0 OrdersOut
FROM OrderLines ol, OrderLineStatuses ols
WHERE ol.orderlinestatusid = ols.id
AND ols.OrderLineStatusCode = 'Completed'
AND ol.DeliveryDate = core.getTruncatedInternalDate
UNION ALL
SELECT
'Incoming deliveries' DESCRIPTION, d.SiteMaterialUsageId SkuId, d.SiteMaterialUsageId, d.SourceSiteMaterialUsageId, ol.WorkcentreId, d.Id,
d.ReceivedDate MovementDate, 1 IsFirm, 'Delivery', d.Weight OrdersIn, 0 OrdersOut
FROM Deliveries d, DeliveryStatuses ds, OrderLines ol
WHERE ol.Id = d.OrderLineId
AND d.DeliveryStatusId = ds.Id
AND ds.DeliveryStatusCode IN ('Firm', 'InTransit')
AND d.receiveddate >= core.getTruncatedInternalDate - (SELECT Nvl(Min(sp.Value),0) FROM SystemParameters sp WHERE sp.ParameterName = 'UseUncompleteOrders')
UNION ALL
SELECT
'Incoming delivered deliveries' DESCRIPTION, d.SiteMaterialUsageId SkuId, d.SiteMaterialUsageId, d.SourceSiteMaterialUsageId, ol.WorkcentreId, d.Id,
d.ReceivedDate MovementDate, 1 IsFirm, 'Delivery', d.Weight OrdersIn, 0 OrdersOut
FROM Deliveries d, DeliveryStatuses ds, OrderLines ol
WHERE ol.Id = d.OrderLineId
AND d.DeliveryStatusId = ds.Id
AND ds.deliverystatuscode IN ('Delivered', 'SeparateDelivered')
AND d.ReceivedDate = core.getTruncatedInternalDate
UNION ALL
SELECT
'Outgoing deliveries' DESCRIPTION, d.SourceSiteMaterialUsageId SkuId, d.SiteMaterialUsageId, d.SourceSiteMaterialUsageId, ol.WorkcentreId, d.Id,
d.ShipDate MovementDate, 1 isFirm, 'Delivery', 0 OrdersIn,
CASE
WHEN ds.DeliveryStatusCode = 'InTransit' THEN
d.OriginalWeight * d.SourceCoef
ELSE
d.SourceWeight
END OrdersOut
FROM Deliveries d, DeliveryStatuses ds, OrderLines ol
WHERE ol.Id = d.OrderLineId
AND d.DeliveryStatusId = ds.Id
AND ds.DeliveryStatusCode IN ('Firm')
AND d.shipdate >= core.getTruncatedInternalDate - (SELECT Nvl(Min(sp.Value),0) FROM SystemParameters sp WHERE sp.ParameterName = 'UseUncompleteOrders')
UNION ALL
SELECT
'Outgoing delivered/intransit deliveries' DESCRIPTION, d.SourceSiteMaterialUsageId SkuId, d.SiteMaterialUsageId, d.SourceSiteMaterialUsageId,
ol.WorkcentreId, d.Id, d.ShipDate, 1 isFirm, 'Delivery', 0 OrdersIn,
CASE
WHEN ds.DeliveryStatusCode = 'InTransit' THEN
d.OriginalWeight * d.SourceCoef
ELSE
d.SourceWeight
END OrdersOut
FROM Deliveries d, DeliveryStatuses ds, OrderLines ol
WHERE ol.Id = d.OrderLineId
AND d.DeliveryStatusId = ds.Id
AND ds.deliverystatuscode IN ('Delivered', 'InTransit')
AND d.ShipDate = core.getTruncatedInternalDate
UNION ALL
SELECT
'Outgoing firm orders' DESCRIPTION, SourceSiteMaterialUsageId SkuId, SiteMaterialUsageId, SourceSiteMaterialUsageId, ol.WorkcentreId, ol.Id,
ol.ConsumptionDate, 1 IsFirm, 'OrderLine', 0 OrdersIn,
GREATEST(0, ol.SourceWeight - GREATEST(ol.WeightIssued, ol.WeightComplete * ol.SourceCoef, ol.DeliverySourceWeight)) OrdersOut
FROM OrderLines ol, OrderLineStatuses ols
WHERE ol.orderlinestatusid = ols.id
AND ols.OrderLineStatusCode = 'Firm'
AND ol.ConsumptionDate >= core.getTruncatedInternalDate - (SELECT Nvl(Min(sp.Value),0) FROM SystemParameters sp WHERE sp.ParameterName = 'UseUncompleteOrders')
UNION ALL
SELECT
'Outgoing completed firm orders' DESCRIPTION, SourceSiteMaterialUsageId SkuId, SiteMaterialUsageId, SourceSiteMaterialUsageId, ol.workcentreId, ol.Id,
ol.ConsumptionDate, 1 IsFirm, 'OrderLine', 0 OrdersIn,
GREATEST(0, ol.SourceWeight - GREATEST(ol.WeightIssued, ol.WeightComplete * ol.SourceCoef, ol.DeliverySourceWeight)) OrdersOut
FROM OrderLines ol, OrderLineStatuses ols
WHERE ol.orderlinestatusid = ols.id
AND ols.OrderLineStatusCode = 'Completed'
AND ol.ConsumptionDate = core.getTruncatedInternalDate
UNION ALL
SELECT 'Completed incoming order line inventories' DESCRIPTION, SiteMaterialUsageId SkuId, SiteMaterialUsageId, SourceSiteMaterialUsageId,
workcentreId, ob.Id, ob.deliverydate AS MovementDate, 1 IsFirm, 'OrderInventory', StockWeight ordersIn,
0 OrdersOut
FROM OrderInventoryIPlanView ob
WHERE IsDelivered = 0
AND ob.OrderLineStatusCode = 'Completed'
AND ob.deliverydate >= core.getTruncatedInternalDate - (SELECT Nvl(Min(sp.Value),0) FROM SystemParameters sp WHERE sp.ParameterName = 'UseUncompleteOrders')
UNION ALL
SELECT 'Incoming order line inventories' DESCRIPTION, SiteMaterialUsageId SkuId, SiteMaterialUsageId, SourceSiteMaterialUsageId, workcentreId,
ob.Id, ob.deliverydate AS MovementDate, 1 IsFirm, 'OrderInventory', StockWeight ordersIn, 0 OrdersOut
FROM OrderInventoryIPlanView ob
WHERE IsDelivered = 0
AND ob.OrderLineStatusCode NOT IN ('Completed', 'Cancelled')
AND ob.deliverydate >= core.getTruncatedInternalDate - (SELECT Nvl(Min(sp.Value),0) FROM SystemParameters sp WHERE sp.ParameterName = 'UseUncompleteOrders')
UNION ALL
SELECT 'Outgoing order line inventories' DESCRIPTION, SourceSiteMaterialUsageId SkuId, SiteMaterialUsageId, SourceSiteMaterialUsageId, workcentreId,
ob.Id, ob.ConsumptionDate AS MovementDate, 1 IsFirm, 'OrderInventory', 0 ordersIn, StockWeight OrdersOut
FROM OrderInventoryIPlanView ob
WHERE IsSameSource = 1
AND ob.OrderLineStatusCode = 'Completed'
AND ob.ConsumptionDate >= core.getTruncatedInternalDate - (SELECT Nvl(Min(sp.Value),0) FROM SystemParameters sp WHERE sp.ParameterName = 'UseUncompleteOrders')
)
SELECT m.DESCRIPTION, SkuId, m.SiteMAterialUsageId, m.SourceSiteMaterialUsageId, m.WorkcentreId, m.ID,
GREATEST(core.getTruncatedInternalDate, m.MovementDate) MovementDate, m.isFirm,
m.MovementType, m.OrdersIn, m.OrdersOut, NVL(l.SiteId, 0) DestinationSiteId, NVL(sl.SiteId, 0) SourceSiteId
FROM m
JOIN Workcentres wc
ON m.WorkcentreId = wc.Id
JOIN Locations sl
ON sl.Id = wc.LocationId
JOIN siteMaterialUsages smu
ON smu.Id = m.SiteMaterialUsageId
JOIN Locations l
ON l.Id = smu.LocationId
|
| IH#StockStates |
|---|
SELECT bv.*, Description StockState FROM BundleValues bv JOIN Bundles b ON b.Id = bv.BundleId WHERE b.Name = 'StockStates' ORDER BY bv.OrderNo |
| IH#SuccessReplenishmentLogs |
|---|
Select Id, Action, Description, Stamp, Stamp - Lag(Stamp) OVER (ORDER BY Id,Stamp) Diff,
(EXTRACT(DAY FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 86400000) +
(EXTRACT(HOUR FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 3600000) +
(EXTRACT(MINUTE FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 60000) +
(EXTRACT(SECOND FROM (Stamp - Lag(Stamp) OVER (ORDER BY Id, Stamp))) * 1000) as Duration
from ProcessLogs
Where ProcessId IN (Select Max(Id) from
Processes Where ProcessType = 'Replenishment'
AND Status = 1)
Order by Id
|
| IH#SupersededOpeningProfiles | View for calculation opening/closing values in real inventory profiles |
|---|
WITH Params AS ( -- read once SELECT MAX(UseSupercessions) AS UseSupercessions, DECODE(MAX(RPClosingCalculationMethod), 'AfterDeliveryDate', 1, 0) AS ClosingMethod FROM IH#ReplenishmentParameters ), SupersededDataRaw AS ( -- branch 1: non-superseding SKU SELECT r.SiteMaterialUsageId, r.ConsignmentLocationId, r.SkuKey, r.DateFrom, r.Opening, r.OrdersIn, r.OrdersOut, r.TentativeOrdersIn, r.TentativeOrdersOut, r.Consumption, r.OriginalConsumption, r.SafetyStock, r.MaxSafetyStock FROM RealInventoryProfilesIPlanView r WHERE NOT EXISTS ( SELECT 1 FROM ReplenishedSubstitutedSku s CROSS JOIN Params p WHERE p.UseSupercessions != 'None' AND s.Replenished = 0 AND s.SiteMaterialUsageId = r.SiteMaterialUsageId ) UNION ALL -- branch 2: superseding SKU with replenishment SELECT rs.OnSiteMaterialUsageId AS SiteMaterialUsageId, r.ConsignmentLocationId, (rs.OnSiteMaterialUsageId || '-0') AS SkuKey, r.DateFrom, r.Opening, r.OrdersIn, r.OrdersOut, r.TentativeOrdersIn, r.TentativeOrdersOut, r.Consumption, r.OriginalConsumption, 0 AS SafetyStock, 0 AS MaxSafetyStock FROM RealInventoryProfilesIPlanView r JOIN ReplenishedSubstitutedSku rs ON r.SiteMaterialUsageId = rs.SiteMaterialUsageId CROSS JOIN Params p WHERE p.UseSupercessions != 'None' AND rs.Replenished = 0 ), SupersededData AS ( -- grouping for case when one SKU is superseded by several SKUs SELECT SiteMaterialUsageId, ConsignmentLocationId, SkuKey, DateFrom, SUM(Opening) AS Opening, SUM(OrdersIn) AS OrdersIn, SUM(OrdersOut) AS OrdersOut, SUM(TentativeOrdersIn) AS TentativeOrdersIn, SUM(TentativeOrdersOut) AS TentativeOrdersOut, SUM(Consumption) AS Consumption, SUM(OriginalConsumption) AS OriginalConsumption, SUM(SafetyStock) AS SafetyStock, SUM(MaxSafetyStock) AS MaxSafetyStock FROM SupersededDataRaw GROUP BY SiteMaterialUsageId, ConsignmentLocationId, SkuKey, DateFrom ), BaseData AS ( SELECT sp.*, p.ClosingMethod, FIRST_VALUE(sp.Opening) OVER(PARTITION BY sp.SiteMaterialUSageId, sp.ConsignmentLocationId ORDER BY sp.DateFrom) AS BaseOpening, NVL(SUM(sp.OrdersIn) OVER(PARTITION BY sp.SiteMaterialUSageId, sp.ConsignmentLocationId ORDER BY sp.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumIn_Prev, NVL(SUM(sp.OrdersOut) OVER(PARTITION BY sp.SiteMaterialUSageId, sp.ConsignmentLocationId ORDER BY sp.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumOut_Prev, NVL(SUM(sp.TentativeOrdersIn) OVER(PARTITION BY sp.SiteMaterialUSageId, sp.ConsignmentLocationId ORDER BY sp.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumTentIn_Prev, NVL(SUM(sp.TentativeOrdersOut) OVER(PARTITION BY sp.SiteMaterialUSageId, sp.ConsignmentLocationId ORDER BY sp.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumTentOut_Prev, NVL(SUM(sp.Consumption) OVER(PARTITION BY sp.SiteMaterialUSageId, sp.ConsignmentLocationId ORDER BY sp.DateFrom ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS SumCons_Prev FROM SupersededData sp CROSS JOIN Params p ), CalculatedData AS ( SELECT bd.*, (bd.BaseOpening + bd.SumIn_Prev - bd.SumOut_Prev) AS OpeningCalc, (bd.BaseOpening + bd.SumIn_Prev + bd.SumTentIn_Prev - bd.SumOut_Prev - bd.SumCons_Prev - bd.SumTentOut_Prev) AS OverAllOpeningCalc, (bd.BaseOpening + bd.SumIn_Prev - bd.SumOut_Prev - bd.SumCons_Prev) AS TentativeOpeningCalc, (bd.BaseOpening + bd.SumIn_Prev - bd.SumOut_Prev - bd.SumCons_Prev) AS FirmOpeningCalc FROM BaseData bd ) SELECT SiteMaterialUSageID, ConsignmentLocationId, SkuKey, DateFrom, OpeningCalc AS Opening, OverAllOpeningCalc AS OverAllOpening, TentativeOpeningCalc AS TentativeOpening, FirmOpeningCalc AS FirmOpening, OrdersIn, TentativeOrdersIn, OrdersOut, TentativeOrdersOut, Consumption, (SumCons_Prev + Consumption) AS CumulativeConsumption, OriginalConsumption, (OpeningCalc + CASE WHEN ClosingMethod = 0 THEN OrdersIn ELSE 0 END - OrdersOut) AS Closing, (OverAllOpeningCalc + CASE WHEN ClosingMethod = 0 THEN (OrdersIn + TentativeOrdersIn) ELSE 0 END - (OrdersOut + Consumption + TentativeOrdersOut)) AS OverallClosing, (TentativeOpeningCalc + CASE WHEN ClosingMethod = 0 THEN OrdersIn ELSE 0 END - (OrdersOut + Consumption)) AS TentativeClosing, (FirmOpeningCalc + CASE WHEN ClosingMethod = 0 THEN OrdersIn ELSE 0 END - (OrdersOut + Consumption)) AS FirmClosing, SafetyStock, MaxSafetyStock FROM CalculatedData |
| IH#SupersededOrderLines |
|---|
SELECT ol.Id OrderLineId, NVL(OnSiteMaterialUsageId, ol.SiteMaterialUsageID) OnSiteMaterialUsageId,
ol.SiteMaterialUsageId, NVL(oo.WorkCentreId, ol.WorkCentreId) WorkCentreId, DeliveryDate, FinalWeight, PeriodType,
ol.OrderLineStatusId, ol.LocationId
FROM OrderLines ol
LEFT JOIN OrderOperations oo ON oo.OrderLineId = ol.Id And oo.IsLastOperation = 1
LEFT JOIN IH#ActiveSupercessions ms
ON ol.SiteMaterialUsageID = ms.SiteMaterialUsageId
|
| IH#SupersededOrders |
|---|
SELECT
SiteMaterialUsageId, DeliveryMonth, SUM(Orders) Orders,
SUM(OrdersIncludeSupercessions) OrdersIncludeSupercessions
FROM IH#SiteSupersededOrders
group by SiteMaterialUsageId, DeliveryMonth
|
| IH#SupersededSkuStockStatus |
|---|
WITH Params AS (
SELECT
NVL(MAX(CASE WHEN ParameterName = 'RPStockStateField' THEN VALUE END), 'Closing') AS StockStateField,
MAX(CASE WHEN ParameterName = 'StockLevelAtZeroWarning' THEN VALUE END) AS StockLevelAtZeroWarning
FROM SystemParameters
WHERE ParameterName IN ('RPStockStateField', 'StockLevelAtZeroWarning')
),
BaseData AS (
SELECT r.*, s.MaxCapacity, s.SafetyStockPercentWarning, s.MaxCapacityBehaviour, s.MaxSafetyStockMethodId, p.StockLevelAtZeroWarning,
-- Calculate TargetStock directly
CASE WHEN p.StockStateField = 'Closing' THEN r.OverallClosing ELSE r.OverallOpening END AS TargetStock,
CASE WHEN p.StockStateField = 'Closing' THEN r.TentativeClosing ELSE r.TentativeOpening END AS TargetTentativeStock
FROM IH#SupersededOpeningProfiles r
JOIN IH#WHStockMonitoring s
ON s.SiteMaterialUsageId = r.SiteMaterialUsageId
AND NVL(s.ConsignmentLocationId, 0) = NVL(r.ConsignmentLocationId, 0)
CROSS JOIN Params p
)
SELECT
SiteMaterialUsageId, ConsignmentLocationId, SkuKey, DateFrom,
OverallOpening, OverallClosing, SafetyStock, MaxSafetyStock,
MaxCapacity, SafetyStockPercentWarning, 1 AS Superseded,
CASE
WHEN TargetStock = 0 AND SafetyStock = 0 AND OriginalConsumption > 0 THEN 1
WHEN TargetStock < 0 THEN 1
WHEN StockLevelAtZeroWarning = 'InventoryLessOrEqualZero' AND SafetyStock > 0 AND TargetStock = 0 THEN 1
WHEN SafetyStock > 0 AND SafetyStockPercentWarning > 0 AND TargetStock < (SafetyStock * SafetyStockPercentWarning / 100) THEN 2
WHEN SafetyStock > 0 AND TargetStock < SafetyStock THEN 3
WHEN MaxCapacityBehaviour IN ('Warning', 'Limit') AND MaxCapacity > 0 AND TargetStock > MaxCapacity THEN 4
WHEN MaxSafetyStockMethodId IS NOT NULL AND MaxSafetyStock IS NOT NULL AND TargetStock > MaxSafetyStock THEN 5
ELSE 9
END AS StockStatus,
CASE
WHEN TargetTentativeStock = 0 AND SafetyStock = 0 AND OriginalConsumption > 0 THEN 1
WHEN TargetTentativeStock < 0 THEN 1
WHEN StockLevelAtZeroWarning = 'InventoryLessOrEqualZero' AND SafetyStock > 0 AND TargetTentativeStock = 0 THEN 1
WHEN SafetyStock > 0 AND SafetyStockPercentWarning > 0 AND TargetTentativeStock < (SafetyStock * SafetyStockPercentWarning / 100) THEN 2
WHEN SafetyStock > 0 AND TargetTentativeStock < SafetyStock THEN 3
WHEN MaxCapacityBehaviour IN ('Warning', 'Limit') AND MaxCapacity > 0 AND TargetTentativeStock > MaxCapacity THEN 4
WHEN MaxSafetyStockMethodId IS NOT NULL AND MaxSafetyStock IS NOT NULL AND TargetTentativeStock > MaxSafetyStock THEN 5
ELSE 9
END AS TentativeStockStatus
FROM BaseData
|
| IH#SystemParameterLog |
|---|
SELECT l.ParameterName, sp.ParameterDescription,
sp.DefaultValue, OldValue, NewValue,
UserName, UserLogin, Stamp
FROM Systemparameterlogs l
JOIN SystemParameters sp
ON sp.ParameterName = l.ParameterName
JOIN Users u on u.Id = l.UserId
|
| IH#TableDefinitions |
|---|
WITH
-- 1. Get index expressions (LONG) in a single query
index_expressions_xml AS (SELECT DBMS_XMLGEN.GETXMLTYPE('SELECT index_name, column_position, column_expression
FROM user_ind_expressions') AS xml_data
FROM dual),
index_expressions AS (SELECT x.index_name, x.column_position, x.real_expression
FROM index_expressions_xml d
CROSS JOIN XMLTABLE('/ROWSET/ROW' PASSING d.xml_data
COLUMNS index_name VARCHAR2(128) PATH 'INDEX_NAME', column_position NUMBER PATH 'COLUMN_POSITION', real_expression CLOB PATH 'COLUMN_EXPRESSION') x
WHERE d.xml_data IS NOT NULL),
-- 2. Combine actual columns and index expressions
index_columns_mapped AS (SELECT c.index_name, c.table_name, c.column_position,
COALESCE(TO_CHAR(e.real_expression), c.column_name) AS final_column
FROM user_ind_columns c
LEFT JOIN index_expressions e
ON e.index_name = c.index_name AND e.column_position = c.column_position),
-- 3. Aggregate index columns
index_columns_agg AS (SELECT table_name, index_name,
LISTAGG(final_column, ', ') WITHIN GROUP (ORDER BY column_position) AS index_columns
FROM index_columns_mapped
GROUP BY table_name, index_name),
-- 4. Build the index row
index_lines AS (SELECT i.table_name, i.index_name,
' - ' || i.index_name ||
CASE WHEN i.uniqueness = 'UNIQUE' THEN ' [UNIQUE]' ELSE '' END || ': ' ||
a.index_columns AS index_line
FROM user_indexes i
JOIN index_columns_agg a ON a.table_name = i.table_name AND a.index_name = i.index_name),
-- 5. Aggregate all table indexes
index_defs AS (SELECT table_name,
XMLCAST(XMLAGG(XMLELEMENT("e", index_line || CHR(10)) ORDER BY index_name) AS CLOB) AS indexes_clob
FROM index_lines
GROUP BY table_name),
-- 6. Extract DATA_DEFAULT (LONG)
column_defaults_xml AS (SELECT DBMS_XMLGEN.GETXMLTYPE('SELECT table_name, column_name, data_default
FROM user_tab_cols
WHERE default_length IS NOT NULL
AND hidden_column = ''NO''') AS xml_data
FROM dual),
column_defaults AS (SELECT x.table_name, x.column_name, TRIM(x.data_default) AS data_default
FROM column_defaults_xml d
CROSS JOIN XMLTABLE('/ROWSET/ROW' PASSING d.xml_data
COLUMNS table_name VARCHAR2(128) PATH 'TABLE_NAME', column_name VARCHAR2(128) PATH 'COLUMN_NAME', data_default CLOB PATH 'DATA_DEFAULT') x
WHERE d.xml_data IS NOT NULL),
-- 7. Build definition lines for each column
column_lines_base AS (SELECT c.table_name, c.column_id,
-- ADD A COMMA HERE before every row except the first
CASE
WHEN ROW_NUMBER() OVER (PARTITION BY c.table_name ORDER BY c.column_id) > 1
THEN ',' || CHR(10)
ELSE '' END || ' ' || c.column_name || ' ' || CASE
WHEN c.data_type = 'NUMBER'
THEN CASE
WHEN c.data_precision IS NULL AND c.data_scale IS NULL
THEN 'NUMBER'
WHEN c.data_scale IS NULL
THEN 'NUMBER(' || c.data_precision || ')'
WHEN c.data_precision IS NULL
THEN 'NUMBER'
ELSE 'NUMBER(' || c.data_precision || ',' || c.data_scale || ')' END
WHEN c.data_type IN ('VARCHAR2', 'CHAR', 'NCHAR', 'NVARCHAR2')
THEN c.data_type ||
'(' ||
c.char_length ||
CASE
WHEN c.char_used = 'B'
THEN ' BYTE'
WHEN c.char_used = 'C'
THEN ' CHAR'
ELSE NULL END ||
')'
WHEN c.data_type = 'RAW'
THEN 'RAW(' || c.data_length || ')'
WHEN c.data_type = 'FLOAT'
THEN CASE
WHEN c.data_precision IS NOT NULL
THEN 'FLOAT(' || c.data_precision || ')'
ELSE 'FLOAT' END
WHEN c.data_type LIKE 'TIMESTAMP%'
THEN c.data_type
ELSE c.data_type END ||
CASE
WHEN d.data_default IS NOT NULL THEN CASE
WHEN c.virtual_column = 'YES'
THEN ' AS (' || TO_CHAR(d.data_default) || ')'
ELSE ' DEFAULT ' || TO_CHAR(d.data_default) END
ELSE '' END ||
CASE WHEN c.virtual_column = 'YES' THEN ' VIRTUAL' ELSE '' END ||
CASE WHEN c.nullable = 'N' THEN ' NOT NULL' ELSE '' END AS column_line
FROM user_tab_cols c
LEFT JOIN column_defaults d
ON d.table_name = c.table_name AND d.column_name = c.column_name
WHERE c.hidden_column = 'NO'),
-- 8. Aggregate all table columns
-- (XMLAGG no longer contains analytic functions; it only concatenates the completed column_line string)
column_defs AS (SELECT table_name,
XMLCAST(XMLAGG(XMLELEMENT("e", column_line) ORDER BY column_id) AS CLOB) AS columns_clob
FROM column_lines_base
GROUP BY table_name)
-- 9. Final assembly
SELECT t.table_name AS TableName,
TO_CLOB('Columns:' || CHR(10) || '(' || CHR(10)) || c.columns_clob ||
TO_CLOB(CHR(10) || ')' || CHR(10) || CHR(10)) ||
TO_CLOB('ApproxRows: ' || NVL(TO_CHAR(t.num_rows), 'NULL') || CHR(10) || CHR(10)) ||
TO_CLOB('Indexes:' || CHR(10)) || NVL(i.indexes_clob, TO_CLOB(' <none>' || CHR(10))) AS Definition
FROM user_tables t
LEFT JOIN column_defs c ON c.table_name = t.table_name
LEFT JOIN index_defs i ON i.table_name = t.table_name
ORDER BY t.table_name
|
| IH#TableIndexes |
|---|
WITH
index_expressions AS (SELECT index_name, column_position,
CASE
WHEN xml_data IS NOT NULL THEN XMLCAST(XMLQUERY(
'/ROWSET/ROW/COLUMN_EXPRESSION' PASSING XMLTYPE(xml_data) RETURNING
CONTENT) AS VARCHAR2(4000))
ELSE NULL END AS real_expression
FROM (SELECT index_name, column_position,
DBMS_XMLGEN.GETXML(
'SELECT column_expression FROM user_ind_expressions ' ||
'WHERE index_name = ''' || index_name || ''' ' ||
'AND column_position = ' || column_position) AS xml_data
FROM user_ind_expressions)),
index_columns_mapped AS (SELECT c.index_name, c.column_position,
COALESCE(e.real_expression, c.column_name) AS final_column
FROM user_ind_columns c
LEFT JOIN index_expressions e
ON c.index_name = e.index_name AND c.column_position = e.column_position)
SELECT i.Table_Name AS TableName, i.index_name AS IndexName,
DECODE(i.uniqueness, 'NONUNIQUE', 0, 1) AS IsUnique,
LISTAGG(m.final_column, ', ') WITHIN GROUP (ORDER BY m.column_position) AS IndexColumns
FROM user_indexes i
JOIN index_columns_mapped m ON i.index_name = m.index_name
GROUP BY i.Table_Name, i.index_name, i.uniqueness
ORDER BY 1, 2
|
| IH#TableUsedSpace |
|---|
WITH
tableSegments AS (SELECT segment_name AS table_name, SUM(bytes) / 1024 / 1024 AS table_mb
FROM user_segments
WHERE segment_type IN ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION')
GROUP BY segment_name),
IndexSegments AS (SELECT i.table_name, SUM(s.bytes) / 1024 / 1024 AS index_mb
FROM user_indexes i
JOIN user_segments s ON s.segment_name = i.index_name
WHERE i.index_type != 'LOB'
GROUP BY i.table_name),
LobSegments AS (SELECT l.table_name, SUM(s.bytes) / 1024 / 1024 AS lob_mb
FROM user_lobs l
JOIN user_segments s ON s.segment_name = l.segment_name
GROUP BY l.table_name),
LobIndexSegments AS (SELECT l.table_name, SUM(s.bytes) / 1024 / 1024 AS lob_idx_mb
FROM user_lobs l
JOIN user_segments s ON s.segment_name = l.index_name
GROUP BY l.table_name),
NestedTableSegments AS (SELECT nt.parent_table_name AS table_name,
SUM(s.bytes) / 1024 / 1024 AS nested_tab_mb
FROM user_nested_tables nt
JOIN user_segments s ON s.segment_name = nt.table_name
GROUP BY nt.parent_table_name)
SELECT t.table_name, ROUND(NVL(tseg.table_mb, 0), 2) AS TableVolume,
ROUND(NVL(iseg.index_mb, 0), 2) AS indexesVolume, ROUND(NVL(lseg.lob_mb, 0), 2) AS lobVolume,
ROUND(NVL(liseg.lob_idx_mb, 0), 2) AS lobIndexesVolume,
ROUND(NVL(ntseg.nested_tab_mb, 0), 2) AS nestedTablesVolume,
ROUND(NVL(tseg.table_mb, 0) + NVL(iseg.index_mb, 0) + NVL(lseg.lob_mb, 0) + NVL(liseg.lob_idx_mb, 0) +
NVL(ntseg.nested_tab_mb, 0), 2) AS totalVolume
FROM user_tables t
LEFT JOIN TableSegments tseg ON tseg.table_name = t.table_name
LEFT JOIN IndexSegments iseg ON iseg.table_name = t.table_name
LEFT JOIN LobSegments lseg ON lseg.table_name = t.table_name
LEFT JOIN LobIndexSegments liseg ON liseg.table_name = t.table_name
LEFT JOIN NestedTableSegments ntseg ON ntseg.table_name = t.table_name
WHERE t.table_name NOT IN (SELECT table_name FROM user_nested_tables)
|
| IH#ToolBatches |
|---|
SELECT tb.Id,
BatchNo,
t.MaterialCode ToolMaterialCode,
t.MaterialName ToolMaterialName,
m.MaterialCode,
m.MaterialName,
ToolMaterialId,
MaterialId
FROM ToolBatches tb
JOIN Materials t ON t.Id = tb.ToolMaterialId
JOIN Materials m ON m.Id = tb.MaterialId
WHERE NOT EXISTS (SELECT 1 FROM Materials u WHERE u.UsedWithMaterialId = tb.ToolMaterialId)
|
| IH#ToolMaterials |
|---|
SELECT m.*
FROM Materials m
JOIN MaterialTYpes mt
ON mt.Id = m.MaterialTypeId
AND mt.IsTool = 1
|
| IH#ToolSku |
|---|
SELECT SiteMaterialUsageId, SiteId, LocationId, MaterialId, WorkcentreId, MaterialTypeId
FROM IH#SiteWarehouseSku
WHERE IsTool = 1
|
| IH#TradingDays |
|---|
SELECT CalendarId, DateFromMonth, WorkingDaysQty TradingDays FROM CalendarTradingDays |
| IH#TransportLocationLocations |
|---|
SELECT tl.LocationName TransportLocationName,
tl.LocationCode TransportLocationCode,
tl.Id TransportLocationId,
l.Id LocationId, l.LocationName, l.LocationCode
FROM IH#TransportLocations tl
JOIN Locations l ON
l.TransportLocationId = tl.Id
ORDER BY 1
|
| IH#TransportLocations |
|---|
SELECT * FROM Locations WHERE ID IN (SELECT TransportLocationId FROM Locations WHERE TransportLocationId IS NOT NULL)
|
| IH#TransportMethodsForEdge |
|---|
SELECT WorkcentreName, WorkcentreCode,
l.LocationName ToLocationName, l.LocationCode ToLocationCode, TransportMethodId as Id, TransportMethodName,
TransportMethodCode,
wc.Id Workcentreid, l.Id ToLocationId
FROM IH#Journeys j
JOIN Workcentres wc
ON wc.LocationId = fromLocationId
JOIN Locations l
ON (l.Id = j.ToLocationId or l.TransportLocationId = j.ToLocationId)
|
| IH#TransportRoutes |
|---|
SELECT tr.Id, tr.FromLocationId, tr.ToLocationId, tr.TransportMethodId, tr.CalendarId, tr.ScheduleId, tr.TimePeriod, tr.COST, tr.Priority, tr.LoadingTime, tr.UnloadingTime, s.SiteName Site, s.Id FromSiteId, NVL(ts.Id,0) ToSiteId, f.LocationName SOURCE, t.LocationName Destination, tm.TransportMethodName Method, c.CalendarName Calendar, sc.ScheduleName Schedule FROM TransportRoutes tr JOIN Locations f ON (f.Id = tr.FromLocationId) JOIN Locations t ON (t.Id = tr.ToLocationId) JOIN TransportMethods tm ON (tm.Id = tr.TransportMethodId) JOIN Sites s ON (s.Id = f.SiteId) LEFT JOIN Sites ts ON (ts.Id = t.SiteId) LEFT JOIN Calendars c ON (c.Id = tr.CalendarId) LEFT JOIN Schedules sc ON (sc.Id = tr.ScheduleId) |
| IH#TransposedMaterials |
|---|
WITH props AS (SELECT * FROM Propertiesiplanview) SELECT m.MaterialId, props.Id AS PropertyId, Code1 PropertyCode, Value1 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 1 AND Code1 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code2 PropertyCode, Value2 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 2 AND Code2 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code3 PropertyCode, Value3 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 3 AND Code3 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code4 PropertyCode, Value4 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 4 AND Code4 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code5 PropertyCode, Value5 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 5 AND Code5 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code6 PropertyCode, Value6 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 6 AND Code6 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code7 PropertyCode, Value7 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 7 AND Code7 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code8 PropertyCode, Value8 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 8 AND Code8 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code9 PropertyCode, Value9 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 9 AND Code9 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code10 PropertyCode, Value10 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 10 AND Code10 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code11 PropertyCode, Value11 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 11 AND Code11 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code12 PropertyCode, Value12 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 12 AND Code12 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code13 PropertyCode, Value13 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 13 AND Code13 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code14 PropertyCode, Value14 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 14 AND Code14 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code15 PropertyCode, Value15 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 15 AND Code15 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code16 PropertyCode, Value16 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 16 AND Code16 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code17 PropertyCode, Value17 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 17 AND Code17 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code18 PropertyCode, Value18 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 18 AND Code18 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code19 PropertyCode, Value19 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 19 AND Code19 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code20 PropertyCode, Value20 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 20 AND Code20 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code21 PropertyCode, Value21 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 21 AND Code21 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code22 PropertyCode, Value22 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 22 AND Code22 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code23 PropertyCode, Value23 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 23 AND Code23 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code24 PropertyCode, Value24 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 24 AND Code24 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code25 PropertyCode, Value25 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 25 AND Code25 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code26 PropertyCode, Value26 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 26 AND Code26 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code27 PropertyCode, Value27 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 27 AND Code27 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code28 PropertyCode, Value28 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 28 AND Code28 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code29 PropertyCode, Value29 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 29 AND Code29 IS NOT NULL UNION ALL SELECT m.MaterialId, props.Id AS PropertyId, Code30 PropertyCode, Value30 PropertyValue, props.OriginalPropertyName FROM MaterialPropsSpec m, props WHERE props.OrderNO = 30 AND Code30 IS NOT NULL |
| IH#UploadedTemplates |
|---|
SELECT ProcessId,
MAX(DECODE(Name, 'CorrectMessages', VALUE, NULL)) AS CorrectMessages,
MAX(DECODE(Name, 'WrongMessages', VALUE, NULL)) AS WrongMessages,
MAX(DECODE(Name, 'SkippedMessages', VALUE, NULL)) AS SkippedMessages
FROM
ProcessResults
GROUP BY ProcessId
|
| IH#UsedExternalTrends |
|---|
SELECT
d.SiteMaterialUsageId,
jt.ForecastPatternId
FROM
(
SELECT SiteMaterialUsageId, UsedExternalTrends
FROM ForecastStatistics fs
WHERE fs.ForecastId = forecasting.GetLatestForecast()
AND UsedExternalTrends IS NOT NULL
) d
CROSS APPLY JSON_TABLE(
'[' || d.UsedExternalTrends || ']',
'$[*]'
COLUMNS (
ForecastPatternId NUMBER PATH '$'
)
) jt
|
| IH#UserPageParameters |
|---|
SELECT pp.Id, PageId, pp.ParameterName, pp.ParameterDescription, ParameterType, DataType, MINVALUE, MAXVALUE, DependOn,
DependBehaviour, DependValues, OrderNo, GroupName, Separator,
DECODE(COALESCE(up.Value, pp.Value, pp.DefaultValue),
'{SYSDATE}', to_char(Trunc(core.getInternalDate, 'month'), 'YYYY-MM-DD'),
COALESCE(up.Value, pp.Value, pp.DefaultValue))
AS VALUE,
u.Id userId, pp.ParameterHint, pp.ActionId, pp.BundleId, pp.IsDevMode
FROM PageParameters pp
CROSS JOIN USERS u
LEFT JOIN UserPageParameters up
ON (up.PageParameterid = pp.Id AND u.id = userid)
|
| IH#UserParameters |
|---|
WITH s
AS
(
SELECT u.Id UserId, sp.*
FROM IT#SystemParameters sp, USERS u
WHERE ParameterType IN ('user', 'session')
)
SELECT s.UserId,
NVL(u.Value, s.Value) as VALUE,
s.Id, s.ParameterName, ParameterType, DataType, MINVALUE, MAXVALUE, CATEGORY, DependOn, ParameterDescription, ParameterHelp,
s.Cloud, READONLY, s.BundleId, s.DefaultValue,
CASE WHEN s.ParameterName IN ('HomePageDashboard', 'ForecastAnalysisDashboard') THEN 0
ELSE NVL2(u.Id, 1, 0)
END AllowReset,
s.LanguageId
FROM s
LEFT JOIN UserParameters u ON (s.Id = u.SystemParameterId AND u.UserId= s.UserId)
|
| IH#UserPermissions |
|---|
SELECT ur.UserId, ra.ActionId, p.PageName, a.ActionName FROM Actions a JOIN RolesActions ra ON (ra.ActionId = a.Id) JOIN UsersRoles ur ON (ur.RoleId = ra.RoleId) JOIN Pages p ON (p.Id = a.PageId) |
| IH#UserReports |
|---|
SELECT uds.Id UserDataSourceId, uds.Parentdatasourceid, uds.Title, uds.Description, ds.Name, u.UserName, uds.IsPublished FROM datasources uds JOIN DataSources ds ON ds.Id = uds.ParentDataSourceId JOIN USERS u ON u.Id = uds.UserId WHERE uds.Type = 'user' |
| IH#UsersRoles |
|---|
WITH r AS
(
SELECT ur.UserId, ur.RoleId, r.RoleName, r.RoleDescription, r.IsInternal, r.IsAdmin
FROM Roles r
JOIN UsersRoles ur ON ur.RoleId = r.Id
)
SELECT u.Id AS UserId, u.UserCode, u.UserName, u.Email,
r.IsInternal, r.IsAdmin,
r.RoleId, r.RoleName, r.RoleDescription
FROM Users u
LEFT JOIN r ON r.UserId = u.Id
ORDER BY u.UserName, r.IsInternal, r.RoleName
|
| IH#ValidBom |
|---|
SELECT b.Id, SIGN(NVL(bm.BomId, 0)) IsValid FROM Bom b LEFT JOIN BomMaterials Bm ON b.Id = Bm.BomId GROUP BY b.Id, bm.BomId |
| IH#ValidOperationSources |
|---|
SELECT ot.Id OperationTypeId, wc.WorkcentreTypeId, wc.Id WorkcentreId, l.SiteId,
OperationTypeName, WorkcentreTypeName, WorkcentreName
FROM OperationTypes ot
JOIN WorkcentreTypes wct ON wct.Id = ot.WorkcentreTypeId
JOIN Workcentres wc ON wc.WorkcentreTypeId = wct.Id
JOIN Locations l ON l.Id = wc.LocationId
WHERE (
EXISTS (SELECT 1 FROM ProductRouteStages prs WHERE prs.OperationTypeId = ot.Id)
OR
NOT EXISTS(SELECT 1 FROM ProductRoutes)
OR
NOT EXISTS (SELECT 1 FROM OperationTypes o WHERE o.WorkcentreTypeId = wc.WorkcentreTypeId and o.Id != ot.Id)
)
|
| IH#ValidSources |
|---|
SELECT ProductionConfigurationId, OperationTypeId,
core.AsCsv(CAST(COLLECT(to_char(WorkcentreId)) AS ParameterArray)) ValidSources,
core.AsCsv(CAST(COLLECT(DECODE(SourceRank, 'primary', to_char(WorkcentreId), NULL)) AS ParameterArray)) PrimaryValidSources
FROM ValidSources
GROUP BY ProductionConfigurationId, OperationTypeId
|
| IH#ViewDefinitions |
|---|
WITH
view_ddls AS (SELECT view_name, DBMS_METADATA.GET_DDL('VIEW', view_name) AS view_raw_ddl FROM user_views),
dependencies_hierarchy AS (SELECT name AS root_view_name, referenced_name, referenced_type,
level AS dependency_level,
LPAD(' ', (LEVEL - 1) * 2) || '- ' || referenced_name || ' (' ||
referenced_type || ')' AS dep_line,
ROWNUM AS order_seq
FROM user_dependencies
START WITH type = 'VIEW'
CONNECT BY PRIOR referenced_name = name AND PRIOR referenced_type = type),
dependencies_agg AS (SELECT root_view_name AS view_name,
XMLCAST(XMLAGG(XMLELEMENT("e", dep_line || CHR(10)) ORDER BY order_seq) AS CLOB) AS deps_clob
FROM dependencies_hierarchy
GROUP BY root_view_name),
base_tables_rows AS (SELECT d.name AS view_name,
LISTAGG(t.table_name || ': ' || NVL(TO_CHAR(t.num_rows), 'no stats'), ', ')
WITHIN GROUP (ORDER BY t.table_name) AS base_rows_info
FROM user_dependencies d
JOIN user_tables t ON t.table_name = d.referenced_name
WHERE d.type = 'VIEW' AND d.referenced_type = 'TABLE'
GROUP BY d.name)
SELECT v.view_name AS ViewName,
TO_CLOB('Definition:' || CHR(10)) || vddl.view_raw_ddl ||
TO_CLOB(CHR(10) || 'Approx Base Table Rows:' || CHR(10) || ' ') ||
TO_CLOB(NVL(r.base_rows_info, '<no direct base tables>')) ||
TO_CLOB(CHR(10) || CHR(10) || 'Dependencies Hierarchy:' || CHR(10)) ||
NVL(d.deps_clob, TO_CLOB(' <none>' || CHR(10))) AS Definition
FROM user_views v
LEFT JOIN view_ddls vddl ON vddl.view_name = v.view_name
LEFT JOIN dependencies_agg d ON d.view_name = v.view_name
LEFT JOIN base_tables_rows r ON r.view_name = v.view_name
|
| IH#WarehouseCapacities |
|---|
SELECT l.Id LocationId, l.SiteId, l.Capacity FROM Locations l JOIN Ih#workcentres wc ON wc.LocationId = l.Id
WHERE wc.WorkcentreTypeName IN ('Warehouse', 'SemiFinisingWarehouse')
|
| IH#WarehouseConsumption |
|---|
SELECT GroupKey, MaterialId, wc.* FROM WarehouseConsumption wc JOIN GroupedSku g ON wc.WarehouseSkuId = g.SiteMaterialUsageId AND NVL(wc.Consignmentlocationid, 0) = NVL(g.ConsignmentLocationId, 0) |
| IH#WarehouseGroupedSkus |
|---|
SELECT Id as SiteMaterialUsageId, GroupKey, Replenished, First_VALUE(Id) OVER(PARTITION BY GroupKey ORDER BY Replenished DESC) OnSiteMaterialUsageId FROM SiteMaterialUsages WHERE GroupKey IS NOT NULL |
| IH#Warehouses |
|---|
SELECT wc.*, NVL(wp.Value, 0) IsFreeStockWarehouse FROM IH#Workcentres wc LEFT JOIN IH#WorkcentreParameters wp ON wp.WorkcentreId = wc.WorkcentreId AND ParameterName = 'IsFreeStockWarehouse' WHERE wc.HasInventory = 1 |
| IH#WastedTableSpace |
|---|
SELECT table_name, ROUND((blocks * 8 / 1024), 2) AS SIZEmb,
ROUND((num_rows * avg_row_len / 1024 / 1024), 2) ActualSizeMB,
(ROUND((blocks * 8 / 1024), 2) - ROUND((num_rows * avg_row_len / 1024 / 1024), 2)) WastedSize,
((ROUND((blocks * 8), 2) - ROUND((num_rows * avg_row_len / 1024), 2)) / ROUND((blocks * 8), 2)) * 100 -
PCT_FREE ReclaimableSpaceInPercent
FROM user_tables
WHERE (ROUND((blocks * 8), 2) > ROUND((num_rows * avg_row_len / 1024), 2))
AND ROUND((blocks * 8 / 1024), 2) > 10 /* tables with size more than 10 mb */
AND ((ROUND((blocks * 8), 2) - ROUND((num_rows * avg_row_len / 1024), 2)) / ROUND((blocks * 8), 2)) * 100 -
PCT_FREE >= 30
|
| IH#WeeklyUsageHistories |
|---|
SELECT hd.SiteMaterialUSageId, TRUNC(DateFrom, 'IW') DateFrom,
NVL(SUM(Weight),0) Weight,
NVL(SUM(AdjustedWeight),0) OriginalAdjustedWeight,
GREATEST(0, SUM(NVL(AdjustedWeight, Weight))) HistoryWeight,
SUM(NVL(AdjustedWeight, Weight)) AdjustedHistoryWeight
FROM UsageHistories hd
GROUP BY hd.SiteMaterialUSageId, TRUNC(DateFrom, 'IW')
|
| IH#WeightUnits |
|---|
SELECT u.Id, u.UnitName, u.UnitDescription, Dividend, Divisor, u.UnitTypeId FROM Units u JOIN UnitTypes ut ON ut.Id = u.UnitTypeId AND UnitTypeName = 'Weight' AND Dividend != -1 UNION ALL SELECT u.Id, u.UnitName, u.UnitDescription, Dividend, Divisor, u.UnitTypeId FROM Units u JOIN UnitTypeConverts uc ON (uc.ToUnitTypeId = u.UnitTypeId) JOIN UnitTypes ut ON (ut.Id = uc.FromUnitTypeID) WHERE ut.UnitTypeName = 'Weight' |
| IH#WHSkus |
|---|
SELECT smu.Id SiteMaterialUsageId, smu.LocationId, smu.MaterialId, wc.Id WorkcentreId, NULL ConsignmentLocationId,
smu.DaysOfSupply, smu.HighQuantity, smu.LowQuantity,
smu.MinOrderQuantity, smu.OrderUnitId, COALESCE(smu.OrderUnitId, ru.UnitId) RoundOrderUnitId,
smu.MaxCapacity, smu.Replenished,
NVL(smu.ReplenishmentStartDate, m.ReplenishmentStartDate) ReplenishmentStartDate,
NVL(smu.ReplenishmentFinishDate, m.ReplenishmentFinishDate) ReplenishmentFinishDate,
COALESCE(smu.SafetyStockMethodId, ccl.SafetyStockMethodId, c.SafetyStockMethodId, core.DefaultSafetyStockMethodId) SafetyStockMethodId,
NVL(smu.SafetyStockPercentWarning, core.DefaultSafetyStockPercentWarning) SafetyStockPercentWarning,
NVL(smu.UpperPercentile, core.DefaultSKUUpperPercentile) UpperPercentile, NVL(smu.LowerPercentile, core.DefaultSKULowerPercentile) LowerPercentile,
smu.UpperPercentileMethod, smu.UpperPercentileMonths,
cr.Id CustomerRankId, cr.CustomerRankDesc,
smu.ReplenishmentFrequency, smu.AlternateProduct,
smu.MaxDaysOfSupply, NVL(smu.MaxReplenishmentFrequency, 0) MaxReplenishmentFrequency, smu.MaxSafetyStockMethodId,
NVL(ccl.CalendarId, core.DefaultCalendarId) CalendarId,
smu.GroupKey, NVL2(smu.GroupKey, NVL(ccl.WarehouseLocationId, ccl.Id), NULL) GroupId,
smu.SkuKey, ccl.WarehouseLocationId, ccl.StockLocationId,
smu.LastInventoryDate, smu.ReplenishmentHorizon, smu.LeadTimeDays,
ccl.SiteId, ccl.CompanyId,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5, smu.SkuProperties,
smu.DerivedCharacteristic1, smu.DerivedCharacteristic2, smu.DerivedCharacteristic3, smu.DerivedCharacteristic4, smu.DerivedCharacteristic5,
smu.IsActiveSku
FROM SiteMaterialUsages smu
JOIN Locations ccl ON smu.LocationId = ccl.Id
JOIN Companies c ON c.Id = ccl.CompanyID
JOIN Materials m ON m.Id = smu.MaterialId
JOIN Workcentres wc on wc.LocationId = smu.LocationId
LEFT JOIN CustomerRanks cr ON COALESCE(smu.CustomerRankId, ccl.CustomerRankId, c.CustomerRankId, core.DefaultCustomerRankId) = cr.Id
LEFT JOIN IH#MaterialTypeRoundingUnits ru ON ru.MaterialTypeId = m.MaterialTypeId
WHERE EXISTS (SELECT 1 FROM WorkCentres w WHERE w.LocationId = smu.LocationId)
UNION ALL
SELECT cp.SiteMaterialUsageId, smu.LocationId, smu.MaterialId, wc.Id WorkcentreId, cp.CustomerId AS ConsignmentLocationId,
cp.DaysOfSupply, cp.HighQuantity, cp.LowQuantity,
cp.MinOrderQuantity, COALESCE(cp.OrderUnitId, smu.OrderUnitId) OrderUnitId, COALESCE(cp.OrderUnitId, smu.OrderUnitId, ru.UnitId) RoundOrderUnitId,
cp.MaxCapacity, cp.Replenished,
NVL(cp.ReplenishmentStartDate, m.ReplenishmentStartDate) ReplenishmentStartDate,
NVL(cp.ReplenishmentFinishDate, m.ReplenishmentFinishDate) ReplenishmentFinishDate,
COALESCE(cp.SafetyStockMethodId, ccl.SafetyStockMethodId, c.SafetyStockMethodId, core.DefaultSafetyStockMethodId) SafetyStockMethodId,
NVL(cp.SafetyStockPercentWarning, core.DefaultSafetyStockPercentWarning) SafetyStockPercentWarning,
NVL(smu.UpperPercentile, core.DefaultSKUUpperPercentile) UpperPercentile, NVL(smu.LowerPercentile, core.DefaultSKULowerPercentile) LowerPercentile,
smu.UpperPercentileMethod, smu.UpperPercentileMonths,
cr.Id AS CustomerRankId, cr.CustomerRankDesc,
cp.ReplenishmentFrequency, cp.AlternateProduct,
cp.MaxDaysOfSupply, NVL(cp.MaxReplenishmentFrequency, 0) MaxReplenishmentFrequency, cp.MaxSafetyStockMethodId,
NVL(ccl.CalendarId, core.DefaultCalendarId) CalendarId,
cp.GroupKey, NVL2(cp.GroupKey, NVL(ccl.WarehouseLocationId, ccl.Id), NULL) GroupId,
cp.SkuKey, ccl.WarehouseLocationId, ccl.StockLocationId,
cp.LastInventoryDate, cp.ReplenishmentHorizon, cp.LeadTimeDays,
ccl.SiteId, ccl.CompanyId,
smu.SkuProperty1, smu.SkuProperty2, smu.SkuProperty3, smu.SkuProperty4, smu.SkuProperty5, smu.SkuProperties,
smu.DerivedCharacteristic1, smu.DerivedCharacteristic2, smu.DerivedCharacteristic3, smu.DerivedCharacteristic4, smu.DerivedCharacteristic5,
cp.IsActiveSku
FROM ConsignmentParameters cp
JOIN SiteMaterialUsages smu ON smu.Id = cp.SiteMaterialUsageId
JOIN Locations ccl ON smu.LocationId = ccl.Id
JOIN Companies c ON c.Id = ccl.CompanyID
JOIN Materials m ON m.Id = smu.MaterialId
JOIN Workcentres wc on wc.LocationId = smu.LocationId
LEFT JOIN CustomerRanks cr ON COALESCE(smu.CustomerRankId, ccl.CustomerRankId, c.CustomerRankId, core.DefaultCustomerRankId) = cr.Id
LEFT JOIN IH#MaterialTypeRoundingUnits ru ON ru.MaterialTypeId = m.MaterialTypeId
WHERE EXISTS (SELECT 1 FROM WorkCentres w WHERE w.LocationId = smu.LocationId)
|
| IH#WHStockMonitoring |
|---|
SELECT smu.Id SiteMaterialUsageId, NULL ConsignmentLocationId, smu.LocationId, SkuKey, SafetyStockMethodId, MaxSafetyStockMethodId, MaxCapacity, NVL(SafetyStockPercentWarning, core.DefaultSafetyStockPercentWarning) SafetyStockPercentWarning, VALUE MaxCapacityBehaviour FROM SiteMaterialUsages smu JOIN Ih#workcentreparameters wp ON ParameterName = 'MaxCapacityBehaviour' AND smu.LocationId = wp.LocationId UNION ALL SELECT cp.SiteMaterialUsageId, cp.CustomerId, smu.LocationId, cp.SkuKey, cp.SafetyStockMethodId, cp.MaxSafetyStockMethodId, cp.MaxCapacity, NVL(cp.SafetyStockPercentWarning, core.DefaultSafetyStockPercentWarning) SafetyStockPercentWarning, VALUE MaxCapacityBehaviour FROM ConsignmentParameters cp JOIN SiteMaterialUsages smu ON smu.Id = cp.Sitematerialusageid JOIN Ih#workcentreparameters wp ON ParameterName = 'MaxCapacityBehaviour' AND smu.LocationId = wp.LocationId |
| IH#WorkCentreDestinations |
|---|
WITH w AS (SELECT sw.Id AS FromWorkCentreId,
sl.Id AS FromLocationId,
sw.WorkCentreName AS FromWorkCentreName,
sw.WorkCentreCode AS FromWorkCentreCode,
sl.LocationName AS FromLocationName,
sl.LocationCode AS FromLocationCode,
dw.WorkCentreId AS ToWorkCentreId,
dl.Id AS ToLocationId,
dw.WorkCentreName AS ToWorkCentreName,
dw.WorkCentreCode AS ToWorkCentreCode,
dl.LocationName AS ToLocationName,
dl.LocationCode AS ToLocationCode,
1 IsDefault
FROM WorkCentres sw
LEFT JOIN (SELECT wp.WorkCentreId, w.LocationId AS Value FROM WorkCentreParameters wp
JOIN WorkCentreParameterTypes wpt ON wpt.Id = wp.ParameterTypeId
AND wpt.ParameterName = 'PMOverrideWarehouse'
JOIN WorkCentres w ON w.WorkCentreCode = wp.Value
WHERE NVL(wp.Value, wpt.DefaultValue) != 'undefined') wp ON wp.WorkCentreId = sw.Id
JOIN Locations sl ON sl.Id = sw.LocationId
JOIN Locations dl ON dl.SiteId = sl.SiteId
LEFT JOIN IH#MainWarehouses dw ON dw.SiteId = dl.SiteId
WHERE dl.Id = Coalesce(wp.Value, dw.LocationId, dl.Id))
SELECT w.FromWorkCentreId, w.FromLocationId,
w.FromWorkCentreName, w.FromWorkCentreCode, w.FromLocationName, w.FromLocationCode,
wh.WorkCentreId AS ToWorkCentreId, wh.LocationId AS ToLocationId,
wh.WorkCentreName AS ToWorkCentreName, wh.WorkCentreCode AS ToWorkCentreCode,
wh.LocationName AS ToLocationName, wh.LocationCode AS ToLocationCode,
0 IsDefault,
w.ToLocationId AS MainWHLocationId,
w.ToWorkCentreName AS MainWHWorkCentreName, w.ToWorkCentreCode AS MainWHWorkCentreCode,
w.ToLocationName AS MainWHLocationName, w.ToLocationCode AS MainWHLocationCode
FROM w
JOIN IH#Journeys j ON j.FromLocationId = w.ToLocationId
JOIN IH#MainWarehouses wh ON wh.LocationId = j.ToLocationId
UNION ALL
SELECT w.*, NULL AS MainWHLocationId,
NULL AS MainWHWorkCentreName, NULL AS MainWHWorkCentreCode,
NULL AS MainWHLocationName, NULL AS MainWHLocationCode
FROM w
WHERE w.FromLocationId != w.ToLocationId
|
| IH#WorkcentreParameters |
|---|
WITH wt AS
(
SELECT ID, WorkCentreTypeName, WorkCentreTypeDesc, IsProductionSource FROM WorkCentreTypes
),
pm AS
(
SELECT MIN(ID) ID FROM wt WHERE wt.WorkCentreTypeName = 'Paper Machine'
)
SELECT w.Id AS WorkcentreId, w.WorkCentreName, w.WorkCentreCode,
w.WorkcentreTypeId, w.IdleCost,
wt.WorkCentreTypeName, wt.WorkCentreTypeDesc,
w.LocationId, l.LocationCode, l.LocationName,
l.SiteId, s.SiteName, s.SiteCode,
ParameterName, ParameterDescription, ParameterHelp,
NVL(wp.VALUE, DefaultValue) AS Value,
wpt.DefaultValue,
wpt.Undefined, wpt.BundleId,
wpt.UnitDescription, wpt.ParameterGroup, wpt.MinValue, wpt.MaxValue, wpt.DataType,
wpt.Id
FROM WorkCentreParameterTypes wpt
CROSS JOIN pm
JOIN wt ON DECODE(wt.IsProductionSource, 1, pm.Id, wt.Id) = wpt.WorkcentreTypeId
JOIN WorkCentres w ON w.WorkCentreTypeId = wt.Id
JOIN Locations l ON l.Id = w.LocationId
JOIN Sites s ON s.Id = l.SiteId
LEFT JOIN WorkCentreParameters wp ON wp.ParameterTypeId = wpt.Id AND wp.WorkcentreId = w.Id
|
| IH#Workcentres |
|---|
SELECT l.LocationName, l.LocationCode, wc.WorkcentreName, wc.WorkcentreCode, s.SiteCode, wct.WorkcentreTypeName, wct.WorkcentreTypeDesc, wct.SupplierType, s.SiteName, wc.Id WorkcentreId, l.Id AS LocationId, s.Id AS SiteId, wc.WorkcentreGroup, WorkcentreTypeId, wc.AutoConfirmationPeriod, wc.NumberOfWorkcentres, wc.IdleCost, COALESCE(l.CalendarId, core.DefaultCalendarId) CalendarId, HasInventory, l.Capacity AS LocationCapacity, IsProductionSource, wct.OrderNo, wct.StageDelayHours, wct.MaxStageDelayHours, wc.LineOfAuthority FROM Locations l JOIN Workcentres wc ON (wc.LocationId = l.Id) JOIN WorkcentreTypes wct ON (wc.WorkcentreTypeId = wct.Id) LEFT JOIN Sites s ON (l.SiteId = s.Id) |
| IH_Navigations |
|---|
SELECT nt.TaskName, dsf.Name, NVL(n.DisplayLabel, dsf.Description) description, dsf.DataType, EntityType, Category,
NVL(n.FreeEntry, DECODE(INITCAP(dsf.DataType), 'String', 1, 0)) IsFreeEntry,
n.Mandatory IsMandatory, NVL(n.LevelNo, dsf.OrderNo) LevelNo, OrderByField, NVL(Hidden, 0) Hidden,
DataSourceName, n.Id NavigationLevelId, dsf.Helper, dsf.HelperColumn, NVL(dsf.Filtered, dsf.DefaultFiltered) Filtered,
NVL(n.DefaultOperation,
CASE WHEN nt.FilterType = 'Picker' THEN '='
ELSE DECODE(INITCAP(dsf.DataType), 'String', 'in', '=')
END ) DefaultOperation, DefaultValue, nt.IsSystem, n.OperationTypeId, n.MaterialTypeId
FROM IH#DataSourceFields dsf
JOIN NavigationTasks nt
ON (UPPER(dsf.DataSourceName) = UPPER(nt.Source))
LEFT JOIN Navigations n
ON (UPPER(n.LevelName) = UPPER(dsf.Name) AND n.TaskName = nt.TaskName)
ORDER BY UPPER(TaskName), LevelNo
|
| IHBS#CorrespondRuns |
|---|
SELECT distinct r.Id SourceRunId, r2.Id RunId,
wc.WorkcentreName || ' ' || r.PositionNo || ' ' || r.Properties SourceRunName,
wc2.WorkcentreName || ' ' || r2.PositionNo || ' ' || r2.Properties RunName
FROM BSOInputdata d
JOIN OptimizedRuns r
ON r.Id = d.SourceRunId
JOIN OptimizedRunOrders o
ON o.OrderId = d.Id
JOIN OptimizedRuns R2
ON r2.Id = o.RunId
JOIN Workcentres wc
ON r.WorkcentreID = wc.Id
JOIN Workcentres wc2
ON r2.WorkcentreID = wc2.Id
|
| IHBS#GradeProperties |
|---|
WITH g AS
(
SELECT * FROM GradeProperties g
UNPIVOT EXCLUDE NULLS
(VALUE FOR PROPERTY IN (
Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10,
Code11, Code12, Code13, Code14, Code15, Code16, Code17, Code18, Code19, Code20,
Code21, Code22, Code23, Code24, Code25, Code26, Code27, Code28, Code29, Code30
))
)
SELECT g.GradeCode, g.GradeId, g.Property, p.Id PropertyId, g.VALUE
FROM g
JOIN IH#ModelCharacteristics2 h
ON UPPER(h.FieldCode) = Upper(g.Property)
JOIN PropertiesIPlanView p
ON UPPER(h.DescriptiveFieldName) = Upper(p.PropertyViewCode)
|
| IHBS#HandlingDelay |
|---|
SELECT wp.WorkCentreId, wp.Value / 1440 AS Value FROM IH#WorkcentreParameters wp WHERE wp.ParameterName = 'HandlingDelay' |
| IHBS#NextAllocationBodies |
|---|
SELECT ab1.*, ab2.WorkcentreId NextWorkcentreId, DECODE(LiveAllocationPeriod, 'Week', ab1.SourceWeek, ab1.SourceMonth) SourcePeriod,
DECODE(LiveAllocationPeriod, 'Week', ab2.SourceWeek, ab2.SourceMonth) NextSourcePeriod, 1 NextAllocation, 1 NextCoef
FROM Allocationbodies ab1
LEFT JOIN AllocationBodies ab2
ON ab1.Sitematerialusageid = ab2.SiteMaterialUsageId
AND ab1.AllocationId = ab2.AllocationId
AND ab1.SeqNo = ab2.SeqNo + 1
AND NVL(ab1.SourceWeek,to_date('01-01-2000', 'DD-MM-YYYY')) = NVL(ab2.Sourceweek,to_date('01-01-2000', 'DD-MM-YYYY'))
AND NVL(ab1.DeliveryWeek, to_date('01-01-2000', 'DD-MM-YYYY')) = NVL(ab2.DeliveryWeek, to_date('01-01-2000', 'DD-MM-YYYY'))
AND NVL(ab1.SourceMonth,to_date('01-01-2000', 'DD-MM-YYYY')) = NVL(ab2.SourceMonth,to_date('01-01-2000', 'DD-MM-YYYY'))
AND NVL(ab1.DeliveryMonth, to_date('01-01-2000', 'DD-MM-YYYY')) = NVL(ab2.DeliveryMonth, to_date('01-01-2000', 'DD-MM-YYYY'))
CROSS JOIN (SELECt CASE WHEN Value IN ('Week', 'WeekMonth') THEN 'Week' ELSE 'Month' END LiveAllocationPeriod
FROM SystemParameters WHERE ParameterName = 'LiveAllocationPeriod')
|
| IHBS#RunOutputDelay |
|---|
SELECT wp.WorkCentreId, wp.Value FROM IH#WorkcentreParameters wp WHERE wp.ParameterName = 'RunOutputDelay' |
| IHDP#ConvertLocations |
|---|
SELECT t.*, locationName, LocationCode FROM
(
SELECT SiteId, SiteName, SiteCode, MIN(l.Id) ConvertLocationId
FROM locations l
JOIN Sites s
ON s.Id = l.siteId
WHERE NOT EXISTS (SELECT 1 FROM workcentres wc WHERE wc.LocationID = l.Id)
AND SITEID IS NOT NULL
GROUP BY SiteId, SiteName, SiteCode
) t
JOIN Locations l2
ON l2.Id = t.ConvertLocationId
|
| IHDP#ConvertSku |
|---|
SELECT smu.Id SkuId, smu.LocationId, smu.MaterialId, smu.endUseId, smu.EndCustomerId, pc.Id, pc.BomId,
bm.MaterialId SourceMaterialId, p.ConvertLocationid, dsku.Id SourceSkuId, Multiplier, Divider,
s2.LocationCode, s2.MaterialCode, s2.EndUseCode, s2.EndCustomerCode, s2.Status,
d2.LocationCode DestinationLocationCode, d2.MaterialCode DestinationMaterialCode,
d2.EndUseCode DestinationEndUseCode, d2.EndCustomerCode DestinationEndCustomerCode,
d2.Status DestinationStatus
FROM SiteMaterialUsages smu
JOIN EV#SiteMaterialUsages s2 ON s2.Id = smu.Id
JOIN Productionconfigurations pc
ON pc.MaterialId = smu.MaterialId
JOIN BoMMaterials bm
ON bm.BomId = pc.BomId
JOIN (SELECT cl.ConvertLocationId, sp.*
FROM SourcePriorities sp
JOIN Locations l
ON sp.SourcelocationId = l.Id
JOIN IHDP#ConvertLocations cl
ON cl.SiteId = l.SiteId
JOIN Workcentres wc on wc.Id = sp.WorkcentreId
JOIN WorkcentreTypes wct on wct.Id = wc.WorkcentreTypeId
AND HasInventory = 0
AND IsActive = 1) p
ON p.Sitematerialusageid = smu.Id
AND p.Priority = 1
AND p.ConvertLocationId != smu.LocationId
LEFT JOIN SiteMaterialUsages dsku
ON dsku.LocationID = p.ConvertLocationId
AND dsku.MaterialID = bm.MaterialId
AND NVL(dsku.endUseId, 0) = NVL(smu.endUseId, 0)
AND NVL(dsku.EndCustomerId, 0) = NVL(smu.EndCustomerId, 0)
LEFT JOIN EV#SiteMaterialUsages d2 ON d2.Id = dsku.Id
WHERE smu.Status = 1
|
| IHDP#ConvertSkuEVG |
|---|
SELECT smu.Id SkuId, smu.LocationId, smu.MaterialId, smu.endUseId, smu.EndCustomerId, pc.Id, pc.BomId,
bm.MaterialId SourceMaterialId, deu.Id SourceEndUseId, mps.CODE10 ManfPlant, p.ConvertLocationid, dsku.Id
SourceSkuId, Multiplier, Divider,
s2.LocationCode, s2.MaterialCode, s2.EndUseCode, s2.EndCustomerCode, s2.Status,
p.ConvertLocationCode DestinationLocationCode, dm.MaterialCode DestinationMaterialCode,
deu.EndUseCode DestinationEndUseCode, ConvertLocationCode DestinationEndCustomerCode,
d2.Status DestinationStatus
FROM SiteMaterialUsages smu
JOIN EV#SiteMaterialUsages s2 ON s2.Id = smu.Id
JOIN Productionconfigurations pc
ON pc.MaterialId = smu.MaterialId
JOIN BoMMaterials bm
ON bm.BomId = pc.BomId
JOIN (SELECT cl.ConvertLocationId, cl.LocationCode ConvertLocationCode, sp.*
FROM SourcePriorities sp
JOIN Locations l
ON sp.SourcelocationId = l.Id
JOIN IHDP#ConvertLocations cl
ON cl.SiteId = l.SiteId
JOIN Workcentres wc on wc.Id = sp.WorkcentreId
JOIN WorkcentreTypes wct on wct.Id = wc.WorkcentreTypeId
AND HasInventory = 0
ANd IsActive = 1) p
ON p.Sitematerialusageid = smu.Id
AND p.Priority = 1
AND p.ConvertLocationId != smu.LocationId
JOIN Materialpropsspec mps
ON mps.MAterialID = bm.MaterialId
JOIN EndUses deu ON deu.EndUseCode = 'NA-' || mps.Code10
JOIN Materials dm ON dm.Id = bm.MaterialId
JOIN Locations dl ON dl.LocationCode = ConvertLocationCode
LEFT JOIN SiteMaterialUsages dsku
ON dsku.LocationID = p.ConvertLocationId
AND dsku.MaterialID = bm.MaterialId
AND NVL(dsku.endUseId, 0) = NVL(deu.Id, 0)
AND dsku.EndCustomerId IS NULL
LEFT JOIN EV#SiteMaterialUsages d2 ON d2.Id = dsku.Id
WHERE smu.Status = 1
|
| IHDP#ConvertSkuOnSameLocation |
|---|
SELECT smu.Id SkuId, smu.LocationId, smu.MaterialId, pc.Id, pc.BomId, bm.MaterialId SourceMaterialId,
smu.LocationId ConvertLocationid, dsku.Id SourceSkuId, Multiplier, Divider
FROM SiteMaterialUsages smu
JOIN Productionconfigurations pc
ON pc.MaterialId = smu.MaterialId
JOIN BoMMaterials bm
ON bm.BomId = pc.BomId
LEFT JOIN SiteMaterialUsages dsku
ON dsku.LocationID = smu.LocationId
AND dsku.MaterialID = bm.MaterialId
WHERE smu.Status = 1
|
| IHDP#DayForSnapshot |
|---|
WITH DefaultCurrencies AS (SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.forecastSnapshotId, fb.SiteMaterialUsageId, cs.DateFrom,
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)) FINAL,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(SystemPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * SystemPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum))) SystemPrice,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(ForecastedPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * ForecastedPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum))) ForecastedPrice,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(SystemPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * SystemPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetSystemPrice,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(ForecastedPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * ForecastedPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetForecastedPrice,
NVL(AVG(ep.Price),0) ReferencePrice,
NVL(AVG(ep.Price),0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) TargetReferencePrice,
NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) ReferencePriceCoef
FROM ForecastSnapshotBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ForecastWeeklyCoefs fc
ON fb.DateFrom = fc.DateFrom
AND fb.FinalWeeklyCoefId = fc.Id
JOIN CalendarSources CS
ON cs.Calendarid = fc.CalendarId
AND cs.DateFromIw = fc.DateFromIw
AND cs.DateFromMonth = fc.DateFrom
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON ep.SiteMaterialUsageId = fb.SiteMaterialUsageId
AND cs.DateFrom BETWEEN ep.DateFrom AND ep.DateTo
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.ForecastSnapshotId, fb.SiteMaterialUsageId, cs.DateFrom
ORDER BY 1, 2
|
| IHDP#DaySystemForecast |
|---|
WITH DefaultCurrencies AS
(SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.SiteMaterialUsageId, cs.DateFrom,
SUM(DECODE(WeekSum, 0, 0, System * sc.Coef * IsWorkingDay / WeekSum)) System,
SUM(DECODE(WeekSum, 0, 0, Customer * cc.Coef * IsWorkingDay / WeekSum)) Customer,
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)) FINAL,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(SystemPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * SystemPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum))) SystemPrice,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(ForecastedPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * ForecastedPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum))) ForecastedPrice,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(SystemPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * SystemPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetSystemPrice,
DECODE(SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)), 0, AVG(ForecastedPrice),
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum) * ForecastedPrice) /
SUM(DECODE(WeekSum, 0, 0, FINAL * fc.Coef * IsWorkingDay / WeekSum)))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetForecastedPrice,
NVL(AVG(ep.Price),0) ReferencePrice,
NVL(AVG(ep.Price),0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) TargetReferencePrice,
NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) ReferencePriceCoef
FROM ForecastBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ForecastWeeklyCoefs fc
ON (fb.DateFrom = fc.DateFrom AND fb.FinalWeeklyCoefId = fc.Id)
JOIN ForecastWeeklyCoefs cc
ON (fb.DateFrom = cc.DateFrom AND cc.DateFromIW = fc.DateFromIW AND fb.CustomerWeeklyCoefId = cc.Id)
JOIN ForecastWeeklyCoefs sc
ON (fb.DateFrom = sc.DateFrom AND sc.DateFromIW = fc.DateFromIW AND fb.SystemWeeklyCoefId = sc.Id)
JOIN CalendarSources CS
ON cs.Calendarid = fc.CalendarId
AND cs.DateFromIw = fc.DateFromIw
AND cs.DateFromMonth = fc.DateFrom
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON (ep.SiteMaterialUsageId = fb.SiteMaterialUsageId AND cs.DateFrom BETWEEN ep.DateFrom AND ep.DateTo)
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.SiteMaterialUsageId, cs.DateFrom
ORDER BY 1, 2
|
| IHDP#ForecastAccuracy |
|---|
WITH b AS
(SELECT b.Name, Key, VALUE FROM Bundles b JOIN BundleValues bv ON bv.BundleId = b.Id)
SELECT t.SiteMaterialUsageId, DateFrom,
SUM(OriginalSystem) OriginalSystem, SUM(SYSTEM) System,
SUM(Customer) Customer, SUM(FINAL) FINAL,
SUM(Upper) Upper, SUM(Lower) Lower,
SUM(UnadjustedHistory) UnadjustedHistory,
SUM(History) History,
SUM(SupersededHistory) SupersededHistory,
SUM(AllSupersededHistory) AllSupersededHistory,
SUM(mtdSupersededHistory) mtdHistory,
SUM(Budget) Budget,
SUM(Orders) Orders,
SUM(case when ms.SiteMaterialUsageId IS NULL THEN NVL(OrdersIncludeSupercessions,0) + NVL(Orders,0) ELSE 0 END) OrdersIncludeSupercessions,
SUM(mtdOrders) mtdOrders, SUM(Allocation) Allocation,
SUM(DECODE(SIGN(dateFrom - f.startDate), -1, history, FINAL)) FinalOrActual,
SUM(DECODE(SIGN(dateFrom - f.startDate), -1, supersededHistory, FINAL)) FinalOrSupersededActual,
MAX(ForecastMethodName) ForecastMethod, MAX(GroupedForecastMethodName) GroupedForecastMethod,
MAX(MonthsOut) MonthsOut, SUM(FittedHistory) FittedHistory, MAX(Seasonality) Seasonality,
MAX(Trend) Trend, MAX(GroupedSeasonality) GroupedSeasonality, MAX(GroupedTrend) GroupedTrend
FROM (
SELECT fb.SiteMaterialUsageId, fb.DateFrom,
Months_Between(fb.Datefrom, f.Startdate) MonthsOut, fb.OriginalSystem, fb.SYSTEM, fb.Customer,
fb.FINAL, fb.lower, fb.Upper, NULL UnadjustedHistory, NULL History, NULL mtdHistory,
NULL SupersededHistory, NULL AllSupersededHistory, NULL mtdSupersededHistory, NULL FittedHistory, NULL Budget,
NULL Orders, NULL OrdersIncludeSupercessions, NULL mtdOrders, NULL Allocation, fm.ForecastMethodName,
fmg.ForecastMethodName GroupedForecastMethodName,
s.Value Seasonality, t.Value Trend, gs.Value GroupedSeasonality, gt.Value GroupedTrend
FROM ForecastBodies fb
JOIN Forecasts f
ON fb.ForecastId = f.Id
LEFT JOIN ForecastStatistics fs
ON fb.Forecastid = fs.ForecastId
AND fb.SiteMaterialUsageID = fs.SiteMaterialUsageId
LEFT JOIN ForecastMethods fm
ON fs.ForecastMethodId = fm.Id
LEFT JOIN ForecastMethods fmg
ON fs.GroupedForecastMethodId = fmg.Id
LEFT JOIN b s
ON s.Name = 'ForecastSeasonal'
AND s.Key = to_char(fs.Seasonality)
LEFT JOIN b t
ON t.Name = 'ForecastTrend'
AND t.Key = to_char(fs.Trend)
LEFT JOIN b gs
ON gs.Name = 'ForecastSeasonal'
AND gs.Key = to_char(fs.GroupedSeasonality)
LEFT JOIN b gt
ON gt.Name = 'ForecastTrend'
AND gt.Key = to_char(fs.GroupedTrend)
UNION ALL
SELECT SiteMaterialUsageId, DateFrom,
NULL MonthsOut, NULL OriginalSystem, NULL System, NULL Customer,
NULL Final, NULL Lower, NULL Upper, Weight UnadjustedHistory, AdjustedHistoryWeight History, mtdHistory,
NULL SupersededHistory, NULL AllSupersededHistory, NULL mtdSupersededHistory, NULL FittedHistory, NULL Budget,
NULL Orders, NULL OrdersIncludeSupercessions, NULL mtdOrders, NULL Allocation, NULL ForecastMethodName,
NULL GroupedForecastMethodName, NULL Seasonality, NULL Trend, NULL GroupedSeasonality, NULL GroupedTrend
FROM IH#MonthlyUsageHistories
UNION ALL
SELECT SiteMaterialUsageId, DateFrom,
NULL MonthsOut, NULL OriginalSystem, NULL System, NULL Customer,
NULL Final, NULL Lower, NULL Upper, NULL UnadjustedHistory, NULL History, NULL mtdHistory,
AdjustedSupersededHistory SupersededHistory, NULL AllSupersededHistory, mtdSupersededHistory,
NULL FittedHistory, NULL Budget,
NULL Orders, NULL OrdersIncludeSupercessions, NULL mtdOrders, NULL Allocation, NULL ForecastMethodName,
NULL GroupedForecastMethodName, NULL Seasonality, NULL Trend, NULL GroupedSeasonality, NULL GroupedTrend
FROM IH#MonthlySupersededHistory
UNION ALL
SELECT SiteMaterialUsageId, DateFrom,
NULL MonthsOut, NULL OriginalSystem, NULL System, NULL Customer,
NULL Final, NULL Lower, NULL Upper, NULL UnadjustedHistory, NULL History, NULL mtdHistory,
NULL SupersededHistory, AllSupersededHistory AllSupersededHistory, NULL mtdSupersededHistory,
NULL FittedHistory, NULL Budget,
NULL Orders, NULL OrdersIncludeSupercessions, NULL mtdOrders, NULL Allocation, NULL ForecastMethodName,
NULL GroupedForecastMethodName, NULL Seasonality, NULL Trend, NULL GroupedSeasonality, NULL GroupedTrend
FROM IH#MonthlyAllSupersededHistory
UNION ALL
SELECT SiteMaterialUsageId, DateFrom, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, FINAL Budget,
NULL Orders, NULL OrdersIncludeSupercessions, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL
FROM IH#ForecastBudgets
UNION ALL
SELECT SiteMaterialUsageId, TRUNC(DeliveryDate, 'mm'), NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL,
SUM(FinalWeight) Orders, NULL OrdersIncludeSupercessions,
SUM(DECODE(SIGN(DeliveryDate - i.internalDate), -1, finalWeight, 0)) mtdOrders,
NULL, NULL, NULL, NULL, NULL, NULL, NULL
FROM OrderLines ol, (SELECT TRUNC(core.getInternalDate) internalDate FROM DUAL) i, OrderLineStatuses ols
WHERE ols.Id = ol.OrderLineStatusId
AND OrderLineStatusCode IN ('Firm', 'Completed')
GROUP BY SiteMaterialUsageId, TRUNC(DeliveryDate, 'mm')
UNION ALL
SELECT ms.OnSiteMaterialUsageId, TRUNC(DeliveryDate, 'mm'), NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL,
NULL Orders, SUM(FinalWeight) OrdersIncludeSupercessions,
NULL mtdOrders,
NULL, NULL, NULL, NULL, NULL, NULL, NULL
FROM OrderLines ol, OrderLineStatuses ols,
IH#MaterialSupercessions ms
WHERE ols.Id = ol.OrderLineStatusId
AND OrderLineStatusCode IN ('Firm', 'Completed')
AND ol.SiteMaterialUsageId = ms.SiteMaterialUsageId
GROUP BY ms.OnSiteMaterialUsageId, TRUNC(DeliveryDate, 'mm')
UNION ALL
SELECT SiteMaterialUsageId, DeliveryMonth, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL OrdersIncludeSupercessions, NULL mtdOrders, SUM(Customer) Allocation,
NULL, NULL, NULL, NULL, NULL, NULL
FROM AllocationBodies
GROUP BY SiteMaterialUsageId, DeliveryMonth
UNION ALL
SELECT SiteMaterialUsageId, TRUNC(DateFrom, 'mm'), NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, SUM(Weight) FittedHistory,
NULL Budget, NULL Orders, NULL OrdersIncludeSupercessions, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL
FROM FittedHistories
GROUP BY SiteMaterialUsageId, TRUNC(DateFrom, 'mm')
) t
CROSS JOIN (SELECT NVL(MAX(startDate), SYSDATE + 1000000) startDate FROM Forecasts) f
LEFT JOIN (SELECT DISTINCT SiteMaterialUsageId FROM IH#MaterialSupercessions) ms on ms.SiteMaterialUsageId = t.SiteMaterialUsageId
GROUP BY t.SiteMaterialUsageId, t.DateFrom
|
| IHDP#ForecastAccuracy_FBH |
|---|
SELECT t.SiteMaterialUsageId, DateFrom,
SUM(OriginalSystem) OriginalSystem, SUM(SYSTEM) System,
SUM(Customer) Customer, SUM(FINAL) FINAL,
SUM(Upper) Upper, SUM(Lower) Lower,
SUM(UnadjustedHistory) UnadjustedHistory,
SUM(History) History,
SUM(MtdHistory) MtdHistory,
SUM(Budget) Budget
FROM (
SELECT fb.SiteMaterialUsageId, fb.DateFrom,
Months_Between(fb.DateFrom, f.StartDate) MonthsOut, fb.OriginalSystem, fb.SYSTEM, fb.Customer,
fb.FINAL, fb.lower, fb.Upper, NULL UnadjustedHistory, NULL History, NULL mtdHistory,
NULL Budget
FROM ForecastBodies fb
JOIN Forecasts f
ON fb.ForecastId = f.Id
UNION ALL
SELECT SiteMaterialUsageId, DateFrom,
NULL MonthsOut, NULL OriginalSystem, NULL System, NULL Customer,
NULL Final, NULL Lower, NULL Upper, Weight UnadjustedHistory, AdjustedHistoryWeight History, mtdHistory,
NULL Budget
FROM IH#MonthlyUsageHistories_FBH
UNION ALL
SELECT SiteMaterialUsageId, DateFrom,
NULL MonthsOut, NULL OriginalSystem, NULL System, NULL Customer,
NULL Final, NULL Lower, NULL Upper, NULL UnadjustedHistory, NULL History, NULL mtdHistory,
FINAL Budget
FROM IH#ForecastBudgets
) t
CROSS JOIN (SELECT NVL(MAX(startDate), SYSDATE + 1000000) startDate FROM Forecasts) f
GROUP BY t.SiteMaterialUsageId, t.DateFrom
|
| IHDP#ForecastChangeDetails |
|---|
WITH a AS
(SELECT NAME AS FieldName
FROM IH#Datasourcefields
WHERE UPPER(DataSourceName) = UPPER('IF$ForecastCollaboration')
AND filtered = 1)
SELECT v.ForecastChangeId, v.FieldName, fc.VALUE
FROM (SELECT ID ForecastChangeId, FieldName FROM ForecastChanges CROSS JOIN a) v
LEFT JOIN ForecastChangeDetails fc
ON (fc.FieldName = v.FieldName AND fc.ForecastChangeId = v.ForecastChangeId)
|
| IHDP#ForecastMethodsSku |
|---|
WITH methods AS
(
SELECT fmr.Id, ds.SiteMaterialUsageId, fmr.ForecastMethodId, RuleWeighting
FROM ForecastMethodRules fmr
JOIN Hierarchypropertydetails d
ON d.Id = fmr.DetailId
JOIN IH#DetailsSku ds on ds.DetailId = d.Id
WHERE fmr.DetailId IS NOT NULL
UNION ALL
SELECT fmr.Id, fmr.SiteMaterialUsageId, fmr.ForecastMethodId, RuleWeighting
FROM ForecastMethodRules fmr
JOIN SiteMaterialUsages smu
ON smu.Id = fmr.SiteMaterialUsageId
WHERE fmr.SiteMaterialUsageId IS NOT NULL
),
q as
(
SELECT m.Id, SiteMaterialUsageId, ForecastMethodId, l.Id AS LaunchProfileId,
ROW_NUMBER() OVER(PARTITION BY SitematerialUsageId ORDER BY RuleWeighting DESC) AS rn
FROM methods m
LEFT JOIN LaunchProfiles l
ON l.ForecastMethodRuleId = m.Id
)
SELECT * FROM q where rn = 1
|
| IHDP#HistoryAndOrdersPrices |
|---|
SELECT uh.SiteMaterialUsageId, smu.MaterialId, Datefrom, Weight,
DECODE(IsHistory, 1, Weight, 0) HistoryWeight,
DECODE(IsHistory, 0, Weight, 0) OrdersWeight,
NVL(uh.PriceQuantityUnitId, core.BaseWeightUnitId) PriceQuantityUnitId,
NVL(uh.CurrencyId, core.InternalCurrencyId) CurrencyId,
Price, UnitName, CurrencyName,
NVL(l.CurrencyId, core.InternalCurrencyId) TargetCurrencyId,
CASE WHEN DateFrom = LAST_VALUE(DateFrom) OVER (PARTITION BY SiteMaterialUsageId
ORDER BY DateFrom
RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) THEN 1 ELSE 0 END IsLastKnownPeriod,
IsHistory
FROM (
SELECT SiteMaterialUsageId, DateFrom, NVL(AdjustedWeight, Weight) Weight, Price, PriceQuantityUnitId, CurrencyId, 1 IsHistory
FROM Usagehistories
WHERE Price IS NOT NULL
AND NVL(AdjustedWeight, Weight) > 0
UNION ALL
SELECT SiteMaterialUsageId, DeliveryDate DateFrom, FinalWeight Weight, Price, UnitId, CurrencyId, 0 IsHistory
FROM OrderLines ol
JOIN OrderLineStatuses ols ON ols.Id = ol.OrderLineStatusId
WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = ol.WorkcentreId)
AND Price IS NOT NULL
AND FinalWeight > 0
AND OrderLineStatusCode IN ('Firm', 'Completed')
) uh
JOIN SiteMaterialUsages smu
ON smu.Id = uh.SiteMaterialUsageId
JOIN Locations l ON l.Id = smu.LocationId
JOIN Currencies c
ON c.Id = NVL(uh.CurrencyId, core.InternalCurrencyId)
JOIN Units u
ON u.Id = NVL(uh.PriceQuantityUnitId, core.BaseWeightUnitId)
|
| IHDP#HistoryStartDate |
|---|
WITH AggregatedHistory AS (
SELECT
uh.SiteMaterialUsageId,
MIN(TRUNC(uh.DateFrom, 'MM')) AS MinHistoryDate
FROM UsageHistories uh
WHERE NVL(uh.AdjustedWeight, uh.Weight) > 0
GROUP BY uh.SiteMaterialUsageId
)
SELECT
smu.Id AS SiteMaterialUsageId,
COALESCE(smu.HistoryStartDate, ah.MinHistoryDate) AS HistoryStartDate
FROM SiteMaterialUsages smu
LEFT JOIN AggregatedHistory ah
ON ah.SiteMaterialUsageId = smu.Id
WHERE NOT EXISTS (
SELECT 1
FROM Workcentres wc
WHERE wc.LocationId = smu.LocationId
)
AND COALESCE(smu.HistoryStartDate, ah.MinHistoryDate) IS NOT NULL
|
| IHDP#MonthForSnapshot | Monthly forecast snapshot used as SNP input Look to procedure populateSNPForecast |
|---|
WITH DefaultCurrencies AS
(SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.ForecastSnapshotId, fb.SiteMaterialUsageId, fb.DateFrom, FINAL, SystemPrice, ForecastedPrice,
SystemPrice * NVL((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider,1) TargetSystemPrice,
ForecastedPrice * NVL((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider,1)
TargetForecastedPrice,
NVL(ep.Price,0) ReferencePrice,
NVL(ep.Price,0) * NVL((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider,1)
TargetReferencePrice,
NVL((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider,1) PriceCoef,
NVL((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider,1) ReferencePriceCoef
FROM ForecastSnapshotBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON (ep.SiteMaterialUsageId = fb.SiteMaterialUsageId AND fb.DateFrom BETWEEN ep.DateFrom AND ep.DateTo)
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
|
| IHDP#MonthlyUsageHistories |
|---|
WITH RawHistory AS (
SELECT
uh.SiteMaterialUSageId, uh.DateFrom,
uh.Weight, uh.AdjustedWeight,
smu.HistoryStartDate AS ManualStartDate,
MIN(CASE WHEN NVL(uh.AdjustedWeight, uh.Weight) > 0 THEN TRUNC(uh.DateFrom, 'MM') END)
OVER (PARTITION BY uh.SiteMaterialUsageId) AS CalcMinDate
FROM UsageHistories uh
JOIN SiteMaterialUsages smu ON uh.SiteMaterialUSageId = smu.Id
WHERE NOT EXISTS (
SELECT 1 FROM Workcentres wc WHERE wc.LocationId = smu.LocationId
)
)
SELECT SiteMaterialUSageId,
TRUNC(DateFrom, 'MM') AS DateFrom,
SUM(Weight) AS Weight,
GREATEST(0, SUM(NVL(AdjustedWeight, Weight))) AS HistoryWeight
FROM RawHistory
WHERE DateFrom >= COALESCE(ManualStartDate, CalcMinDate)
GROUP BY SiteMaterialUSageId, TRUNC(DateFrom, 'MM')
|
| IHDP#MonthSystemForecast | System monthly forecast used as SNP input |
|---|
SELECT fb.SiteMaterialUsageId, fb.DateFrom, System, Customer, FINAL,
SystemPrice,
ForecastedPrice,
SystemPrice * NVL(er.RateRatio,0) TargetSystemPrice,
ForecastedPrice * NVL(er.RateRatio,0) TargetForecastedPrice,
NVL(ep.Price, 0) ReferencePrice,
NVL(ep.Price, 0) * NVL(rer.RateRatio,0) TargetReferencePrice,
er.RateRatio,
rer.RateRatio ReferenceRateRatio
FROM ForecastBodies fb
LEFT JOIN IH#MonthlyExchangeRates er
ON er.FromCurrencyId = fb.PriceCurrencyId
AND er.ToCurrencyId = core.InternalCurrencyId()
AND er.DateFrom = fb.DateFrom
LEFT JOIN IH#ExpandedPrices ep
ON (ep.SiteMaterialUsageId = fb.SiteMaterialUsageId AND fb.DateFrom BETWEEN ep.DateFrom AND ep.DateTo)
LEFT JOIN IH#MonthlyExchangeRates rer
ON rer.FromCurrencyId = ep.CurrencyId
AND rer.ToCurrencyId = core.InternalCurrencyId()
AND rer.DateFrom = fb.DateFrom
|
| IHDP#OrderLinePrices |
|---|
SELECT ol.SiteMaterialUsageId, ol.MaterialId, DeliveryDate, FinalWeight FinalWeight,
u.Id PriceQuantityUnitId,
COALESCE(ol.CurrencyId, core.InternalCurrencyId) CurrencyId,
Price, UnitName, CurrencyName,
NVL(l.CurrencyId, core.InternalCurrencyId) TargetCurrencyId,
CASE WHEN DeliveryDate = LAST_VALUE(DeliveryDate) OVER (PARTITION BY SiteMaterialUsageId
ORDER BY DeliveryDate
RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) THEN 1 ELSE 0 END IsLastKnownPeriod
FROM OrderLines ol
JOIN SiteMaterialUsages smu
ON smu.Id = ol.SiteMaterialUsageId
JOIN Locations l ON l.Id = smu.LocationId
JOIN Currencies c
ON c.Id = NVL(ol.CurrencyId, core.InternalCurrencyId)
JOIN Units u
ON u.Id = core.BaseWeightUnitId
JOIN OrderLineStatuses ols ON ols.Id = ol.OrderLineStatusId
WHERE Price IS NOT NULL
AND FinalWeight > 0
AND NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = smu.LocationId)
AND OrderLineStatusCode IN ('Firm', 'Completed')
|
| IHDP#OrderWorkingDays |
|---|
WITH d AS
(SELECT core.getInternalMonth() AS CurrentMonth, CORE.getTruncatedInternalDate() AS CurrentDate,
Value MethodName
FROM SystemParameters
WHERE ParameterName='OrdersVsFinal'),
skumethod AS
(SELECT SiteMaterialUsageId, d.CurrentDate, d.CurrentMonth,
LEAST(GREATEST(MAX(DeliveryDate), d.CurrentDate - 1), LAST_DAY(d.CurrentMonth)) MaxDeliveryDate
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
CROSS JOIN d
WHERE TRUNC(DeliveryDate, 'mm') >= d.CurrentMonth
AND OrderLineStatusCode IN ('Completed', 'Firm')
GROUP BY SiteMaterialUsageId, d.CurrentDate, d.CurrentMonth),
locmethod AS
(SELECT LocationId, d.CurrentDate, d.CurrentMonth,
LEAST(GREATEST(MAX(DeliveryDate), d.CurrentDate - 1), LAST_DAY(d.CurrentMonth)) MaxDeliveryDate
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
CROSS JOIN d
WHERE TRUNC(DeliveryDate, 'mm') >= d.CurrentMonth
AND OrderLineStatusCode IN ('Completed', 'Firm')
GROUP BY LocationId, d.CurrentDate, d.CurrentMonth),
CalSources AS
(SELECT CalendarId, DateFrom, IsWorkingDay,
SUM(IsWorkingday) OVER(PARTITION BY CalendarId ORDER BY DateFrom) WorkingDays,
SUM(IsWorkingDay) OVER(PARTITION BY CalendarId) TotalWorkingDays
FROM CalendarSources s
JOIN d
ON s.DATEFROMMONTH = d.CurrentMonth)
SELECT s.SiteMaterialUsageId, d.CurrentMonth,
NVL(s1.Workingdays, GREATEST(0, s2.WorkingDays - 1)) OrdersWorkingDays,
s2.WorkingDays,
s2.Totalworkingdays
FROM IH#CustomerSkuCalendars s
CROSS JOIN d
JOIN CalSources s2
ON s2.CalendarId = s.CalendarId
AND s2.DateFrom = d.CurrentDate
LEFT JOIN skumethod
ON skumethod.SiteMaterialUsageId = s.SiteMaterialUsageId
LEFT JOIN locmethod
ON locmethod.LocationId = s.LocationId
LEFT JOIN CalSources s1
ON s1.CalendarId = s.CalendarId
AND s1.DateFrom = DECODE(d.MethodName, 'Sku', skumethod.MaxDeliveryDate, locmethod.MaxDeliveryDate)
|
| IHDP#QuarterForSnapshot |
|---|
WITH DefaultCurrencies AS (SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.forecastSnapshotId, fb.SiteMaterialUsageId, TRUNC(fb.DateFrom, 'Q') DateFrom,
SUM(FINAL) FINAL,
DECODE(SUM(FINAL), 0, AVG(SystemPrice), SUM(FINAL * SystemPrice) / SUM(FINAL)) SystemPrice,
DECODE(SUM(FINAL), 0, AVG(ForecastedPrice), SUM(FINAL * ForecastedPrice) / SUM(FINAL)) ForecastedPrice,
DECODE(SUM(FINAL), 0, AVG(SystemPrice), SUM(FINAL * SystemPrice) / SUM(FINAL))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetSystemPrice,
DECODE(SUM(FINAL), 0, AVG(ForecastedPrice), SUM(FINAL * ForecastedPrice) / SUM(FINAL))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetForecastedPrice,
NVL(AVG(ep.Price),0) ReferencePrice,
NVL(AVG(ep.Price),0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) TargetReferencePrice,
NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) ReferencePriceCoef
FROM ForecastSnapshotBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON ep.SiteMaterialUsageId = fb.SiteMaterialUsageId
AND fb.DateFrom BETWEEN ep.DateFrom AND ep.DateTo
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.forecastSnapshotId, fb.SiteMaterialUsageId, TRUNC(fb.DateFrom, 'Q')
ORDER BY 1, 2
|
| IHDP#QuarterSystemForecast |
|---|
WITH DefaultCurrencies AS
(SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.SiteMaterialUsageId, TRUNC(fb.DateFrom, 'Q') DateFrom,
SUM(System) System, SUM(Customer) Customer, SUM(FINAL) FINAL,
DECODE(SUM(FINAL), 0, AVG(SystemPrice), SUM(FINAL * SystemPrice) / SUM(FINAL)) SystemPrice,
DECODE(SUM(FINAL), 0, AVG(ForecastedPrice), SUM(FINAL * ForecastedPrice) / SUM(FINAL)) ForecastedPrice,
DECODE(SUM(FINAL), 0, AVG(SystemPrice), SUM(FINAL * SystemPrice) / SUM(FINAL))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetSystemPrice,
DECODE(SUM(FINAL), 0, AVG(ForecastedPrice), SUM(FINAL * ForecastedPrice) / SUM(FINAL))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetForecastedPrice,
NVL(AVG(ep.Price),0) ReferencePrice,
NVL(AVG(ep.Price),0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) TargetReferencePrice,
NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) ReferencePriceCoef
FROM ForecastBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON (ep.SiteMaterialUsageId = fb.SiteMaterialUsageId AND fb.DateFrom BETWEEN ep.DateFrom AND ep.DateTo)
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.SiteMaterialUsageId, TRUNC(fb.DateFrom, 'Q')
ORDER BY 1, 2
|
| IHDP#SourcingDates |
|---|
WITH SourceData AS
(
SELECT SiteMaterialUSageId, MaterialCode, DateFrom StartDate, NVL(DateTo, to_date('01-01-2050', 'DD-MM-YYYY')) FinishDate, TRUNC(core.getInternalDate) CurrentDate
FROM SourcePriorities sp
JOIN Materials m ON m.Id = sp.DestinationMaterialId
WHERE Priority = 1
AND sp.IsActive = 1
AND NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = sp.DestinationLocationId)
AND NOT EXISTS (SELECT 1
FROM Ih#workcentres w
WHERE WorkcentreTypeName IN ('Virtual Paper Machine', 'Virtual Warehouse')
AND w.WorkcentreId = sp.WorkcentreId)
),
grp_starts AS /* remove gaps */
(SELECT SiteMaterialUSageId, MaterialCode, StartDate, FinishDate, CurrentDate, MAX(FinishDate + 1) over(PARTITION BY SiteMaterialUSageId ORDER BY StartDate,
FinishDate rows BETWEEN unbounded preceding AND 1 preceding) mm,
CASE
WHEN StartDate > MAX(FinishDate + 1) over(PARTITION BY SiteMaterialUSageId ORDER BY StartDate,
FinishDate rows BETWEEN unbounded preceding AND 1 preceding)
AND LAG(StartDate, 1) over(PARTITION BY SiteMaterialUSageId ORDER BY StartDate, FinishDate) > CurrentDate
THEN
0
WHEN StartDate > MAX(FinishDate + 1) over(PARTITION BY SiteMaterialUSageId ORDER BY StartDate,
FinishDate rows BETWEEN unbounded preceding AND 1 preceding) THEN
1
ELSE
0
END grp_start,
LAG(StartDate, 1) over(PARTITION BY SiteMaterialUSageId ORDER BY StartDate,
FinishDate) PrevStartDate
FROM sourceData)
/*SELECT * FROM grp_starts*/
,
grps AS /* get group numbers */
(SELECT SiteMaterialUSageId, MaterialCode, StartDate, FinishDate, CurrentDate,
SUM(grp_start) over(PARTITION BY SiteMaterialUsageId ORDER BY StartDate, FinishDate) grp
FROM grp_starts)
/*SELECT * FROM grps*/
,
periods AS /* select range attributes */
(
SELECT SiteMaterialUSageId, MaterialCode, grp,
MIN(StartDate) over(PARTITION BY SiteMaterialUSageId, grp) StartDate,
MAX(FinishDate) over(PARTITION BY SiteMaterialUSageId, grp) FinishDate,
MAX(FinishDate) over(PARTITION BY SiteMaterialUSageId, grp) - MIN(StartDate) over(PARTITION BY SiteMaterialUSageId, grp) lengthPeriod,
CASE WHEN MIN(StartDate) over(PARTITION BY SiteMaterialUSageId, grp) > CurrentDate THEN 1 ELSE 0 END IsFuturePeriod,
CASE WHEN CurrentDate BETWEEN MIN(StartDate) over(PARTITION BY SiteMaterialUSageId, grp)
AND MAX(FinishDate) over(PARTITION BY SiteMaterialUSageId, grp) THEN 1 ELSE 0 END IsLivePeriod
FROM grps
)
/*select p.* from Periods p*/
SELECT SiteMaterialUSageId, MaterialCode, StartDate SourcingStartDate, NULLIF(FinishDate, to_date('01-01-2050', 'DD-MM-YYYY')) SourcingEndDate, rr, isFuturePeriod, isLivePeriod
FROM
(
SELECT SiteMaterialUSageId, MaterialCode, grp, StartDate, FinishDate, lengthPeriod, isFuturePeriod, isLivePeriod,
row_number() OVER(PARTITION BY SiteMaterialUSageId ORDER BY isFuturePeriod, lengthPeriod DESC) rr
FROM periods
) t
WHERE rr = 1
|
| IHDP#UsageHistoryPrices |
|---|
SELECT uh.SiteMaterialUsageId, smu.MaterialId, Datefrom, NVL(AdjustedWeight, Weight) HistoryWeight,
NVL(uh.PriceQuantityUnitId, core.BaseWeightUnitId) PriceQuantityUnitId,
COALESCE(uh.CurrencyId, core.InternalCurrencyId) CurrencyId,
Price, UnitName, CurrencyName,
NVL(l.CurrencyId, core.InternalCurrencyId) TargetCurrencyId,
CASE WHEN DateFrom = LAST_VALUE(DateFrom) OVER (PARTITION BY SiteMaterialUsageId
ORDER BY DateFrom
RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) THEN 1 ELSE 0 END IsLastKnownPeriod
FROM UsageHistories uh
JOIN SiteMaterialUsages smu
ON smu.Id = uh.SiteMaterialUsageId
JOIN Locations l ON l.Id = smu.LocationId
JOIN Currencies c
ON c.Id = COALESCE(uh.CurrencyId, core.InternalCurrencyId)
JOIN Units u
ON u.Id = NVL(uh.PriceQuantityUnitId, core.BaseWeightUnitId)
WHERE Price IS NOT NULL
AND NVL(AdjustedWeight, Weight) > 0
|
| IHDP#WeekForSnapshot | Weekly forecast snapshot used as SNP input |
|---|
WITH DefaultCurrencies AS (SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.ForecastSnapshotId, fb.SiteMaterialUsageId, fc.DateFromIW DateFrom,
SUM(FINAL * fc.Coef) FINAL,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(SystemPrice), SUM(FINAL * fc.Coef * SystemPrice) / SUM(FINAL * fc.Coef))
SystemPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(ForecastedPrice),
SUM(FINAL * fc.Coef * ForecastedPrice) / SUM(FINAL * fc.Coef)) ForecastedPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(SystemPrice), SUM(FINAL * fc.Coef * SystemPrice) / SUM(FINAL * fc.Coef))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetSystemPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(ForecastedPrice),
SUM(FINAL * fc.Coef * ForecastedPrice) / SUM(FINAL * fc.Coef))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetForecastedPrice,
NVL(AVG(ep.Price),0) ReferencePrice,
NVL(AVG(ep.Price),0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1)
TargetReferencePrice,
NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) ReferencePriceCoef
FROM ForecastSnapshotBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ForecastWeeklyCoefs fc
ON fc.Id = fb.FinalWeeklyCoefId AND fb.DateFrom = fc.DateFrom
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON (ep.SiteMaterialUsageId = fb.SiteMaterialUsageId AND fc.DateFromIW BETWEEN ep.DateFrom AND ep.DateTo)
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.ForecastSnapshotId, fb.SiteMaterialUsageId, DateFromIW
ORDER BY 1,2,3
|
| IHDP#WeeklyForecastBodies |
|---|
WITH c AS (SELECT wc.Id, wc.DateFromIW, wc.DateFrom, wc.Coef FROM ForecastWeeklyCoefs wc ) SELECT fb.SiteMaterialUsageID, smu.MaterialId, fc.DateFromIW, fc.DateFrom, system * sc.Coef System, Customer * cc.Coef Customer, FINAL * fc.Coef Final, IsWorking FROM ForecastBodies fb, c fc, c sc, c cc, SiteMaterialUsages smu WHERE fc.Id = fb.FinalWeeklyCoefid AND fb.DateFrom = fc.DateFrom AND cc.Id = fb.CustomerWeeklyCoefid AND fb.DateFrom = cc.DateFrom AND sc.Id = fb.SystemWeeklyCoefid AND fb.DateFrom = sc.DateFrom AND sc.DateFromIW = fc.DateFromIW AND cc.DateFromIw = fc.DatefromIw AND sc.Datefrom = fc.DateFrom AND cc.Datefrom = fc.DateFrom AND smu.Id = fb.SiteMaterialUsageId |
| IHDP#WeeklyForecastBudgets |
|---|
SELECT fb.SiteMaterialUsageID, fc.DateFromIW, SUM(FINAL * fc.Coef) Final FROM IH#ForecastBudgets fb, ForecastWeeklyCoefs fc WHERE fc.Id = fb.FinalWeeklyCoefid AND fb.DateFrom = fc.DateFrom group by fb.ForecastSnapshotId, fb.SiteMaterialUsageID, fc.DateFromIW |
| IHDP#WeeklyForecastSnapshots |
|---|
SELECT fb.ForecastSnapshotId, fb.SiteMaterialUsageID, fc.DateFromIW, SUM(FINAL * fc.Coef) Final FROM ForecastSnapshotBodies fb, ForecastWeeklyCoefs fc WHERE fc.Id = fb.FinalWeeklyCoefid AND fb.DateFrom = fc.DateFrom group by fb.ForecastSnapshotId, fb.SiteMaterialUsageID, fc.DateFromIW |
| IHDP#WeekMonthForSnapshot |
|---|
WITH DefaultCurrencies AS (SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.ForecastSnapshotId, fb.SiteMaterialUsageId,
CASE WHEN fc.DateFromIW > fc.DateFrom THEN fc.DateFromIW ELSE fc.DateFrom END DateFrom,
SUM(FINAL * fc.Coef) FINAL,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(SystemPrice),
SUM(FINAL * fc.Coef * SystemPrice) / SUM(FINAL * fc.Coef)) SystemPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(ForecastedPrice),
SUM(FINAL * fc.Coef * ForecastedPrice) / SUM(FINAL * fc.Coef)) ForecastedPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(SystemPrice),
SUM(FINAL * fc.Coef * SystemPrice) / SUM(FINAL * fc.Coef))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetSystemPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(ForecastedPrice),
SUM(FINAL * fc.Coef * ForecastedPrice) / SUM(FINAL * fc.Coef))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetForecastedPrice,
NVL(AVG(ep.Price),0) ReferencePrice,
NVL(AVG(ep.Price),0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) TargetReferencePrice,
NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) ReferencePriceCoef
FROM ForecastSnapshotBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ForecastWeeklyCoefs fc
ON fc.Id = fb.FinalWeeklyCoefId AND fb.DateFrom = fc.DateFrom
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON ep.SiteMaterialUsageId = fb.SiteMaterialUsageId
AND CASE WHEN fc.DateFromIW > fc.DateFrom THEN fc.DateFromIW ELSE fc.DateFrom END BETWEEN ep.DateFrom AND ep.DateTo
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.ForecastSnapshotId, fb.SiteMaterialUsageId,
CASE WHEN fc.DateFromIW > fc.DateFrom THEN fc.DateFromIW ELSE fc.DateFrom END
ORDER BY 1,2,3
|
| IHDP#WeekMonthSystemForecast |
|---|
WITH DefaultCurrencies AS (
SELECT ID FROM Currencies WHERE IsInternal = 1
),
Filtered AS (
SELECT ID, DateFrom, SiteMaterialUsageId,
PriceCurrencyId, SystemPriceCurrencyId,
System, Customer, FINAL,
SystemPrice, ForecastedPrice,
SystemWeeklyCoefId, CustomerWeeklyCoefId, FinalWeeklyCoefId
FROM ForecastBodies
WHERE DateFrom >= core.getInternalMonth()
)
SELECT fb.SiteMaterialUsageId,
CASE WHEN fc.DateFromIW > fc.DateFrom THEN fc.DateFromIW ELSE fc.DateFrom END AS DateFrom,
SUM(fb.System * sc.Coef) AS System,
SUM(fb.Customer * cc.Coef) AS Customer,
SUM(fb.FINAL * fc.Coef) AS FINAL,
DECODE(SUM(fb.FINAL * fc.Coef), 0, AVG(fb.SystemPrice),
SUM(fb.FINAL * fc.Coef * fb.SystemPrice) / SUM(fb.FINAL * fc.Coef)) AS SystemPrice,
DECODE(SUM(fb.FINAL * fc.Coef), 0, AVG(fb.ForecastedPrice),
SUM(fb.FINAL * fc.Coef * fb.ForecastedPrice) / SUM(fb.FINAL * fc.Coef)) AS ForecastedPrice,
DECODE(SUM(fb.FINAL * fc.Coef), 0, AVG(fb.SystemPrice),
SUM(fb.FINAL * fc.Coef * fb.SystemPrice) / SUM(fb.FINAL * fc.Coef))
* NVL(MIN(mers.RateRatio), 1) AS TargetSystemPrice,
DECODE(SUM(fb.FINAL * fc.Coef), 0, AVG(fb.ForecastedPrice),
SUM(fb.FINAL * fc.Coef * fb.ForecastedPrice) / SUM(fb.FINAL * fc.Coef))
* NVL(MIN(mer.RateRatio), 1) AS TargetForecastedPrice,
NVL(AVG(ep.Price), 0) AS ReferencePrice,
NVL(AVG(ep.Price), 0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider), 1) AS TargetReferencePrice,
NVL(MIN(mer.RateRatio), 1) AS PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider), 1) AS ReferencePriceCoef
FROM Filtered fb
CROSS JOIN DefaultCurrencies c
JOIN ForecastWeeklyCoefs fc ON fb.DateFrom = fc.DateFrom AND fb.FinalWeeklyCoefId = fc.Id
JOIN ForecastWeeklyCoefs cc ON fb.DateFrom = cc.DateFrom AND fb.CustomerWeeklyCoefId = cc.Id AND cc.DateFromIW = fc.DateFromIW
JOIN ForecastWeeklyCoefs sc ON fb.DateFrom = sc.DateFrom AND fb.SystemWeeklyCoefId = sc.Id AND sc.DateFromIW = fc.DateFromIW
JOIN IH#MonthlyExchangeRates mers
ON mers.FromCurrencyId = fb.SystemPriceCurrencyId
AND mers.ToCurrencyId = c.Id
AND mers.DateFrom = fb.DateFrom
JOIN IH#MonthlyExchangeRates mer
ON mer.FromCurrencyId = fb.PriceCurrencyId
AND mer.ToCurrencyId = c.Id
AND mer.DateFrom = fb.DateFrom
LEFT JOIN IH#ExpandedPrices ep
ON ep.SiteMaterialUsageId = fb.SiteMaterialUsageId
AND CASE WHEN fc.DateFromIW > fc.DateFrom THEN fc.DateFromIW ELSE fc.DateFrom END BETWEEN ep.DateFrom AND ep.DateTo
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.SiteMaterialUsageId, CASE WHEN fc.DateFromIW > fc.DateFrom THEN fc.DateFromIW ELSE fc.DateFrom END
ORDER BY 1, 2
|
| IHDP#WeekSystemForecast | System weekly forecast used as SNP input |
|---|
WITH DefaultCurrencies AS
(SELECT ID FROM Currencies WHERE IsInternal = 1)
SELECT fb.SiteMaterialUsageId, fc.DateFromIW DateFrom,
SUM(System * sc.Coef) System,
SUM(Customer * cc.Coef) Customer,
SUM(FINAL * fc.Coef) FINAL,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(SystemPrice), SUM(FINAL * fc.Coef * SystemPrice) / SUM(FINAL * fc.Coef))
SystemPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(ForecastedPrice), SUM(FINAL * fc.Coef * ForecastedPrice) / SUM(FINAL *
fc.Coef)) ForecastedPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(SystemPrice), SUM(FINAL * fc.Coef * SystemPrice) / SUM(FINAL * fc.Coef))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetSystemPrice,
DECODE(SUM(FINAL * fc.Coef), 0, AVG(ForecastedPrice), SUM(FINAL * fc.Coef * ForecastedPrice) / SUM(FINAL *
fc.Coef))
* NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) TargetForecastedPrice,
NVL(AVG(ep.Price),0) ReferencePrice,
NVL(AVG(ep.Price),0) * NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1)
TargetReferencePrice,
NVL(MIN((1 / (er.Multiplier / er.Divider)) * er2.Multiplier / er2.Divider),1) PriceCoef,
NVL(MIN((1 / (rer.Multiplier / rer.Divider)) * rer2.Multiplier / rer2.Divider),1) ReferencePriceCoef
FROM ForecastBodies fb
CROSS JOIN DefaultCurrencies c
JOIN ForecastWeeklyCoefs fc
ON (fb.DateFrom = fc.DateFrom AND fb.FinalWeeklyCoefId = fc.Id)
JOIN ForecastWeeklyCoefs cc
ON (fb.DateFrom = cc.DateFrom AND fb.CustomerWeeklyCoefId = cc.Id AND cc.DateFromIW = fc.DateFromIW)
JOIN ForecastWeeklyCoefs sc
ON (fb.DateFrom = sc.DateFrom AND fb.SystemWeeklyCoefId = sc.Id AND sc.DateFromIW = fc.DateFromIW )
JOIN ExpandedExchangeRates er
ON er.CurrencyId = fb.PriceCurrencyId
AND fb.DateFrom BETWEEN er.DateFrom AND er.DateTo
JOIN ExpandedExchangeRates er2
ON fb.DateFrom BETWEEN er2.DateFrom AND er2.DateTo
AND er2.CurrencyId = c.Id
LEFT JOIN IH#ExpandedPrices ep
ON (ep.SiteMaterialUsageId = fb.SiteMaterialUsageId AND fc.DateFromIW BETWEEN ep.DateFrom AND ep.DateTo)
LEFT JOIN ExpandedExchangeRates rer
ON rer.CurrencyId = ep.CurrencyId
AND fb.DateFrom BETWEEN rer.DateFrom AND rer.DateTo
LEFT JOIN ExpandedExchangeRates rer2
ON fb.DateFrom BETWEEN rer2.DateFrom AND rer2.DateTo
AND rer2.CurrencyId = c.Id
GROUP BY fb.SiteMaterialUsageId, fc.DateFromIW
|
| IHL#OrderOperations |
|---|
SELECT OrderCode, LineNoCode, OperationNo, OrderBookId, OrderLineId, oo.Id OrderOperationId, NVL(oo.MaterialId, ol.MaterialId) TargetMaterialId from OrderOperations oo JOIN OrderLines ol ON ol.Id = oo.OrderLineId JOIN OrderBooks ob ON ob.Id = ol.OrderBookId |
| IHMP#Allocation |
|---|
SELECT SiteMaterialUsageId, smu.MaterialId, WorkcentreId, DeliveryWeek DemandWeek, DeliveryMonth DemandMonth, DispatchMonth, DispatchWeek,
SUM(System) System,
SUM(Customer) Customer,
SUM(Indicatives) Indicatives,
SUM(Orders) Orders,
SUM(Customer - Orders) RemainingAllocation
FROM (
SELECT SiteMaterialUsageId, WorkcentreId, DeliveryWeek, DeliveryMonth,
TRUNC(DeliveryWeek - NVL(mr.TimePeriod,0), 'IW') DispatchWeek,
TRUNC(DeliveryWeek - NVL(mr.TimePeriod,0), 'month') DispatchMonth,
System, Customer, 0 Indicatives, 0 Orders
FROM AllocationBodies a
LEFT JOIN MasterRoutes mr
ON mr.Id = a.MasterRouteId
UNION ALL
SELECT SitematerialusageId, WorkcentreId, TRUNC(DeliveryDate, 'IW') DeliveryWeek,
TRUNC(DeliveryDate, 'month') DeliveryMonth,
TRUNC(DespatchDate, 'IW') DispatchWeek,
TRUNC(DespatchDate, 'month') DispatchMonth,
0 System, 0 Customer, 0 Indicatives, FinalWeight Orders
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
WHERE ols.OrderLineStatusCode IN ('Firm', 'Completed')
) t
JOIN SiteMaterialUsages smu
ON t.SiteMaterialUsageID = smu.Id
GROUP BY SiteMaterialUsageId, MaterialId, WorkcentreId, DeliveryWeek, DeliveryMonth, DispatchWeek, DispatchMonth
|
| IHMP#AllocationIndicatives |
|---|
SELECT SiteMaterialUsageId, smu.MaterialId, WorkcentreId, DeliveryWeek DemandWeek, DeliveryMonth DemandMonth,
DispatchWeek, DispatchMonth,
SUM(System) System,
SUM(Customer) Customer,
SUM(Indicatives) Indicatives,
SUM(Orders) Orders,
SUM(Customer - Orders) RemainingAllocation
FROM (
SELECT SiteMaterialUsageId, WorkcentreId, DeliveryWeek, DeliveryMonth,
TRUNC(DeliveryWeek - NVL(mr.TimePeriod,0), 'IW') DispatchWeek, TRUNC(DeliveryWeek - NVL(mr.TimePeriod,0), 'month') DispatchMonth,
System, Customer, 0 Indicatives, 0 Orders
FROM AllocationBodies a
LEFT JOIN MasterRoutes mr
ON mr.Id = a.MasterRouteId
UNION ALL
SELECT SiteMaterialUsageId, WorkcentreId, DeliveryWeek, DeliveryMonth,
TRUNC(DeliveryWeek - NVL(mr.TimePeriod,0), 'IW') DispatchWeek, TRUNC(DeliveryWeek - NVL(mr.TimePeriod,0), 'month') DispatchMonth,
0 System, 0 Customer, VALUE Indicatives, 0 Orders
FROM Indicatives i
LEFT JOIN MasterRoutes mr
ON mr.Id = i.MasterRouteId
UNION ALL
SELECT SitematerialusageId, WorkcentreId, TRUNC(DeliveryDate, 'IW') DeliveryWeek,
TRUNC(DeliveryDate, 'month') DeliveryMonth,
TRUNC(DespatchDate, 'IW') DispatchWeek, TRUNC(DespatchDate, 'month') DispatchMonth,
0 System, 0 Customer, 0 Indicatives, FinalWeight Orders
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
WHERE ols.OrderLineStatusCode IN ('Firm', 'Completed')
) t
JOIN SiteMaterialUsages smu
ON t.SiteMaterialUsageID = smu.Id
GROUP BY SiteMaterialUsageId, MaterialId, WorkcentreId, DeliveryWeek, DeliveryMonth, DispatchWeek, DispatchMonth
|
| IHMP#FutureAllocations |
|---|
WITH CustomerSkus AS (
SELECT s.Id AS SiteMaterialUsageId,
OnSiteMaterialUsageId,
core.getInternalMonth AS InternalMonth
FROM SiteMaterialUsages s
WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = s.LocationId)
),
CombinedData AS (
-- Block 1: Data from AllocationBodies
SELECT ab.SiteMaterialUsageId,
ab.WorkcentreId,
ab.DeliveryMonth AS DateFrom,
ab.Customer AS Allocation,
0 AS Indicatives
FROM AllocationBodies ab
JOIN CustomerSkus s ON s.SiteMaterialUsageId = ab.SiteMaterialUsageId
WHERE ab.DeliveryMonth > s.InternalMonth
AND ab.IsLastStage = 1
UNION ALL
-- Block 2: Data from Indicatives
SELECT i.SiteMaterialUsageId,
i.WorkcentreId,
i.DeliveryMonth AS DateFrom,
0 AS Allocation,
i.Value AS Indicatives
FROM Indicatives i
JOIN CustomerSkus s ON s.SiteMaterialUsageId = i.SiteMaterialUsageId
WHERE i.DeliveryMonth > s.InternalMonth
)
SELECT SiteMaterialUsageId,
WorkcentreId,
DateFrom,
SUM(Allocation) AS Allocation,
SUM(Indicatives) AS Indicatives
FROM CombinedData
GROUP BY SiteMaterialUsageId, WorkcentreId, DateFrom
|
| IHMP#MaterialWorkcentrePairs |
|---|
SELECT DISTINCT MaterialId, WorkcentreId,SiteMaterialUsageId FROM IHMP#SupplierInventoryItems |
| IHMP#MonthlySnapshotAllocation | View for releasing SNP Allocation to Forecast snapshot. |
|---|
SELECT sd.ScenarioId, sd.ScenarioSessionId, si.SiteMaterialUsageId, sd.DateFrom DeliveryDate, sd.Price, sd.Aggregated DEMAND, DECODE(sd.Allocation, 0, 0, sd.Allocation) AS Allocation, DECODE(sd.Aggregated - sd.Allocation, 0, 0, sd.Aggregated - sd.Allocation) AS Unallocated, NVL(sd.COST, 0) COST, DECODE(sd.Allocation, 0, 0, sd.Cost / sd.Allocation) NominalCost, sd.Id FROM SNODemands sd JOIN SNOItemsShort si ON sd.Id = si.Id AND sd.ScenarioSessionId = si.ScenarioSessionId AND sd.CoProductId IS NULL |
| IHMP#MtdData |
|---|
WITH CustomerSkus AS (
SELECT /*+ MATERIALIZE */
s.Id AS SiteMaterialUsageId,
core.getInternalMonth AS InternalMonth,
core.getTruncatedInternalDate AS InternalDate,
NVL(l.CalendarId, (SELECT VALUE FROM SystemParameters WHERE ParameterName = 'DefaultCalendar')) AS CalendarId
FROM SiteMaterialUsages s
JOIN Locations l ON l.Id = s.LocationId
WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = s.LocationId)
),
MtdCoefs AS (
SELECT /*+ MATERIALIZE */
CalendarId, MtdCoef
FROM IH#CalendarMtdCoefs
),
MtdAllocations AS (
SELECT ab.SiteMaterialUsageId, ab.WorkcentreId,
SUM(ab.Customer * c.MtdCoef) AS MtdAllocation,
SUM(ab.Customer) AS CurrentAllocation
FROM AllocationBodies ab
JOIN CustomerSkus s ON s.SiteMaterialUsageId = ab.SiteMaterialUsageId
JOIN MtdCoefs c ON c.CalendarId = s.CalendarId
WHERE ab.DeliveryMonth = s.InternalMonth
AND IsLastStage = 1
GROUP BY ab.SiteMaterialUsageId, ab.WorkcentreId
),
MtdIndicatives AS (
SELECT i.SiteMaterialUsageId, i.WorkcentreId,
SUM(i.Value * c.MtdCoef) AS MtdIndicatives,
SUM(i.Value) AS CurrentIndicatives
FROM Indicatives i
JOIN CustomerSkus s ON s.SiteMaterialUsageId = i.SiteMaterialUsageId
JOIN MtdCoefs c ON c.CalendarId = s.CalendarId
WHERE i.DeliveryMonth = s.InternalMonth
GROUP BY i.SiteMaterialUsageId, i.WorkcentreId
),
MtdHistory AS (
SELECT uh.SiteMaterialUsageId, uh.WorkcentreId,
SUM(NVL(uh.AdjustedWeight, uh.Weight)) AS MtdHistory
FROM UsageHistories uh
JOIN CustomerSkus s ON s.SiteMaterialUsageId = uh.SiteMaterialUsageId
WHERE uh.DateFrom BETWEEN s.InternalMonth AND s.InternalDate
GROUP BY uh.SiteMaterialUsageId, uh.WorkcentreId
),
AllTargetPairs AS (
SELECT SiteMaterialUsageId, WorkcentreId FROM MtdAllocations
UNION
SELECT SiteMaterialUsageId, WorkcentreId FROM MtdIndicatives
UNION
SELECT SiteMaterialUsageId, WorkcentreId FROM MtdHistory
UNION
SELECT ab.SiteMaterialUsageId, ab.WorkcentreId
FROM AllocationBodies ab
JOIN CustomerSkus s ON s.SiteMaterialUsageId = ab.SiteMaterialUsageId
WHERE ab.DeliveryMonth > s.InternalMonth
AND ab.IsLastStage = 1
UNION
SELECT i.SiteMaterialUsageId, i.WorkcentreId
FROM Indicatives i
JOIN CustomerSkus s ON s.SiteMaterialUsageId = i.SiteMaterialUsageId
WHERE i.DeliveryMonth > s.InternalMonth
)
SELECT
s.SiteMaterialUsageId,
p.WorkcentreId,
a.MtdAllocation,
a.CurrentAllocation,
i.MtdIndicatives,
i.CurrentIndicatives,
h.MtdHistory
FROM CustomerSkus s
LEFT JOIN AllTargetPairs p ON p.SiteMaterialUsageId = s.SiteMaterialUsageId
LEFT JOIN MtdAllocations a ON a.SiteMaterialUsageId = p.SiteMaterialUsageId AND a.WorkcentreId = p.WorkcentreId
LEFT JOIN MtdIndicatives i ON i.SiteMaterialUsageId = p.SiteMaterialUsageId AND i.WorkcentreId = p.WorkcentreId
LEFT JOIN MtdHistory h ON h.SiteMaterialUsageId = p.SiteMaterialUsageId AND h.WorkcentreId = p.WorkcentreId
|
| IHMP#MtdData2 |
|---|
WITH CustomerSkus AS
(SELECT /*+ MATERIALIZE */ s.Id AS SiteMaterialUsageId, core.getInternalMonth AS InternalMonth,
core.getTruncatedInternalDate AS InternalDate,
NVL(l.CalendarId, (SELECT VALUE FROM SystemParameters WHERE ParameterName = 'DefaultCalendar')) AS CalendarId
FROM SiteMaterialUsages s
JOIN Locations l ON l.Id = s.LocationId
WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = s.LocationId)
),
MtdCoefs AS (
SELECT /*+ MATERIALIZE */ CalendarId, MtdCoef FROM IH#CalendarMtdCoefs
),
MtdAllocations AS
(SELECT ab.SiteMaterialUsageId, ab.WorkcentreId, SUM(ab.Customer * c.MtdCoef) AS MtdAllocation,
SUM(ab.Customer) AS CurrentAllocation
FROM AllocationBodies ab
JOIN CustomerSkus s
ON s.SiteMaterialUsageId = ab.SiteMaterialUsageId
JOIN MtdCoefs c ON c.CalendarId = s.CalendarId
WHERE ab.DeliveryMonth = s.InternalMonth
AND IsLastStage = 1
GROUP BY ab.SiteMaterialUsageId, ab.WorkcentreId),
mtdIndicatives AS
(SELECT i.SiteMaterialUsageId, i.WorkcentreId, SUM(i.Value * c.MtdCoef) AS MtdIndicatives,
SUM(i.Value) AS CurrentIndicatives
FROM Indicatives i
JOIN CustomerSkus s ON s.SiteMaterialUsageId = i.SiteMaterialUsageId
JOIN MtdCoefs c ON c.CalendarId = s.CalendarId
WHERE i.DeliveryMonth = s.InternalMonth
GROUP BY i.SiteMaterialUsageId, i.WorkcentreId),
mtdhistory AS
(SELECT
uh.SiteMaterialUsageId, uh.WorkcentreId, SUM(NVL(uh.AdjustedWeight, uh.Weight)) AS MtdHistory
FROM UsageHistories uh
JOIN CustomerSkus s
ON s.SiteMaterialUsageId = uh.SiteMaterialUsageId
WHERE uh.DateFrom BETWEEN s.InternalMonth AND s.InternalDate
GROUP BY uh.SiteMaterialUsageId, uh.WorkcentreId)
SELECT SiteMaterialUsageId, WorkcentreId, a.MtdAllocation, a.CurrentAllocation, i.MtdIndicatives, i.CurrentIndicatives,
h.MtdHistory
FROM mtdallocations a
FULL OUTER JOIN mtdHistory h
USING (SiteMaterialUsageId, WorkcentreId)
FULL OUTER JOIN mtdIndicatives i
USING (SiteMaterialUsageId, WorkcentreId)
|
| IHMP#SkuHistoryAllocation |
|---|
WITH dt AS (
SELECT
TRUNC(core.getTruncatedInternalDate, 'month') AS FirstMonthDate,
core.getTruncatedInternalDate AS InternalDate,
(SELECT VALUE FROM SystemParameters WHERE ParameterName = 'DefaultCalendar') AS DefaultCalendarId
FROM dual
)
SELECT
SiteMaterialUsageId,
MaterialId,
SUM(History) MtdHistory,
SUM(MtdAllocation) MtdAllocation,
SUM(Allocation) Allocation,
(SUM(History) / NULLIF(SUM(MtdAllocation), 0)) * 100 Diff
FROM (
SELECT
ab.SiteMaterialUsageId,
smu.MaterialId,
0 AS History,
(ab.Customer * c.MtdCoef) AS MtdAllocation,
ab.Customer AS Allocation
FROM AllocationBodies ab
JOIN sitematerialusages smu ON smu.Id = ab.Sitematerialusageid
JOIN locations l ON l.Id = smu.LocationId
CROSS JOIN dt
JOIN IH#CalendarMtdCoefs c ON c.CalendarId = NVL(l.CalendarId, dt.DefaultCalendarId)
WHERE ab.DeliveryMonth = dt.FirstMonthDate
AND ab.IsLastStage = 1
UNION ALL
SELECT
uh.SiteMaterialUsageId,
smu.MaterialId,
NVL(uh.AdjustedWeight, uh.Weight) AS History,
NULL AS MtdAllocation,
NULL AS Allocation
FROM UsageHistories uh
JOIN sitematerialusages smu ON smu.Id = uh.Sitematerialusageid
CROSS JOIN dt
WHERE uh.DateFrom BETWEEN dt.FirstMonthDate AND dt.InternalDate
)
GROUP BY SiteMaterialUsageId, MaterialId
|
| IHMP#SkuWorkcentrePairs |
|---|
WITH Param AS (
SELECT add_months(TRUNC(core.getTruncatedInternalDate, 'month'), -NVL(MIN(VALUE), 12)) as StartDateInPast
FROM SystemParameters
WHERE ParameterName = 'LiveAllocationPeriodInPast'
),
ActiveSupercessions AS (
SELECT OnSiteMaterialUsageId, SiteMaterialUsageId
FROM IH#ActiveSupercessions
)
SELECT DISTINCT SiteMaterialUsageId, WorkcentreId, SourceMaterialId
FROM (
SELECT smu.Id as SiteMaterialUsageId, NULL as WorkcentreId, NULL as SourceMaterialId
FROM SiteMaterialUsages smu
WHERE EXISTS (
SELECT 1 FROM ForecastBodies fb
CROSS JOIN Param p
WHERE fb.SiteMaterialUsageId = smu.Id AND fb.DateFrom >= p.StartDateInPast
)
UNION ALL
SELECT SiteMaterialUsageId, WorkcentreId, SourceMaterialId
FROM AllocationBodies
CROSS JOIN Param p
WHERE NVL(DeliveryMonth, DeliveryWeek) >= p.StartDateInPast
UNION ALL
SELECT s.OnSiteMaterialUsageId, ab.WorkcentreId, SourceMaterialId
FROM AllocationBodies ab
CROSS JOIN Param p
JOIN ActiveSupercessions s ON s.SiteMaterialUsageId = ab.SiteMaterialUsageId
WHERE NVL(ab.DeliveryMonth, ab.DeliveryWeek) >= p.StartDateInPast
UNION ALL
SELECT BaseOrders.SiteMaterialUsageId,
COALESCE(oo.WorkcentreId, BaseOrders.WorkcentreId, mwh.WorkcentreId) as WorkcentreId, SourceMaterialId
FROM (
SELECT Id, SiteId, SiteMaterialUsageId, WorkcentreId, SourceMaterialId
FROM OrderLines
CROSS JOIN Param p
WHERE DeliveryDate >= p.StartDateInPast
) BaseOrders
LEFT JOIN OrderOperations oo ON oo.OrderLineId = BaseOrders.Id AND oo.IsLastOperation = 1
LEFT JOIN IH#MainWarehouses mwh ON mwh.SiteId = BaseOrders.SiteId
UNION ALL
SELECT s.OnSiteMaterialUsageId,
COALESCE(oo.WorkcentreId, BaseOrders.WorkcentreId, mwh.WorkcentreId) as WorkcentreId, SourceMaterialId
FROM (
SELECT Id, SiteId, SiteMaterialUsageId, WorkcentreId, SourceMaterialId
FROM OrderLines
CROSS JOIN Param p
WHERE DeliveryDate >= p.StartDateInPast
) BaseOrders
JOIN ActiveSupercessions s ON s.SiteMaterialUsageId = BaseOrders.SiteMaterialUsageId
LEFT JOIN OrderOperations oo ON oo.OrderLineId = BaseOrders.Id AND oo.IsLastOperation = 1
LEFT JOIN IH#MainWarehouses mwh ON mwh.SiteId = BaseOrders.SiteId
UNION ALL
SELECT SiteMaterialUsageId, WorkcentreId, smu.MaterialId as SourceMaterialId
FROM UsageHistories uh
JOIN SiteMaterialUsages smu
ON smu.Id = uh.SiteMaterialUsageId
CROSS JOIN Param p
WHERE DateFrom >= p.StartDateInPast
UNION ALL
SELECT s.OnSiteMaterialUsageId, uh.WorkcentreId, smu.MaterialId as SourceMaterialId
FROM UsageHistories uh
JOIN SiteMaterialUsages smu
ON smu.Id = uh.SiteMaterialUsageId
CROSS JOIN Param p
JOIN ActiveSupercessions s ON s.SiteMaterialUsageId = uh.SiteMaterialUsageId
WHERE uh.DateFrom >= p.StartDateInPast
)
|
| IHMP#SupplierInventoryItems |
|---|
SELECT smu.MaterialId, WorkcentreId, smu.LocationId, ab.SiteMaterialUsageId, 'Allocation' Description
FROM AllocationBodies ab
JOIN SiteMAterialUsages smu
ON smu.Id = ab.SiteMaterialUsageId
WHERE NVL(DeliveryMonth, DeliveryWeek) >= TRUNC(core.getTruncatedInternalDate, 'month')
UNION ALL
SELECT smu.MaterialId, WorkcentreId, smu.LocationId, ab.SiteMaterialUsageId, 'Allocation' Description
FROM Indicatives ab
JOIN SiteMAterialUsages smu
ON smu.Id = ab.SiteMaterialUsageId
WHERE NVL(DeliveryMonth, DeliveryWeek) >= TRUNC(core.getTruncatedInternalDate, 'month')
UNION ALL
SELECT ol.MaterialId, coalesce(oo.WorkcentreId, ol.WorkcentreId, mwh.WorkcentreId) WorkcentreId,
ol.LocationId, ol.SiteMaterialUsageId, 'OrderLines' Description
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
LEFT JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
AND IsLastOperation = 1
LEFT JOIN IH#MainWarehouses mwh
ON mwh.SiteId = ol.SiteId
WHERE (OrderLineStatusCode IN ('System', 'Completed') AND DeliveryDate >= TRUNC(core.getTruncatedInternalDate, 'month'))
OR (OrderLineStatusCode = 'Firm' AND DeliveryDate >= core.getBackOrderStartPeriod())
UNION ALL
SELECT smu.MaterialId, uh.WorkcentreId, smu.LocationId, uh.SiteMaterialUsageId, 'MTDHistory' Description
FROM UsageHistories uh
JOIN SiteMaterialUsages smu
ON smu.Id = uh.SiteMaterialUsageId
WHERE DateFrom >= TRUNC(core.getTruncatedInternalDate, 'month')
UNION ALL
SELECT smu.MaterialId, uh.WorkcentreId, smu.LocationId, uh.SiteMaterialUsageId, 'ConsumptionHistory' Description
FROM ConsumptionHistories uh
JOIN SiteMaterialUsages smu
ON smu.Id = uh.SiteMaterialUsageId
WHERE DateFrom >= TRUNC(core.getTruncatedInternalDate, 'month')
UNION ALL
SELECT smu.MaterialId, wc.Id WorkcentreId, NULL, NULL, 'Inventory' Description
FROM Inventories i
JOIN SiteMaterialUsages smu
ON smu.Id = i.SiteMaterialUsageId
JOIN Workcentres wc
ON wc.LocationId = smu.LocationId
WHERE i.DateFrom = smu.LastInventoryDate
AND Weight > 0
UNION ALL
SELECT i.MaterialId, wc.Id WorkcentreId, i.CustomerId, smu.Id SiteMaterialUsageId, 'SupplierInventory' Description
FROM IH#LatestSupplierInventories i
JOIN Workcentres wc on wc.LocationId = i.WarehouseId
LEFT JOIN SiteMaterialUsages smu
ON smu.MaterialId = i.MaterialId
AND smu.LocationId = i.CustomerId
|
| IHRP#ReplenishmentProductRouting |
|---|
WITH q AS ( SELECT MaterialId, SourceSiteMaterialUsageId, SiteMaterialUsageId, NULL Priority, 'customer' DestinationType FROM IH#EndPointSkuPortions p WHERE IsDirect = 1 UNION ALL SELECT DISTINCT MaterialId, SourceSiteMaterialUsageId, SiteMaterialUsageId, PriorityPath Priority, 'replenishment' DestinationType FROM ReplenishedSku WHERE SourceSiteMaterialUsageId IS NOT NULL) SELECT MaterialId, SourceSiteMaterialUsageId, SiteMaterialUsageId, DestinationType, t.MaterialCode, t.MaterialName, t.LocationName TargetLocationName,t.LocationCode TargetLocationCode, s.LocationName SourceLocationName, s.LocationCode SourceLocationCode, NVL(Priority,0) Priority FROM q JOIN ev#skus t ON t.Id = q.SiteMaterialUsageId JOIN ev#skus s ON s.Id = q.SourceSiteMaterialUsageId |
| IHRP#SourceRunCombinedCapacity |
|---|
WITH q AS ( SELECT sr.SiteId, WorkcentreId, MaterialId, SUM(Capacity) Capacity FROM sourceRuns sr JOIN SourceRunMaterials srm ON srm.MaterialRunId = sr.MaterialRunId WHERE sr.MaterialRunid > 0 GROUP BY SiteId, WorkcentreId, MaterialId ) SELECT NVL(q.SiteId, r.SiteId) SiteId, NVL(q.WorkCentreId, r.WorkCentreId) WorkCentreId, NVL(q.MaterialId, r.MaterialId) MaterialId, NVL(q.Capacity, 0) Capacity, NVL(EffectiveProductionRate,0) EffectiveProductionRate FROM q FULL OUTER JOIN IH#ActualProductionRates r ON r.WorkCentreId = q.WorkCentreId AND r.materialId = q.MaterialId WHERE r.IsActive = 1 and core.getTruncatedInternalDate() BETWEEN r.DateFrom AND r.DateTo |
| IHRP#SupersededSourceData |
|---|
with sup
as (
SELECT rs.PointId, rs.ChainNo, ms.FromMaterialId AS FromMaterialId,
smu.LocationCode FromCustomerLocationCode,
smu.MaterialCode FromMaterialCode,
tsmu.LocationCode ToCustomerLocationCode,
tsmu.MaterialCode ToMaterialCode
FROM ReplenishedSku rs
JOIN ReplenishedCustomerSku rcs
ON rs.SiteMaterialUsageID = rcs.SourceSiteMaterialUsageId
JOIN IH#ActiveSupercessions ms
ON ms.OnSiteMaterialUsageId = rcs.SiteMaterialUsageId
JOIN EV#Skus smu
ON smu.Id = ms.SiteMaterialUsageId
JOIN EV#Skus tsmu
ON tsmu.Id = ms.OnSiteMaterialUsageId
JOIN SourcePriorities sp on sp.SiteMaterialUsageId = ms.SiteMaterialUsageId And IsActive = 1
WHERE ms.StartDate <= core.getTruncatedInternalDate
AND (( SELECT NVL(MIN(VALUE), 0) FROM SystemParameters WHERE ParameterName = 'RPSupersessionSameLocation') = 0
OR smu.LocationCode = tsmu.LocationCode)
)
SELECT distinct 'Supersessions' TypeOfReplacement, sup.FromCustomerLocationCode,
sup.FromCustomerLocationCode || ' ' || sup.FromMaterialCode || ' --> ' || sup.ToMaterialCode CustomerChain,
fs.LocationCode WarehouseCode, ts.LocationCode ToWarehouseCode,
fs.MaterialCode FromMaterialCode, ts.MaterialCode ToMaterialCode,
smu.Id SiteMaterialUsageId, rs.SiteMaterialUsageId OnSiteMaterialUsageId, sup.FromMaterialId
from sup
JOIN ReplenishedSKU rs
ON rs.PointId = sup.PointId
AND rs.ChainNo = sup.ChainNo
JOIN SiteMaterialUsages smu ON (smu.LocationId = rs.LocationId)
AND smu.MaterialID = sup.FromMaterialID
JOIN EV#skus fs ON fs.Id = smu.Id
JOIN EV#Skus ts ON ts.Id = rs.SiteMaterialUsageId
WHERE NOT EXISTS(SELECT 1 FROM ReplenishedSku rs2 WHERE rs2.SiteMaterialUsageId = smu.Id AND Replenished = 1)
AND EXISTS (SELECT 1 FROM SourcePriorities sp where sp.SiteMaterialUsageId = smu.Id And sp.IsActive = 1)
UNION ALL
SELECT distinct 'Warehouse Group' TypeOfReplacement, sup.FromCustomerLocationCode,
sup.FromCustomerLocationCode || ' ' || sup.FromMaterialCode || ' --> ' || sup.ToMaterialCode CustomerChain,
fs.LocationCode WarehouseCode, ts.LocationCode ToWarehouseCode,
fs.MaterialCode FromMaterialCode, ts.MaterialCode ToMaterialCode,
smu.Id SiteMaterialUsageId, rs.SiteMaterialUsageId OnSiteMaterialUsageId, sup.FromMaterialId
FROM ReplenishedSku rs
join locations l on l.WarehouseLocationId = rs.WarehouseLocationId
join sup
ON rs.PointId = sup.PointId
AND rs.ChainNo = sup.ChainNo
JOIN SiteMaterialUsages smu ON (smu.LocationId = l.Id)
AND smu.MaterialId = sup.FromMaterialId
JOIN EV#skus fs ON fs.Id = smu.Id
JOIN EV#Skus ts ON ts.Id = rs.SiteMaterialUsageId
where rs.WarehouseLocationId IS NOT NULL
AND NOT EXISTS(SELECT 1 FROM ReplenishedSku rs2 WHERE rs2.SiteMaterialUsageId = smu.Id AND Replenished = 1)
AND EXISTS (SELECT 1 FROM SourcePriorities sp WHERE sp.SiteMaterialUsageId = smu.Id And sp.IsActive = 1)
|
| IHSA#AllocationMTD |
|---|
WITH allocations AS
(SELECT ab.SiteMaterialUsageId, ab.WorkcentreId, SUM(Customer) Allocation
FROM AllocationBodies ab
WHERE DeliveryMonth = TRUNC(core.getInternalDate, 'month')
GROUP BY ab.SiteMaterialUsageId, ab.WorkcentreId),
history AS
(SELECT SiteMaterialUsageId, WorkcentreId, SUM(NVL(AdjustedWeight, Weight)) HistoryWeight
FROM UsageHistories
WHERE TRUNC(DateFrom, 'month') = TRUNC(core.getInternalDate, 'month')
GROUP BY SiteMaterialUsageId, WorkcentreId)
SELECT NVL(a.SiteMaterialUsageId, h.SiteMaterialUsageId) SiteMaterialUsageId, NVL(a.WorkcentreId, h.WorkcentreId) WorkcentreId,
NVL(Allocation, 0) Allocation, NVL(HistoryWeight, 0) HistoryWeight, WorkingDays, totalWorkingDays,
CASE WHEN WorkingDays = 0 THEN 0 ELSE NVL(Allocation, 0) / WorkingDays END DailyAllocation,
CASE WHEN WorkingDays = 0 OR NVL(Allocation, 0) = 0 OR TotalWorkingDays = 0 THEN 0
ELSE NVL(HistoryWeight, 0) / WorkingDays * TotalWorkingDays / NVL(Allocation, 0) * 100
END Percentage
FROM allocations a
FULL OUTER JOIN history h
ON h.SiteMaterialUsageId = a.SiteMaterialUsageId
AND h.WorkcentreId = a.WorkcentreId
JOIN IH#SkuWorkingDays c
ON c.SiteMaterialUsageID = NVL(a.SiteMaterialUsageId, h.SiteMaterialUsageId)
AND c.DateFrom = core.getTruncatedInternalDate()
|
| IHSA#AllocationsVsOrders |
|---|
WITH orders AS
(
SELECT SiteMaterialUsageId, NVL(oo.WorkcentreId, ol.WorkcentreId) WorkcentreId, SUM(FinalWeight) OrdersWeight,
LEAST(GREATEST(MAX(DeliveryDate), core.getTruncatedInternalDate), LAST_DAY(core.getTruncatedInternalDate)) MaxDeliveryDate
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
LEFT JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
AND oo.IsLastOperation = 1
WHERE TRUNC(DeliveryDate, 'month') = TRUNC(CORE.getInternalDate, 'month')
AND OrderLineStatusCode IN ('Completed', 'Firm')
GROUP BY SiteMaterialUsageId, NVL(oo.WorkcentreId, ol.WorkcentreId)
),
allocations AS
(SELECT ab.SiteMaterialUsageId, ab.WorkcentreId, SUM(Customer) Allocation
FROM AllocationBodies ab
WHERE DeliveryMonth = TRUNC(core.getInternalDate, 'month')
GROUP BY ab.SiteMaterialUsageId, ab.WorkcentreId)
SELECT o.SiteMaterialUsageID, o.WorkcentreId, WorkingDays, TotalWorkingDays, a.Allocation, o.OrdersWeight,
case when TotalWorkingDays = 0 THEN 0 ELSE a.Allocation / TotalWorkingDays END DailyAllocation,
case when TotalWorkingDays = 0 OR WorkingDays = 0 THEN 0 ELSE a.Allocation / TotalWorkingDays * WorkingDays END CurrentAllocation,
case when TotalWorkingDays = 0 OR WorkingDays = 0 OR a.Allocation = 0 THEN 0 ELSE OrdersWeight / (a.Allocation / TotalWorkingDays * WorkingDays) * 100 END Percentage
FROM Orders o
JOIN allocations a
ON a.SiteMaterialUsageId = o.SiteMaterialUsageId
AND a.WorkcentreId = o.WorkcentreId
JOIN IH#SkuWorkingDays s
ON s.SiteMaterialUSageID = o.siteMaterialUsageId
AND s.DateFrom = o.MaxDeliveryDate
|
| IHSA#AllocationVsHistory |
|---|
WITH allocations AS
(
SELECT ab.SiteMaterialUsageId, smu.MaterialId, smu.LocationId, ab.WorkcentreId, DeliveryWeek Period,
SUM(Customer) Allocation, ep.Price CalculatedPrice,
SUM(Customer * COST) / SUM(Customer) COST
FROM AllocationBodies ab
JOIN SiteMaterialUsages smu
ON smu.Id = ab.SiteMaterialUsageId
JOIN Workcentres wc
ON wc.Id = ab.WorkcentreId
JOIN Locations l
ON l.Id = wc.LocationId
LEFT JOIN IH#ExpandedPrices ep
ON ep.SiteMaterialUsageId = ab.Sitematerialusageid
AND DeliveryWeek BETWEEN ep.DateFrom AND ep.DateTo
LEFT JOIN IH#ProductCosts pc
ON pc.MaterialId = smu.MaterialId
AND pc.WorkcentreId = ab.WorkcentreId
AND DeliveryWeek BETWEEN pc.Effective AND pc.NextEffective
AND Customer > 0
GROUP BY ab.SiteMaterialUsageId, smu.MaterialId, smu.LocationId, ab.WorkcentreId, DeliveryWeek, ep.Price
)
,
history AS
(
SELECT SiteMaterialUsageId, smu.MaterialId, smu.LocationId, uh.WorkcentreId, TRUNC(dateFrom, 'IW') Period,
SUM(NVL(AdjustedWeight, Weight)) History,
SUM(NVL(AdjustedWeight, Weight) * Price) / SUM(NVL(AdjustedWeight, Weight)) ActualPrice,
AVG(pc.COST) COST
FROM UsageHistories uh
JOIN SiteMaterialUsages smu
ON smu.Id = uh.SiteMaterialUsageId
LEFT JOIN IH#ProductCosts pc
ON pc.MaterialId = smu.MaterialId
AND pc.WorkcentreId = uh.WorkcentreId
AND uh.dateFrom BETWEEN pc.Effective AND pc.NextEffective
GROUP BY SiteMaterialUsageId, smu.MaterialId, smu.LocationId, uh.WorkcentreId, TRUNC(dateFrom, 'IW')
)
SELECT NVL(a.SiteMaterialUsageId, h.SiteMaterialUsageId) SiteMaterialUsageId,
NVL(a.MaterialId, h.MaterialId) MaterialId,
NVL(a.LocationId, h.LocationId) LocationId,
NVL(a.Workcentreid, h.Workcentreid) WorkcentreId,
NVL(a.Period, h.Period) Period,
a.Allocation, h.History, a.CalculatedPrice, ActualPrice,
NVL(a.Cost, h.Cost) COST
FROM allocations a
FULL OUTER JOIN history h
ON h.SiteMaterialUsageId = a.SiteMaterialUSageId
AND h.WorkcentreId = a.WorkcentreId
AND h.Period = a.Period
|
| IHSA#AutomaticCyclePeriods |
|---|
SELECT gc.ScenarioSessionId, gc.ScenarioId, gc.GradeId, pp.PeriodNumber
FROM GradeCycleTypeSnapshots gc
JOIN ScenarioPeriodSnapshots pp
ON pp.ScenarioSessionId = gc.ScenarioSessionId
AND pp.StartPeriod = gc.DateFrom
WHERE IsProductionPeriod = 1
|
| IHSA#AvailableInventorySnapshots |
|---|
WITH CalculatedInventory AS (
SELECT i.ScenarioSessionId, i.ScenarioId, wc.Id as WorkCentreId, i.DateFrom,
i.MaterialId, m.MaterialCode, l.SiteId, NVL(si.Id, -1) SnoItemId,
-- delta per period
i.AvailableInventory - NVL(GREATEST(0, LAG(i.AvailableInventory, 1)
OVER (PARTITION BY i.SiteMaterialUsageId ORDER BY i.DateFrom)), 0) AS AvailableInventory,
i.SafetyStock, i.LeadTimeDays, i.ProjectedInventory, i.ProjectedSafetyStock
FROM (
SELECT st.ScenarioSessionId, st.ScenarioId, MaterialId, LocationId, SiteMaterialUsageId, DateFrom, LeadTimeDays, AvailableInventory ProjectedInventory,
SafetyStock as ProjectedSafetyStock,
DECODE(AllowUseSafetyStock, 1, AvailableInventory, AvailableInventory - SafetyStock) AvailableInventory,
DECODE(AllowUseSafetyStock, 1, SafetyStock, 0) SafetyStock
FROM IHSA#Inventorysnapshots st
JOIN (
SELECT ScenarioSessionId, ScenarioId, NVL(MIN(VALUE), 0) AllowUseSafetyStock
FROM ScenarioParameters
WHERE ParameterName = 'AllowUseSafetyStockInAllocations'
GROUP BY ScenarioSessionId, ScenarioId
) p ON p.ScenarioSessionId = st.ScenarioSessionId AND p.ScenarioId = st.ScenarioId
) i
JOIN Locations l ON l.Id = i.LocationId
JOIN Workcentres wc ON wc.LocationId = l.Id
JOIN SNOItemsShort si ON si.SiteMaterialUsageId = i.SiteMaterialUsageId AND si.ScenarioSessionId = i.ScenarioSessionId
JOIN Materials m ON m.Id = si.MaterialId
JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId
WHERE mt.IsTool = 0
)
SELECT * FROM CalculatedInventory
WHERE AvailableInventory > 0
|
| IHSA#BomUsage |
|---|
SELECT * FROM
(
SELECT sa.ScenarioSessionId, sa.ScenarioId, sa.Id, sa.CoProductId, sa.DeliveryDate, sa.SourceDate, sa.AllocationId, sa.StageNo, sa.IsLastStage, sa.WorkCentreId, sa.Allocation,
DECODE(sa.Rate * sa.TimeEfficiency, 0, 0, (sa.Allocation / sa.Rate) * (100 / sa.TimeEfficiency)) * 60 AllocationMinutes,
sa.Rate, sa.Allocation / (sa.MaterialEfficiency/ 100) - sa.Allocation Losses,
sa.OperationTypeId, sa.SourcePropertyValueId, sa.SourceMaterialId, sa.BOMSourceMaterialId, sa.SeqNo,
sa2.WorkcentreId as NextWorkCentreId
FROM SourcingAllocation sa
JOIN SourcingAllocation sa2
ON sa2.ScenarioSessionId = sa.ScenarioSessionId
AND sa2.ScenarioID = sa.ScenarioId
AND sa2.Id = sa.Id
AND NVL(sa2.CoProductId, 0) = NVL(sa.CoProductId,0)
AND sa2.AllocationId = sa.AllocationId
AND sa2.DeliveryDate = sa.DeliveryDate
AND sa2.SeqNo = sa.SeqNo - 1
)
Where SourceMaterialId is not null
|
| IHSA#CoProductAllocations |
|---|
SELECT a.ScenarioSessionId, a.ScenarioId, a.Id, a.WorkcentreId, 'A' Type, wh.LocationId, a.CoProductId,
CASE
WHEN SIGN(MasterRouteId) = -1 THEN
NULL
ELSE
MasterRouteId
END MasterRouteId, smu.Id SitematerialusageId, a.DeliveryDate DeliveryPeriod, a.SourceDate SourcePeriod,
0 AS NonMoveableWeight, a.Allocation AS System, a.AllocationId, a.StageNo, a.SeqNo, a.IsLastStage,
si.PropertyValueId, c.ProductRouteId, a.OperationTypeId, a.NextOperationTypeId, NVL(a.BomSourceMaterialId,
si.MaterialId) SourceMaterialId
FROM SourcingAllocation a
JOIN ConfigurationSnapshots c
ON a.ScenarioSessionId = c.ScenarioSessionId
AND a.ConfigurationId = c.Id
AND a.OperationTypeId = c.OperationTypeId
AND c.IsIdentical = 0
JOIN SNOItemsShort si
ON c.ScenarioSessionId = si.ScenarioSessionId
AND si.Id = a.Id
AND si.CoProductId = a.CoProductId
JOIN IH#MainWarehouses wh
ON wh.SiteId = a.SiteId
LEFT JOIN SiteMaterialUsages smu
ON smu.LocationId = wh.LocationId
AND smu.MaterialId = a.CoProductId
WHERE a.CoProductid IS NOT NULL
UNION ALL
SELECT so.ScenarioSessionId, NULL ScenarioId, SnoItemId as id, so.WorkcentreId, 'O' Type, wh.LocationId, so.CoProductId,
MasterRouteId, smu.Id SiteMaterialUsageId,
DeliveryPeriod,
SourcePeriod,
so.Weight AS NonMoveableWeight, 0 AS System,
-1 AllocationId, 0 StageNo, 0 seqNo, 1 IsLastStage,
so.PropertyValueId, NULL ProductRouteId, so.OperationTypeId, NULL NextOperationTypeId, so.MaterialId SourceMaterialId
FROM SNOAllOrderSnapshots so
JOIN IH#Workcentres wc
ON so.WorkcentreId = wc.WorkcentreID
JOIN IH#MainWarehouses wh
ON wh.SiteId = wc.SiteId
LEFT JOIN SiteMaterialUsages smu
ON smu.LocationId = wh.LocationId
AND smu.MaterialId = so.CoProductId
WHERE so.IsFirm = 1
AND so.CoProductId IS NOT NULL
AND so.SourceType IN ('stock', 'production', 'supplier')
AND so.PropertyValueId IS NOT NULL
AND so.SourcePeriod IS NOT NULL
|
| IHSA#CoProductCoefs |
|---|
SELECT ScenarioSessionId, PropertyValueId, GradeId, CoProductId, Percentage, TotalPercentage, TotalPricePercentage, Percentage / 100 Coef FROM CoProductSnapshots |
| IHSA#CoProductComparison |
|---|
WITH t AS
(SELECT ScenarioSessionId, WorkcentreId, SourcePeriod, SUM(CoProductAllocation) CoProductAllocation
FROM Snosolutiontempdata
WHERE WorkcentreId > 0
GROUP BY ScenarioSessionId, WorkcentreId, SourcePeriod
HAVING SUM(CoProductAllocation) > 0),
a AS
(SELECT sa.ScenarioSessionId, WorkcentreId, PeriodNumber, SUM(Allocation) CoProductAllocation
FROM SourcingAllocation sa
JOIN ScenarioPeriodSnapshots p
ON p.StartPeriod = sa.SourceDate
AND sa.ScenarioSessionId = p.ScenarioSessionId
WHERE scenarioId = -1
AND CoProductId IS NOT NULL
GROUP BY sa.ScenarioSessionId, WorkcentreId, PeriodNumber)
SELECT NVL(t.ScenarioSessionId, a.ScenarioSessionId) ScenarioSessionId, NVL(t.WorkcentreId, a.WorkcentreId) WorkcentreId,
NVL(t.SourcePeriod, a.PeriodNumber) SourcePeriod, t.CoProductAllocation SolutionAllocation,
a.CoProductAllocation CoProductAllocation,
NVL(t.CoProductAllocation,0) - NVL(a.CoProductAllocation,0) Diff
FROM t
FULL OUTER JOIN a
ON a.ScenarioSessionId = t.ScenarioSessionId
AND a.WorkcentreId = t.WorkcentreId
AND t.SourcePeriod = a.PeriodNumber
|
| IHSA#CoProductItemComparison |
|---|
WITH t AS
(
SELECT d.ScenarioSessionId, WorkcentreId, Id, SourcePeriod, p.StartPeriod SourceDate, SUM(CoProductAllocation) CoProductAllocation
FROM IHSA#SolutionTempData d
JOIN ScenarioPeriodSnapshots p
ON p.PeriodNumber = d.SourcePeriod
AND d.ScenarioSessionId = p.ScenarioSessionId
GROUP BY d.ScenarioSessionId, WorkcentreId, Id, d.SourcePeriod, p.StartPeriod
HAVING SUM(CoProductAllocation) > 0
),
a AS
(
SELECT sa.ScenarioSessionId, WorkcentreId, Id, PeriodNumber SourcePeriod, SourceDate, SUM(Allocation) CoProductAllocation
FROM SourcingAllocation sa
JOIN ScenarioPeriodSnapshots p
ON p.StartPeriod = sa.SourceDate
AND sa.ScenarioSessionId = p.ScenarioSessionId
WHERE scenarioId = -1
AND CoProductId IS NOT NULL
GROUP BY sa.ScenarioSessionId, WorkcentreId, Id, PeriodNumber, SourceDate
)
SELECT NVL(t.ScenarioSessionId, a.ScenarioSessionId) ScenarioSessionId,
NVL(t.WorkcentreId, a.WorkcentreId) WorkcentreId,
NVL(t.Id, a.Id) Id,
NVL(t.SourcePeriod, a.SourcePeriod) SourcePeriod,
NVL(t.SourceDate, a.SourceDate) SourceDate,
t.CoProductAllocation SolutionAllocation,
a.CoProductAllocation CoProductAllocation,
NVL(t.CoProductAllocation,0) - NVL(a.CoProductAllocation,0) Diff
FROM t
FULL OUTER JOIN a
ON a.ScenarioSessionId = t.ScenarioSessionId
AND a.WorkcentreId = t.WorkcentreId
AND a.Id = t.Id
AND t.SourcePeriod = a.SourcePeriod
AND t.SourceDate = a.SourceDate
|
| IHSA#CycleCapacity |
|---|
WITH q AS (
SELECT DISTINCT ScenarioSessionId, ScenarioId, WorkcentreId, CycleTypeId, DateFrom FROM ScenarioRates
WHERE IsActive > 0
)
SELECT q.ScenarioSessionId, q.ScenarioId, q.DateFrom, q.CycleTypeId, q.WorkcentreId FROM IVSA#PaperMachineCapacities pm
JOIN q ON pm.Workcentreid = q.WorkcentreId
AND q.DateFrom = pm.DateFrom
AND pm.ScenarioSessionId = q.ScenarioSessionId
AND pm.ScenarioId = q.ScenarioId
WHERE HasCapacity = 1
|
| IHSA#CycleFixedPeriods |
|---|
SELECT ss.Id as ScenarioSessionId, ct.ScenarioId, ct.CycleTypeId, CycleType, ct.DetailId,
ss.FixedPeriodDate,
MaxStartDate LastFixedRunPeriodDate,
ss.StartWeek + FixedPeriodInWeeks * 7 CyclePeriodDate,
LEAST(ss.FinishWeek, GREATEST(ss.FixedPeriodDate, ss.StartWeek + FixedPeriodInWeeks * 7, NVL(mr.MaxStartDate, ss.FixedPeriodDate))) CycleFixedPeriodDate,
Frequency, WeekTolerance, ct.Priority, ProducingDay, GroupName,
FixedPeriodInWeeks
FROM IHSA#CycleTypes ct
JOIN ScenarioSessions ss
ON ss.Id = ct.ScenarioSessionId
LEFT JOIN (
SELECT ScenarioSessionId, cycleTypeId, MAX(TRUNC(StartDate)) MaxStartDate
FROM SNPMaterialRunSnapshots
WHERE ScenarioId = 0
AND IsFixed = 1
GROUP BY ScenarioSessionId, cycleTypeId
) mr
ON mr.ScenarioSessionId = ss.Id
AND mr.CycleTypeID = ct.CycleTypeId
|
| IHSA#CycleFrequencies |
|---|
SELECT cf.ScenarioSessionId, cf.ScenarioId, gs.Id AS GradeId, pp.PeriodNumber CycleFixedPeriod,
fp.PeriodNumber FirstPeriod,
analysis.TruncDate(cf.CycleFixedPeriodDate, ss.SnapshotPeriodType) CycleFixedPeriodDate,
analysis.TruncDate(cf.FirstPeriodDate, ss.SnapshotPeriodType) FirstPeriodDate, cf.Frequency, cf.WeekTolerance
FROM CycleFrequencySnapshots cf
JOIN GradeSnapshots gs
ON gs.ScenarioSessionId = cf.ScenarioSessionId
AND gs.CycleTypeId = cf.CycleTypeId
JOIN ScenarioSessions ss
ON ss.Id = cf.ScenarioSessionId
JOIN ScenarioPeriodSnapshots pp
ON pp.ScenarioSessionId = ss.Id
AND pp.StartPeriod = analysis.TruncDate(cf.CycleFixedPeriodDate, ss.SnapshotPeriodType)
JOIN ScenarioPeriodSnapshots fp
ON fp.ScenarioSessionId = ss.Id
AND fp.StartPeriod = analysis.TruncDate(cf.FirstPeriodDate, ss.SnapshotPeriodType)
|
| IHSA#CycleFrequency |
|---|
WITH orders AS
(SELECT /*+ INDEX(si LISNOITEMS2 ) */ so.ScenarioSessionId, ct.CycleTypeId, ct.ScenarioId,
MAX(CASE WHEN p.Value = 1 OR so.SourcePeriod > ct.CycleFixedPeriodDate THEN NULL ELSE so.SourcePeriod END) MaxOrderPeriodFixed,
MIN(CASE WHEN p.Value = 1 OR so.SourcePeriod <= ct.CycleFixedPeriodDate THEN NULL ELSE so.SourcePeriod END) MinOrderPeriodPostFixed
FROM SNOAllOrderSnapshots so
JOIN GradeSnapshots gs
ON gs.MaterialId = so.SourceMaterialId
AND gs.ScenarioSessionId = so.ScenarioSessionId
LEFT JOIN (SELECT ScenarioSessionId, Value
FROM ScenarioSessionParameters
Where ParameterName = 'SNPExcludeOrdersFromDetermination') p
ON p.ScenarioSessionId = so.ScenarioSessionId
JOIN IHSA#CycleFixedPeriods ct
ON ct.CycleTypeId = gs.CycleTypeId
AND ct.ScenarioSessionId = so.ScenarioSessionId
WHERE so.SourcePeriod IS NOT NULL
AND so.SourceType = 'production'
AND so.IsFirm = 1
GROUP BY so.ScenarioSessionId, ct.ScenarioId, ct.CycleTypeId),
runs AS
(SELECT ScenarioSessionId, CycleTypeId, MAX(TRUNC(FinishDate)) MaxRunPeriod
FROM SNPMaterialRunSnapshots
WHERE IsActive = 1
AND ScenarioId = 0
GROUP BY ScenarioSessionId, CycleTypeid)
SELECT ct.ScenarioId, ss.Id as ScenarioSessionId, UserName, StartWeek, ct.CycleTypeId, CycleType, Frequency, WeekTolerance, FixedPeriodInWeeks,
MaxRunPeriod, MaxOrderPeriodFixed, MinOrderPeriodPostFixed,
ss.FixedPeriodDate ScenarioFixedPeriodDate,
ct.CycleFixedPeriodDate,
CASE WHEN MaxOrderPeriodFixed IS NULL AND MaxOrderPeriodFixed IS NULL AND MaxRunPeriod IS NULL
THEN ct.CycleFixedPeriodDate
ELSE LEAST(
GREATEST(
GREATEST(NVL(MaxRunPeriod, ss.StartWeek), NVL(MaxOrderPeriodFixed, ss.StartWeek)) + (Frequency - 1) * 7,
ct.CycleFixedPeriodDate
),
GREATEST(ct.CycleFixedPeriodDate, NVL(MinOrderPeriodPostFixed, ss.StartWeek))
)
END AS FirstPeriodDate
FROM IHSA#CycleFixedPeriods ct
JOIN IH#ScenarioSessions SS
ON ct.ScenarioSessionId = ss.Id
LEFT JOIN Orders o
ON o.CycleTypeId = ct.CycleTypeId
AND ss.Id = o.ScenarioSessionId
AND o.ScenarioId = ct.ScenarioId
LEFT JOIN Runs r
ON r.CycleTypeId = ct.CycleTypeId
AND ss.Id = r.ScenarioSessionId
|
| IHSA#CycleTypes |
|---|
SELECT ScenarioSessionId, ScenarioId, d.PropertiesCode CycleType, ct.Id CycleTypeId,
DetailId, Frequency, WeekTolerance, ct.Priority, ProducingDay, GroupName, FixedPeriodInWeeks
FROM CycleTypeSnapshots ct
JOIN Ih#hierarchypropertydetails d
ON d.ID = ct.DetailId
|
| IHSA#CycleUtilisation |
|---|
WITH q AS
(
SELECT so.ScenarioSessionId, SnoItemId, NULL ScenarioId, SourcePeriod, so.WorkcentreId, gs.cycleTypeId, so.PropertyValueId as SourcePropertyValueId,
CASE WHEN NVL(so.Rate,0) != 0 THEN so.RemainingSourceWeight / Rate * (100 / TimeEfficiency)
ELSE 0
END OrdersHours,
0 AllocationHours,
so.RemainingSourceWeight OrdersWeight, 0 AllocationWeight, Rate,
so.CoProductId
FROM Snoallordersnapshots so
JOIN GradeSnapshots gs
ON gs.MaterialId = so.SourceMaterialId
AND gs.ScenarioSessionId = so.ScenarioSessionId
JOIN IH#Workcentres wc
ON wc.WorkcentreId = so.WorkcentreId
AND wc.OrderNo > 0
WHERE SourceType = 'production'
AND so.RemainingSourceWeight > 0
AND so.SourcePeriod IS NOT NULL
AND NOT EXISTS
(
SELECT 1
FROM SNOMovableOrderSnapshots mo
WHERE mo.ScenarioSessionId = so.ScenarioSessionId
AND mo.ScenarioId = -1
AND mo.OrderLineId = so.OrderLineId
)
UNION ALL
SELECT sa.ScenarioSessionId, sa.Id SnoItemId, sa.ScenarioId, SourceDate SourcePeriod, WorkcentreId, gs.cycleTypeId,
NVL(sa.SourcePropertyValueId, gs.PropertyValueId) SourcePropertyValueId,
0 OrdersHours, DECODE(Rate * TimeEfficiency, 0, 0, Allocation / Rate * (100 / TimeEfficiency)) AllocationHours,
0 OrdersWeight,
Allocation AllocationWeight,
Rate,
sa.CoProductId
FROM SourcingAllocation sa
JOIN GradeSnapshots gs
ON gs.Id = sa.GradeId
AND gs.ScenarioSessionId = sa.ScenarioSessionId
WHERE Allocation > 0
AND OperationTypeId IS NOT NULL
AND sa.CoProductId IS NULL
)
SELECT CoProductId, ScenarioSessionId, ScenarioId, SnoItemId, SourcePeriod, WorkcentreId, WorkcentreTypeId, CycleTypeId, SourcePropertyValueId,
NVL(SUM(OrdersHours),0) OrdersHours, NVL(SUM(AllocationHours),0) AllocationHours,
NVL(SUM(OrdersWeight),0) OrdersWeight, NVL(SUM(AllocationWeight),0) AllocationWeight,
DECODE(SUM(OrdersHours + AllocationHours), 0, 0, SUM(OrdersWeight + AllocationWeight ) / SUM(OrdersHours + AllocationHours)) Rate
FROM q
JOIN Workcentres wc ON wc.Id = q.WorkcentreId
GROUP BY CoProductId, ScenarioSessionId, ScenarioId, SnoItemId, SourcePeriod, WorkcentreId, WorkcentreTypeId, cycleTypeId, SourcePropertyValueId
|
| IHSA#DailyToolsInventory |
|---|
WITH
sessions AS (SELECT s.ScenarioSessionId, s.Id AS ScenarioId, ss.StartWeek
FROM Scenarios s
JOIN ScenarioSessions ss ON ss.Id = s.ScenarioSessionId),
raw_events AS (
-- Initial Opening Stock (taken from the session for all its scenarios)
SELECT ss.ScenarioSessionId, ss.ScenarioId, inv.SiteMaterialUsageId, inv.DateFrom AS EventDate,
inv.Opening AS Opening, 0 AS Incoming, 0 AS Outgoing, inv.UsedByOrders AS Usage
FROM ToolInventorySnapshots inv
JOIN sessions ss ON inv.ScenarioSessionId = ss.ScenarioSessionId
UNION ALL
-- Movements (Outgoing)
SELECT m.ScenarioSessionId, m.ScenarioId, smu.Id, m.DespatchDate, 0, 0, DECODE(IsActive, 1, m.Quantity, 0), 0
FROM ToolMovementsSnapshots m
JOIN SiteMaterialUsages smu ON smu.LocationId = m.FromLocationId AND smu.MaterialId = m.ToolMaterialId
UNION ALL
-- Movements (Incoming)
SELECT m.ScenarioSessionId, m.ScenarioId, smu.Id, m.DeliveryDate, 0, DECODE(IsActive, 1, m.Quantity, 0), 0, 0
FROM ToolMovementsSnapshots m
JOIN SiteMaterialUsages smu ON smu.LocationId = m.LocationId AND smu.MaterialId = m.ToolMaterialId
),
sparse_agg AS (
-- Aggregate only days with movements
SELECT r.ScenarioSessionId, r.ScenarioId, SiteMaterialUsageId, EventDate, SUM(Opening) AS DayOpening,
SUM(Incoming) AS DayIncoming, SUM(Outgoing) AS DayOutgoing, SUM(Usage) AS DayUsage
FROM raw_events r
JOIN sessions ss ON r.ScenarioSessionId = ss.ScenarioSessionId
AND r.ScenarioId = ss.ScenarioId
WHERE EventDate >= ss.StartWeek
GROUP BY r.ScenarioSessionId, r.ScenarioId, SiteMaterialUsageId, EventDate
),
calculated_steps AS (
-- Calculate balances only at change points
SELECT sa.*,
FIRST_VALUE(DayOpening)
OVER ( PARTITION BY ScenarioSessionId, ScenarioId, SiteMaterialUsageId ORDER BY EventDate ) +
SUM(DayIncoming - DayOutgoing)
OVER ( PARTITION BY ScenarioSessionId, ScenarioId, SiteMaterialUsageId ORDER BY EventDate
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS ClosingAtPoint
FROM sparse_agg sa),
daily_grid AS (
-- Build the grid at the end, using only the session boundaries
SELECT sb.ScenarioSessionId, dg.column_value AS DayStart
FROM (SELECT ScenarioSessionId, MIN(StartPeriod) AS MinDate, MAX(EndPeriod) AS MaxDate
FROM ScenarioPeriodSnapshots
GROUP BY ScenarioSessionId) sb
CROSS JOIN TABLE (core.DateGenerator(sb.MinDate, sb.MaxDate)) dg),
filled_data AS (
-- Join the grid to the calculated points and carry the values forward
SELECT ss.ScenarioSessionId, ss.ScenarioId, u.SiteMaterialUsageId, dg.DayStart AS DateFrom,
cs.DayIncoming, cs.DayOutgoing, cs.DayUsage,
-- Carry forward the last known balance
LAST_VALUE(cs.ClosingAtPoint)
IGNORE NULLS OVER ( PARTITION BY ss.ScenarioSessionId, ss.ScenarioId, u.SiteMaterialUsageId ORDER BY dg.DayStart ) AS CurrentClosing
FROM daily_grid dg
JOIN sessions ss ON ss.ScenarioSessionId = dg.ScenarioSessionId
JOIN (SELECT DISTINCT SiteMaterialUsageId, ScenarioSessionId FROM raw_events) u
ON u.ScenarioSessionId = ss.ScenarioSessionId
LEFT JOIN calculated_steps cs
ON cs.ScenarioSessionId = ss.ScenarioSessionId AND cs.ScenarioId = ss.ScenarioId AND
cs.SiteMaterialUsageId = u.SiteMaterialUsageId AND cs.EventDate = dg.DayStart)
-- Final result with Opening and Available calculated
SELECT ScenarioSessionId, ScenarioId, f.SiteMaterialUsageId, DateFrom, t.MaterialId, t.SiteId, t.LocationId,
(NVL(CurrentClosing, 0) - (NVL(DayIncoming, 0) - NVL(DayOutgoing, 0))) AS Opening,
NVL(DayIncoming, 0) AS Incoming, NVL(DayOutgoing, 0) AS Outgoing, NVL(DayUsage, 0) AS Usage,
NVL(CurrentClosing, 0) AS Closing, NVL(CurrentClosing, 0) - NVL(DayUsage, 0) AS Available,
MIN(TRUNC(NVL(CurrentClosing, 0) - NVL(DayUsage, 0)))
OVER (PARTITION BY ScenarioSessionId, ScenarioId, f.SiteMaterialUsageId order by DateFrom desc) AS MinAvailable
FROM filled_data f
JOIN IH#ToolSku t ON t.SiteMaterialUsageId = f.SiteMaterialUsageId
|
| IHSA#DefaultOperations |
|---|
SELECT wc.Id WorkcentreId, MIN(o.Id) OperationTypeId FROM Workcentres wc JOIN WorkcentreTypes wct ON wct.Id = wc.WorkcentreTypeId JOIN OperationTypes o ON o.Workcentretypeid = wct.Id GROUP BY wc.Id |
| IHSA#DefaultProductRoutes |
|---|
SELECT MaterialId, MIN(ProductRouteId) ProductRouteId FROM Productionconfigurations pc GROUP BY MaterialId |
| IHSA#IgnoredSmallDemands |
|---|
WITH q AS ( SELECT sd.ScenarioSessionId, sd.ScenarioId, sd.Id FROM SnoDemands sd JOIN SNOItemsShort si ON si.ScenarioSessionId = sd.ScenarioSessionId AND si.Id = sd.Id AND si.CoProductId IS NULL AND si.Iswarehouse = 0 GROUP BY sd.ScenarioSessionId, sd.ScenarioID, sd.Id HAVING SUM(Aggregated) = 0 ) SELECT sd.ScenarioSessionId, sd.ScenarioID, sd.ID, sd.DateFrom, sd.Netted FROM SNODemands sd JOIN q ON q.ScenarioSessionId = sd.ScenarioSessionId AND q.ScenarioId = sd.ScenarioId AND q.Id = sd.Id AND sd.Netted > 0 |
| IHSA#IndicativesMTD |
|---|
WITH indicative AS
(SELECT ab.SiteMaterialUsageId, ab.WorkcentreId, SUM(VALUE) IndicativeValue
FROM indicatives ab
WHERE DeliveryMonth = TRUNC(core.getInternalDate, 'month')
GROUP BY ab.SiteMaterialUsageId, ab.WorkcentreId),
history AS
(SELECT SiteMaterialUsageId, WorkcentreId, SUM(NVL(AdjustedWeight, Weight)) HistoryWeight
FROM UsageHistories
WHERE TRUNC(DateFrom, 'month') = TRUNC(core.getInternalDate, 'month')
GROUP BY SiteMaterialUsageId, WorkcentreId)
SELECT NVL(a.SiteMaterialUsageId, h.SiteMaterialUsageId) SiteMaterialUsageId, NVL(a.WorkcentreId, h.WorkcentreId) WorkcentreId,
NVL(IndicativeValue, 0) IndicativeValue,
NVL(HistoryWeight, 0) HistoryWeight, WorkingDays, totalWorkingDays,
CASE WHEN WorkingDays = 0 THEN 0 ELSE NVL(IndicativeValue, 0) / WorkingDays END DailyAllocation,
CASE WHEN WorkingDays = 0 OR NVL(IndicativeValue, 0) = 0 OR TotalWorkingDays = 0 THEN 0
ELSE NVL(HistoryWeight, 0) / WorkingDays * TotalWorkingDays / NVL(IndicativeValue, 0) * 100
END Percentage
FROM Indicative a
FULL OUTER JOIN history h
ON h.SiteMaterialUsageId = a.SiteMaterialUsageId
AND h.WorkcentreId = a.WorkcentreId
JOIN IH#SkuWorkingDays c
ON c.SiteMaterialUsageID = NVL(a.SiteMaterialUsageId, h.SiteMaterialUsageId)
AND c.DateFrom = core.getTruncatedInternalDate
|
| IHSA#IndicativesVsOrders |
|---|
WITH orders AS
(
SELECT SiteMaterialUsageId, NVL(oo.WorkcentreId, ol.WorkcentreId) WorkcentreId, SUM(FinalWeight) OrdersWeight,
LEAST(GREATEST(MAX(DeliveryDate), core.getTruncatedInternalDate), LAST_DAY(core.getTruncatedInternalDate)) MaxDeliveryDate
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
LEFT JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
AND oo.IsLastOperation = 1
WHERE TRUNC(DeliveryDate, 'month') = TRUNC(CORE.getInternalDate, 'month')
AND OrderLineStatusCode IN ('Completed', 'Firm')
GROUP BY SiteMaterialUsageId, NVL(oo.WorkcentreId, ol.WorkcentreId)
),
allocations AS
(SELECT ab.SiteMaterialUsageId, ab.WorkcentreId, SUM(VALUE) IndicativesValue
FROM indicatives ab
WHERE DeliveryMonth = TRUNC(core.getInternalDate, 'month')
GROUP BY ab.SiteMaterialUsageId, ab.WorkcentreId)
SELECT o.SiteMaterialUsageID, o.WorkcentreId, WorkingDays, TotalWorkingDays, a.IndicativesValue, o.OrdersWeight,
case when TotalWorkingDays = 0 THEN 0 ELSE a.IndicativesValue / TotalWorkingDays END DailyAllocation,
case when TotalWorkingDays = 0 OR WorkingDays = 0 THEN 0 ELSE a.IndicativesValue / TotalWorkingDays * WorkingDays END CurrentAllocation,
case when TotalWorkingDays = 0 OR WorkingDays = 0 OR a.IndicativesValue = 0 THEN 0 ELSE OrdersWeight / (a.IndicativesValue / TotalWorkingDays * WorkingDays) * 100 end Percentage
FROM Orders o
JOIN IH#SkuWorkingDays s
ON s.SiteMaterialUSageID = o.siteMaterialUsageId
AND s.DateFrom = o.MaxDeliveryDate
JOIN allocations a
ON a.SiteMaterialUsageId = o.SiteMaterialUsageId
AND a.WorkcentreId = o.WorkcentreId
|
| IHSA#InitialSourcePeriods |
|---|
SELECT ScenarioSessionId, ScenarioId, SNPItemId, ActivePeriods,
LISTAGG(WorkcentreList, ';') WITHIN GROUP(ORDER BY SnpItemId, OperationTypeId) InitialSources
FROM (SELECT s.ScenarioSessionId, s.ScenarioId, s.SNPItemId, s.OperationTypeId, r.ActivePeriods,
s.OperationTypeId || ':' || LISTAGG(DISTINCT s.WorkcentreId, ',') WITHIN GROUP(ORDER BY s.WorkcentreId) WorkcentreList
FROM Initialsourcesnapshots s
JOIN Ihsa#initialsourcerules r
ON r.Id = s.InitialSourceRuleId
AND r.ScenarioSessionId = s.ScenarioSessionId
AND r.ScenarioID = s.ScenarioId
AND r.OperationTypeId = s.OperationTypeId
GROUP BY s.ScenarioSessionId, s.ScenarioId, s.SNPItemId, s.OperationTypeId, ActivePeriods)
GROUP BY ScenarioSessionId, ScenarioId, SNPItemId, ActivePeriods
|
| IHSA#InitialSourceRules |
|---|
with sources as (
SELECT
srs.ScenarioSessionId,
srs.ScenarioId,
srs.InitialSourceRuleId,
srs.OperationTypeId,
NVL(ot.OperationTypeName, 'No Operation') AS OperationTypeName,
core.asCsv(CAST(COLLECT(wc.WorkCentreName) AS ParameterArray)) WorkCentres,
core.asCsv(CAST(COLLECT(s.SiteName) AS ParameterArray)) Sites
FROM InitialSourceRuleSourceSnapshots srs
LEFT JOIN WorkCentres wc
ON (wc.Id = srs.WorkCentreId)
LEFT JOIN Sites s
ON (s.Id = srs.SiteId)
LEFT JOIN OperationTypes ot
ON (ot.Id = srs.OperationTypeId)
GROUP BY srs.ScenarioSessionId, srs.ScenarioId, srs.InitialSourceRuleId, srs.OperationTypeId, ot.OperationTypeName
),
periods as (
SELECT
p.InitialSourceRuleId,
p.ScenarioSessionId,
p.ScenarioId,
core.asCsv(CAST(COLLECT(to_char(p.IsActive) ORDER BY p.DateFrom) AS ParameterArray)) ActivePeriods,
SIGN(SUM(p.IsActive)) IsRuleActive
FROM InitialSourceRulePeriodSnapshots p
GROUP BY p.InitialSourceRuleId, p.ScenarioSessionId, p.ScenarioId
)
SELECT
sr.ScenarioSessionId,
sr.ScenarioId,
sr.Id,
sr.IsActive,
sr.RuleWeighting,
sr.DetailId,
srs.OperationTypeId,
srs.OperationTypeName,
srs.WorkCentres,
srs.Sites,
p.ActivePeriods,
p.IsRuleActive
FROM InitialSourceRuleSnapshots sr
JOIN Periods p
ON p.InitialSourceRuleId = sr.Id
AND sr.ScenarioSessionId = p.ScenarioSessionId
AND sr.ScenarioId = p.ScenarioId
JOIN Sources srs
ON srs.InitialSourceRuleId = sr.Id
AND srs.ScenarioSessionId = sr.ScenarioSessionId
AND srs.ScenarioId = sr.ScenarioId
|
| IHSA#InitialSourceSources |
|---|
SELECT sr.ScenarioSessionId, sr.ScenarioId, sr.InitialSourceRuleId, w.WorkCentreID, w.SiteId,
NVL(sr.OperationTypeId, w.OperationTypeId) OperationTypeId
FROM InitialSourceRuleSourceSnapshots sr
JOIN Ih#SiteworkcentreOperations w
ON w.SiteId = sr.SiteId
AND w.OperationTypeId = sr.OperationTypeId
WHERE sr.SiteId IS NOT NULL
AND w.IsProductionSource = 1
AND EXISTS (SELECT 1
FROM Configurationsnapshots cs
WHERE cs.ScenarioSessionId = sr.ScenarioSessionId
AND cs.OperationTypeId = NVL(sr.OperationTypeId, w.OperationTypeId))
UNION
SELECT sr.ScenarioSessionId, sr.ScenarioId, sr.InitialSourceRuleId, w.WorkCentreID, w.SiteId, sr.OperationTypeId
FROM InitialSourceRuleSourceSnapshots sr
JOIN IH#WorkCentres w
ON (w.WorkCentreId = sr.WorkCentreId)
WHERE sr.WorkCentreId IS NOT NULL
AND w.IsProductionSource = 1
AND EXISTS (SELECT 1
FROM Configurationsnapshots cs
WHERE cs.ScenarioSessionId = sr.ScenarioSessionId
AND cs.OperationTypeId = sr.OperationTypeId)
|
| IHSA#InventorySnapshots |
|---|
SELECT i.*, mt.IsFinishedGoods
FROM InventorySnapshots i
JOIN MaterialTypes mt ON i.MaterialTypeId = mt.Id
WHERE NOT EXISTS(SELECT 1 FROM WorkCentres w
JOIN WorkCentreParameterSnapshots wp ON wp.WorkCentreId = w.Id
WHERE wp.ExcludeFromSA = 1
AND wp.ScenarioSessionId = i.ScenarioSessionId
AND wp.ScenarioId = i.ScenarioId
AND w.LocationId = i.LocationId)
AND NOT EXISTS(SELECT 1 FROM WHSKUSnapshots s
WHERE s.ExcludeFromSA = 1
AND s.ScenarioSessionId = i.ScenarioSessionId
AND s.ScenarioId = i.ScenarioId
AND s.SiteMaterialUsageId = i.SiteMaterialUsageId)
|
| IHSA#MaterialRunSnapshots |
|---|
SELECT WorkcentreName, CycleType, InitialDuration / 60 Hours, mr.* FROM Snpmaterialrunsnapshots mr JOIN Workcentres wc ON wc.Id = mr.WorkcentreId JOIN IHSA#CycleTypes ct ON ct.CycleTypeId = mr.CycleTypeId AND ct.ScenarioId = mr.ScenarioId AND mr.ScenarioSessionId = ct.ScenarioSessionId ORDER BY WorkcentreId, SourcePeriod, StartDate |
| IHSA#NettedLiveAllocation |
|---|
WITH OrderLineOperations
AS (
SELECT SiteMaterialUsageId, NVL(oo.MaterialId, ol.MaterialId) SourceMaterialId,
TRUNC(NVL(oo.DueDate, ol.DespatchDate), DECODE(LiveAllocationPeriod, 'Month', 'month', 'IW')) SourceDate,
oo.WorkcentreId, oo.OperationTypeId, SUM(oo.Quantity) Quantity
FROM OrderLines ol
JOIN OrderOperations oo
ON oo.OrderLineId = ol.Id
JOIN Orderlinestatuses ols
ON ols.Id = ol.OrderLineStatusId
JOIN OrderOperationStatuses oos
ON oos.Id = oo.OrderOperationStatusId
CROSS JOIN (SELECT NVL(MIN(VALUE), 'WeekMonth') LiveAllocationPeriod
FROM SystemParameters
WHERE ParameterName = 'LiveAllocationPeriod') p
WHERE OrderLineStatusCode IN ('Firm', 'Completed')
AND OrderOperationStatusCode IN ('Firm', 'Completed')
GROUP BY SiteMaterialUsageId, NVL(oo.MaterialId, ol.MaterialId), oo.OperationTypeId,
TRUNC(NVL(oo.DueDate, ol.DespatchDate), DECODE(LiveAllocationPeriod, 'Month', 'month', 'IW')),
oo.WorkcentreId
),
allocations AS
(
SELECT ab.SiteMaterialUsageId, NVL(ab.SourceMaterialId, smu.MaterialId) SourceMaterialId,
DECODE(LiveAllocationPeriod, 'Month', ab.SourceMonth, ab.SourceWeek) SourceDate,
ab.WorkcentreId, ab.OperationTypeId, SUM(ab.Customer) Allocation
FROM AllocationBodies ab
JOIN SiteMaterialUsages smu ON smu.Id = ab.SiteMaterialUsageId
CROSS JOIN (SELECT NVL(MIN(VALUE), 'WeekMonth') LiveAllocationPeriod
FROM SystemParameters
WHERE ParameterName = 'LiveAllocationPeriod') p
WHERE ab.Customer > 0
GROUP BY ab.SiteMaterialUsageId, NVL(ab.SourceMaterialId, smu.MaterialId),
ab.OperationTypeId, DECODE(LiveAllocationPeriod, 'Month', ab.SourceMonth, ab.SourceWeek),
ab.WorkcentreId
)
SELECT NVL(a.SiteMaterialUsageId, oo.SiteMaterialUsageId) SiteMaterialUsageId,
NVL(a.SourceMaterialId, oo.SourceMaterialId) SourceMaterialId,
NVL(a.WorkcentreId, oo.WorkcentreId) WorkcentreId,
NVL(a.OperationTypeId, oo.OperationTypeId) OperationTypeId,
NVL(a.SourceDate, oo.SourceDate) SourceDate,
SUM(NVL(a.Allocation,0)) Allocation, SUM(NVL(oo.Quantity,0)) Quantity,
GREATEST(0, SUM(NVL(a.Allocation,0) - NVL(oo.Quantity,0))) RemainingAllocation
FROM allocations a
FULL OUTER JOIN OrderLineOperations oo
ON a.SiteMaterialUsageId = oo.SiteMaterialUsageId
AND a.WorkcentreId = oo.WorkcentreId
AND a.OperationTypeId = oo.OperationTypeId
AND a.SourceDate = oo.SourceDate
GROUP BY NVL(a.SiteMaterialUsageId, oo.SiteMaterialUsageId),
NVL(a.SourceMaterialId, oo.SourceMaterialId),
NVL(a.WorkcentreId, oo.WorkcentreId),
NVL(a.OperationTypeId, oo.OperationTypeId),
NVL(a.SourceDate, oo.SourceDate)
HAVING GREATEST(0, SUM(a.Allocation - NVL(oo.Quantity,0))) > 0 OR SUM(NVL(oo.Quantity,0)) > 0
|
| IHSA#OnHoldStock |
|---|
WITH RawData AS
(SELECT sa.ScenarioSessionId, sa.ScenarioId, sa.SiteId, sa.Allocation, sa.SourceDate, sa.DispatchDate
FROM SourcingAllocation sa
JOIN WorkCentres wc
ON wc.Id = sa.WorkCentreId
JOIN WorkcentreTypes wct
ON wct.Id = wc.WorkcentreTypeId
WHERE wct.IsProductionSource = 1)
SELECT ScenarioSessionId, ScenarioId, SiteId, DateFrom,
SUM(CASE WHEN DateType = 'SRC' THEN Allocation ELSE 0 END) AS Produced,
SUM(CASE WHEN DateType = 'DISP' THEN Allocation ELSE 0 END) AS Dispatched
FROM RawData UNPIVOT
INCLUDE NULLS(DateFrom FOR DateType IN
(SourceDate AS 'SRC', DispatchDate AS 'DISP'))
GROUP BY ScenarioSessionId, ScenarioId, SiteId, DateFrom
|
| IHSA#OrderLines |
|---|
SELECT o.ScenarioSessionId, o.OrderLineId, o.OrderOperationId,
DECODE(IsFirm, 1, 'Firm', 2, 'Completed', 'Tentative') MovementStatus,
NVL2(o.OrderOperationId, 'OrderOperation', 'OrderLine') MovementType,
o.SnoItemId, SourceType, DestinationType, LocationCode, WorkcentreCode, SiteCode,
OperationTypeName, SourcePeriod, DeliveryPeriod, Weight, RemainingWeight, StageNo, IsLastStage
FROM Snoallordersnapshots o
LEFT JOIN Workcentres wc
ON wc.Id = o.WorkcentreId
LEFT JOIN Sites s
ON s.Id = o.SiteId
JOIN Locations l
ON o.LocationId = l.Id
LEFT JOIN OperationTypes ot
ON ot.Id = o.OperationTypeId
|
| IHSA#OrderOperations |
|---|
SELECT ol.MaterialId, oo.WorkcentreId, NVL(oo.OperationTypeId, o.OperationTypeId) OperationTypeId,
TRUNC(NVL(oo.DueDate, ol.DespatchDate), 'IW') SourceWeek,
pr.ProductRouteId, m.ReplenishmentFlag, SIGN(NVL(wc.Id, 0)) IsWarehouse, NVL(oo.Quantity, ol.Finalweight) Weight
FROM OrderLines ol
LEFT JOIN OrderOperations oo
ON oo.Orderlineid = ol.Id
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusID
JOIN OrderOperationStatuses oos
ON oos.Id = oo.OrderOperationStatusId
LEFT JOIN Workcentres wc
ON wc.LocationId = ol.LocationId
JOIN IHSA#ReplenishedMaterials m ON m.MaterialId = ol.MaterialId
LEFT JOIN IHSA#DefaultOperations o ON o.WorkcentreId = oo.WorkcentreId
LEFT JOIN IHSA#DefaultProductRoutes pr ON pr.MaterialId = ol.MaterialId
WHERE OrderLineStatusCode IN ('Firm', 'Completed')
AND OrderOperationStatusCode IN ('Firm', 'Completed')
|
| IHSA#PairsOfToolsSku |
|---|
WITH tools
AS (
SELECT m.Id MaterialId, UsedWithMaterialId, MaterialTypeId, m.MaterialCode
FROM Materials m
JOIN MaterialTypes mt ON mt.Id = m.MaterialTypeId
WHERE mt.IsTool = 1 AND NOT EXISTS (SELECT 1 FROM Materials d WHERE d.UsedWithMaterialId = m.Id)
)
SELECT smu1.Id SiteMaterialUsageId, NVL(smu2.Id, smu1.Id) SecondSiteMaterialUsageId, q.MaterialId,
q.MaterialTypeID, q.MaterialCode, wc.WorkcentreId, wc.SiteId
FROM tools q
LEFT JOIN SiteMaterialUsages smu1 ON smu1.MaterialId = q.MaterialId
LEFT JOIN SiteMaterialUsages smu2
ON smu2.MaterialId = q.UsedWithMaterialId AND smu1.LocationId = smu2.LocationId
JOIN IH#SiteWorkcentres wc ON wc.LocationId = NVL(smu1.LocationId, smu2.LocationId)
|
| IHSA#ProductionConfigurations |
|---|
SELECT gs.ScenarioSessionId, gs.MaterialId, MIN(cs.ProductRouteId) ProductRouteId,
gs.ConfigurationSet
FROM GradeSnapshots gs
JOIN ConfigurationSnapshots cs
ON cs.ScenarioSessionId = gs.ScenarioSessionId
AND cs.MaterialId = gs.MaterialId
GROUP BY gs.ScenarioSessionId, gs.MaterialId, gs.ConfigurationSet
|
| IHSA#ProductionPlanSnapshots |
|---|
SELECT WorkcentreName, CycleType, InitialDuration / 60 Hours, p.* FROM SnpProductionPlanSnapshots p JOIN Workcentres wc ON wc.Id = p.WorkcentreId JOIN IHSA#CycleTypes ct ON ct.CycleTypeId = p.CycleTypeId aND p.ScenarioId = ct.ScenarioId AND p.ScenarioSessionId = ct.ScenarioSessionId ORDER BY WorkcentreId, SourcePeriod, StartDate |
| IHSA#ProductionRates |
|---|
SELECT ScenarioSessionId, ScenarioId, Effective, WorkcentreId, OperationTypeId, DetailId, Rate, OriginalRate, DECODE(rt.ProductionRateType, 'Nett', Rate, Rate * pr.MaterialEfficiency / 100) NettRate, TimeEfficiency, MaterialEfficiency, ConversionFactor, IsGenerated FROM ProductionRateSnapshots pr CROSS JOIN (SELECT NVL(MIN(VALUE), 'Nett') ProductionRateType FROM SystemParameters WHERE ParameterName = 'ProductionRateType') rt |
| IHSA#ProductionUtilisation |
|---|
WITH q AS
(
SELECT mi.ScenarioSessionId, ScenarioId, OrderNo, wc.WorkcentreTypeId, WorkcentreTypeDesc, mi.WorkcentreId,
DateFrom, TimePeriod, PeriodLength * 24 * NumberOfWorkcentres PeriodHours,
SUM( (PeriodLength * NumberOfWorkcentres * 24 - ShutHours) * ((100 - TimeEfficiency) / 100)) RoughTimeLostHours,
SUM(AvailableCapacityHours) AvailableCapacityHours,
SUM(NominalCapacityHours) TotalHours,
SUM(ShutHours) ShutHours,
SUM(OrdersHours) OrdersHours, SUM(CoProductOrdersHours) CoProductOrdersHours,
SUM(CoProductAllocationHours) CoProductAllocationHours, SUM(AllocationHours) AllocationHours,
SUM(FixedCapacityHours) FixedHours,
SUM(GREATEST(0, GREATEST(0, CapacityHours - OrdersHours - CoProductOrdersHours - AllocationHours - CoProductAllocationHours))) FreeCapacityHours,
SUM(Orders) OrdersWeight,
SUM(Allocation) AllocationWeight,
SUM(CoProductOrders) CoProductOrdersWeight,
SUM(CoProductAllocation) CoProductAllocationWeight,
SUM(DECODE(NominalCapacityHours, 0, 0, NominalCapacity / NominalCapacityHours * GREATEST(0, AvailableCapacityHours - OrdersHours - CoProductOrdersHours - AllocationHours - CoProductAllocationHours))) UnallocatedCapacity
FROM Machineinformation mi
JOIN IH#Workcentres wc
ON wc.WorkcentreId = mi.workcentreId
AND wc.OrderNo > 0
JOIN ScenarioPeriodSnapshots p ON p.startperiod = mi.DateFrom
AND p.ScenarioSessionId = mi.ScenarioSessionId
WHERE wc.IsProductionSource = 1
GROUP BY mi.ScenarioSessionId, ScenarioId, OrderNo, NumberOfWorkcentres, wc.WorkcentreTypeId, WorkcentreTypeDesc,
DateFrom, TimePeriod, PeriodLength, CUBE(mi.WorkcentreId)
)
SELECT ScenarioSessionId, ScenarioId, q.WorkcentreTypeId, q.WorkcentreTypeDesc, q.OrderNo, q.WorkcentreId, WorkcentreName, WorkcentreCode, SiteCode,
SiteName, DateFrom, TimePeriod, PeriodHours, RoughTimeLostHours, AvailableCapacityHours, TotalHours, ShutHours,
OrdersHours, CoProductOrdersHours,
AllocationHours, CoProductAllocationHours,
FixedHours, FreeCapacityHours,
OrdersWeight, AllocationWeight,
CoProductOrdersWeight, CoProductAllocationWeight,
UnallocatedCapacity,
CASE WHEN ROUND(OrdersHours + AllocationHours + CoProductOrdersHours + CoProductAllocationHours, 2) > ROUND(AvailableCapacityHours, 2) THEN 1 ELSE 0 END IsOverbooked,
CASE WHEN ROUND(OrdersHours + AllocationHours + CoProductOrdersHours + CoProductAllocationHours, 2) = ROUND(AvailableCapacityHours, 2) THEN 1 ELSE 0 END IsBottleneck
FROM q
LEFT JOIN IH#Workcentres wc
ON wc.WorkcentreId = q.WorkcentreId
AND wc.OrderNo > 0
ORDER BY ScenarioSessionId, ScenarioId, q.OrderNo,
DateFrom, TimePeriod, WorkcentreName NULLS FIRST, WorkcentreCode NULLS FIRST
|
| IHSA#RealInventoryProfile |
|---|
SELECT
r.SiteMaterialUsageId, r.ConsignmentLocationId, NVL2(r.SiteMaterialUsageId, r.SiteMaterialUsageId || '-' || NVL(r.ConsignmentLocationId, 0), '') SkuKey,
r.DateFrom,
r.Opening, r.OrdersIn, r.OrdersOut, 0 AS Forecast, r.Closing, r.SafetyStock
FROM RealInventoryProfilesiplanview r
|
| IHSA#RealInventoryProfileReduced |
|---|
WITH
SessionParams AS (
SELECT /*+ MATERIALIZE */ ss.ID AS ScenarioSessionId, ss.StartDate, ss.StartWeek,
CASE WHEN (SELECT NVL(MIN(sp.Value), 'DeliveryDate') FROM SystemParameters sp
WHERE sp.ParameterName = 'RPClosingCalculationMethod') = 'DeliveryDate'
THEN 1 ELSE 0 END AS IsSameDay
FROM ScenarioSessions ss
),
Actuals AS (
SELECT r.SiteMaterialUsageId, r.ConsignmentLocationId, r.DateFrom,
r.Opening, r.OrdersIn, r.OrdersOut, r.SafetyStock, ss.ScenarioSessionId
FROM RealInventoryProfilesiplanview r
cross join sessionparams ss
WHERE r.DateFrom >= ss.StartDate
),
Forecasts AS (
SELECT sp.SourceSiteMaterialUsageId AS SiteMaterialUsageId, sp.ConsignmentLocationId,
f.DateFrom, SUM(f.Final) AS Forecast, ss.ScenarioSessionId
FROM IHDP#DaySystemForecast f
JOIN SourcePriorities sp ON sp.SiteMaterialUsageId = f.SiteMaterialUsageId AND sp.IsActive = 1 AND sp.Priority = 1
cross join sessionparams ss
WHERE f.DateFrom BETWEEN ss.StartDate AND ss.StartWeek - 1
GROUP BY sp.SourceSiteMaterialUsageId, sp.ConsignmentLocationId, f.DateFrom, ss.ScenarioSessionId
),
ProfilesRaw AS (
SELECT
NVL(a.ScenarioSessionId, f.ScenarioSessionId) as ScenarioSessionId,
NVL(a.SiteMaterialUsageId, f.SiteMaterialUsageId) AS SiteMaterialUsageId,
NVL(a.ConsignmentLocationId, f.ConsignmentLocationId) AS ConsignmentLocationId,
NVL(a.DateFrom, f.DateFrom) AS DateFrom,
NVL(a.Opening, 0) AS RawOpening,
NVL(a.OrdersIn, 0) AS OrdersIn,
NVL(a.OrdersOut, 0) AS OrdersOut,
NVL(f.Forecast, 0) AS Forecast,
NVL(a.SafetyStock, 0) AS SafetyStock
FROM Actuals a
FULL OUTER JOIN Forecasts f ON a.SiteMaterialUsageId = f.SiteMaterialUsageId
AND NVL(a.ConsignmentLocationId, 0) = NVL(f.ConsignmentLocationId, 0)
AND a.DateFrom = f.DateFrom
AND a.ScenarioSessionId = f.ScenarioSessionId
),
CalculatedRunning AS (
SELECT
pr.*,
p.IsSameDay,
FIRST_VALUE(pr.RawOpening) OVER(PARTITION BY pr.ScenarioSessionId, pr.SiteMaterialUsageId, pr.ConsignmentLocationId ORDER BY pr.DateFrom) AS InitialOpening,
CASE WHEN p.IsSameDay = 1 THEN pr.OrdersIn
ELSE LAG(pr.OrdersIn, 1, 0) OVER(PARTITION BY pr.ScenarioSessionId, pr.SiteMaterialUsageId, pr.ConsignmentLocationId ORDER BY pr.DateFrom)
END AS EffectiveOrdersIn
FROM ProfilesRaw pr
JOIN SessionParams p ON p.ScenarioSessionId = pr.ScenarioSessionId
)
SELECT
ScenarioSessionId, SiteMaterialUsageId, ConsignmentLocationId, NVL2(SiteMaterialUsageId, SiteMaterialUsageId || '-' || NVL(ConsignmentLocationId, 0), '') SkuKey,
DateFrom,
NVL(LAG(Closing) OVER(PARTITION BY ScenarioSessionId, SiteMaterialUsageId, ConsignmentLocationId ORDER BY DateFrom), InitialOpening) AS Opening,
OrdersIn, OrdersOut, Forecast,
(InitialOpening + SUM(EffectiveOrdersIn - Forecast - OrdersOut) OVER(PARTITION BY ScenarioSessionId, SiteMaterialUsageId, ConsignmentLocationId ORDER BY DateFrom)) AS Closing,
SafetyStock
FROM (
SELECT c.*, (InitialOpening + SUM(EffectiveOrdersIn - Forecast - OrdersOut) OVER(PARTITION BY ScenarioSessionId, SiteMaterialUsageId, ConsignmentLocationId ORDER BY DateFrom)) as Closing
FROM CalculatedRunning c
)
|
| IHSA#ReplenishedMaterials |
|---|
SELECT m.Id MaterialId, NVL(ab.ReplenishmentFlag, 0) ReplenishmentFlag FROM Materials m LEFT JOIN (SELECT MaterialId, MAX(ReplenishmentFlag) ReplenishmentFlag FROM AllocationBodies2 GROUP BY MaterialId) ab ON ab.MaterialId = m.Id |
| IHSA#ScenarioFullPeriods |
|---|
SELECT p.ScenarioSessionId, p.StartPeriod StartDate, ROW_number() OVER (partition by ScenarioSessionId Order by StartPeriod) - 1 PeriodNumber
FROM ScenarioPeriodSnapshots p
JOIN ScenarioSessions SS
ON ss.Id = p.ScenarioSessionId
WHERE StartPeriod = CASE WHEN ss.SnapshotPeriodType IN ('WeekMonth2', 'WeekMonth') THEN TRUNC(StartPeriod, 'IW') ELSE StartPeriod End
|
| IHSA#ScenarioParameters |
|---|
SELECT s.ScenarioSessionId, s.ScenarioId, ss.SessionName, c.ScenarioName,
s.ParameterName, p.ParameterDescription, s.Value
FROM Scenarioparameters s
JOIN SystemParameters p ON s.ParameterName = p.ParameterName
JOIN ScenarioSessions ss ON s.ScenarioSessionId = ss.Id
JOIN Scenarios c ON c.ScenarioSessionId = ss.Id
AND c.Id = s.ScenarioId
|
| IHSA#SiteMape |
|---|
WITH a AS
(
SELECT ab.SiteMaterialUsageId, ab.WorkcentreId, ab.DeliveryMonth, ab.Customer, ab.System, 0 Orders, 0 OrdersIncludeSupercessions, 0 BackOrders, 0 History, 0 AdjustedHistory,
0 SupersededHistory, 0 Indicatives
FROM AllocationBodies ab
WHERE ab.System > 0 or ab.Customer > 0
UNION ALL
SELECT ol.SiteMaterialUsageId, ol.WorkcentreId, ol.DeliveryMonth,
0 Customer, 0 System,
ol.Orders, ol.OrdersIncludeSupercessions, 0 BackOrders,
0 History, 0 AdjustedHistoryWeight, 0 SupersededHistory, 0 Indicatives
FROM IH#SiteSupersededOrders ol
WHERE ol.Orders != 0 OR ol.OrdersIncludeSupercessions != 0
UNION ALL
SELECT ol.SiteMaterialUsageId, ol.WorkcentreId, DeliveryDate DeliveryMonth,
0 Customer, 0 System,
0 Orders, 0 OrdersIncludeSupercessions, BackOrders BackOrders,
0 History, 0 AdjustedHistoryWeight, 0 SupersededHistory, 0 Indicatives
FROM IH#BackOrders ol
UNION ALL
SELECT h.SiteMaterialUsageId, h.WorkcentreId, DateFrom DeliveryMonth, 0 Customer, 0 System, 0 Orders, 0 OrdersIncludeSupercessions,
0 BackOrders,
Weight History, adjustedHistoryWeight AdjustedHistory, 0 SupersededHistory, 0 Indicatives
FROM IH#SiteMonthlyHistories h
WHERE Weight != 0 OR adjustedHistoryWeight != 0
UNION ALL
SELECT h.SiteMaterialUsageId, h.WorkcentreId, DateFrom DeliveryMonth, 0 Customer, 0 System, 0 Orders, 0 OrdersIncludeSupercessions, 0 BackOrders,
0 History, 0 AdjustedHistory, AdjustedSupersededHistory SupersededHistory, 0 Indicatives
FROM IH#SiteSupersededHistories h
WHERE AdjustedSupersededHistory != 0
UNION ALL
SELECT SiteMaterialUsageId, i.WorkcentreId, DeliveryMonth, 0 Customer, 0 System, 0 Orders, 0 OrdersIncludeSupercessions, 0 BackOrders,
0 History, 0 AdjustedHistory, 0 SupersededHistory, Value Indicatives
FROM Indicatives i
WHERE Value > 0
)
SELECT SiteMaterialUsageId, WorkcentreId, DeliveryMonth, SUM(Customer) Customer, SUM(System) System, SUM(Orders) Orders,
SUM(OrdersIncludeSupercessions) OrdersIncludeSupercessions,
SUM(BackOrders) BackOrders,
SUM(History) History, SUM(AdjustedHistory) AdjustedHistory,
SUM(SupersededHistory) SupersededHistory,
SUM(Indicatives) Indicatives
FROM a
GROUP BY SiteMaterialUsageId, WorkcentreId, DeliveryMonth
|
| IHSA#SiteWarehouseAllocation | Sourcing allocations mapped to the main warehouse SKU of the source workcentre site. This view contains only SourcingAllocation data and keeps scenario identity. |
|---|
SELECT DISTINCT a.ScenarioSessionId,
a.ScenarioId,
a.Id,
a.WorkcentreId,
wc.SiteId,
mw.LocationId,
sku.SiteMaterialUsageId,
sku.MaterialId,
a.SourceDate,
a.DispatchDate,
a.Allocation AllocationIn,
a.Allocation AllocationOut,
a.AllocationId,
a.StageNo,
a.SeqNo,
a.IsLastStage,
a.CoProductId
FROM SourcingAllocation a
JOIN IH#Workcentres wc
ON wc.WorkcentreId = a.WorkcentreId
JOIN IH#MainWarehouses mw
ON mw.SiteId = wc.SiteId
JOIN IH#SiteWarehouseSku sku
ON sku.SiteId = mw.SiteId
AND sku.LocationId = mw.LocationId
AND sku.MaterialId = a.SourceMaterialId
WHERE a.Allocation > 0
|
| IHSA#SnapshotPeriodTypes |
|---|
SELECT 'day' PeriodType, 0 PeriodTypeOrder FROM dual UNION ALL SELECT 'weekmonth' PeriodType, 1 PeriodTypeOrder FROM dual UNION ALL SELECT 'weekmonth2' PeriodType, 2 PeriodTypeOrder FROM dual UNION ALL SELECT 'week' PeriodType, 3 PeriodTypeOrder FROM dual UNION ALL SELECT 'month' PeriodType, 4 PeriodTypeOrder FROM dual UNION ALL SELECT 'quarter' PeriodType, 5 PeriodTypeOrder FROM dual UNION ALL SELECT 'total' PeriodType, 6 PeriodTypeOrder FROM dual |
| IHSA#SnapshotTables |
|---|
WITH TableColumns AS (
SELECT c.table_name AS TableName,
MAX(CASE WHEN c.column_name = 'SCENARIOSESSIONID' THEN 1 ELSE 0 END) AS HasSessionFlag,
MAX(CASE WHEN c.column_name = 'SCENARIOID' THEN 1 ELSE 0 END) AS HasScenarioFlag,
MAX(CASE WHEN c.column_name = 'SNAPSHOTSTATE' THEN 1 ELSE 0 END) AS HasStateFlag
FROM user_tab_columns c
INNER JOIN user_tables t
ON c.table_name = t.table_name
WHERE c.column_name IN ('SCENARIOSESSIONID', 'SCENARIOID', 'SNAPSHOTSTATE')
AND t.TABLE_NAME NOT IN ('SCENARIOS', 'SCENARIOSESSION')
GROUP BY c.table_name
)
SELECT TableName,
HasScenarioFlag,
HasStateFlag,
CASE
WHEN HasSessionFlag = 1 AND HasScenarioFlag = 0 AND HasStateFlag = 0
THEN '1. Session only data'
WHEN HasSessionFlag = 1 AND HasScenarioFlag = 1 AND HasStateFlag = 0
THEN '2. Scenario data'
WHEN HasSessionFlag = 1 AND HasScenarioFlag = 0 AND HasStateFlag = 1
THEN '3. Scenario with active data'
ELSE '4. Wrong configuration for SNP tables'
END AS GroupName
FROM TableColumns
WHERE HasSessionFlag = 1
ORDER BY GroupName, TableName
|
| IHSA#SNoAllOrderSnapshots |
|---|
SELECT so.ScenarioSessionId, s.Id as ScenarioId, so.SNoItemId, so.CoProductid,
so.OrderLineId, so.OrderOperationId, so.SourceType, so.DestinationType,
so.IsFirm, so.DeliveryPeriod, so.SourcePeriod, so.DespatchDate, so.IsLastStage,
so.Weight, so.RemainingWeight,
mo.Remainingweight MovableWeight,
so.Weight - NVL(mo.Remainingweight,0) NonMoveableWeight,
NVL(mo.IsIgnoredForNetting,0) IsIgnoredForNetting,
so.PropertyValueId, so.WorkcentreId, so.OperationTypeId,
so.SiteMaterialUsageId, so.MaterialId, so.SourceMaterialId, so.MasterRouteId, so.SiteId
FROM SNOALLOrderSnapshots so
JOIN ScenarioSessions ss
ON ss.Id = so.ScenarioSessionId
JOIN Scenarios s
ON s.ScenarioSessionId = ss.Id
LEFT JOIN SNOMovableOrderSnapshots mo
ON mo.ScenarioSessionId = ss.Id
AND mo.ScenarioId = s.Id
AND mo.OrderLineId = so.OrderLineId
AND NVL(mo.OrderOperationId, 0) = NVL(so.OrderOperationId, 0)
|
| IHSA#SNODemands |
|---|
SELECT si.Id SNPItemId, si.MaterialId, sd.*, NVL(ur.description, 'Fully Allocated') AllocationStatus, Aggregated + MoveableFirm - DECODE(NVL(sd.CoProductId,0), 0, sd.allocation, 0) UnallocatedVolume, DECODE(NVL(sd.CoProductId,0), 0, sd.Aggregated, sd.Allocation) PriceVolume, Aggregated AS DemandIncludeMandatory, DECODE(NVL(sd.CoProductId,0), 0, sd.Aggregated, sd.Allocation) * Price PriceVolume2 FROM SNODemands sd LEFT JOIN UnallocatedReasons ur ON ur.Id = sd.Unallocatedreasonid JOIN SnoItemsShort si on si.ScenarioSessionId = sd.ScenarioSessionId AND si.Id = sd.Id AND NVL(si.CoProductId,0) = NVL(sd.CoProductId,0) JOIN CustomerRankSnapshots cr on cr.ScenarioSessionId = si.ScenarioSessionId and cr.ScenarioId = sd.ScenarioId AND cr.Id = si.Customerrankid WHERE cr.DisplayInForecast = 1 |
| IHSA#SNPItemDemandAnalysis |
|---|
WITH inputDemands AS
(
SELECT sd.ScenarioSessionId,
sd.ScenarioId,
sd.Id SnpItemId,
sd.DateFrom,
NULL OrderLineId,
sd.Price,
NVL(sd.OptionalDemand, 0) OptionalDemand,
0 MandatoryDemand,
NVL(sd.OptionalDemand, 0) Demand,
0 PreAllocatedDemand,
0 IsMandatory
FROM SNODemands sd
JOIN SNOItemsShort si
ON si.ScenarioSessionId = sd.ScenarioSessionId
AND si.Id = sd.Id
AND si.CoProductId IS NULL
WHERE sd.CoProductId IS NULL
AND sd.IsDemand = 1
AND NVL(sd.OptionalDemand, 0) > 0
UNION ALL
SELECT sd.ScenarioSessionId,
sd.ScenarioId,
sd.Id SnpItemId,
sd.DateFrom,
NULL OrderLineId,
sd.Price,
0 OptionalDemand,
NVL(sd.MandatoryDemand, 0) MandatoryDemand,
NVL(sd.MandatoryDemand, 0) Demand,
0 PreAllocatedDemand,
1 IsMandatory
FROM SNODemands sd
JOIN SNOItemsShort si
ON si.ScenarioSessionId = sd.ScenarioSessionId
AND si.Id = sd.Id
AND si.CoProductId IS NULL
WHERE sd.CoProductId IS NULL
AND sd.IsDemand = 1
AND NVL(sd.MandatoryDemand, 0) > 0
UNION ALL
SELECT sd.ScenarioSessionId,
sd.ScenarioId,
sd.Id SnpItemId,
sd.DateFrom,
NULL OrderLineId,
sd.Price,
0 OptionalDemand,
0 MandatoryDemand,
0 Demand,
NVL(sd.PreAllocatedDemand, 0) PreAllocatedDemand,
CAST(NULL AS INTEGER) IsMandatory
FROM SNODemands sd
JOIN SNOItemsShort si
ON si.ScenarioSessionId = sd.ScenarioSessionId
AND si.Id = sd.Id
AND si.CoProductId IS NULL
WHERE sd.CoProductId IS NULL
AND sd.IsDemand = 1
AND NVL(sd.PreAllocatedDemand, 0) > 0
UNION ALL
SELECT mo.ScenarioSessionId,
mo.ScenarioId,
mo.SnoItemId SnpItemId,
o.DeliveryPeriod DateFrom,
mo.OrderLineId,
o.Price,
0 OptionalDemand,
mo.RemainingWeight MandatoryDemand,
mo.RemainingWeight Demand,
0 PreAllocatedDemand,
1 IsMandatory
FROM SNOMovableOrderSnapshots mo
JOIN SnoAllOrderSnapshots o
ON o.ScenarioSessionId = mo.ScenarioSessionId
AND o.SnoItemId = mo.SnoItemId
AND o.OrderLineId = mo.OrderLineId
AND o.IsLastStage = 1
JOIN SNOItemsShort si
ON si.ScenarioSessionId = mo.ScenarioSessionId
AND si.Id = mo.SnoItemId
AND si.CoProductId IS NULL
WHERE mo.IsDemand = 1
), allocations AS
(
SELECT sa.ScenarioSessionId,
sa.ScenarioId,
sa.Id SnpItemId,
sa.DeliveryDate DateFrom,
sa.OrderLineId,
SUM(CASE WHEN sa.IsLastStage = 1 THEN sa.Allocation ELSE 0 END) Allocation,
SUM(sa.ProductionCost) ProductionCost,
SUM(sa.TransportCost) TransportCost,
SUM(sa.InventoryCost) InventoryCost
FROM SourcingAllocation sa
WHERE NVL(sa.CoProductId, 0) = 0
GROUP BY sa.ScenarioSessionId, sa.ScenarioId, sa.Id, sa.DeliveryDate, sa.OrderLineId
), unallocated AS
(
SELECT u.ScenarioSessionId,
u.ScenarioId,
u.SnpItemId,
u.DateFrom,
u.OrderLineId,
u.IsMandatory,
SUM(GREATEST(u.Demand - u.Allocation, 0)) UnallocatedDemand,
SUM(u.Allocation) Allocation,
LISTAGG(DISTINCT r.Description, '; ') WITHIN GROUP (ORDER BY r.Description) ReasonName,
MIN(u.FirstDeliveryDate) FirstDeliveryDate,
MIN(u.TotalCost) UnallocatedTotalCost,
MIN(u.TransportCost) UnallocatedTransportCost,
MIN(u.TransportTime) TransportTime
FROM SNPUnallocatedItems u
JOIN UnallocatedReasons r
ON r.Id = u.UnallocatedReasonId
GROUP BY u.ScenarioSessionId, u.ScenarioId, u.SnpItemId, u.DateFrom, u.OrderLineId, u.IsMandatory
), demandRows AS
(
SELECT d.*,
a.Allocation TotalAllocation,
SUM(d.PreAllocatedDemand) OVER (
PARTITION BY d.ScenarioSessionId, d.ScenarioId, d.SnpItemId, d.DateFrom, d.OrderLineId
) PreAllocatedTotal,
a.ProductionCost,
a.TransportCost,
a.InventoryCost,
u.UnallocatedDemand,
u.ReasonName,
u.FirstDeliveryDate,
u.UnallocatedTotalCost,
u.UnallocatedTransportCost,
u.TransportTime,
CASE
WHEN d.IsMandatory IS NULL THEN 0
WHEN d.OrderLineId IS NOT NULL THEN NVL(a.Allocation, 0)
WHEN u.SnpItemId IS NOT NULL THEN NVL(u.Allocation, 0)
ELSE d.Demand
END EngineAllocation
FROM inputDemands d
LEFT JOIN allocations a
ON a.ScenarioSessionId = d.ScenarioSessionId
AND a.ScenarioId = d.ScenarioId
AND a.SnpItemId = d.SnpItemId
AND a.DateFrom = d.DateFrom
AND (a.OrderLineId = d.OrderLineId OR (a.OrderLineId IS NULL AND d.OrderLineId IS NULL))
LEFT JOIN unallocated u
ON u.ScenarioSessionId = d.ScenarioSessionId
AND u.ScenarioId = d.ScenarioId
AND u.SnpItemId = d.SnpItemId
AND u.DateFrom = d.DateFrom
AND (u.OrderLineId = d.OrderLineId OR (u.OrderLineId IS NULL AND d.OrderLineId IS NULL))
AND u.IsMandatory = d.IsMandatory
)
SELECT d.ScenarioSessionId,
d.ScenarioId,
d.SnpItemId,
d.DateFrom,
p.PeriodNumber,
d.OrderLineId,
d.Price,
d.Demand,
d.EngineAllocation Allocation,
CASE WHEN d.TotalAllocation > d.PreAllocatedTotal THEN d.ProductionCost * d.EngineAllocation / (d.TotalAllocation - d.PreAllocatedTotal) ELSE 0 END ProductionCost,
CASE WHEN d.TotalAllocation > d.PreAllocatedTotal THEN d.TransportCost * d.EngineAllocation / (d.TotalAllocation - d.PreAllocatedTotal) ELSE 0 END TransportCost,
CASE WHEN d.TotalAllocation > d.PreAllocatedTotal THEN d.InventoryCost * d.EngineAllocation / (d.TotalAllocation - d.PreAllocatedTotal) ELSE 0 END InventoryCost,
d.UnallocatedDemand,
d.ReasonName,
d.FirstDeliveryDate,
d.UnallocatedTotalCost,
d.UnallocatedTransportCost,
d.TransportTime,
d.IsMandatory
FROM demandRows d
JOIN IH#ScenarioPeriodSnapshots p
ON p.ScenarioSessionId = d.ScenarioSessionId
AND p.StartPeriod = d.DateFrom
|
| IHSA#SNPItemDemands |
|---|
SELECT sd.ScenarioSessionId, Id, DECODE(p.IsPartial, 1, p.PeriodNumber + 1, p.PeriodNumber) PeriodNumber,
Price, OptionalDemand, MandatoryDemand, NULL OrderLineId, NULL OperationTypeId, NULL WorkCentreId, NULL SiteId
FROM SNODemands sd
JOIN IH#ScenarioPeriodSnapshots p
ON p.StartPeriod = sd.DateFrom
AND p.ScenarioSessionId = sd.ScenarioSessionId
WHERE sd.ScenarioId = -1
AND IsDemand = 1
AND OptionalDemand + MandatoryDemand > 0
UNION ALL
SELECT o.ScenarioSessionId, o.SnoItemId Id, dp.PeriodNumber, Price,
0 OptionalDemand, RemainingWeight MandatoryDemand, OrderLineId, OperationTypeId,
o.WorkCentreId, NVL(o.SiteId, wc.SiteId) SiteId
FROM SnoAllOrderSnapshots o
JOIN IH#ScenarioPeriodSnapshots dp
ON dp.StartPeriod = o.DeliveryPeriod
AND dp.ScenarioSessionId = o.ScenarioSessionId
LEFT JOIN IH#SiteWorkcentres wc on wc.WorkcentreId = o.WorkcentreId
WHERE EXISTS (SELECT 1 FROM SNOMovableOrderSnapshots sa
WHERE sa.ScenarioSessionId = o.ScenarioSessionId
AND sa.ScenarioId = -1
AND sa.OrderLineId = o.OrderLineId
AND sa.IsDemand = 1)
|
| IHSA#SNPItemRecords |
|---|
SELECT si.ScenarioSessionId, si.Id, gs.ConfigurationSet, GradeId, si.CustomerRankId,
si.LocationId CustomerId,
si.ReplenishmentFlag, si.IsOptional, si.CoverPeriod,
CASE WHEN s.SNPStockCustomers = 'Any' or si.ReplenishmentFlag = 1
THEN NVL(si.MaterialId, -1)
ELSE -1 end MaterialId
FROM SnoItemsShort si
JOIN Scenarios s
ON s.ScenarioSessionId = si.ScenarioSessionId
AND s.Id = -1
LEFT JOIN GradeSnapshots gs
ON gs.ScenarioSessionId = si.ScenarioSessionId
AND gs.MaterialId = si.MaterialId
WHERE si.CoProductId IS NULL
AND (EXISTS (SELECT 1
FROM SNODemands sd
WHERE sd.ScenarioSessionId = si.ScenarioSessionId
AND sd.ScenarioId = -1
AND sd.IsDemand = 1
AND sd.OptionalDemand + sd.MandatoryDemand > 0
AND sd.Id = si.Id)
OR EXISTS (select 1
from SNOMovableOrderSnapshots so
where so.ScenarioSessionId = si.ScenarioSessionId
AND so.ScenarioId = -1
and so.IsDemand = 1
and so.SnoItemId = si.Id)
)
|
| IHSA#SNPProductionCosts |
|---|
SELECT c.ScenarioSessionId, c.ScenarioId, s.SiteId, c.WorkcentreId, c.OperationTypeId, DetailId, p.periodnumber TimePeriodId, Cost FROM CostRuleSnapshots c JOIN Scenarioperiodsnapshots p on p.StartPeriod = c.Effective AND p.ScenarioSessionId = c.ScenarioSessionId JOIN IH#SiteWorkcentres s ON s.WorkcentreId = c.WorkcentreId |
| IHSA#SNPProductionRates |
|---|
SELECT c.ScenarioSessionId, c.ScenarioId, s.SiteId, c.WorkcentreId, c.OperationTypeId, DetailId, p.periodnumber TimePeriodId, Rate, TimeEfficiency, MaterialEfficiency FROM Productionratesnapshots c JOIN Scenarioperiodsnapshots p on p.StartPeriod = c.Effective AND p.ScenarioSessionId = c.ScenarioSessionId JOIN IH#SiteWorkcentres s ON s.WorkcentreId = c.WorkcentreId |
| IHSA#SolutionTempData |
|---|
SELECT dp.StartPeriod DeliveryDate, sp.StartPeriod SourceDate, dip.StartPeriod DispatchDate,
wc.WorkCentreTypeName, wc.LocationId, wc.SiteId, wc.HasInventory,
case when d.SourceMaterialId IS NULL and d.BomMaterialId IS NULL AND d.PropertyValueId != d.SourcePropertyValueId
then 1 else 0 end IsSubstituted,
d.*
FROM (
SELECT st.ScenarioSessionId, si.Id,
si.PropertyValueId, gs.PropertyValueId AS SourcePropertyValueId,
st.AllocationId, st.GradeId, st.SourceGradeId,
st.MasterRouteId, st.WorkCentreId, si.MaterialId,
st.SourcePeriod, st.DeliveryPeriod, st.DispatchPeriod,
st.StageNo, st.IsLastStage, st.ConfigurationId, st.OperationTypeId,
st.NextOperationTypeId, st.SeqNo, st.SourceMaterialId, st.BomMaterialId,
st.ToolMaterialId,
st.OrderLineId,
st.Allocation, st.AllocationDurationMinutes / 60 as AllocationHours, st.ProductionRateHours as ProductionRate,
st.CoProductAllocation,
st.AllocationDurationMinutes, st.ProductionRateHours,
st.ProductionCost, st.TransportCost, st.InventoryCost
FROM SnoSolutionTempData st
JOIN SNoItemsShort si
ON si.ScenarioSessionId = st.ScenarioSessionId
AND si.Id = st.SnoItemId
AND si.CoProductId IS NULL
AND WorkcentreId > 0
LEFT JOIN (SELECT DISTINCT ScenarioSessionId, Id, PropertyValueId FROM GradeSnapshots) gs
ON gs.ScenarioSessionId = st.ScenarioSessionId
AND gs.Id = st.SourceGradeId
) d
JOIN ScenarioSessions ss
ON ss.Id = d.ScenarioSessionId
JOIN IH#SiteWorkcentres wc
ON wc.WorkCentreId = d.WorkCentreId
JOIN Scenarioperiodsnapshots dp
ON dp.PeriodNumber = d.Deliveryperiod
AND dp.ScenarioSessionId = d.ScenarioSessionId
JOIN Scenarioperiodsnapshots sp
ON sp.PeriodNumber = d.SourcePeriod
AND sp.ScenarioSessionId = d.ScenarioSessionId
LEFT JOIN Scenarioperiodsnapshots dip
ON dip.PeriodNumber = d.DispatchPeriod
AND dip.ScenarioSessionId = d.ScenarioSessionId
|
| IHSA#SourcingAllocation | View for releasing allocations. Source view for aggregation by required time periods, NULL ScenarioId which used for Order Lines should be replaced by NVL(ScenarioId, ScenarioIdIn) ScenarioId |
|---|
SELECT a.ScenarioSessionId, a.ScenarioId, a.Id, a.WorkcentreId,
case when SIGN(MasterRouteId) = -1 then NULL else MasterRouteId end MasterRouteId,
si.SiteMaterialUsageId, si.MaterialId,
a.DeliveryDate DeliveryPeriod, a.SourceDate SourcePeriod,
a.DispatchDate DispatchPeriod,
0 AS NonMoveableWeight, a.Allocation AS System,
a.AllocationId, a.StageNo, a.SeqNo, a.IsLastStage,
si.PropertyValueId, c.ProductRouteId, a.OperationTypeId, a.NextOperationTypeId,
NVL(a.BomSourceMaterialId, si.MaterialId) SourceMaterialId
FROM SourcingAllocation a
JOIN SNOItemsShort si
ON a.ScenarioSessionId = si.ScenarioSessionId
AND si.Id = a.Id
AND si.CoProductId IS NULL
LEFT JOIN ConfigurationSnapshots c
ON a.ScenarioSessionId = c.ScenarioSessionId
AND a.ConfigurationId = c.Id
AND a.OperationTypeId = c.OperationTypeId
AND c.IsIdentical = 0
LEFT JOIN MasterRoutes mr
ON mr.Id = a.MasterRouteId
WHERE a.WorkcentreId IS NOT NULL
AND a.CoProductId IS NULL
AND Allocation > 0
UNION ALL
SELECT so.ScenarioSessionId, so.ScenarioId, SnoItemId as id, NVL(so.WorkcentreId, wh.WorkcentreId)
WorkcentreId,
MasterRouteId, so.SiteMaterialUsageId, so.MaterialId,
DeliveryPeriod,
SourcePeriod,
DespatchDate DispatchPeriod,
so.NonMoveableWeight AS NonMoveableWeight, 0 AS System,
-1 AllocationId, 0 StageNo, 0 seqNo, IsLastStage,
so.PropertyValueId, NULL ProductRouteId, so.OperationTypeId, NULL NextOperationTypeId, MaterialId as SourceMaterialId
FROM IHSA#SNOAllOrderSnapshots so
LEFT JOIN IH#MainWarehouses wh
ON wh.SiteId = so.SiteId
WHERE so.IsFirm IN (1,2)
AND so.CoProductId IS NULL
AND so.SourceType IN ('stock', 'production', 'supplier')
AND so.PropertyValueId IS NOT NULL
AND so.IsIgnoredForNetting = 0
AND EXISTS (SELECT 1 FROM SNoItemsShort SI WHERE si.ScenarioSessionId = so.ScenarioSessionId AND
si.SiteMaterialUsageId = so.SiteMaterialUsageId)
AND EXISTS (SELECT 1 FROM ForecastbodySnapshots fb WHERE fb.SnapshotState = 1 AND fb.ScenarioSessionId =
so.ScenarioSessionId AND fb.DateFrom = so.DeliveryPeriod
AND fb.SiteMaterialUsageId = so.SiteMaterialUsageId
)
|
| IHSA#SourcingAllocation2 |
|---|
SELECT a.ScenarioSessionId, a.ScenarioId, a.Id, a.WorkcentreId,
case when SIGN(MasterRouteId) = -1 then NULL else MasterRouteId end MasterRouteId,
a.DeliveryDate DeliveryPeriod, a.SourceDate SourcePeriod,
0 AS NonMoveableWeight, a.Allocation * ci.Coef AS System,
a.AllocationId, a.StageNo, a.IsLastStage,
c.ProductRouteId, a.OperationTypeId, a.SourceMaterialId, ci.MaterialId, si.ReplenishmentFlag
FROM SourcingAllocation a
JOIN ConfigurationSnapshots c
ON a.ScenarioSessionId = c.ScenarioSessionId
AND a.ConfigurationId = c.Id
AND a.OperationTypeId = c.OperationTypeId
AND c.IsIdentical = 0
JOIN SNOMaterialCoefs ci
ON a.Id = ci.Id
AND a.ScenarioSessionId = ci.ScenarioSessionId
AND a.DeliveryDate = ci.Datefrom
JOIN SNOItemsShort si
ON c.ScenarioSessionId = si.ScenarioSessionId
AND si.Id = a.Id
WHERE a.WorkcentreId IS NOT NULL
AND Allocation > 0
UNION ALL
SELECT so.ScenarioSessionId, NULL ScenarioId, SnoItemId as id, WorkcentreId, MasterRouteId,
DeliveryPeriod,
SourcePeriod,
so.Weight AS NonMoveableWeight, 0 AS System,
-1 AllocationId, 0 StageNo, 1 IsLastStage,
NULL ProductRouteId, so.OperationTypeId, NULL SourceMaterialId, so.MaterialId, si.ReplenishmentFlag
FROM SNOAllOrderSnapshots so, SNOItemsShort si
WHERE so.IsFirm = 1
AND so.ScenarioSessionId = si.ScenarioSessionId
AND si.Id = so.SnoItemId
AND so.SourceType IN ('stock', 'production', 'supplier')
AND so.PropertyValueId IS NOT NULL
AND so.SourcePeriod IS NOT NULL
AND NOT EXISTS (SELECT 1 FROM SNOMovableOrderSnapshots sa
WHERE sa.ScenarioSessionId = so.ScenarioSessionId
AND sa.ScenarioId = -1
AND sa.OrderLineId = so.OrderLineId)
|
| IHSA#SubstitutionMaterials |
|---|
SELECT distinct ps.ScenarioSessionId, ps.ScenarioId, ps.Id ProductSubstitutionId, tm.Id MaterialId, tm.MaterialTypeId,
sm.Id SourceMaterialId, sm.MaterialTypeId SourceMaterialTypeId, g.Id ProductionGradeId,
SIGN(SUM(p.IsActive) OVER(PARTITION BY ps.ScenarioSessionId, ps.ScenarioId, ps.Id)) IsActive
FROM ProductSubstitutionSnapshots ps
JOIN Substitutionperiodsnapshots p
ON p.Scenariosessionid = ps.ScenarioSessionId
AND p.ScenarioId = ps.ScenarioId
AND p.Productsubstitutionid = ps.Id
JOIN Ih#detailsmaterial t
ON t.DetailId = ps.DetailId
JOIN Ih#detailsmaterial s
ON s.DetailId = ps.FromDetailId
JOIN Materials tm
ON t.MaterialId = tm.Id
AND (ps.MaterialTypeId IS NULL OR ps.MaterialTypeId = tm.MaterialTypeId)
JOIN Materials sm
ON s.MaterialId = sm.Id
AND (ps.MaterialTypeId IS NULL OR ps.MaterialTypeId = sm.MaterialTypeId)
JOIN GradeSnapshots g
ON g.ScenarioSessionId = ps.ScenarioSessionId
AND g.MaterialId = sm.Id
WHERE NOT EXISTS(SELECT 1 FROM CoProducts cp where cp.CoProductMaterialId in (sm.Id, tm.Id))
|
| IHSA#ToolPoolingUsages |
|---|
WITH capacity AS
(SELECT ScenarioSessionId, ScenarioId, SiteId, DateFrom, SUM(NominalCapacityHours) / COUNT(1) AvailableDuration
FROM MachineInformation mi
JOIN Workcentres wc
ON wc.Id = mi.WorkcentreId
JOIN OperationTypes ot
ON wc.WorkcentreTypeId = wc.WorkcentretypeId
AND ToolMaterialTypeId IS NOT NULL
WHERE MachineType = 'PM'
GROUP BY ScenarioSessionId, ScenarioId, SiteId, DateFrom),
allocations AS
(SELECT ScenarioSessionId, ScenarioId, SourceDate, SiteId, MaterialId, ToolMaterialId, SUM(Allocation) Allocation,
SUM(Orders) Orders, SUM(AllocationHours) AllocationHours, SUM(OrderHours) OrderHours
FROM IVSA#SourcingAllocations
WHERE ToolMaterialId IS NOT NULL
GROUP BY ScenarioSessionId, ScenarioId, SourceDate, SiteId, MaterialId, ToolMaterialId)
SELECT a.ScenarioSessionId, a.ScenarioId, a.SiteId, a.SourceDate AS DateFrom, a.MaterialId, s.ToolMaterialId,
a.Allocation, a.Orders, a.AllocationHours, a.OrderHours, s.TotalQuantity, c.AvailableDuration,
a.OrderHours + a.AllocationHours AS TotalHours,
(a.AllocationHours + a.OrderHours) / (NULLIF(s.TotalQuantity, 0) * c.AvailableDuration) * 100 AS Utilisation
FROM IHSA#ToolsQuantity s
LEFT JOIN Allocations a
ON s.ScenarioSessionId = a.ScenarioSessionId
AND s.ToolMaterialId = a.ToolMaterialId
LEFT JOIN Capacity c
ON c.ScenarioSessionId = a.ScenarioSessionId
AND c.ScenarioId = a.ScenarioId
AND c.SiteId = a.SiteId
AND c.DateFrom = a.SourceDate
|
| IHSA#ToolPrimaryRates |
|---|
WITH RankedRates AS (
SELECT
pr.ScenarioSessionId,
pr.ScenarioId,
pr.ToolMaterialId,
pr.Rate,
CASE WHEN wcp.Value = 0 THEN 999999 ELSE to_number(wcp.Value) END as Priority
FROM IHSA#ToolRates pr
JOIN WorkCentres wc ON wc.Id = pr.WorkcentreId
JOIN WorkCentreTypes wct ON wct.Id = wc.WorkcentreTypeId AND wct.IsPrimaryType = 1
JOIN IH#WorkcentreParameters wcp ON wcp.WorkcentreId = pr.WorkcentreId
AND wcp.ParameterName = 'Priority'
),
PriorityMin AS (
SELECT ScenarioSessionId, ScenarioId, ToolMaterialId, Rate, Priority,
MIN(Priority) OVER (PARTITION BY ScenarioSessionId, ScenarioId, ToolMaterialId) as BestPriority
FROM RankedRates
)
SELECT ScenarioSessionId, ScenarioId, ToolMaterialId, AVG(Rate) as Rate
FROM PriorityMin
WHERE Priority = BestPriority
GROUP BY ScenarioSessionId, ScenarioId, ToolMaterialId
|
| IHSA#ToolProposals |
|---|
WITH site_usage AS (
SELECT a.ScenarioSessionId,
a.ScenarioId,
a.ToolMaterialId,
a.SiteId,
SUM(NVL(a.AllocationHours, 0)) AS AllocationHours,
SUM(NVL(a.OrderHours, 0)) AS OrderHours
FROM IVSA#SourcingAllocations a
WHERE ToolMaterialId IS NOT NULL
AND Exists (SELECT 1 FROM Scenarios s where s.ScenarioSessionId = a.ScenarioSessionId and s.Id = a.ScenarioId and s.Istoolpoolingenabled = 1)
GROUP BY
a.ScenarioSessionId,
a.ScenarioId,
a.ToolMaterialId,
a.SiteId
),
site_ranking AS (
SELECT su.ScenarioSessionId,
su.ScenarioId,
su.ToolMaterialId,
su.SiteId,
ROW_NUMBER() OVER (
PARTITION BY su.ScenarioSessionId, su.ToolMaterialId
ORDER BY su.AllocationHours + su.OrderHours DESC, su.SiteId
) AS overall_rr
FROM site_usage su
),
tools as (
SELECT sr.ScenarioSessionId,
sr.ScenarioId,
sr.ToolMaterialId,
MAX(CASE WHEN sr.overall_rr = 1 THEN sr.SiteId END) AS PrimarySiteId,
MAX(CASE WHEN sr.overall_rr = 2 THEN sr.SiteId END) AS SecondarySiteId
FROM site_ranking sr
GROUP BY sr.ScenarioSessionId,
sr.ScenarioId, sr.ToolMaterialId
)
SELECT t.ScenarioSessionId, t.ScenarioId, t.ToolMaterialId,
PrimarySiteId, SecondarySiteId, InitialSitesIds,
CASE
WHEN t.PrimarySiteId IS NOT NULL THEN
(SELECT COUNT(1)
FROM TABLE(core.StringToArray(q.InitialSitesIds)) t
WHERE TO_NUMBER(t.Column_Value) != t.PrimarySiteId)
ELSE 0
END AS OtherPrimary,
CASE
WHEN t.SecondarySiteId IS NOT NULL THEN
(SELECT COUNT(1)
FROM TABLE(core.StringToArray(q.InitialSitesIds)) t
WHERE TO_NUMBER(t.Column_Value) != t.SecondarySiteId)
ELSE 0
END AS OtherSecondary
FROM tools t
JOIN IHSA#ToolsQuantity q
ON q.ScenarioSessionId = t.ScenarioSessionId
AND q.ToolMaterialId = t.ToolMaterialId
|
| IHSA#ToolRates |
|---|
SELECT pr.ScenarioSessionId, pr.ScenarioId, m.Id ToolMaterialId, pr.WorkcentreId, pr.Rate,
pr.Materialefficiency, pr.TimeEfficiency
FROM ProductionRateSnapshots pr
JOIN ScenarioSessions ss ON ss.Id = pr.ScenarioSessionId
JOIN IH#DetailsMaterial dm ON dm.DetailId = pr.DetailId
JOIN OperationTypes ot ON ot.Id = pr.OperationTypeId and ToolMaterialTypeId is not null
JOIN Materials m ON m.Id = dm.MaterialId AND ToolMaterialTypeId = m.MaterialTypeId
WHERE pr.Effective = ss.StartWeek
AND NOT EXISTS (Select 1 from Materials d where d.UsedWithMaterialId = dm.MaterialId )
|
| IHSA#ToolsAvailableInventory |
|---|
SELECT d.ScenarioSessionId, d.ScenarioId, d.SiteMaterialUsageId, smu.SiteId, smu.MaterialId,
p.PeriodNumber, p.StartPeriod, p.PeriodLength,
SUM(d.Available) / p.PeriodLength AS Available
FROM IHSA#DailyToolsInventory d
JOIN IH#ToolSku smu
ON smu.SiteMaterialUsageId = d.SiteMaterialUsageId
JOIN ScenarioPeriodSnapshots p
ON d.ScenarioSessionId = p.ScenarioSessionId AND d.DateFrom >= p.StartPeriod AND d.DateFrom < p.EndPeriod
GROUP BY d.ScenarioSessionId, d.ScenarioId, d.SiteMaterialUsageId, smu.SiteId, smu.MaterialId,
p.PeriodNumber, p.StartPeriod, p.PeriodLength
|
| IHSA#ToolsMovements |
|---|
SELECT ScenarioSessionId, ScenarioId, d.SiteMaterialUsageId,
s.SiteMaterialUsageId as SourceSiteMaterialUsageId,
t.IsActive, SIGN(NVL(t.Id, 0)) as IsActiveEditable,
NVL(t.Id,0) as Id, s.SiteId FromSiteId, d.SiteId ToSiteId, t.ToolMaterialId,
ss.SiteCode FromSiteCode, ss.SiteName FromSiteName,
ts.SiteCode ToSiteCode, ts.SiteName ToSiteName,
m.MaterialCode as ToolMaterialCode, m.MaterialName as ToolMaterialName,
t.DespatchDate, t.DeliveryDate, t.Quantity, t.MovementId OrderLineId,
NVL(ol.OrderCode, 'session') OrderCode, NVL(ol.LineNoCode, 'session') LineNoCode
FROM Toolmovementssnapshots t
JOIN IH#ToolSku d ON d.LocationId = t.LocationId AND d.MaterialId = t.ToolMaterialId
JOIN IH#ToolSku s ON s.LocationId = t.FromLocationId AND s.MaterialId = t.ToolMaterialId
JOIN Sites ss ON ss.Id = s.SiteId
JOIN Sites ts ON ts.Id = d.SiteId
JOIN Materials m ON m.Id = t.ToolMaterialId
LEFT JOIN IH#OrderLines ol ON ol.Id = t.MovementId
|
| IHSA#ToolsQuantity |
|---|
SELECT i.ScenarioSessionId, i.MaterialId as ToolMaterialId, SUM(Opening) TotalQuantity,
core.asCSV(SET(CAST(COLLECT(SiteName) AS ParameterArray))) InitialSites,
core.asCSV(SET(CAST(COLLECT(to_char(i.SiteId)) AS ParameterArray))) InitialSitesIds
FROM IHSA#DailyToolsInventory i
JOIN Ih#scenarios s
ON s.Id = i.ScenarioId
AND s.ScenarioSessionId = i.ScenarioSessionId
JOIN Sites
ON Sites.Id = i.SiteId
WHERE i.DateFrom = s.StartWeek
AND i.ScenarioId = 0
AND i.Opening >= 1
GROUP BY i.ScenarioSessionId, i.MaterialId
|
| IHSA#ToolUsages |
|---|
WITH stock AS
(
SELECT i.ScenarioSessionId, i.ScenarioId, i.SiteMaterialUsageId,
StartPeriod DateFrom, i.MaterialId as ToolMaterialId, i.SiteId, Available
FROM IHSA#ToolsAvailableInventory i
),
capacity AS
(
SELECT ScenarioSessionId, ScenarioId, SiteId, DateFrom, SUM(NominalCapacityHours) / Count(1) AvailableDuration
FROM MachineInformation mi
JOIN Workcentres wc
ON wc.Id = mi.WorkcentreId
JOIN OperationTypes ot
ON wc.WorkcentreTypeId = wc.WorkcentretypeId
AND ToolMaterialTypeId IS NOT NULL
WHERE MachineType = 'PM'
GROUP BY ScenarioSessionId, ScenarioId, SiteId, DateFrom),
allocations AS
(
SELECT ScenarioSessionId, ScenarioId, SourceDate, SiteId, MaterialId, ToolMaterialId, SUM(Allocation) Allocation,
SUM(Orders) Orders,
SUM(AllocationHours) AllocationHours,
SUM(OrderHours) OrderHours
FROM IVSA#SourcingAllocations
WHERE ToolMaterialId IS NOT NULL
GROUP BY ScenarioSessionId, ScenarioId, SourceDate, SiteId, MaterialId, ToolMaterialId
)
SELECT s.ScenarioSessionId, s.ScenarioId, s.SiteMaterialUsageId, s.SiteId, s.DateFrom, a.MaterialId, s.ToolMaterialId,
a.Allocation, a.Orders, a.AllocationHours, a.OrderHours, s.Available, c.AvailableDuration,
a.OrderHours + a.AllocationHours AS TotalHours,
(a.AllocationHours + a.OrderHours) / (NULLIF(s.Available, 0) * c.AvailableDuration) * 100 AS Utilisation
FROM stock s
LEFT JOIN Allocations a
ON s.ScenarioSessionId = a.ScenarioSessionId
AND s.ScenarioId = a.ScenarioId
AND s.SiteId = a.SiteId
AND s.ToolMaterialId = a.ToolMaterialId
AND s.DateFrom = a.SourceDate
LEFT JOIN Capacity c
ON s.ScenarioSessionId = c.ScenarioSessionId
AND s.ScenarioId = c.ScenarioId
AND s.SiteId = c.SiteId
AND s.DateFrom = c.DateFrom
|
| IHSA#WeeklyMonthPeriods | Define Periods for SNP mode week/month (hybrid mode) |
|---|
SELECT CASE WHEN dateWeek > DateMonth THEN DateWeek ELSE DateMonth END StartPeriod,
SUM(1) PeriodLength,
CASE WHEN dateWeek > DateMonth THEN DateWeek ELSE DateMonth END + SUM(1) EndPeriod
FROM IH#DAILYRANGE
GROUP BY CASE WHEN dateWeek > DateMonth THEN DateWeek ELSE DateMonth END
ORDER BY 1
|
| IHSA#WorkcentreShutSnapshots |
|---|
SELECT ws.ScenarioSessionId, ws.WorkcentreId, ws.Id, ws.StartDate, ws.FinishDate, sp.StartPeriod, sp.EndPeriod, sp.PeriodNumber,
DECODE(Sign(sp.StartPeriod-ws.StartDate), -1 , ws.StartDate, sp.StartPeriod) NewStartDate,
DECODE(Sign(sp.EndPeriod - ws.FinishDate), -1, (sp.EndPeriod), ws.FinishDate) NewFinishDate,
(DECODE(Sign(sp.EndPeriod - ws.FinishDate), -1, (sp.EndPeriod), ws.FinishDate) -
DECODE(Sign(sp.StartPeriod-ws.StartDate), -1 , ws.StartDate, sp.StartPeriod)) * 24 ShutDurationInHours,
numtodsinterval(DECODE(Sign(sp.EndPeriod - ws.FinishDate), -1, (sp.EndPeriod), ws.FinishDate) -
DECODE(Sign(sp.StartPeriod-ws.StartDate), -1 , ws.StartDate, sp.StartPeriod), 'day') Duration
FROM WorkCentreShutSnapshots ws, ScenarioPeriodSnapshots sp
WHERE ws.StartDate < sp.EndPeriod
AND ws.FinishDate > sp.StartPeriod
AND ws.ScenarioId = -1
AND ws.ScenarioSessionId = sp.ScenarioSessionId
|
| IM$Characteristics |
|---|
SELECT propertyName Name, 'EndUseProperty' TYPE, HierarchyLevelNo AS OrderNo FROM ENDUSEPROPERTIES UNION ALL SELECT HierarchyLevelName Name, 'Hierarchy' TYPE, HierarchyLevelNo AS OrderNo FROM HierarchyLevels UNION ALL SELECT PropertyName Name, 'Property' TYPE, NULL OrderNo FROM Properties ORDER BY 2,3 |
| IM$ProductProperties |
|---|
SELECT MaterialTypeName TYPE, PropertyName property, HierarchyLevelNo OrderNo, mtp.DefaultValue FROM MaterialTypes mt JOIN MaterialTypeProperties mtp ON (mt.Id = mtp.MaterialTypeId) JOIN Properties p ON (p.Id = mtp.PropertyId) ORDER BY 1,3 |
| IM$ProductTypes |
|---|
SELECT MaterialTypeName Name, case when IsFinishedGoods = 1 then 'yes' else 'no' end FinishedGoods, case when IsTool = 1 then 'yes' else 'no' end Tool FROM MaterialTypes |
| IM$Properties |
|---|
SELECT PropertyName Name, PropertyDesc DESCRIPTION, DataType, DataMask mask, DefaultValue FROM Properties |
| IM$WorkCentreTypes |
|---|
SELECT wt.WorkCentreTypeName Name,
wt.WorkCentreTypeDesc Description,
DECODE(wt.IsValidInitialSource, 1, 'yes', 'no') IsValidSource,
DECODE(wt.IsProductionSource, 1, 'yes', 'no') IsProductionSource,
SupplierType,
DECODE(wt.HasInventory, 1, 'yes', 'no') HasInventory,
wt.StageDelayHours,
wt.MaxStageDelayHours,
wt.Orderno,
DECODE(wt.IsPrimaryType, 1, 'yes', 'no') IsPrimaryType
FROM WorkCentreTypes wt
|
| IRH#ScenarioAllocation |
|---|
WITH a AS (
SELECT sa.ID, sa.CoProductId, sa.ScenarioId, sa.ScenarioSessionId, sa.WorkCentreId, sa.Siteid, r.RouteCategory,
TRUNC(sa.DeliveryDate, 'IW') AS DeliveryWeek,
TRUNC(sa.DeliveryDate, 'month') as DeliveryMonth,
TRUNC(sa.DispatchDate, 'IW') AS DispatchWeek,
TRUNC(sa.DispatchDate, 'month') AS DispatchMonth,
TRUNC(sa.SourceDate, 'IW') AS SourceWeek,
TRUNC(sa.SourceDate, 'month') as SourceMonth,
(sa.Allocation / sa.ConversionFactor) AS Allocation,
CASE WHEN Rate > 0 THEN (sa.Allocation / sa.ConversionFactor) / sa.Rate ELSE 0 END AS AllocationHours,
0 Orders, 0 OrderHours,
sa.Revenue, sa.TransportCost, sa.ProductionCost + sa.TransportCost + sa.InventoryCost AS TotalCost, sa.Margin
FROM SourcingAllocation sa
LEFT JOIN MasterRouteSnapshots r ON r.ScenarioSessionId = sa.ScenarioSessionId
AND r.ScenarioId = sa.ScenarioId
AND r.Id = sa.MasterRouteId
UNION ALL
SELECT so.SnoItemId, so.CoProductId, s.Id ScenarioId, so.ScenarioSessionId, so.WorkCentreId, so.SiteId, r.RouteCategory,
TRUNC(so.DeliveryPeriod, 'IW') AS DeliveryWeek,
TRUNC(so.DeliveryPeriod, 'Month') AS DeliveryMonth,
TRUNC(so.SourcePeriod, 'IW') AS DispatchWeek,
TRUNC(so.SourcePeriod, 'month') AS DispatchMonth,
TRUNC(so.SourcePeriod, 'IW') AS SourceWeek,
TRUNC(so.SourcePeriod, 'month') AS SourceMonth,
0 Allocation, 0 AllocationHours,
so.Weight AS Orders, DECODE(so.Rate, 0, 0, so.RemainingSourceWeight / so.Rate * (100 / TimeEfficiency) ) AS OrderHours,
so.Revenue, so.TransportCost, so.TotalCost, so.Margin
FROM SNOAllOrderSnapshots so
JOIN Scenarios s
ON so.ScenarioSessionId = s.ScenarioSessionId
LEFT JOIN MasterRouteSnapshots r ON r.ScenarioSessionId = so.ScenarioSessionId
AND r.ScenarioId = s.Id
AND r.Id = so.MasterRouteId
WHERE so.IsFirm IN (1,2)
AND so.Snoitemid IS NOT NULL
AND EXISTS(SELECT 1 FROM ScenarioSessions ss
WHERE so.RequestedDate BETWEEN ss.StartWeek AND ss.FinishWeek
AND so.ScenarioSessionId = ss.Id)
AND so.SourcePeriod IS NOT NULL
),
ab AS (
SELECT ID, CoProductId, ScenarioId, ScenarioSessionId, WorkCentreId, SiteId, RouteCategory,
DeliveryWeek, DeliveryMonth, DispatchWeek, DispatchMonth, SourceWeek, SourceMonth,
SUM(Allocation) AS Allocation, SUM(AllocationHours) AS AllocationHours,
SUM(Orders) AS Orders, SUM(OrderHours) AS OrderHours,
SUM(Revenue) AS Revenue, SUM(TransportCost) AS TransportCost,
SUM(TotalCost) AS Cost, SUM(Margin) AS Margin
FROM a
GROUP BY ID, CoProductId, ScenarioId, ScenarioSessionId, WorkCentreId, SiteId, RouteCategory,
DeliveryWeek, DeliveryMonth, DispatchWeek, DispatchMonth, SourceWeek, SourceMonth
),
hc as (
SELECT h.ScenarioId, h.ScenarioSessionId, h.SiteId, h.HoldingCost, h.Effective DateFrom,
NVL(LEAD(h.Effective,1) OVER (PARTITION BY h.ScenarioId, h.ScenarioSessionId, h.SiteId ORDER BY h.Effective) - 1, to_date('01.01.2050', 'dd.mm.yyyy')) DateTo
FROM HoldingCostSnapshots h
)
SELECT ab.ID, ab.CoProductId, ab.ScenarioId, ab.ScenarioSessionId, ab.WorkCentreId, ab.SiteId, ab.RouteCategory,
ab.DeliveryWeek, ab.DeliveryMonth, ab.DispatchWeek, ab.DispatchMonth, ab.SourceWeek, ab.SourceMonth,
ab.Allocation, ab.AllocationHours, ab.Orders, ab.OrderHours,
ab.Revenue, ab.TransportCost, ab.Cost, ab.Margin, hc.HoldingCost,
ROW_NUMBER() OVER (PARTITION BY ab.ScenarioSessionId, ab.ScenarioId, ab.DeliveryMonth, ab.DeliveryWeek, ab.Id, ab.CoProductId ORDER BY NULL) LevelNo
FROM ab
LEFT JOIN hc ON hc.ScenarioId = ab.ScenarioId
AND hc.ScenarioSessionId = ab.ScenarioSessionId
AND ab.SiteId = hc.SiteId
AND ab.DeliveryWeek BETWEEN hc.DateFrom AND hc.DateTo
|
| ISC#ForecastLocationCurrencies |
|---|
SELECT distinct LocationName, LocationCode, fc.CurrencyName ForecastCurrency, lc.CurrencyName LocationCurrency, fb.PriceCurrencyId, fb.SystemPriceCurrencyId, NVL(l.CurrencyId, core.InternalCurrencyId) LocationCurrencyId, smu.LocationId FROM ForecastBodies fb JOIN SiteMaterialUsages smu ON smu.Id = fb.SiteMaterialUsageID JOIN Locations l ON smu.LocationId = l.Id JOIN Currencies fc ON fc.Id = fb.SystemPriceCurrencyId JOIN Currencies lc ON lc.Id = NVL(l.CurrencyId, core.InternalCurrencyId) WHERE fb.ForecastId = forecasting.getLatestForecast() AND fb.SystemPriceCurrencyId != NVL(l.CurrencyId, core.InternalCurrencyId) |
| ISC#MTSWrongForecastConsumption |
|---|
SELECT
COALESCE(ip.SiteMaterialUsageId, rip.SiteMaterialUsageId) AS SiteMaterialUsageId,
COALESCE(ip.DateFrom, rip.DateFrom) AS DateFrom,
-- (InventoryProfiles)
ip.ConsumptionForecast AS IP_Consumption,
ip.OriginalConsumptionForecast AS IP_OriginalConsumption,
-- (Realinventoryprofilesiplanview)
rip.Consumption AS RIP_Consumption,
rip.OriginalConsumption AS RIP_OriginalConsumption,
-- Diff
(COALESCE(ip.ConsumptionForecast, 0) - COALESCE(rip.Consumption, 0)) AS Diff_Consumption,
(COALESCE(ip.OriginalConsumptionForecast, 0) - COALESCE(rip.OriginalConsumption, 0)) AS Diff_OriginalConsumption
FROM InventoryProfiles ip
FULL OUTER JOIN Realinventoryprofilesiplanview rip
ON ip.SiteMaterialUsageId = rip.SiteMaterialUsageId
AND ip.DateFrom = rip.DateFrom
WHERE COALESCE(ip.SiteMaterialUsageId, rip.SiteMaterialUsageId) IN (Select Id From SiteMaterialUsages where Replenished = 1)
AND (
COALESCE(ip.ConsumptionForecast, 0) <> COALESCE(rip.Consumption, 0)
OR
COALESCE(ip.OriginalConsumptionForecast, 0) <> COALESCE(rip.OriginalConsumption, 0)
)
|
| ISC#WrongReplenishmentFlag |
|---|
WITH OptionPriorities AS (
SELECT
sku.SiteMaterialUsageId as SiteMaterialUsageId,
CASE
-- 1. REPLENISHED (Highest Priority)
-- Status is Replenished + Dates are valid (Start <= Today <= Finish)
-- Handling NULLs: Start NULL = infinite past, Finish NULL = infinite future
WHEN Replenished = 1
AND (DateFrom IS NULL OR DateFrom <= core.getTruncatedInternalDate)
AND (DateTo IS NULL OR DateTo >= core.getTruncatedInternalDate)
THEN 1
-- 2. FUTURE
-- Status is Replenished + DateFrom is strictly in the future
-- Note: If DateFrom > DateTo (invalid range),
-- the first check fails, but this one captures it as "Future".
WHEN Replenished = 1
AND (DateFrom > core.getTruncatedInternalDate)
THEN 2
-- 3. DELISTED
-- If we reached this point, there are no Active or Future options.
-- Check for Delisted status.
WHEN Replenished = 2
THEN 3
-- 4. NON-REPLENISHED
-- Covers cases:
-- - WkcStatus = 'Non-Replenished'
-- - Expired dates (DateTo < Today)
-- - Invalid date intervals not captured by Future
ELSE 4
END as PriorityRank
FROM IH#CustomerSkus sku
LEFT JOIN Ih#customersourcepriorities p
ON sku.SiteMaterialUsageId = p.SiteMaterialUsageId
),
SkuFinalStatus AS (
SELECT
SiteMaterialUsageId,
CASE
WHEN MIN(PriorityRank) = 1 THEN 1
WHEN MIN(PriorityRank) = 2 THEN -1
WHEN MIN(PriorityRank) = 3 THEN 2
ELSE 0 -- Triggers for Rank 4 or if sfs.BestRank IS NULL (no options)
END CorrectReplenishmentFlag
FROM OptionPriorities
GROUP BY SiteMaterialUsageId
)
SELECT SiteMaterialUsageId,
ReplenishmentFlag,
CorrectReplenishmentFlag
FROM SkuFinalStatus s
JOIN SiteMaterialUsages smu
ON s.SiteMaterialUsageId = smu.Id
AND ReplenishmentFlag != s.CorrectReplenishmentFlag
|
| IT#Actions |
|---|
SELECT
a.Id Id, a.ActionName,
COALESCE(d1.DictionaryValue, a.ActionDescription) AS ActionDescription,
COALESCE(d2.DictionaryValue, a.ActionHint) AS ActionHint,
a.Title, a.GridName, a.GridColumnName, a.GridAction,
a.Isdefault, a.MULTISELECT, a.Pageid,
a.Icon, a.IsDevMode, a.IsEtc, a.GroupName, a.IsVisible,
a.OverrideActionId, a.ParentActionId,
a.InsertUserId, a.InsertDate, a.UpdateUserId, a.UpdateDate,
l.Id LanguageId
FROM Actions a
JOIN Pages p ON (p.Id = a.PageId)
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1 ON (d1.Dictionarykey = 'Actions.' || p.PageName || '.ActionDescription' AND a.Id = d1.TableRowId AND d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2 ON (d2.Dictionarykey = 'Actions.' || p.PageName || '.ActionHint' AND a.Id = d2.TableRowId AND d2.LanguageId = l.Id)
UNION
SELECT
a.Id Id, a.ActionName,
COALESCE(d1.DictionaryValue, a.ActionDescription) AS ActionDescription,
COALESCE(d2.DictionaryValue, a.ActionHint) AS ActionHint,
a.Title, a.GridName, a.GridColumnName, a.GridAction,
a.Isdefault, a.MULTISELECT, a.Pageid,
a.Icon, a.IsDevMode, a.IsEtc, a.GroupName, a.IsVisible,
NULL OverrideActionId, NULL ParentActionId,
a.InsertUserId, a.InsertDate, a.UpdateUserId, a.UpdateDate,
l.Id LanguageId
FROM Actions a
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1 ON (d1.Dictionarykey = 'CommonActions.Description' AND a.Id = d1.TableRowId AND d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2 ON (d2.Dictionarykey = 'CommonActions.Hint' AND a.Id = d2.TableRowId AND d2.LanguageId = l.Id)
WHERE a.Pageid IS NULL
|
| IT#AllCurrencies |
|---|
SELECT c.Id CurrencyId, CurrencyName, COALESCE(DictionaryValue, CurrencyDescription) AS CurrencyDescription, c.IsInternal, l.Id LanguageId FROM Currencies c CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'Currencies.Description' AND c.Id = d.TableRowId AND d.LanguageId = l.Id) UNION ALL SELECT 0 CurrencyId, 'Local Currency', 'Local Currency' AS, 0, l.Id LanguageId FROM Languages l |
| IT#BundleValues |
|---|
SELECT
l.Id AS LanguageId,
t.Id,
t.BundleId,
t.Key,
NVL(d1.DictionaryValue, t.Value) AS Value,
t.OrderNo,
NVL(d2.DictionaryValue, t.Description) AS Description
FROM BundleValues t
JOIN Bundles p ON t.BundleId = p.Id
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.DictionaryKey = 'BundleValues.' || p.Name || '.Value' AND d1.TableRowId = t.Id AND d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2
ON (d2.DictionaryKey = 'BundleValues.' || p.Name || '.Description' AND d2.TableRowId = t.Id AND d2.LanguageId = l.Id)
|
| IT#ChartLines |
|---|
SELECT
l.Id AS LanguageId,
t.Id,
t.ChartId,
t.orderNo,
NVL(d1.DictionaryValue, t.Caption) AS Caption,
t.FieldName,
t.Type,
t.ControlType,
t.IsEditable,
t.IsShowTotal,
t.State,
t.colorColumn,
t.BackgroundColorColumn,
t.dataColumns,
t.dataColumnsMapping,
t.editableColumn,
t.tooltipColumn,
t.classColumn,
t.Color,
t.Pattern,
t.IsResizable,
t.IsTransformColumn,
t.IsTransformable,
t.TransformFormat,
t.IsShowToolTip,
t.IsConfigurable,
t.MaxWidth,
t.MinWidth,
t.Style,
t.Format,
t.Sort,
t.Filter
FROM ChartLines t
JOIN Charts c ON t.ChartId = c.Id
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.DictionaryKey = 'ChartLines.' || c.Name || '.Caption' AND d1.TableRowId = t.Id AND d1.LanguageId = l.Id)
|
| IT#Charts |
|---|
SELECT
l.Id AS LanguageId,
t.Id,
t.Name,
NVL(d1.DictionaryValue, t.Description) AS Description,
t.PageId,
t.Type,
t.Configuration
FROM Charts t
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.DictionaryKey = 'Charts.' || t.Name || '.Description' AND d1.TableRowId = t.Id AND d1.LanguageId = l.Id)
|
| IT#Currencies |
|---|
SELECT c.Id CurrencyId, CurrencyName, COALESCE(DictionaryValue, CurrencyDescription) AS CurrencyDescription, c.IsInternal, l.Id LanguageId FROM Currencies c CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'Currencies.Description' AND c.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#CustomerRanks |
|---|
SELECT cr.Id CustomerRankId, cr.CustomerRankName, COALESCE(DictionaryValue, CustomerRankDesc) AS CustomerRankDesc, l.Id LanguageId FROM CustomerRanks cr CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'CustomerRanks' AND cr.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#DataSourceFields |
|---|
SELECT ds.Name DataSourceName, ds.Title, ds.Description DataSourceDescription, DataSourceId,
dsf.Id, dsf.Name, COALESCE(d1.DictionaryValue, dsf.Description) AS Description,
COALESCE(d2.DictionaryValue, dsf.EntityType) AS EntityType,
dsf.EntityType AS DefaultEntityType, Category, Expression, DataType, OrderNo,
DefaultFiltered,
NVL(Filtered, DefaultFiltered) Filtered, Helper, HelperColumn, PARTITION, ParentField, FUNCTION, UnitTypeId, UnitId, CurrencyId,
IsCurrency, IsTimeUnit, TimeUnitId, IncludeNullCondition, IsCustomField, IsMandatory,
l.Id LanguageId
FROM (
SELECT df.Id AS TranslateRowId, NVL(ds.Name, d.Name) DataSourceNameForTranslation,
rf.*
FROM DataSourceFields rf
JOIN DataSources d
ON d.Id = rf.DataSourceId
LEFT JOIN DataSourceFields DF
ON df.DataSourceId = NVL(d.ParentDataSourceId, d.Id)
AND UPPER(rf.Name) = UPPER(df.Name)
LEFT JOIN DataSources ds ON ds.Id = NVL(d.ParentDataSourceId, d.Id)
) dsf
JOIN DataSources ds
ON ds.Id = dsf.DataSourceId
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.Dictionarykey = 'DataSourceFields.' || dsf.DataSourceNameForTranslation || '.Description' AND dsf.TranslateRowId = d1.TableRowId AND
d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2
ON (d2.Dictionarykey = 'DataSourceFields.' || dsf.DataSourceNameForTranslation || '.EntityType' AND dsf.TranslateRowId = d2.TableRowId AND
d2.LanguageId = l.Id)
|
| IT#EventMessages |
|---|
SELECT em.Id EventMessageId, EventName, COALESCE(DictionaryValue, EventDescription) AS EventDescription, l.Id LanguageId FROM EventMessages em CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'EventMessages.Description' AND em.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#ForecastMethods |
|---|
SELECT f.Id ForecastMethodId, f.ForecastMethodName, COALESCE(d.DictionaryValue, f.ForecastMethodDesc) AS ForecastMethodDesc, f.Internal, l.Id LanguageId FROM IH#ForecastMethods f CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'ForecastMethodTypes' AND f.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#GridColumns |
|---|
SELECT
l.Id AS LanguageId,
t.Id,
t.GridId,
t.ActionId,
t.orderNo,
NVL(d1.DictionaryValue, t.Caption) AS Caption,
t.FieldName,
t.Type,
t.ControlType,
t.IsEditable,
t.IsShowTotal,
t.IsFinancial,
t.TotalFunction,
t.State,
t.DataForColumn,
t.colorColumn,
t.BackgroundColorColumn,
t.dataColumns,
t.dataColumnsMapping,
t.editableColumn,
t.tooltipColumn,
NVL(d2.DictionaryValue, t.ToolTipFormat) AS ToolTipFormat,
t.showToolTipColumn,
t.classColumn,
t.Color,
t.BackgroundColor,
t.IsResizable,
t.IsTransformColumn,
t.IsTransformable,
t.TransformFormat,
t.IsShowToolTip,
t.IsConfigurable,
t.IsGridFilter,
t.SubRow,
t.MaxWidth,
t.MinWidth,
t.Style,
t.Format,
t.Sort,
t.Filter,
t.DependOnColumn,
t.SystemParameter,
t.SystemParameterValue,
t.OrderColumn,
t.ColumnToolTip,
t.Help,
t.IsSummary
FROM GridColumns t
JOIN Grids p ON t.GridId = p.Id
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.DictionaryKey = 'GridColumns.' || p.Name || '.Caption' AND d1.TableRowId = t.Id AND d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2
ON (d2.DictionaryKey = 'GridColumns.' || p.Name || '.ToolTipFormat' AND d2.TableRowId = t.Id AND d2.LanguageId = l.Id)
|
| IT#MasterRouteUnits |
|---|
SELECT * FROM IT#Units u where UnitTypeName = 'Weight' and (IsBaseUnit = 1 or Dividend = -1) |
| IT#Navigations |
|---|
SELECT nt.TaskName, dsf.Name, NVL(n.DisplayLabel, dsf.Description) description, dsf.DataType, EntityType, Category,
NVL(n.FreeEntry, DECODE(INITCAP(dsf.DataType), 'String', 1, 0)) IsFreeEntry,
n.Mandatory IsMandatory, NVL(n.LevelNo, dsf.OrderNo) LevelNo, OrderByField, NVL(Hidden, 0) Hidden,
DataSourceName, n.Id NavigationLevelId, dsf.Helper, dsf.HelperColumn, dsf.Filtered Filtered,
NVL(n.DefaultOperation,
CASE WHEN nt.FilterType = 'Picker' THEN '='
ELSE DECODE(INITCAP(dsf.DataType), 'String', 'in', '=')
END ) DefaultOperation, DefaultValue, nt.IsSystem, n.OperationTypeId, n.MaterialTypeId,
LanguageId
FROM IT#DataSourceFields dsf
JOIN NavigationTasks nt
ON (UPPER(dsf.DataSourceName) = UPPER(nt.Source))
LEFT JOIN Navigations n
ON (UPPER(n.LevelName) = UPPER(dsf.Name) AND n.TaskName = nt.TaskName)
ORDER BY UPPER(TaskName), LevelNo
|
| IT#OrderLineReasons |
|---|
SELECT r.Id ReasonId, r.Reason ReasonName, COALESCE(DictionaryValue, ReasonDescription) AS ReasonDesc, l.Id LanguageId FROM Reasons r CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'Reasons' AND r.Id = d.TableRowId AND d.LanguageId = l.Id) WHERE r.ReasonType = 'OrderLine' |
| IT#PageParameters |
|---|
SELECT
l.Id AS LanguageId,
t.Id,
t.PageId,
t.ActionId,
t.ParameterName,
NVL(d1.DictionaryValue, t.ParameterDescription) AS ParameterDescription,
NVL(d2.DictionaryValue, t.ParameterHint) AS ParameterHint,
t.ParameterType,
t.DataType,
t.DefaultValue,
t.Value,
t.MinValue,
t.MaxValue,
t.DependOn,
t.DependBehaviour,
t.DependValues,
t.OrderNo,
t.Separator,
t.GroupName,
t.BundleId,
t.IsDevMode
FROM PageParameters t
JOIN Pages p ON t.PageId = p.Id
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.DictionaryKey IN ('PageParameters.' || p.PageName || '.ParameterDescription', 'PageParameters.Description') AND d1.TableRowId = t.Id AND d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2
ON (d2.DictionaryKey IN ('PageParameters.' || p.PageName || '.ParameterHint', 'PageParameters.Description') AND d2.TableRowId = t.Id AND d2.LanguageId = l.Id)
|
| IT#Pages |
|---|
SELECT p.ID, PageName, COALESCE(d1.DictionaryValue, p.PageDescription) AS PAgeDescription,
COALESCE(d2.DictionaryValue, p.PageHint) AS PAgeHint, IsBasePage,
ShowAlways, HelpRef, Cloud, BlockedTasks, p.InsertUserId,
p.InsertDate, p.UpdateUserId, p.UpdateDate, l.Id LanguageId, p.IsDevMode, p.Icon,
p.Area, p.SubGroup
FROM Pages p
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.Dictionarykey = 'Pages.PageDescription' AND p.Id = d1.TableRowId AND d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2
ON (d2.Dictionarykey = 'Pages.PageHint' AND p.Id = d2.TableRowId AND d2.LanguageId = l.Id)
|
| IT#ProcessParts |
|---|
SELECT pp.Id as ProcessPartId, pp.ProcessPartName, COALESCE(d.DictionaryValue, pp.ProcessPartDesc) AS ProcessPartDesc, l.Id LanguageId FROM ProcessParts pp CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'ProcessParts' AND pp.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#Roles |
|---|
SELECT r.Id RoleId, RoleName, COALESCE(DictionaryValue, RoleDescription) AS RoleDescription, IsAdmin, IsInternal, r.InsertUserId, r.InsertDate, r.UpdateUserId, r.UpdateDate, l.Id LanguageId FROM Roles r CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'Roles.Description' AND r.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#SafetyStockMethods |
|---|
SELECT s.Id SafetyStockMethodId, s.SafetyStockMethodName, COALESCE(d.DictionaryValue, s.SafetyStockMethodDesc) AS SafetyStockMethodDesc, l.Id LanguageId FROM SafetyStockMethods s CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'SafetyStockMethods' AND s.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#SystemParameters |
|---|
SELECT
t.Id,
t.ParameterName,
NVL(d1.DictionaryValue, t.ParameterDescription) AS ParameterDescription,
NVL(d2.DictionaryValue, t.ParameterHelp) AS ParameterHelp,
t.ParameterType,
t.DataType,
t.Value,
t.DefaultValue,
t.MinValue,
t.MaxValue,
t.ReadOnly,
t.Cloud,
NVL(d3.DictionaryValue, t.Category) AS Category,
t.DependOn,
t.BundleId,
l.Id as LanguageId
FROM SystemParameters t
CROSS JOIN Languages l
LEFT JOIN DBDictionaries d1
ON (d1.DictionaryKey = 'SystemParameters.ParameterDescription' AND d1.TableRowId = t.Id AND d1.LanguageId = l.Id)
LEFT JOIN DBDictionaries d2
ON (d2.DictionaryKey = 'SystemParameters.ParameterHelp' AND d2.TableRowId = t.Id AND d2.LanguageId = l.Id)
LEFT JOIN DBDictionaries d3
ON (d3.DictionaryKey = 'SystemParameters.Category' AND d3.TableRowId = t.Id AND d3.LanguageId = l.Id)
|
| IT#Tasks |
|---|
SELECT t.Id as TaskId, t.TaskName, COALESCE(d.DictionaryValue, t.Description) AS TaskDesc, l.Id LanguageId FROM Tasks t CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'Tasks' AND t.Id = d.TableRowId AND d.LanguageId = l.Id) |
| IT#Units |
|---|
with t as ( SELECT u.Id Id, UnitName, COALESCE(DictionaryValue, UnitDescription) AS UnitDescription, l.Id LanguageId FROM Units u CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'Units' AND u.Id = d.TableRowId AND d.LanguageId = l.Id) ) SELECT u.Id, u.UnitName, t.UnitDescription, UnitTypeId, UnitTypeName, UnitTypeDesc, IsBaseUnit, FromBaseUnit, Dividend, Divisor, LanguageId, MaterialTypeId, DividendProductPart, DivisorProductPart, DECODE(Dividend, -1, 1, 0) IsConverted FROM Units u JOIN UnitTypes ut ON (ut.Id = u.UnitTypeID) JOIN t ON (t.Id = u.Id) UNION ALL SELECT u.Id, u.UnitName, t.UnitDescription, UnitTypeId, UnitTypeName, UnitTypeDesc, IsBaseUnit, FromBaseUnit, Dividend, Divisor, LanguageId, MaterialTypeId, DividendProductPart, DivisorProductPart, 1 IsConverted FROM Units u JOIN UnitTypeConverts uc ON (uc.ToUnitTypeid = u.Unittypeid) JOIN UnitTypes ut ON (ut.Id = uc.FromUnitTypeID) LEFT JOIN t ON (t.Id = u.Id) |
| IT#UnitTypes |
|---|
SELECT t.Id, UnitTypeName, COALESCE(DictionaryValue, UnitTypeDesc) AS UnitTypeDesc, l.Id LanguageId FROM UnitTypes t CROSS JOIN Languages l LEFT JOIN DBDictionaries d ON (d.Dictionarykey = 'UnitTypes' AND t.Id = d.TableRowId AND d.LanguageId = l.Id) where UnitTypeName = 'Weight' OR EXISTS (select 1 from UnitTypeConverts c where c.fromunittypeid = t.Id or c.ToUnitTypeId = t.Id) |
| IT#UserPageParameters |
|---|
SELECT
t.LanguageId,
u.Id UserId,
t.Id,
t.PageId,
t.ActionId,
t.ParameterName,
t.ParameterDescription,
t.ParameterHint,
t.ParameterType,
t.DataType,
t.DefaultValue,
DECODE(COALESCE(up.Value, t.Value, t.DefaultValue),
'{SYSDATE}', to_char(TRUNC(core.getInternalDate, 'month'), 'YYYY-MM-DD'),
COALESCE(up.Value, t.Value, t.DefaultValue))
AS VALUE,
t.MinValue,
t.MaxValue,
t.DependOn,
t.DependBehaviour,
t.DependValues,
t.OrderNo,
t.Separator,
t.GroupName,
t.BundleId,
t.IsDevMode
FROM IT#PageParameters t
CROSS JOIN USERS u
LEFT JOIN UserPageParameters up
ON (up.PageParameterid = t.Id AND u.id = userid)
|
| IV#CostRules |
|---|
SELECT cr.*, wc.SiteName, wc.WorkcentreName, ot.OperationTypeName,
d.Code1, d.Code2, d.Code3, d.Code4, d.Code5, d.Code6, d.Code7, d.Code8, d.Code9, d.Code10,
d.Code11, d.Code12, d.Code13, d.Code14, d.Code15, d.Code16, d.Code17, d.Code18, d.Code19, d.Code20,
d.Code21, d.Code22, d.Code23, d.Code24, d.Code25, d.Code26, d.Code27, d.Code28, d.Code29, d.Code30,
NVL(LEAD(Effective) OVER(PARTITION BY cr.WorkcentreId, cr.OperationTypeId, cr.DetailId ORDER BY cr.Effective) - 1,
to_date('2100-01-01', 'YYYY-MM-DD')) EffectiveTo,
CASE WHEN TRUNC(core.getInternalDate) BETWEEN Effective AND NVL(LEAD(Effective) OVER(PARTITION BY cr.WorkcentreId, cr.OperationTypeId, cr.DetailId ORDER BY cr.Effective),
to_date('2100-01-01', 'YYYY-MM-DD')) THEN 1 ELSE 0 END IsActive,
d.ProductCode
FROM CostRules cr
JOIN HierarchyPropertyDetails d ON (d.Id = cr.DetailId)
JOIN IH#Workcentres wc ON wc.WorkcentreId = cr.WorkcentreId
LEFT JOIN OperationTypes ot ON ot.Id = cr.OperationTypeId
|
| IV#CostRulesValues |
|---|
SELECT d.Id DetailId, MAX(Value1) Value1, MAX(Value2) Value2,
MAX(Value3) Value3, MAX(Value4) Value4, MAX(Value5) Value5,
MAX(Value6) Value6, MAX(Value7) Value7, MAX(Value8) Value8,
MAX(Value9) Value9, MAX(Value10) Value10, MAX(Value11) Value11,
MAX(Value12) Value12, MAX(Value13) Value13, MAX(Value14) Value14,
MAX(Value15) Value15, MAX(Value16) Value16, MAX(Value17) Value17,
MAX(Value18) Value18, MAX(Value19) Value19, MAX(Value20) Value20,
MAX(Value21) Value21, MAX(Value22) Value22, MAX(Value23) Value23,
MAX(Value24) Value24, MAX(Value25) Value25, MAX(Value26) Value26,
MAX(Value27) Value27, MAX(Value28) Value28, MAX(Value29) Value29,
MAX(Value30) Value30
FROM HierarchyPropertyDetails d
JOIN CostRules cr on d.Id = cr.DetailId
JOIN MaterialPropsSpec m
ON NVL(d.Code1, '!$NONE$!') IN (m.Code1, '!$NONE$!')
AND NVL(d.Code2, '!$NONE$!') IN (m.Code2, '!$NONE$!')
AND NVL(d.Code3, '!$NONE$!') IN (m.Code3, '!$NONE$!')
AND NVL(d.Code4, '!$NONE$!') IN (m.Code4, '!$NONE$!')
AND NVL(d.Code5, '!$NONE$!') IN (m.Code5, '!$NONE$!')
AND NVL(d.Code6, '!$NONE$!') IN (m.Code6, '!$NONE$!')
AND NVL(d.Code7, '!$NONE$!') IN (m.Code7, '!$NONE$!')
AND NVL(d.Code8, '!$NONE$!') IN (m.Code8, '!$NONE$!')
AND NVL(d.Code9, '!$NONE$!') IN (m.Code9, '!$NONE$!')
AND NVL(d.Code10, '!$NONE$!') IN (m.Code10, '!$NONE$!')
AND NVL(d.Code11, '!$NONE$!') IN (m.Code11, '!$NONE$!')
AND NVL(d.Code12, '!$NONE$!') IN (m.Code12, '!$NONE$!')
AND NVL(d.Code13, '!$NONE$!') IN (m.Code13, '!$NONE$!')
AND NVL(d.Code14, '!$NONE$!') IN (m.Code14, '!$NONE$!')
AND NVL(d.Code15, '!$NONE$!') IN (m.Code15, '!$NONE$!')
AND NVL(d.Code16, '!$NONE$!') IN (m.Code16, '!$NONE$!')
AND NVL(d.Code17, '!$NONE$!') IN (m.Code17, '!$NONE$!')
AND NVL(d.Code18, '!$NONE$!') IN (m.Code18, '!$NONE$!')
AND NVL(d.Code19, '!$NONE$!') IN (m.Code19, '!$NONE$!')
AND NVL(d.Code20, '!$NONE$!') IN (m.Code20, '!$NONE$!')
AND NVL(d.Code21, '!$NONE$!') IN (m.Code21, '!$NONE$!')
AND NVL(d.Code22, '!$NONE$!') IN (m.Code22, '!$NONE$!')
AND NVL(d.Code23, '!$NONE$!') IN (m.Code23, '!$NONE$!')
AND NVL(d.Code24, '!$NONE$!') IN (m.Code24, '!$NONE$!')
AND NVL(d.Code25, '!$NONE$!') IN (m.Code25, '!$NONE$!')
AND NVL(d.Code26, '!$NONE$!') IN (m.Code26, '!$NONE$!')
AND NVL(d.Code27, '!$NONE$!') IN (m.Code27, '!$NONE$!')
AND NVL(d.Code28, '!$NONE$!') IN (m.Code28, '!$NONE$!')
AND NVL(d.Code29, '!$NONE$!') IN (m.Code29, '!$NONE$!')
AND NVL(d.Code30, '!$NONE$!') IN (m.Code30, '!$NONE$!')
GROUP BY d.Id
|
| IV#DataSourceFilters |
|---|
SELECT rf.Id, rf.Code, rf.IsShared, rf.Logic, rf.HashCode, rf.ToolTip, rf.SqlText, dsf.DataSourceId, dsf.Name, dsf.UserId FROM ReportFilters rf JOIN DataSourceFilters dsf ON (dsf.ReportFilterId = rf.Id) |
| IV#Hierarchies |
|---|
SELECT HierarchyId, RTRIM(NVL2(HierarchyName1, HierarchyName1 || ' / ', '') || NVL2(HierarchyName2, HierarchyName2 || ' / ', '') || NVL2(HierarchyName3, HierarchyName3 || ' / ', '') || NVL2(HierarchyName4, HierarchyName4 || ' / ', '') || NVL2(HierarchyName5, HierarchyName5 || ' / ', '') || NVL2(HierarchyName6, HierarchyName6 || ' / ', '') || NVL2(HierarchyName7, HierarchyName7 || ' / ', '') || NVL2(HierarchyName8, HierarchyName8 || ' / ', '') || NVL2(HierarchyName9, HierarchyName9 || ' / ', '') || NVL2(HierarchyName10, HierarchyName10 || ' / ', '') || NVL2(HierarchyName11, HierarchyName11 || ' / ', '') || NVL2(HierarchyName12, HierarchyName12 || ' / ', '') || NVL2(HierarchyName13, HierarchyName13 || ' / ', '') || NVL2(HierarchyName14, HierarchyName14 || ' / ', '') || NVL2(HierarchyName15, HierarchyName15 || ' / ', ''), ' / ') Hierarchies FROM Expandedhierarchiesspec |
| IV#MaterialProperties |
|---|
SELECT em.MaterialId, pv.PropertyValueCode, Value, pv.PropertyId, p.PropertyName, mtp.Hierarchylevelno, m.MaterialTypeId FROM ExpandedMaterials em jOIN PropertyValues pv ON (pv.Id = em.Propertyvalueid) JOIN Materials m ON (m.Id = em.MaterialId) JOIN Properties p ON (p.Id = pv.PropertyId) JOIN MaterialTypeProperties mtp ON (mtp.MaterialTypeId = m.MaterialTypeId AND p.Id = mtp.PropertyId) ORDER BY em.MaterialID, mtp.Hierarchylevelno |
| IV#MAterials |
|---|
SELECT mt.MaterialTypeName, m.* FROM materials m JOIN MaterialTypes mt ON (mt.Id = m.MaterialtypeId) |
| IV#PriceRules |
|---|
SELECT pr.*, LocationCode, ProductCode, EndUseCode, EndCustomerCode,
d.Code1, d.Code2, d.Code3, d.Code4, d.Code5, d.Code6, d.Code7, d.Code8, d.Code9, d.Code10,
d.Code11, d.Code12, d.Code13, d.Code14, d.Code15, d.Code16, d.Code17, d.Code18, d.Code19, d.Code20,
d.Code21, d.Code22, d.Code23, d.Code24, d.Code25, d.Code26, d.Code27, d.Code28, d.Code29, d.Code30,
HierarchyCode1, HierarchyCode2, HierarchyCode3, HierarchyCode4, HierarchyCode5,
HierarchyCode6, HierarchyCode7, HierarchyCode8, HierarchyCode9, HierarchyCode10,
HierarchyCode11, HierarchyCode12, HierarchyCode13, HierarchyCode14, HierarchyCode15,
Property1, Property2, Property3, Property4, Property5, Property6, Property7, Property8, Property9, Property10,
Property11, Property12, Property13, Property14, Property15,
NVL(LEAD(Effective) OVER(PARTITION BY pr.DetailId ORDER BY pr.Effective, RuleWeighting ASC) - 1,
to_date('2100-01-01', 'YYYY-MM-DD')) EffectiveTo,
CASE WHEN core.getTruncatedInternalDate BETWEEN Effective AND NVL(LEAD(Effective) OVER(PARTITION BY pr.DetailId ORDER BY pr.Effective, RuleWeighting ASC),
to_date('2100-01-01', 'YYYY-MM-DD')) THEN 1 ELSE 0 END IsActive
FROM PriceRules pr
JOIN HierarchyPropertyDetails d ON (d.Id = pr.DetailId)
|
| IV#RangeProperties |
|---|
SELECT DISTINCT MaterialId, WorkcentreId FROM ( SELECT em.MaterialId, pv.Value, pv.PropertyId, r.WorkcentreId, r.rangefrom, r.RangeTo FROM ExpandedMaterials em JOIN PropertyValues pv ON pv.Id = em.PropertyValueId JOIN Properties p ON (p.Id = pv.PropertyID AND p.DataType = 'Integer') LEFT JOIN ReplenishmentRestrictions r ON r.PropertyID = pv.PropertyId WHERE to_number(pv.Value) BETWEEN NVL(RANGEFrom,0) AND NVL(RangeTo, 9999999999999) ) WHERE WorkcentreId IS NOT NULL |
| IV#WorkcentreRangeProperties |
|---|
SELECT r.Id, wc.WorkcentreId, p.PropertyId, p.PropertyDesc, r.Rangefrom, r.RangeTo FROM ( SELECT * FROM IH#Workcentres WHERE IsProductionSource = 1) wc CROSS JOIN (SELECT Id PropertyId, PropertyDesc FROM properties WHERE datatype = 'Integer') p LEFT JOIN ReplenishmentRestrictions r ON r.WorkcentreId = wc.WorkcentreId AND p.PropertyId = r.PropertyId |
| IVBS#MaterialRuns |
|---|
SELECT mr.Quantity - NVL(oo.Weight,0) FreeCapacity, mr.*
FROM MaterialRuns mr
LEFT JOIN
(
SELECT oo.MaterialRunId, SUM(oo.RemainingQuantity) AS Weight
FROM IH#OrderDuration oo
WHERE oo.MaterialRunId IS NOT NULL
AND oo.OrderOperationStatusCode IN ('Firm', 'Completed')
GROUP BY oo.MaterialRunId
) oo ON oo.MaterialRunId = mr.Id
|
| IVDP#HistoryData |
|---|
SELECT hd.SiteMaterialUSageId,
l.LocationCode, m.MaterialCode,
l.LocationName, m.MaterialName,
eu.EndUseCode, eu.EndUseDescription,
ec.LocationCode EndCustomerCode, ec.LocationName EndCustomerName,
StartDate,
DateFrom,
Weight,
l.LocationCode || ' / ' || m.MaterialCode SkuCode,
l.LocationName || ' / ' || m.MaterialName SkuName
FROM HistoryData hd
JOIN SiteMaterialUsages smu ON hd.Sitematerialusageid = smu.Id
JOIN Locations l ON l.Id = smu.LocationId
JOIN Materials m ON m.Id = smu.MaterialId
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON ec.Id = smu.EndCustomerId
ORDER BY l.LocationCode, m.MaterialCode, eu.EndUseCode, ec.LocationCode, StartDate, DateFrom
|
| IVDP#HistoryStartDate |
|---|
SELECT t.SiteMaterialUsageId, NVL(smu.HistoryStartDate, MIN(FirstHistoryDate)) HistoryDate
FROM (
SELECT uh.SiteMaterialUsageId, MIN(Trunc(uh.DateFrom, 'mm')) AS FirstHistoryDate
FROM UsageHistories uh
group by SiteMaterialUsageId
UNION ALL
SELECT ms.OnSiteMaterialUsageId, MIN(Trunc(uh.DateFrom, 'mm')) AS FirstHistoryDate
FROM UsageHistories uh
JOIN IH#ActiveSupercessions ms
ON (uh.SiteMaterialUsageId = ms.SiteMaterialUSageId)
group by ms.OnSiteMaterialUsageId
) t
JOIN SiteMaterialUsages smu
ON smu.Id = t.SiteMaterialUsageId
GROUP BY t.SiteMaterialUsageId, smu.HistoryStartDate
|
| IVDP#UsageHistories |
|---|
SELECT hd.SiteMaterialUSageId,
l.LocationCode, m.MaterialCode,
l.LocationName, m.MaterialName,
eu.EndUseCode, eu.EndUseDescription,
ec.LocationName EndCustomerName, ec.LocationCode EndCustomerCode,
DateFrom,
Weight,
AdjustedWeight,
NVL(AdjustedWeight, Weight) Quantity,
l.LocationCode || ' / ' || m.MaterialCode SkuCode,
l.LocationName || ' / ' || m.MaterialName SkuName
FROM UsageHistories hd
JOIN IH#CUSTOMERSKUS smu ON hd.Sitematerialusageid = smu.SiteMaterialUSageId
JOIN Locations l ON l.Id = smu.LocationId
JOIN Materials m ON m.Id = smu.MaterialId
LEFT JOIN EndUses eu ON eu.Id = smu.EndUseId
LEFT JOIN Locations ec ON eu.Id = smu.EndCustomerId
ORDER BY l.LocationCode, m.MaterialCode, eu.EndUseCode, ec.LocationCode, DateFrom
|
| IVMP#Indicatives |
|---|
SELECT SiteMaterialUsageId, GradeId, WorkCentreId, SiteId,
DeliveryMonth, DeliveryWeek,
SUM(OrdersWeight) OrdersWeight,
SUM(Allocation) Allocation
FROM (
SELECT SiteMaterialUsageId, GradeId, ab.WorkcentreId, wc.SiteId, DeliveryMonth,
DeliveryWeek, 0 OrdersWeight, VALUE Allocation
FROM Indicatives ab
JOIN SiteMaterialUsages smu
ON ab.SiteMaterialUsageId = smu.Id
JOIN GradeMaterials gm
ON smu.MaterialId = gm.MaterialId
JOIN IH#Workcentres wc
ON ab.WorkcentreId = wc.WorkcentreId
UNION ALL
SELECT NVL(ms.OnSiteMaterialUsageId, ol.SiteMaterialUsageId), GradeId, ol.WorkcentreId, wc.SiteId,
Trunc(DeliveryDate, 'Month') DeliveryMonth, Trunc(DeliveryDate, 'IW') DeliveryWeek,
FinalWeight / NVL(ConversionFactor, 1) OrdersWeight,
0 Allocation
FROM OrderLines ol
JOIN GradeMaterials gm
ON ol.SourceMaterialId = gm.MaterialId
JOIN OrderLineStatuses ols
ON ol.OrderLineStatusId = ols.Id
JOIN IH#Workcentres wc
ON ol.WorkcentreId = wc.WorkcentreId
LEFT JOIN IH#ActiveSupercessions ms
ON ms.SiteMaterialUsageId = ol.SiteMaterialUsageId
LEFT JOIN SiteMaterialUsages smu
ON ms.OnSiteMaterialUsageId = smu.Id
LEFT JOIN IH#ActualProductionRates r
ON r.WorkCentreId = ol.WorkCentreId
AND r.MaterialId = NVL(smu.MaterialId, ol.MaterialId)
AND NVL(ol.ConsumptionDate, ol.DespatchDate) BETWEEN r.DateFrom AND r.DateTo
WHERE ols.OrderLineStatusCode IN ('Firm', 'Completed')
AND OrderType = 'Customer'
)
GROUP BY SiteMaterialUsageId, GradeId, WorkcentreId, SiteId, DeliveryMonth, DeliveryWeek
|
| IVMP#LiveAllocations |
|---|
SELECT SiteMaterialUsageId, WorkcentreId, OperationTypeId, MaterialId,
SourceMonth, SourceWeek, DeliveryMonth, DeliveryWeek, AllocationId,
SUM(OrdersWeight) OrdersWeight, SUM(SystemOrdersWeight) SystemOrdersWeight,
SUM(Allocation) Allocation
FROM
(
SELECT SiteMaterialUsageId, ab.WorkcentreId, ab.OperationTypeId, smu.MaterialId,
SourceMonth, SourceWeek, DeliveryMonth, DeliveryWeek,
0 OrdersWeight, 0 SystemOrdersWeight,
Customer / DECODE(wc.WorkcentreTypeName, 'Paper Machine', ConversionFactor, 1) Allocation, ab.Id AllocationId
FROM AllocationBodies ab
JOIN SiteMaterialUsages smu ON ab.SiteMaterialUsageId = smu.Id
JOIN IH#Workcentres wc ON ab.WorkcentreId = wc.WorkcentreId
UNION ALL
SELECT o.SiteMaterialUsageId,
o.WorkcentreId,
o.OperationTypeId,
o.MaterialId,
Trunc(p.StartPeriod, 'Month') SourceMonth,
Trunc(p.StartPeriod, 'IW') SourceWeek,
Trunc(DeliveryDate, 'Month') DeliveryMonth,
Trunc(DeliveryDate, 'IW') DeliveryWeek,
o.OrdersWeight * p.Coef OrdersWeight,
o.SystemOrdersWeight * p.Coef SystemOrdersWeight,
0 Allocation, 0 AllocationId
FROM
(
SELECT NVL(smu.OnSiteMaterialUsageId, ol.SiteMaterialUsageId) SiteMaterialUsageId,
COALESCE(oo.WorkcentreId, ol.WorkcentreId) WorkcentreId,
r.OperationTypeId,
ol.MaterialId,
COALESCE(oo.dueDate, oo.FinishTime, ol.DespatchDate) SourceDate,
DeliveryDate,
SUM(CASE WHEN NVL(oos.OrderOperationStatusCode, ols.OrderLineStatusCode) IN ('Firm', 'Completed')
THEN NVL(oo.Quantity, ol.FinalWeight) / NVL(ConversionFactor, 1)
END) OrdersWeight,
SUM(CASE WHEN NVL(oos.OrderOperationStatusCode, ols.OrderLineStatusCode) = 'System'
THEN NVL(oo.Quantity, ol.FinalWeight) / NVL(ConversionFactor, 1)
END) SystemOrdersWeight,
NVL(oo.OperationDuration, 0) OperationDuration
FROM OrderLines ol
JOIN OrderLineStatuses ols ON ols.Id = ol.OrderLineStatusId
LEFT JOIN OrderOperations oo ON oo.OrderLineId = ol.Id
LEFT JOIN OrderOperationStatuses oos ON oos.Id = oo.OrderOperationStatusId
LEFT JOIN IH#ActiveSupercessions ms ON ms.SiteMaterialUsageId = ol.SiteMaterialUsageId
LEFT JOIN SiteMaterialUsages smu on smu.Id = ms.OnSiteMaterialUsageId
LEFT JOIN IH#ActualProductionRates r
ON r.WorkCentreId = NVL(oo.WorkcentreId, ol.WorkcentreId)
AND NVL(r.OperationTypeId,0) = NVL(oo.OperationTypeId,0)
AND r.MaterialId = NVL(smu.MaterialId, ol.MaterialId)
AND COALESCE(oo.dueDate, oo.FinishTime, ol.DespatchDate) BETWEEN r.DateFrom AND r.DateTo
WHERE NVL(oos.OrderOperationStatusCode, ols.OrderLineStatusCode) IN ('Firm', 'Completed', 'System')
GROUP BY NVL(smu.OnSiteMaterialUsageId, ol.SiteMaterialUsageId),
COALESCE(oo.WorkcentreId, ol.WorkcentreId), r.OperationTypeId, ol.MaterialId,
COALESCE(oo.dueDate, oo.FinishTime, ol.DespatchDate),
DeliveryDate,
NVL(oo.OperationDuration, 0)
) o
CROSS JOIN core.getWeekPeriod(o.SourceDate - o.OperationDuration / 1440, o.SourceDate) p
)
GROUP BY SiteMaterialUsageId, WorkcentreId, OperationTypeId, MaterialId,
SourceMonth, SourceWeek, DeliveryMonth, DeliveryWeek, AllocationId
|
| IVMP#TransportAllocations |
|---|
WITH t AS
(SELECT ab.SiteMaterialUsageId, ab.WorkCentreId, ab.MasterRouteId, wc.LocationId SourceLocationId, wc.SiteId,
ab.DeliveryWeek, ab.DeliveryMonth, Trunc(ab.DeliveryWeek - NVL(mr.TimePeriod, 0), 'Month') DespatchMonth,
Trunc(ab.DeliveryWeek - NVL(mr.TimePeriod, 0), 'IW') DespatchWeek, ab.SourceWeek, ab.SourceMonth,
Customer / NVL(ConversionFactor,1) AS Allocation, 0 Orders,
0 SourceWeight, 0 RemainingWeight, 0 RemainingSourceWeight, 'CUST' DestinationType,
CASE wc.WorkCentreTypeName
WHEN 'Paper Machine' THEN
'PM'
ELSE
'FG'
END AS SourceType
FROM AllocationBodies ab
JOIN IH#Workcentres wc ON wc.WorkcentreID = ab.workcentreId
LEFT JOIN MasterRoutes mr
ON mr.Id = ab.MasterRouteId
where ab.DeliveryMonth >= (SELECT MIN(TRUNC(core.getInternalDate)) - 93 FROM dual)
UNION ALL
SELECT ol.SiteMaterialUsageId, ol.WorkCentreId, mr.Id MasterRouteId, sw.LocationId SourceLocationId, sw.SiteId,
Trunc(DeliveryDate, 'Month') DeliveryMonth, Trunc(DeliveryDate, 'IW') DeliveryWeek,
Trunc(DespatchDate, 'Month') DespatchMonth, Trunc(DespatchDate, 'IW') DespatchWeek,
Trunc(ol.DespatchDate, 'Month') SourceMonth, Trunc(ol.DespatchDate, 'IW') SourceWeek, 0 Allocation,
ol.FinalWeight / NVL(ConversionFactor,1) AS Orders, ol.SourceWeight,
GREATEST(0, ol.FinalWeight - GREATEST(ol.WeightComplete, ol.DeliveryWeight)) AS RemainingWeight,
GREATEST(0,
ol.SourceWeight - GREATEST(ol.WeightIssued, ol.WeightComplete * ol.SourceCoef, ol.DeliverySourceWeight))
AS RemainingSourceWeight,
CASE dw.WorkCentreTypeName
WHEN 'Warehouse' THEN
'FG'
ELSE
'CUST'
END AS DestinationType,
CASE sw.WorkCentreTypeName
WHEN 'Paper Machine' THEN
'PM'
ELSE
'FG'
END AS SourceType
FROM OrderLines ol
JOIN OrderLineStatuses ols
ON ols.Id = ol.OrderLineStatusId
AND ols.OrderLineStatusCode IN ('Firm')
JOIN IH#WorkCentres sw
ON sw.WorkCentreId = ol.WorkCentreId
LEFT JOIN IH#ActualProductionRates r
ON r.WorkcentreId = ol.WorkcentreId
AND r.MaterialId = ol.MaterialId
AND NVL(ol.ConsumptionDate, ol.DespatchDate) BETWEEN r.DateFrom AND r.DateTo
LEFT JOIN IH#WorkCentres dw
ON dw.LocationId = ol.LocationId
LEFT JOIN (SELECT mr.Id, mr.Cost, mr.TimePeriod, mr.FromSiteId, d.LocationId,
DENSE_RANK() OVER(PARTITION BY mr.FromSiteId, d.LocationId ORDER BY mr.TimePeriod, mr.Id DESC) r
FROM MasterRoutes mr
JOIN IH#DetailsLocation d
ON d.DetailId = mr.DetailId) mr
ON mr.LocationId = ol.LocationId
AND mr.FromSiteId = sw.SiteId
AND mr.r = 1
WHERE DeliveryDate >= (SELECT MIN(TRUNC(core.getInternalDate)) - 93 FROM dual)
)
SELECT SiteMaterialUsageId, WorkCentreId, MasterRouteId, SourceLocationId, SiteId, DeliveryWeek, DeliveryMonth,
DespatchWeek, DespatchMonth, SourceWeek, SourceMonth, SUM(Allocation) Allocation, SUM(Orders) Orders,
SUM(SourceWeight) SourceWeight, SUM(RemainingWeight) RemainingWeight,
SUM(RemainingSourceWeight) RemainingSourceWeight, DestinationType, SourceType
FROM t
GROUP BY SiteMaterialUsageId, WorkCentreId, MasterRouteId, SourceLocationId, SiteId, DeliveryWeek, DeliveryMonth,
DespatchWeek, DespatchMonth, SourceWeek, SourceMonth, DestinationType, SourceType
|
| IVRP#MaterialRunProducts |
|---|
SELECT mrp.MaterialRunId, rp.RunProductId, p.PropertyName, rp.PropertyValueCode FROM MaterialRunProducts mrp JOIN Materialrunproperties rp ON rp.RunProductId = mrp.Id JOIN Properties p ON p.Id = rp.PropertyId |
| IVRP#MaterialRuns |
|---|
SELECT mb.BlockCode, mr.RunCode, w.WorkCentreCode, mr.Id, mr.StartDate, mr.FinishDate, mrs.RunStatusName
FROM MaterialRuns mr
JOIN MaterialBlocks mb
ON mb.Id = mr.MaterialBlockId
JOIN WorkCentres w
ON w.Id = mr.WorkCentreid
JOIN MaterialRunStatuses mrs
ON mrs.Id = mr.MaterialRunStatusId
|
| IVRP#OrderInformation |
|---|
SELECT oi.OrderLineId, oi.Type, i.Type ValueType, i.Value, oi.Type || '.' || i.Type DictionaryKey, i.Value DictionaryValue from OrderInformation oi LEFT JOIN OrderInformationItems i ON (oi.Id = i.OrderInformationId) |
| IVRP#OrderLines |
|---|
SELECT OrderCode,
fcs.LocationCode FromConsignmentLocationCode,
tcs.LocationCode ToConsignmentLocationCode,
m.MaterialCode,
l.LocationCode,
l.LocationName,
tm.TransportMethodCode,
j.journeyCode,
s.SiteCode,
wc.WorkcentreCode,
ols.OrderLineStatusName,
mt.Materialtypename MaterialTypeName,
smt.Materialtypename SourceMaterialTypeName,
Round(ol.FinalWeight * COALESCE(ol.Dividend, su.Dividend, 0) / COALESCE(ol.Divisor, su.Divisor, 1), 0) as QuantityInUnits,
am.ExistingAlternateName AlternateProductCode,
su.UnitName,
ol.*
from OrderLines ol
join OrderBooks o ON (o.Id = ol.OrderBookId)
JOIN Locations l ON (ol.LocationId = l.ID)
JOIN Materials m ON (m.Id = ol.MaterialId)
LEFT JOIN Workcentres wc ON wc.Id = ol.WorkcentreId
LEFT JOIN Sites s ON s.Id = ol.SiteId
JOIN MaterialTypes mt ON (mt.ID = m.MaterialTypeId)
JOIN OrderLineStatuses ols ON (ols.Id = ol.OrderLineStatusId)
LEFT JOIN TransportMethods tm ON (tm.ID = ol.TransportMethodId)
LEFT JOIN (SELECT mu.*, u.UnitName, u.IsBaseUnit
FROM materialUnits mu
JOIN Units u ON u.Id = mu.UnitId) su
ON ol.MaterialId = su.MaterialId
AND (su.UnitId = ol.UnitId OR (ol.UnitId IS NULL AND su.IsBaseUnit = 1))
LEFT JOIN Locations fcs ON (fcs.ID = ol.FromConsignmentlocationId)
LEFT JOIN Locations tcs ON (tcs.ID = ol.ToConsignmentlocationId)
LEFT JOIN Journeys j ON (j.ID = ol.JourneyId AND IsInternal = 0)
LEFT JOIN Materials sm ON (sm.Id = ol.SourceMaterialId)
LEFT JOIN MaterialTypes smt ON (smt.ID = sm.MaterialTypeId)
LEFT JOIN IH#AlternateMaterials am ON am.Id = ol.SiteMaterialUsageId AND NVL(am.ConsignmentLocationId, 0) = NVL(ol.ToConsignmentLocationId, 0)
|
| IVRP#OrderOperations |
|---|
SELECT wc.WorkcentreCode, ols.OrderOperationStatusName, ols.OrderOperationStatusCode, BlockCode, RunCode, oo.* from OrderOperations oo JOIN Workcentres wc ON (wc.Id = oo.WorkcentreId) JOIN OrderOperationStatuses ols ON (ols.Id = oo.OrderOperationStatusId) LEFT JOIN MaterialRuns mr ON (mr.Id = oo.MaterialRunId) LEFT JOIN MaterialBlocks mb ON (mb.Id = mr.MaterialBlockId) |
| IVSA#DemandAllocations |
|---|
SELECT sa.SourceDate, sa.SourceDate SourceMonth, sa.DeliveryDate, sa.DeliveryDate DeliveryMonth, sa.ID, sa.ScenarioId, sa.ScenarioSessionId, sd.Aggregated, sd.nonmoveablefirm, sa.Allocation, WorkcentreId, SiteId, sa.ProductionCost, sa.TransportCost, sa.InventoryCost FROM ( SELECT SourceDate, SourceDate SourceMonth, DeliveryDate, DeliveryDate DeliveryMonth, sa.ID, ScenarioId, ScenarioSessionId, WorkcentreId, SiteId, SUM(Allocation) Allocation, SUM(ProductionCost) ProductionCost, SUM(TransportCost) TransportCost, SUM(InventoryCost) InventoryCost FROM SourcingAllocation sa GROUP BY SourceDate, DeliveryDate, sa.ID, ScenarioId, ScenarioSessionId, WorkcentreId, SiteId ) sa JOIN ScenarioSessions ss ON ss.Id = sa.ScenarioSessionId JOIN SNoDemands sd ON sd.ScenarioSessionId = sa.ScenarioSessionId AND sd.ScenarioID = sa.ScenarioId AND sd.Datefrom = sa.DeliveryDate AND sd.Id = sa.Id |
| IVSA#PaperMachineCapacities |
|---|
SELECT ScenarioSessionId, ScenarioId, WorkcentreId, WorkcentreName, WorkcentreCode, DateFrom, case when NominalCapacityHours - AllocationHours - CoProductAllocationHours - OrdersHours - CoProductOrdersHours - ShutHours > 0.01 then 1 else 0 end HasCapacity, NominalCapacityHours - AllocationHours - CoProductAllocationHours - OrdersHours - CoProductOrdersHours - ShutHours AvailableCapacityHours FROM Machineinformation mi join Workcentres wc on wc.Id = mi.WorkcentreId WHERE WorkcentreId IS NOT NULL AND MachineType = 'PM' |
| IVSA#PMCapacities |
|---|
WITH mc AS
(SELECT ScenarioSessionId, ScenarioId, WorkcentreId, SiteId, mi.DateFrom SourceDate, TimePeriod, NominalCapacity,
AvailableCapacityHours, CapacityHours, NominalCapacityHours, ShutHours, FixedCapacityHours,
OrdersHours, CoProductOrdersHours, Orders, CoProductOrders,
AllocationHours, CoProductAllocationHours, Allocation, CoProductAllocation,
GREATEST(0, AvailableCapacityHours - OrdersHours - CoProductOrdersHours - AllocationHours - CoProductAllocationHours) UnallocatedHours,
CASE
WHEN OrdersHours + CoProductOrdersHours > CapacityHours THEN
CapacityHours
ELSE
OrdersHours + CoProductOrdersHours
END + AllocationHours + CoProductAllocationHours AllocatedHours,
MachineType
FROM MachineInformation mi
WHERE MachineType = 'PM'
)
SELECT mc.ScenarioSessionId, mc.ScenarioId, mc.WorkcentreId, mc.SiteId, mc.SourceDate, mc.TimePeriod, NominalCapacity,
NominalCapacityHours, AvailableCapacityHours, CapacityHours, UnallocatedHours,
(NominalCapacityHours - UnallocatedHours) AllocatedHours,
AllocationHours, CoProductAllocationHours,
OrdersHours, CoProductOrdersHours,
CASE WHEN MachineType = 'ES' THEN NominalCapacity
ELSE DECODE(NominalCapacityHours, 0, 0, Allocation + CoProductAllocation + Orders + CoProductOrders + (NominalCapacity / NominalCapacityHours * UnallocatedHours)) END Capacity,
DECODE(NominalCapacityHours, 0, 0, NominalCapacity / NominalCapacityHours * UnallocatedHours) UnallocatedCapacity,
ShutHours ShutHours,
Allocation, CoProductAllocation,
Orders, CoProductOrders
FROM mc
ORDER BY 1,2,3,4,5
|
| IVSA#SourcingAllocations |
|---|
SELECT ScenarioId, t.ScenarioSessionId, DeliveryDate, SourceDate,
AllocationId, StageNo, SeqNo, IsLastStage, ConversionFactor, Rate, PropertyValueId,
SourcePropertyValueId, SourceMaterialId, OperationTypeId, NextOperationTypeId,
ToolMaterialId,
SUM(Allocation) Allocation, SUM(Orders) Orders, SUM(NVL(AllocationHours,0)) AllocationHours,
SUM(NVL(OrderHours,0)) OrderHours,
SUM(RemainingSourceWeight) RemainingSourceWeight, SUM(RemainingWeight) RemainingWeight, WorkcentreId,
SourceLocationId, DestinationType, SourceType, IsFirm, t.ID, si.MaterialId, t.CoProductId, t.SiteId,
SUM(Revenue) Revenue, SUM(ProductionCost) ProductionCost,
SUM(TransportCost) TransportCost, SUM(InventoryCost) InventoryCost, SUM(TransportCost + ProductionCost + InventoryCost) TotalCost,
SUM(Margin) Margin,
SUM((Allocation + Orders) / (MaterialEfficiency/ 100) - Allocation - Orders) Losses,
SUM(DECODE(IsLastStage, 1, (Allocation + Orders) * Price, 0)) PriceVolume,
SUM(DECODE(IsLastStage, 1, (Allocation + Orders), 0)) TotalAllocation,
DECODE(NULLIF(SUM(Allocation / ConversionFactor / NULLIF(Rate,0)), 0), 0, 0, NVL(SUM(Margin) / NULLIF(SUM(Allocation / ConversionFactor / NULLIF(Rate,0)), 0),0)) Profitability
FROM (
SELECT sa.ScenarioId, sa.ScenarioSessionId, DeliveryDate, SourceDate, AllocationId, StageNo, SeqNo, IsLastStage, sa.Sourcematerialid, sa.SourcePropertyValueId,
OperationTypeId, NextOperationTypeId,
ConversionFactor, Rate,
Allocation, 0 Orders,
AllocationHours,
0 OrderHours, 0 RemainingSourceWeight,
0 RemainingWeight, wc.WorkcentreId, wc.LocationId SourceLocationId,
sa.Id, si.MaterialId, sa.CoproductId, sa.Siteid,
'customer' DestinationType,
CASE
WHEN wc.SupplierType <> 'none' THEN 'supplier'
WHEN wc.HasInventory = 1 THEN 'stock'
ELSE 'production'
END AS SourceType, 1 IsFirm,
Revenue, ProductionCost, TransportCost, InventoryCost,
Margin, MaterialEfficiency,
Price, ToolMaterialId
FROM SourcingAllocation sa
JOIN IH#Workcentres wc ON wc.WorkcentreId = sa.WorkcentreId
JOIN SNOItemsShort si ON (si.ScenarioSessionId = sa.ScenarioSessionId
AND si.Id = sa.Id
AND NVL(si.CoProductId,0) = NVL(sa.CoProductId,0)
)
UNION ALL
SELECT s.Id ScenarioId, so.ScenarioSessionId, so.DeliveryPeriod AS DeliveryDate,
SourcePeriod AS SourceDate,
-OrderLineId as AllocationId, StageNo,
MAX(StageNo) OVER(PARTITION BY so.ScenarioSessionId, OrderLineId) + 1 - StageNo seqNo, IsLastStage,
NULL SourceMaterialId, PropertyValueId SourcePropertyValueId,
NULL OperationTypeId, NULL NextOperationTypeId,
ConversionFactor, Rate,
0 Allocation,
so.Weight AS Orders, 0 AllocationHours,
CASE WHEN NVL(so.Rate,0) != 0 THEN so.RemainingSourceWeight / Rate * (100 / TimeEfficiency)
ELSE 0
END OrderHours,
so.RemainingSourceWeight, so.RemainingWeight, so.WorkcentreId, wc.LocationId SourceLocationId,
so.SnoItemId, so.MaterialId, so.CoProductId, SiteId, DestinationType, SourceType, IsFirm, Revenue, ProductionCost, TransportCost,
InventoryCost, Margin, MaterialEfficiency,
Price, ToolMaterialId
FROM SNOAllOrderSnapshots so, Scenarios s, WorkCentres wc
WHERE so.ScenarioSessionId = s.ScenarioSessionId
AND wc.Id = so.WorkcentreId
AND so.RemainingSourceWeight > 0
AND so.SourcePeriod IS NOT NULL
AND NOT EXISTS(SELECT 1 FROM SNOMovableOrderSnapshots sa
WHERE sa.ScenarioSessionId = so.ScenarioSessionId
AND sa.ScenarioId = s.Id
AND sa.OrderLineId = so.OrderLineId)
) t
JOIN SNoItemsShort SI ON (si.ScenarioSessionId = t.ScenarioSessionId
AND si.Id = t.Id
AND NVL(si.CoProductId,0) = NVL(t.CoProductId,0)
)
GROUP BY ScenarioId, t.ScenarioSessionId, DeliveryDate, SourceDate, AllocationId, StageNo, seqNo, IsLastStage, t.ID, si.MaterialId, t.CoProductId, WorkcentreId,
SourceLocationId, SiteId, DestinationType, SourceType, IsFirm,
PropertyValueId, SourcePropertyValueId, SourceMaterialId, ConversionFactor, Rate,
OperationTypeId, NextOperationTypeId, ToolMaterialId
|
| IVSA#TransportAllocations |
|---|
SELECT ScenarioId, t.ScenarioSessionId, DeliveryDate, DeliveryDate DeliveryMonth, SourceDate, SourceDate SourceMonth,
PropertyValueId, SUM(Allocation) Allocation, SUM(Orders) Orders, SUM(RemainingSourceWeight) RemainingSourceWeight,
SUM(RemainingWeight) RemainingWeight, MasterRouteId, WorkcentreId, SourceLocationId, DestinationType, SourceType,
IsFirm, t.ID, t.CoProductId, SiteId, SUM(Revenue) Revenue, SUM(ProductionCost) ProductionCost, SUM(TransportCost) TransportCost,
SUM(InventoryCost) InventoryCost, SUM(ProductionCost + InventoryCost + TransportCost) TotalCost,
SUM(Margin) Margin
FROM (SELECT ScenarioId, ScenarioSessionId, DeliveryDate, SourceDate, Allocation, 0 Orders, 0 RemainingSourceWeight,
0 RemainingWeight, MasterRouteId, wc.WorkcentreId, wc.LocationId SourceLocationId, sa.ID, sa.CoProductId, wc.Siteid,
'customer' DestinationType,
CASE
WHEN wc.SupplierType <> 'none' THEN 'supplier'
WHEN wc.HasInventory = 1 THEN 'stock'
ELSE 'production'
END AS SourceType, 1 IsFirm,
Revenue, ProductionCost, TransportCost, InventoryCost, Margin
FROM SourcingAllocation sa
JOIN IH#Workcentres wc
ON wc.WorkcentreId = sa.WorkcentreId
UNION ALL
SELECT s.Id ScenarioId, so.ScenarioSessionId, so.DeliveryPeriod AS DeliveryDate,
SourcePeriod AS SourceDate, 0 Allocation,
so.Weight AS Orders, so.RemainingSourceWeight, so.RemainingWeight, so.MasterRouteId, so.WorkcentreId,
wc.LocationId SourceLocationId, so.SnoItemId, so.CoProductId, SiteId, DestinationTYpe, SourceType, IsFirm, Revenue, ProductionCost,
TransportCost, InventoryCost, Margin
FROM SNOAllOrderSnapshots so, Scenarios s, Workcentres wc
WHERE so.ScenarioSessionId = s.ScenarioSessionId
AND wc.Id = so.WorkcentreId
AND so.SourcePeriod IS NOT NULL
AND NOT EXISTS (SELECT * FROM SourcingAllocation sa
where sa.ScenarioSessionId = so.ScenarioSessionId
and sa.ScenarioId = s.Id
and so.OrderLineId = sa.OrderLineId)
) t
JOIN SNoItemsShort SI
ON (si.ScenarioSessionId = t.ScenarioSessionId AND si.Id = t.Id AND NVL(si.CoProductId,0) = NVL(t.CoProductId, 0))
GROUP BY ScenarioId, t.ScenarioSessionId, DeliveryDate, SourceDate, t.ID, t.CoProductId, MasterRouteId, WorkcentreId, SourceLocationId,
SiteId, DestinationType, SourceType, IsFirm, PropertyValueId
|
| IVSN#CustomerSourcePriorities |
|---|
SELECT * FROM
(
SELECT sp.Id, sp.DestinationLocationID, sp.DestinationMaterialId, sl.SiteId, l.LocationCode, l.LocationName, sp.Priority,
NVL(j.JourneyCode, j2.JourneyCode) JourneyCode, NVL(j.TimePeriod, j2.TimePeriod) Duration, mg.GroupId,
ROW_NUMBER() OVER(PARTITION BY sp.DestinationLocationID, sp.DestinationMaterialId, sl.SiteId ORDER BY sp.Priority) RankLevel
FROM SourcePriorities sp
JOIN Locations l
ON sp.Destinationlocationid = l.Id
JOIN Locations sl
ON sp.SourceLocationId = sl.Id
LEFT JOIN IH#Journeys j
ON sp.JourneyId = j.JourneyId
LEFT JOIN IH#Journeys j2
ON j2.FromLocationId = sl.Id AND j2.ToLocationId = NVL(l.TransportLocationId, l.Id)
LEFT JOIN MaterialGroups mg
ON mg.MaterialId = sp.DestinationMaterialId
WHERE NOT EXISTS (SELECT 1 FROM Workcentres wc WHERE wc.LocationId = l.Id)
AND sp.IsActive = 1
)
WHERE RankLevel = 1
|
| IVSN#SiteSourcePriorities |
|---|
SELECT * FROM ( SELECT sp.Id, ss.Id SourceSiteId, NVL(ds.id,0) TargetSiteId, m.Id MaterialId, sp.Priority, ds.SiteName TargetSiteName, ss.SiteName SourceSiteName, smu.Replenished IsReplenished, ROW_NUMBER() OVER(PARTITION BY ss.Id, ds.Id, m.Id ORDER BY Priority) RankLevel FROM SourcePriorities sp JOIN Locations dl ON dl.Id = sp.DestinationLocationId JOIN Locations sl ON sl.Id = sp.SourceLocationId JOIN Materials m ON m.Id = sp.SourceMaterialId LEFT JOIN Sites ds ON ds.Id = dl.SiteId JOIN Sites SS ON ss.Id = sl.SiteId JOIN SiteMaterialUsages smu ON sp.SiteMaterialUsageId = smu.Id WHERE sp.SourceMaterialId = sp.DestinationMaterialId AND ConsignmentLocationId IS NULL AND sp.IsActive = 1 ) WHERE RankLevel = 1 |
| IVT#Inventories |
|---|
SELECT l.LocationCode LOCATION, m.MaterialCode Product, smu.Id, i.DateFrom, i.Weight FROM Inventories i JOIN SiteMaterialUsages smu ON smu.Id = i.SiteMaterialUsageId JOIN Locations l ON (l.Id = smu.LocationId) JOIN Materials m ON (m.Id = smu.MaterialId) |
| IVT#InventoryProfiles |
|---|
SELECT l.LocationCode LOCATION, m.MaterialCode Product, smu.Id, rip.Opening,rip.DateFrom, rip.Consumption, rip.ConsumptionOrders, rip.TentativeOrdersIn, rip.PlannedInventory, rip.MinOpening, rip.SafetyStock FROM InventoryProfiles rip JOIN SiteMaterialUsages smu ON smu.Id = rip.SiteMaterialUsageId JOIN Locations l ON (l.Id = smu.LocationId) JOIN Materials m ON (m.Id = smu.MaterialId) |
| IVT#OrderLines |
|---|
SELECT l.LocationCode LOCATION, m.MaterialCode Product, wc.WorkcentreCode Workcentre, ol.Id, ol.DeliveryDate, ol.ConsumptionDate, ol.DespatchDate, ol.FinalWeight, OrderLineStatusCode, OrderLineStatusName FROM OrderLines ol JOIN OrderLineStatuses ols ON (ols.Id = ol.OrderLineStatusId) JOIN Locations l ON (l.Id = ol.LocationId) JOIN Materials m ON (m.Id = ol.MaterialId) JOIN Workcentres wc ON wc.Id = ol.WorkcentreId |
| IVT#RealInventoryProfiles |
|---|
SELECT l.LocationCode LOCATION, m.MaterialCode Product, smu.Id, rip.Opening,rip.DateFrom, rip.Closing, rip.OrdersIn, rip.OrdersOut, rip.TentativeOrdersIn, rip.TentativeOrdersOut, rip.MinOpening, rip.SafetyStock FROM RealInventoryProfilesIPlanView rip JOIN SiteMaterialUsages smu ON smu.Id = rip.SiteMaterialUsageId JOIN Locations l ON (l.Id = smu.LocationId) JOIN Materials m ON (m.Id = smu.MaterialId) |
| IVT#Skus |
|---|
SELECT l.LocationCode Location,
m.MaterialCode Product,
eu.EndUseCode EndUse,
NVL(ec.LocationCode, l.LocationCode) EndCustomer,
smu.Id,
eu.Id EndUseId,
ec.Id EndCustomerId,
smu.Status
FROM SiteMaterialUsages smu
JOIN Locations l
ON (l.Id = smu.LocationId)
JOIN Materials m
ON (m.Id = smu.MaterialId)
LEFT JOIN endUses eu
ON (eu.Id = smu.EndUseid)
LEFT JOIN Locations ec
ON (ec.Id = smu.EndCustomerId)
|
| IVT#TentativeOrderLines |
|---|
SELECT l.LocationCode LOCATION, m.MaterialCode Product, wc.WorkcentreCode Workcentre, ol.Id, ol.DeliveryDate, ol.ConsumptionDate, ol.DespatchDate, ol.FinalWeight, OrderLineStatusCode, OrderLineStatusName FROM OrderLines ol JOIN OrderLineStatuses ols ON (ols.Id = ol.OrderLineStatusId) JOIN Locations l ON (l.Id = ol.LocationId) JOIN Materials m ON (m.Id = ol.MaterialId) JOIN Workcentres wc ON wc.Id = ol.WorkcentreId WHERE ols.OrderLineStatusCode = 'System' |
| LocationsIPlanView |
|---|
SELECT l.Id, LocationName, t.WorkcentreTYpeId, wct.WorkcentreTypeName, Capacity, LocationCode, CompanyId, CustomerrankId, SafetyStockMethodId, CalendarId, HierarchyId, TransportLocationId, SiteId, DECODE(WorkcentreTypeId, NULL, 1, DECODE(WorkcentreTypeName, 'Warehouse', 1, 'Virtual Warehouse', 1, 0)) IsConsumer, DECODE(WorkcentreTypeId, NULL, 1, 0) IsEndCustomer, SIGN(NVL(WorkcentreTypeId,0)) IsSupplier, DECODE(WorkcentreTypeId, NULL, 1, DECODE(WorkcentreTypeName, 'Warehouse', 1, 'Virtual Warehouse', 1, 0)) HasSku FROM Locations l LEFT JOIN ( SELECT LocationId, MIN(WorkcentreTypeId) WorkcentreTypeId FROM Workcentres GROUP BY LocationId ) t ON l.Id = t.LocationId LEFT JOIN WorkcentreTypes wct ON (t.WorkcentreTYpeId = wct.Id) |
| MaterialTypesIPlanView |
|---|
Select MaterialTypeName, PropertyName, PropertyDesc, ProductionStageNo, HierarchyLevelNo, PropertyId, MaterialTypeId, mt.Isfinishedgoods, mt.IsTool from MaterialTypeProperties mtp, MaterialTypes mt, Properties p WHERE mtp.PropertyId = p.Id AND mtp.MaterialTypeId = mt.Id order by MaterialTypeName,HierarchyLevelNo |
| OrderInventoryIPlanView |
|---|
SELECT ob.Id, ol.SiteMaterialUsageId, ob.OrderLineId, ol.ToConsignmentLocationId, ol.SKUKey, ol.SourceSkuKey, ol.locationId,
ob.StockWeight, ob.DeliveryDate, ol.ConsumptionDate, ob.LocationId WarehouseId, ol.SourceSiteMaterialUsageId, ol.WorkcentreId,
ob.IsDelivered, ob.IsSameSource,
OrderLineStatusCode, v.WarehouseLocationId
FROM OrderBookInventories ob, OrderLines ol, OrderLineStatuses ols, IH#SkuWarehouseLocations v
WHERE ob.IsLatest = 1
AND ol.Id = ob.OrderLineId
AND ols.Id = ol.OrderLineStatusId
AND ol.SkuKey = v.SkuKey
|
| PackageVersionsView |
|---|
Select 'analysis' PackageName, analysis.packageVersion Version from dual UNION ALL Select 'bs' PackageName, bs.packageVersion Version from dual UNION ALL Select 'dc' PackageName, dc.packageVersion Version from dual UNION ALL Select 'ddq' PackageName, ddq.packageVersion Version from dual UNION ALL Select 'ext' PackageName, ext.packageVersion Version from dual UNION ALL Select 'forecasting' PackageName, forecasting.packageVersion Version from dual UNION ALL Select 'fg' PackageName, fg.packageVersion Version from dual UNION ALL Select 'ip' PackageName, ip.packageVersion Version from dual UNION ALL Select 'core' PackageName, core.packageVersion Version from dual UNION ALL Select 'mp' PackageName, mp.packageVersion Version from dual UNION ALL Select 'og' PackageName, og.packageVersion Version from dual UNION ALL Select 'reports' PackageName, reports.packageVersion Version from dual UNION ALL Select 'rp' PackageName, rp.packageVersion Version from dual |
| PropertiesIPlanView |
|---|
SELECT Id, PropertyName OriginalPropertyName, REGEXP_REPLACE(PropertyDesc, '[^[:alnum:]_\s]', '') AS PropertyName,
PropertyDesc, DataType,
UPPER('P_' || REGEXP_REPLACE(PropertyDesc, '[^[:alnum:]_\s]', '')) PropertyViewName,
UPPER('P_' || REGEXP_REPLACE(PropertyDesc, '[^[:alnum:]_\s]', '') || 'CODE') PropertyViewCode,
'Code' || ROW_NUMBER() Over(ORDER BY Id) FieldPropertyCode,
'Value' || ROW_NUMBER() Over(ORDER BY Id) FieldPropertyValue,
ROW_NUMBER() Over(ORDER BY Id) OrderNo,
'P' Prefix, DefaultValue
FROM Properties
|
| RealInventoryProfilesIPlanView |
|---|
SELECT SiteMaterialUsageId, ConsignmentLocationId, SKUKey, DateFrom, OverallOpening, Opening,
OrdersIn, TentativeOrdersIn, OrdersOut, TentativeOrdersOut, Closing,
OverallClosing, FirmClosing, MinOpening, Consumption, OriginalConsumption, SafetyStock, MaxSafetyStock
FROM Realinventoryprofiles r
WHERE NOT EXISTS (SELECT 1 FROM GroupRealInventoryProfiles g WHERE g.SkuKey = r.SkuKey)
UNION ALL
SELECT SiteMaterialUsageId, ConsignmentLocationId, SKUKey, DateFrom, OverallOpening, Opening,
OrdersIn, TentativeOrdersIn, OrdersOut, TentativeOrdersOut, Closing,
OverallClosing, FirmClosing, MinOpening, Consumption, OriginalConsumption, SafetyStock, MaxSafetyStock
FROM GroupRealInventoryProfiles
|
| SitePropertiesIPlanView |
|---|
SELECT Id,
REGEXP_REPLACE(PropertyName, '[^[:alnum:]_]', '') AS PropertyName,
PropertyName AS PropertyDesc,
UPPER('STP_' || REGEXP_REPLACE(PropertyName, '[^[:alnum:]_]', '')) PropertyViewName,
'SiteProperty' || ROW_NUMBER() Over(ORDER BY Id) FieldProperty,
HierarchyLevelNO OrderNo,
'STP' Prefix
FROM SiteProperties
|
| SkuPropertiesIPlanView |
|---|
SELECT Id,
REGEXP_REPLACE(PropertyName, '[^[:alnum:]_]', '') AS PropertyName,
PropertyName AS PropertyDesc,
UPPER('SP_' || REGEXP_REPLACE(PropertyName, '[^[:alnum:]_]', '')) PropertyViewName,
'SkuProperty' || ROW_NUMBER() Over(ORDER BY Id) FieldProperty,
HierarchyLevelNO OrderNo,
'SP' Prefix
FROM SkuProperties
|
| SKUWorkcentresDFIPlanView |
|---|
SELECT smu.Id AS SiteMaterialUsageId,
smu.LocationId,
smu.MaterialId,
d.ToLocationName AS LocationName,
d.ToLocationCode AS LocationCode,
d.FromWorkCentreId AS SourceWorkCentreId,
d.FromWorkCentreName AS SourceWorkCentreName,
d.fromWorkCentreCode AS SourceWorkCentreCode
FROM IH#WorkCentreDestinations d
JOIN SiteMaterialUsages smu ON smu.LocationId = d.ToLocationId
LEFT JOIN SourcePriorities sp ON sp.SourceLocationId IN (d.FromLocationId, d.MainWHLocationId) AND sp.SiteMaterialUsageId = smu.Id and sp.IsActive = 1
WHERE 1=1
AND (d.IsDefault = 1 OR sp.Id IS NOT NULL)
|
| StockLocationSKUIPlanView |
|---|
SELECT smu.LocationId, smu.Id SiteMaterialUsageId, l.StockLocationId, smu2.Id StockSiteMaterialUsageId
FROM SiteMaterialUsages smu, SiteMaterialUSages smu2, locations l
WHERE smu.LocationId = l.Id
AND smu2.LocationId = l.StockLocationId
AND l.StockLocationID IS NOT NULL
AND smu.MaterialId = smu2.MaterialId
|
| UserWidgetsIPlanView |
|---|
-- System widgets per user roles
SELECT w.Id, ur.UserId, WidgetName, WidgetDescription, WidgetCategory, WidgetTemplateId, 1 IsSystem
FROM Widgets w, RolesWidgets rw, UsersRoles ur
WHERE w.id = rw.widgetid
AND rw.roleid = ur.roleid
AND w.UserId = 1
UNION
-- Actual user widgets
SELECT w.Id, w.UserId, WidgetName, WidgetDescription, WidgetCategory, WidgetTemplateId, 0 IsSystem
FROM widgets w
|
| WeeklyMonthMapIPlanView |
|---|
SELECT DISTINCT DateFromIW AS dateFromWeek, DateFromMonth, WeeklyCoef FROM ( SELECT DateFrom, DateFromIw, DateFromMonth, COUNT(1) OVER (PARTITION BY DateFromIW, DateFromMonth) / 7 WeeklyCoef FROM Calendarsources CS, Calendars c, SystemPArameters sp WHERE cs.CalendarId = c.Id AND c.Id = sp.Value AND sp.ParameterName = 'DefaultCalendar' ) |