lazhen
2024-08-27 eedb70fb1485575c0f75f47081b40bfe0552fba8
_Main/BL/Type_AOnlineAndMOfflinePlanPIR/StaticMethod_GenerateData.qbl
@@ -12,9 +12,8 @@
  TextBody:
  [*
    // 甄兰鸽 Aug-23-2024 (created)
    cdlast                 := maxobject( owner, AOnlineAndMOfflinePlanPIR, cd, cd.StartDate(), cd.EndDate(), cd.Werk() );
    if( not isnull( cdlast ) ){
      loginfo              := cdlast.InterfaceLoginfo();
    loginfo                := maxobject(  owner, InterfaceLoginfo, loginfo, loginfo.Name() = Translations::InterfaceDataset_AOnlineAndMOfflinePlanPIR_Name(), loginfo.InterfaceDateTime() );
    if( not isnull( loginfo ) ){
      if( not loginfo.IsShow() ){
        loginfo.Delete();
      }else{
@@ -38,7 +37,7 @@
    loginfo.AOnlineAndMOfflinePlanPIR( relinsert, pir );
    traverse( macroplan, AssemblyOnlinePlanColumn, column, column.ColumnDate() >= startdate and column.ColumnDate() <= enddate ){
      traverse( column, AssemblyOnlinePlanCell, cell, ( werk = 'All' or cell.AssemblyOnlinePlanRow().ProductionLine().FindString( werk, 0 ) > -1 )
                and cell.AssemblyOnlinePlanRow().RowNr() = '1' ){
                and cell.AssemblyOnlinePlanRow().Type() = '1' ){
        quantityrow        := cell.AssemblyOnlinePlanRow();
        if( not exists( productids, Elements, e, e = quantityrow.ProductID() ) ){
          productids.Add( quantityrow.ProductID() );
@@ -53,13 +52,14 @@
    traverse( macroplan, OfflinePlanTable, table ){
      traverse( table, OfflinePlanColumn, column, column.ColumnDate() >= startdate and column.ColumnDate() <= enddate ){
        traverse( column, OfflinePlanCell, cell, ( werk = 'All' or cell.OfflinePlanRow().ProductionLine().FindString( werk, 0 ) > -1 )
                  and ( cell.OfflinePlanRow().ProductionLine() <> 'DL_MOMO' or cell.OfflinePlanRow().ProductionLine() <> 'CC_MOMO' ) ){
                  and ( cell.OfflinePlanRow().ProductionLine() <> 'DL_MOMO' or cell.OfflinePlanRow().ProductionLine() <> 'CC_MOMO' )
                  and cell.OfflinePlanRow().Type() = '1' ){
          row              := cell.OfflinePlanRow();
          if( not exists( productids, Elements, e, e = row.ProductID() ) ){
            productids.Add( row.ProductID() );
          }
          pirdata          := selectobject(  pir, PIRData, pirdata, pirdata.Product() = row.ProductID() and pirdata.PlanningDate() = column.ColumnDate() );
          if( isnull( pir ) ){
          if( isnull( pirdata ) ){
            pirdata          := pir.PIRData( relnew, Product         := row.ProductID()
                                             , PlanningDate            := column.ColumnDate()
                                             , PlanningQty             := 0 );