xiaoding721
2024-08-20 5951fe0975513b70ce01c9d12e43fb69836269f7
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
已修改8个文件
已添加14个文件
已删除3个文件
449 ■■■■■ 文件已修改
_Main/BL/Relations/Relation_FinancialProductionRow_Product_MP_Product_MP_FinancialProductionRow.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_FinancialSalesRow_Product_MP_Product_MP_FinancialSalesRow.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_InterfacePlanInventoryDataPush_InterfaceDataset_InterfaceDataset_In.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_Fac.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_FactoryName.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_InventoryDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_PlanningInventory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_Product.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_VersionName.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/StaticMethod_GenerateData.qbl 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InterfacePlanInventoryDataPush/_ROOT_Type_InterfacePlanInventoryDataPush.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TransferPlanCell/StaticMethod_GenerateReport.qbl 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TransferPlanRow/StaticMethod_IdentifyTheFactory.qbl 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupReport.def 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ContextMenuEngineLogisticsCostReport.def 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ContextMenuInterface.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupReport_bCC_EngineRackReport_OnClick.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupReport_bDL_EngineRackReport_OnClick.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupReport_bMachineLogisticsCostReport_OnCli.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mCC_EngineRackRep.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mDL_EngineRackRep.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mMachineLogistics.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuInterface_mInterfacePlanInventoryDataPush_O.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_FinancialProductionRow_Product_MP_Product_MP_FinancialProductionRow.qbl
@@ -16,7 +16,7 @@
  RelationSide.RightSide FinancialProductionRow
  {
    #keys: '3[415136.0.992900299][415136.0.992900298][415136.0.992900300]'
    Cardinality: '0to1'
    Cardinality: '1toN'
    ObjectDefinition: Product_MP
    OwningSide: 'Reference'
  }
_Main/BL/Relations/Relation_FinancialSalesRow_Product_MP_Product_MP_FinancialSalesRow.qbl
@@ -16,7 +16,7 @@
  RelationSide.RightSide FinancialSalesRow
  {
    #keys: '3[415136.0.993115881][415136.0.993115880][415136.0.993115882]'
    Cardinality: '0to1'
    Cardinality: '1toN'
    ObjectDefinition: Product_MP
    OwningSide: 'Reference'
  }
_Main/BL/Relations/Relation_InterfacePlanInventoryDataPush_InterfaceDataset_InterfaceDataset_In.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: #root
Relation InterfacePlanInventoryDataPush_InterfaceDataset_InterfaceDataset_InterfacePlanInventoryDataPush
{
  #keys: '1[413988.0.1493874639]'
  DefaultRelationStrategy
  {
  }
  RelationSide.LeftSide InterfaceDataset
  {
    #keys: '3[413988.0.1493874641][413988.0.1493874640][413988.0.1493874642]'
    Cardinality: '0to1'
    ObjectDefinition: InterfacePlanInventoryDataPush
    OwningSide: 'Reference'
  }
  RelationSide.RightSide InterfacePlanInventoryDataPush
  {
    #keys: '3[413988.0.1493874644][413988.0.1493874643][413988.0.1493874645]'
    Cardinality: '1toN'
    ObjectDefinition: InterfaceDataset
    OwningSide: 'Owned'
  }
}
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl
@@ -30,16 +30,15 @@
    traverse( owner, FinancialProductionSource, source, not source.IsImport() ){//财务产量报表非导入
      traverse( source, FinancialProductionReport, report, not report.IsShow() ){//财务产量报表不显示
        traverse( report, FinancialProductionRow, row, row.Unit() = ccunit and exists( row, FinancialProductionCell, cell, cell.Value() <> '0' ) ){//财务产量报表里的长春产量, ä¸ä¸º0
          ccrow               := table.GetRow( row.Name() );
          product             := row.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
            enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = ccunit );
            if( not isnull( enginecost ) ){
              ccrow               := table.GetRow( row.Name() );
              products.Add( product );
              traverse( row, FinancialProductionCell, cell, cell.Value() <> '0' ){
                //入库量/包装容量*入库单价,入库量等于长春产量
@@ -57,16 +56,15 @@
    traverse( owner, FinancialSalesSource, source, not source.IsImport() ){//财务销量报表非导入
      traverse( source, FinancialSalesReport, report, not report.IsShow() ){//财务销量报表不显示
        traverse( report, FinancialSalesRow, row, row.Unit() = ccunit and exists( row, FinancialSalesCell, cell, cell.Value() <> '0' ) ){//财务销量报表里的长春产量, ä¸ä¸º0
          ccrow               := table.GetRow( row.Name() );
          product             := row.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
            enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = ccunit );
            if( not isnull( enginecost ) ){
              ccrow               := table.GetRow( row.Name() );
              products.Add( product );
              traverse( row, FinancialSalesCell, cell, cell.Value() <> '0' ){
                //出库量/包装容量*出库单价,入库量等于长春销量
@@ -94,21 +92,20 @@
          periodname         := periodtime.Format( "M2/D2/Y" );
          
          column             := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
          traverse( trip, ProductInTrip, pit, pit.Quantity() = 0 ){
            row              := table.GetRow( pit.ProductID() );
          traverse( trip, ProductInTrip, pit, pit.Quantity() <> 0 ){
            product          := pit.Product_MP();
            productparents   := product.GetAllParent();
            if( exists( productparents, Elements, e, e.ID() = produtparent ) ){////查询产品类型是发动机
              //在发动机成本参数表找到对应的包装容量
              enginecost       := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
              enginecost       := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = ccunit );
              //在运输成本参数表里找到发动机对应运输单价和装载容量
              transcost        := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = ccline 
                                                and trans.Destination() = ccrent 
                                                and exists( productparents, Elements, e, e.ID() = trans.Product() ) );
                                                and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '发动机', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
              if( not isnull( enginecost ) and not isnull( transcost ) ){
                row              := table.GetRow( pit.ProductID() );
                products.Add( product );
                //运输数量/包装容量/装载容量*运输单价
                quantity       := ceil( ceil( [Number]pit.Quantity() / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice();//四舍五入
@@ -125,22 +122,21 @@
      //是否属于长春外租库
      isccrent               := table.IsInUnit( stockingpoint, ccrent );
      if( isccrent ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf()
                  and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0 ) ){
          //获取行
          product            := pisp.Product_MP();
          productparents     := product.GetAllParent();
          row                := table.GetRow( pisp.ProductID() );
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){////查询产品类型是发动机
            //查询对应的发动机成本
            enginecost         := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
            enginecost         := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = ccunit );
            if( not isnull( enginecost ) ){
              row                := table.GetRow( pisp.ProductID() );
              products.Add( product );
              //当product planning的日期区间在需要的日期区间内 
              traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear
                        ){
              traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0 ){
                periodtime := pispip.Start().StartOfMonth().Date();
                periodname := periodtime.Format( "M2/D2/Y" );
                quantity   := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
@@ -46,17 +46,16 @@
          periodname         := periodtime.Format( "M2/D2/Y" );
          
          column             := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
          traverse( trip, ProductInTrip, pit, pit.Quantity() = 0 and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
          traverse( trip, ProductInTrip, pit, pit.Quantity() <> 0 and not isnull( column ) and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            quantity         := [Number]pit.Quantity();
            row              := table.GetRow( pit.ProductID() );
            product          := pit.Product_MP();
            productparents   := product.GetAllParent();
            if( isccrent ){//目的地是长春外租库
              //在发动机成本参数表找到对应的包装容量
              enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
              enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = ccunit );
              if( not isnull( enginecost ) ){
                products.Add( product );
                cell         := selectobject( row, Cell, cell, cell.Column() = column );
@@ -71,14 +70,13 @@
            }
            if( isdlrent ){//目的地是大连外租库
              //在发动机成本参数表找到对应的包装容量
              enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
              enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = dlunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = dlunit  );
              //在运输成本参数表里找到发动机对应运输单价和装载容量
              transcost      := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = dlline
                                                and trans.Destination() = dlrent
                                                and exists( productparents, Elements, e, e.ID() = trans.Product() ) );
              transcost      := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = laneleg.OriginStockingPointID()
                                                and trans.Destination() = laneleg.DestinationStockingPointID()
                                                and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '发动机', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
              if( not isnull( enginecost ) and not isnull( transcost ) ){
                products.Add( product );
                cell         := selectobject( row, Cell, cell, cell.Column() = column );
@@ -95,17 +93,16 @@
    traverse( owner, FinancialProductionSource, source, not source.IsImport() ){//财务产量报表非导入
      traverse( source, FinancialProductionReport, report, not report.IsShow() ){//财务产量报表不显示
        traverse( report, FinancialProductionRow, row, row.Unit() = dlunit and exists( row, FinancialProductionCell, cell, cell.Value() <> '0' ) ){//财务产量报表里的大连产量, ä¸ä¸º0
          ccrow               := table.GetRow( row.Name() );
          product             := row.Product_MP();
          products.Add( product );
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = dlunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = dlunit );
            if( not isnull( enginecost ) ){
              ccrow               := table.GetRow( row.Name() );
              traverse( row, FinancialProductionCell, cell, cell.Value() <> '0' ){
                column        := selectobject( table, Column, column, column.Name() = cell.FinancialProductionColumn().Name() );
                //大连外租库入库费用
@@ -120,17 +117,16 @@
    traverse( owner, FinancialSalesSource, source, not source.IsImport() ){//财务销量报表非导入
      traverse( source, FinancialSalesReport, report, not report.IsShow() ){//财务销量报表不显示
        traverse( report, FinancialSalesRow, row, row.Unit() = ccunit and exists( row, FinancialSalesCell, cell, cell.Value() <> '0' ) ){//财务销量报表里的大连产量, ä¸ä¸º0
          ccrow               := table.GetRow( row.Name() );
          product             := row.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            products.Add( product );
            //查询对应的发动机成本
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = dlunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = dlunit );
            if( not isnull( enginecost ) ){
              ccrow               := table.GetRow( row.Name() );
              traverse( row, FinancialSalesCell, cell, cell.Value() <> '0' ){
                column        := selectobject( table, Column, column, column.Name() = cell.FinancialSalesColumn().Name() );
                //大连外租库出库费用
@@ -154,18 +150,17 @@
        iscc                   := table.IsInUnit( destisp, ccunit );
        if( isdl and iscc ){
          //查询对应的发动机成本
          enginecost           := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
          enginecost           := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = ccunit );
          //在运输成本参数表里找到发动机对应运输单价和装载容量
          transcost            := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = dlline
                                                  and trans.Destination() = dlrent
                                                  and exists( productparents, Elements, e, e.ID() = trans.Product() ) );
          transcost            := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = tprow.SourceStockpoingPointID()
                                                  and trans.Destination() = tprow.TargetStockpoingPointID()
                                                  and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '发动机', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
          if( not isnull( enginecost ) and not isnull( transcost ) ){
            row                := table.GetRow( product.ID() );
            products.Add( product );
            traverse( tprow,TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() ){
            traverse( tprow,TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() and [Number]tpcell.Value() > 0){
              periodtime       := tpcell.TransferPlanColumn().ColumnDate().StartOfMonth();
              periodname       := periodtime.Format( "M2/D2/Y" );
              column           := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
@@ -179,7 +174,7 @@
      }
    }
    //长春短途运输费用:客户需求数量/包装容量/装载容量*运输单价,客户需求数量取自forecast里sales segment为长春的数量汇总,再用公式计算,月度进行汇总(取客户需求数量换算成车次)
    traverse( owner, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.SalesSegment_MP() ) and forecast.StartDate() < startofnextyear ){
    traverse( owner, SalesDemand.astype( Forecast ), forecast, forecast.Quantity() > 0 and not isnull( forecast.SalesSegment_MP() ) and forecast.StartDate() < startofnextyear ){
      salessegment            := forecast.SalesSegment_MP();
      parentsalessegments     := salessegment.GetAllParent();
      //是否属于长春
@@ -188,16 +183,15 @@
        product               := forecast.Product_MP();
        productparents        := product.GetAllParent();
        if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
          row                 := table.GetRow( forecast.ProductID() );
          products.Add( forecast.Product_MP() );
          
          //查询对应的发动机成本
          enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
          enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                 and engine.Factory() = ccunit );
          if( not isnull( enginecost ) ){
            traverse( forecast, PlanningSalesDemandInPeriod, psdip ){
            row                 := table.GetRow( forecast.ProductID() );
            traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() > 0 ){
              periodtime       := psdip.StartDate().StartOfMonth();
              periodname       := periodtime.Format( "M2/D2/Y" );
        //      info( '-------------------------', periodname, periodtime );
@@ -220,14 +214,15 @@
      //是否属于大连外租库
      isdlrent                := stockingpoint.ID() = dlrent or unit.ID() = dlrent or exists( parentunits, Elements, punit, punit.ID() = dlrent );
      if( isccrent or isdlrent ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf()
                  and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0 ) ){
          //获取行
          product             := pisp.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            row               := table.GetRow( pisp.ProductID() );
            products.Add( pisp.Product_MP() );
            traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear ){
            traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0  ){
              periodtime      := pispip.Start().StartOfMonth().Date();
              periodname      := periodtime.Format( "M2/D2/Y" );
              column          := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
@@ -235,20 +230,18 @@
              
              if( isccrent ){
                //在发动机成本参数表找到对应的包装容量
                enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
                enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                   and engine.MLB_MQB() = product.MQBMLB()
                                                   and engine.Factory() = ccunit
                                                   and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                   and engine.Factory() = ccunit );
                 if( not isnull( enginecost ) ){
                   cost        := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                   cell.CCRentStorageCost( cell.CCRentStorageCost() + cost );
                 }
              } else {
                //在发动机成本参数表找到对应的包装容量
                enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation()
                enginecost     := selectobject( owner, LogisticsCostEngine, engine, engine.Generation().ToLower() = product.Generation().ToLower()
                                                   and engine.MLB_MQB() = product.MQBMLB()
                                                   and engine.Factory() = dlunit
                                                   and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
                                                   and engine.Factory() = dlunit  );
                 if( not isnull( enginecost ) ){
                   cost        := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                   cell.DLRentStorageCost( cell.DLRentStorageCost() + cost );;
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_Fac.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute Fac
{
  #keys: '3[413988.0.1493874711][413988.0.1493874710][413988.0.1493874712]'
  Description: '工厂简写'
  ValueType: String
}
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_FactoryName.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute FactoryName
{
  #keys: '3[413988.0.1493874701][413988.0.1493874700][413988.0.1493874702]'
  Description: '工厂名称'
  ValueType: String
}
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_InventoryDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute InventoryDate
{
  #keys: '3[413988.0.1493874665][413988.0.1493874664][413988.0.1493874666]'
  Description: '库存日期'
  ValueType: Date
}
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_PlanningInventory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute PlanningInventory
{
  #keys: '3[413988.0.1493874681][413988.0.1493874680][413988.0.1493874682]'
  Description: '对应日期的计划库存数量'
  ValueType: Number
}
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_Product.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute Product
{
  #keys: '3[413988.0.1493874655][413988.0.1493874654][413988.0.1493874656]'
  Description: '物料号'
  ValueType: String
}
_Main/BL/Type_InterfacePlanInventoryDataPush/Attribute_VersionName.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute VersionName
{
  #keys: '3[413988.0.1493874691][413988.0.1493874690][413988.0.1493874692]'
  Description: '版本名称'
  ValueType: String
}
_Main/BL/Type_InterfacePlanInventoryDataPush/StaticMethod_GenerateData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GenerateData (
  MacroPlan macroPlan,
  InterfaceDataset interfaceDataset
)
{
  TextBody:
  [*
    interfaceDataset.InterfacePlanInventoryDataPush( relflush );
    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" )
                                                        );
      }
    }
  *]
}
_Main/BL/Type_InterfacePlanInventoryDataPush/_ROOT_Type_InterfacePlanInventoryDataPush.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
Type InterfacePlanInventoryDataPush
{
  #keys: '5[413988.0.1493874636][413988.0.1493874634][0.0.0][413988.0.1493874635][413988.0.1493874637]'
  BaseType: Object
  StructuredName: 'InterfacePlanInventoryDataPushs'
}
_Main/BL/Type_TransferPlanCell/StaticMethod_GenerateReport.qbl
@@ -16,14 +16,14 @@
      traverse ( u, Lane.LaneLeg.Trip, t ) {
        traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0 ) {
          // æ‰¾è¡Œ
          tpr := TransferPlanRow::FindTransferPlanRowTypeIndex( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().Name(),
                                                                t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().Name(),
          tpr := TransferPlanRow::FindTransferPlanRowTypeIndex( TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ),
                                                                TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ),
                                                                pit.Product_MP().ID() );
          if ( isnull( tpr ) ) {
            tpr := macroPlan.TransferPlanRow( relnew, 
                                              RowNr                   := rowNr,
                                              SourceStockpoingPointID := t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().Name(),
                                              TargetStockpoingPointID := t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().Name(),
                                              SourceStockpoingPointID := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ),
                                              TargetStockpoingPointID := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ),
                                              ProductID               := pit.Product_MP().ID() );     
          }
          
_Main/BL/Type_TransferPlanRow/StaticMethod_IdentifyTheFactory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
Quintiq file version 2.0
#parent: #root
StaticMethod IdentifyTheFactory (
  StockingPoint_MP spmp
) as String
{
  TextBody:
  [*
    factory := "";
    if ( spmp.Name().Regex( "长春" ) or spmp.Name().Regex( "CC" ) ) {
      factory := "CC";
    } else if ( spmp.Name().Regex( "大连" ) or spmp.Name().Regex( "DL" ) ) {
      factory := "DL";
    } else {
      factory := "找不到属于哪个工厂";
    }
    return factory;
  *]
}
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupReport.def
@@ -91,17 +91,6 @@
        Taborder: 6
      ]
    }
    Component bMachineLogisticsCostReport
    {
      #keys: '[413988.0.1467117990]'
      BaseType: 'WebButton'
      Properties:
      [
        Image: 'LOCATION_PIN'
        Label: '机加物流成本报表'
        Taborder: 7
      ]
    }
    Component ButtonScenarioComparisonDemandComparison id:ButtonScenarioComparisonDemandComparison_256
    {
      #keys: '[412672.1.90201789]'
@@ -110,7 +99,7 @@
      [
        Image: 'EQUALS'
        Label: '需求对比'
        Taborder: 8
        Taborder: 7
      ]
    }
    Component ButtonScheduleSummaryReport
@@ -135,28 +124,6 @@
        Taborder: 9
      ]
    }
    Component bCC_EngineRackReport
    {
      #keys: '[413988.0.1477120930]'
      BaseType: 'WebButton'
      Properties:
      [
        Image: 'SATELLITE'
        Label: '长春发动机料架报表'
        Taborder: 10
      ]
    }
    Component bDL_EngineRackReport
    {
      #keys: '[413988.0.1488511896]'
      BaseType: 'WebButton'
      Properties:
      [
        Image: 'EARTH_LOCATION'
        Label: '大连发动机料架报表'
        Taborder: 11
      ]
    }
    Component ButtonEngineLogisticsCostReport
    {
      #keys: '[415136.0.989557433]'
@@ -169,7 +136,7 @@
      [
        Image: 'MONEY2'
        Label: '发动机物流成本报表'
        Taborder: 12
        Taborder: 10
      ]
    }
    Component ButtonAnnualPlanReport
@@ -180,7 +147,7 @@
      [
        Image: 'DOCUMENT_HEART'
        Label: '全年计划报表'
        Taborder: 13
        Taborder: 11
      ]
    }
  ]
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ContextMenuEngineLogisticsCostReport.def
@@ -12,8 +12,8 @@
      Properties:
      [
        Description: 'CC engine logistics cost report'
        Image: 'MONEY2'
        Taborder: 0
        Image: 'MONEY_COINS2'
        Taborder: 1
        Title: '长春发动机物流成本报表'
      ]
    }
@@ -24,11 +24,44 @@
      Properties:
      [
        Description: 'DL engine logistics cost report'
        Image: 'MONEY2'
        Taborder: 1
        Image: 'PIGGY_BANK'
        Taborder: 2
        Title: '大连发动机物流成本报表'
      ]
    }
    Component mMachineLogisticsCostReport
    {
      #keys: '[413988.0.1492770837]'
      BaseType: 'WebMenu'
      Properties:
      [
        Image: 'LOCATION_PIN'
        Taborder: 0
        Title: '机加物流成本报表'
      ]
    }
    Component mCC_EngineRackReport
    {
      #keys: '[413988.0.1492701081]'
      BaseType: 'WebMenu'
      Properties:
      [
        Image: 'SATELLITE'
        Taborder: 3
        Title: '长春发动机料架报表'
      ]
    }
    Component mDL_EngineRackReport
    {
      #keys: '[413988.0.1492780876]'
      BaseType: 'WebMenu'
      Properties:
      [
        Image: 'EARTH_LOCATION'
        Taborder: 4
        Title: '大连发动机料架报表'
      ]
    }
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ContextMenuInterface.def
@@ -38,6 +38,16 @@
        Title: 'Finished engine inventory'
      ]
    }
    Component mInterfacePlanInventoryDataPush
    {
      #keys: '[413988.0.1495640230]'
      BaseType: 'WebMenu'
      Properties:
      [
        Taborder: 3
        Title: '计划库存数据推送接口测试'
      ]
    }
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupReport_bCC_EngineRackReport_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupReport_bDL_EngineRackReport_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupReport_bMachineLogisticsCostReport_OnCli.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mCC_EngineRackRep.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: ContextMenuEngineLogisticsCostReport/mCC_EngineRackReport
Response OnClick () id:Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mCC_EngineRackReport_OnClick
{
  #keys: '[413988.0.1494079933]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  GroupServerCalls: true
  QuillAction
  {
    Body:
    [*
      ApplicationScope.ViewManager().ResetUserViewById( "CCEngineRackReport", true);
    *]
  }
}
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mDL_EngineRackRep.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: ContextMenuEngineLogisticsCostReport/mDL_EngineRackReport
Response OnClick () id:Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mDL_EngineRackReport_OnClick
{
  #keys: '[413988.0.1494298669]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  GroupServerCalls: true
  QuillAction
  {
    Body:
    [*
      ApplicationScope.ViewManager().ResetUserViewById( "DLEngineRackReport", true);
    *]
  }
}
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mMachineLogistics.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: ContextMenuEngineLogisticsCostReport/mMachineLogisticsCostReport
Response OnClick () id:Response_MacroPlanner_ContextMenuEngineLogisticsCostReport_mMachineLogisticsCostReport_OnClick
{
  #keys: '[413988.0.1492720600]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  GroupServerCalls: true
  QuillAction
  {
    Body:
    [*
      ApplicationScope.ViewManager().ResetUserViewById( "MachineLogisticsCostReport", true);
    *]
  }
}
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ContextMenuInterface_mInterfacePlanInventoryDataPush_O.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: ContextMenuInterface/mInterfacePlanInventoryDataPush
Response OnClick () id:Response_MacroPlanner_ContextMenuInterface_mInterfacePlanInventoryDataPush_OnClick
{
  #keys: '[413988.0.1495640258]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMenu_OnClick'
  QuillAction
  {
    Body:
    [*
      InterfacePlanInventoryDataPush::GenerateData( MacroPlan, InterfaceDataset );
    *]
    GroupServerCalls: false
  }
}