陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Quintiq file version 2.0
#parent: GanttChartDemandSupplyGroup
Response OnDrawNode (
  StockingPointInPeriod element
) id:Response_GanttChartDemandSupplyGroup_OnDrawNode_246
{
  #keys: '[110880.5.2031055784]'
  Body:
  [*
    // Determine colors for gantt chart spip nodes
    if( not element.HasConstraintViolations() )
    {
      // All pispip is negative inventory allowed
      if( element.HasAllProductsWithNegativeInventoryAllowed() )
      {
        drawinfo.AddCompartment( ColorScheme.GanttChart_Custom1(), element.Period_MP().Duration() );
      }
      // All pispip is inactive
      else if( element.HasAllInActiveProducts() )
      {
        drawinfo.AddCompartment( ColorScheme.GanttChart_Free(), element.Period_MP().Duration() );
      }
      // Not all pispip have fulfilled dependentdemand and salesdemand
      else if( not element.HasAllProductsWithFulfilledDependentAndSalesDemand() )
      {
        drawinfo.AddCompartment( ColorScheme.GanttChart_Warning1(), element.Period_MP().Duration() );
      }
      // Not all pispip have fulfilled inventorty target
      else if( not element.HasAllProductsWithFulfilledInventoryDemand() )
      {
        drawinfo.AddCompartment( ColorScheme.GanttChart_Warning2(), element.Period_MP().Duration() );
      }
      // All pispip have fulfilled demand
      else if( element.HasAllProductsWithFulfilledDemand() )
      {
        drawinfo.AddCompartment( ColorScheme.GanttChart_Good(), element.Period_MP().Duration() );
      }
    
    }
    
    // Check if background is dark
    if( drawinfo.BackgroundColor().IsDark() )
    {
      drawinfo.TextColor( Color::White() );
    }
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_GanttChart_OnDrawNode'
}