lazhen
2024-08-15 5f8bcf34b598f40388661497c74c788b13b904dc
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -48,7 +48,7 @@
          if( exists( productparents, Elements, e, e.ID() = productparent ) ){//查询产品类型是发动机
            row               := table.GetRow( pisp.ProductID() );
            products.Add( pisp.Product_MP() );
            weekstart         := owner.StartOfPlanning().Date();
    //        weekstart         := owner.StartOfPlanning().Date();
            pispips           := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() 
                                                    and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ), pispip.Start() );
            
@@ -56,7 +56,7 @@
              //天
              daycolumn        := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), pispip.Start().Date() );
              //周
              weekcolumn       := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), weekstart );
              weekcolumn       := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), pispip.Start().Date() );
              
              supplyquantity   := [Number]pispip.NewSupplyQuantity();//四舍五入
              inventoryquantity:= [Number]pispip.PlannedInventoryLevelEnd();//四舍五入
@@ -75,8 +75,9 @@
              //库存
              if( iscc or isdl ){
                row.SetCellInventoryValue( daycolumn, iscc, [Real]inventoryquantity );
                if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){
                  weekstart      := ( weekstart + Duration::Days( 7 ) ).Date();
                if( weekcolumn.EndDate() = pispip.Start().Date() or pispip.Period_MP() = endperiod ){
    //            if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){
    //              weekstart      := ( weekstart + Duration::Days( 7 ) ).Date();
                  row.SetCellInventoryValue( weekcolumn, iscc, [Real]inventoryquantity );
                }
              }
@@ -92,14 +93,14 @@
      traverse( table, Column, column ){
        cell := selectobject( row, Cell, cell, cell.Column() = column );
        if( column.TimeUnit() = Translations::MP_GlobalParameters_Day() ){
          tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = column.Period() );
          tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = column.StartDate() );
          if( tprow.SourceStockpoingPointID() = 'CC' and tprow.TargetStockpoingPointID() = 'DL' ){
            cell.CCTransferQty( [Real]tpcell.Value() );
          }else if( tprow.SourceStockpoingPointID() = 'DL' and tprow.TargetStockpoingPointID() = 'CC' ){
            cell.DLTransferQty( [Real]tpcell.Value() );
          }
        }else if( column.TimeUnit() = Translations::MP_GlobalParameters_Week() ){
          period := column.Period() + Duration::Days( 6 );
          period := column.StartDate() + Duration::Days( 6 );
          tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = period.Date() );
          
          if( tprow.SourceStockpoingPointID() = 'CC' and tprow.TargetStockpoingPointID() = 'DL' ){