admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
30
31
Quintiq file version 2.0
#parent: #root
StaticMethod GenerateData (
  MacroPlan macroPlan,
  InterfaceDataset interfaceDataset,
  Number versionFlag
)
{
  TextBody:
  [*
    ipidps := selectset( interfaceDataset, InterfacePlanInventoryDataPush, tempIPIDP, tempIPIDP.VersionFlag() = versionFlag );
    MacroPlan::DeleteObjects( ipidps );
    
    actualDateTime := DateTime::ActualTime();
    
    traverse ( macroPlan, Product_MP.ProductInStockingPoint_MP, pispmp, not pispmp.IsSystem() and pispmp.IsLeaf() ) {
      traverse ( pispmp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispippl, not pispippl.IsPeriodFrozen() ) {
        interfaceDataset.InterfacePlanInventoryDataPush( relnew,
                                                         Product           := pispmp.ProductID(),
                                                         InventoryDate     := pispippl.Start().Date(),
                                                         PlanningInventory := [Number]pispippl.InventoryLevelEnd(),
                                                         VersionName       := macroPlan.ScenarioName(),
                                                         FactoryName       := ifexpr( pispmp.StockingPointID().Regex( "大连" ) or pispmp.StockingPointID().Regex( "DL" ), "大连工厂", "长春工厂" ),
                                                         Fac               := ifexpr( pispmp.StockingPointID().Regex( "大连" ) or pispmp.StockingPointID().Regex( "DL" ), "DL", "CC" ),
                                                         InterfaceTime     := actualDateTime,
                                                         VersionFlag       := versionFlag
                                                        );
      } 
    }
  *]
}