lihongji
2024-09-27 46ddfed5009f83c7238e11254154c03aa8260774
_Main/BL/Type_OfflinePlanCell/StaticMethod_Download.qbl
@@ -1,7 +1,8 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Download (
  MacroPlan macroPlan
  MacroPlan macroPlan,
  OfflinePlanRows selectedOPRs
) as BinaryValue
{
  TextBody:
@@ -13,12 +14,12 @@
    
    opt  := maxselect( macroPlan, OfflinePlanTable, tempOPT, true, tempOPT.SaveDateTime() );
    opcs := selectsortedset( opt, OfflinePlanColumn, tempOPC, true, tempOPC.ColumnDate() );
    oprs := selectsortedset( opt, OfflinePlanRow, tempOPR, true, tempOPR.ProductionLine(), tempOPR.ProductID(), tempOPR.Type() );
    oprs := selectsortedset( selectedOPRs, Elements, tempOPR, true, tempOPR.ProductionLine(), tempOPR.ProductID(), tempOPR.Type() );
    traverse ( opcs, Elements, opc ) {
      column := xmlDOM.CreateElement( "column" );
      name   := xmlDOM.CreateElement( "name" );
      type   := xmlDOM.CreateElement( "type" );
      name.TextContent( ifexpr( opc.ColumnDate() < macroPlan.StartOfPlanning().Date(), "", opc.ColumnDate().Format( "Y/M2/D2" ) ) );
      name.TextContent( ifexpr( opc.ColumnDate() < macroPlan.StartOfPlanning().Date(), "*", opc.ColumnDate().Format( "Y/M2/D2" ) ) );
      type.TextContent( "String" );
      column.AppendChild( name );
      column.AppendChild( type );