| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod VerifySalesDemandInPeriodIsPostponed ( | 
|   LibUTF_IterationRun run, | 
|   MacroPlan macroplan, | 
|   NamedValueTree nvt_originalsdip, | 
|   NamedValueTree nvt_postponesdip | 
| ) | 
| { | 
|   Description: 'Verify that salesdemand in period is postponed' | 
|   TextBody: | 
|   [* | 
|     dto_oriignalsdip := DTO_SalesDemandInPeriod::ConstructNew( run, nvt_originalsdip )  | 
|     originalsdip := UI_SalesDemandInPeriod::FindSingle( run, macroplan, true,  | 
|                                                         dto_oriignalsdip.SalesDemandID(),  | 
|                                                         dto_oriignalsdip.StartDate(), dto_oriignalsdip.EndDate() ); | 
|     dto_postponed := DTO_SalesDemandInPeriod::ConstructNew( run, nvt_postponesdip ); | 
|     //check exist of postponed sales demand  | 
|     postponedsdip := select( originalsdip, PostponedSalesDemand, postponedsdip,  | 
|                              postponedsdip.StartDate() = dto_postponed.StartDate()  | 
|                             and postponedsdip.EndDate() = dto_postponed.EndDate() ); | 
|      | 
|     if( run.AssertNotIsNull( postponedsdip, "SalesDemandInPeriod should be postponed from " + dto_oriignalsdip.StartDate().Format( "D-M-Y") + " to " + dto_postponed.StartDate().Format( "D-M-Y" ) + ".") ) | 
|     { | 
|       run.AssertEqual( dto_postponed.Quantity().Round( 2 ), postponedsdip.Quantity().Round( 2 ), "Incorrect postponed quantity." );   | 
|     } | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |