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
  | Quintiq file version 2.0 
 |  #parent: #root 
 |  StaticMethod FindSingle ( 
 |    LibUTF_IterationRun run, 
 |    MacroPlan macroplan, 
 |    Boolean checknull, 
 |    String salesdemandid, 
 |    Date start, 
 |    Date end 
 |  ) as SalesDemandInPeriod 
 |  { 
 |    TextBody: 
 |    [* 
 |      instance := null( SalesDemandInPeriod ); 
 |      salesdemand := select( macroplan, SalesDemand, sd, sd.ID() = salesdemandid ); 
 |      if( run.AssertNotIsNull( salesdemand, "Sales demand " + salesdemandid + " not found.") ) 
 |      { 
 |        instance := select( salesdemand, SalesDemandInPeriod, sdip, sdip.StartDate() = start and sdip.EndDate() = end ); 
 |        if ( checknull ) 
 |        { 
 |          run.AssertNotIsNull( instance, "Sales demand in period start from " + start.Format( "D-M-Y")  + " end on " + end.Format( "D-M-Y") + " not found");   
 |        } 
 |       
 |      } 
 |       
 |      return instance; 
 |    *] 
 |    InterfaceProperties { Accessibility: 'Module' } 
 |  } 
 |  
  |