xiaoding721
2024-10-17 f7e27cb24f4cdbe6a25af74549867dbd49b1b401
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
已添加6个文件
已修改8个文件
已删除1个文件
378 ■■■■ 文件已修改
_Main/BL/Type_MachineLogisticsCostReportCell/Attribute_WoodenCratePriceReal.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachineLogisticsCostReportCell/Function_CalcWoodenCrateCost.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_Package.qbl 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/Sys/Repr/Global/MachineLogisticsCostReportCell.qrp 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_dhSelectedFactoryMCRR_OnCreated.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_ddslFactory_OnCreated.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_ddslFactory_OnUserSelectionChanged.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/_ROOT_Component_FormMachineLogisticsCostReport.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/NewAssemblyOnlinePlan.vw 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/NewOfflinePlan.vw 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachineLogisticsCostReportCell/Attribute_WoodenCratePriceReal.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute WoodenCratePriceReal
{
  #keys: '3[415754.0.434001070][415754.0.434001069][415754.0.434001071]'
  Description: '木箱单价(Real)'
  ValueType: Real
}
_Main/BL/Type_MachineLogisticsCostReportCell/Function_CalcWoodenCrateCost.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
@@ -10,72 +10,76 @@
    macroPlan.MachineLogisticsCostReportRow( relflush );
    macroPlan.MachineLogisticsCostReportColumn( relflush );
    
    // åˆå§‹åŒ–一年数据列
    // åˆ›å»ºè¡Œ
    categories := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf()                           and
                                      exists( tempPMP, AllParent.AsParent, tempPMP1, tempPMP1.ID() = "机加件" ),
                                      tempPMP.ParentID() );
    traverse ( categories, Elements, c ) {
      macroPlan.MachineLogisticsCostReportRow( relnew, Factory := "大连工厂", Category := c  );
      macroPlan.MachineLogisticsCostReportRow( relnew, Factory := "长春工厂", Category := c );
    }
    // åˆ›å»ºåˆ—
    indexDate := macroPlan.StartOfPlanning().Date().StartOfMonth();
    for ( i := 0; i < 12; i++ ) {
      macroPlan.MachineLogisticsCostReportColumn( relnew, StartDate := indexDate );
      indexDate := indexDate.StartOfNextMonth();
    }
    
    // æ‰¾å‡ºæ‰€æœ‰å¤§ç±»ï¼Œåˆ›å»ºæ•°æ®
    categories := selectuniquevalues( macroPlan, PackagingPlanRow, tempPPR, true, tempPPR.Category() );
    traverse ( categories, Elements, c ) {
    // åˆ›å»ºå•元格
    traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr ) { // å¾ªçŽ¯è¡Œ
      info( "当前遍历的行:", mlcrr.Factory(), " ", mlcrr.Category() );
      traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) { // å¾ªçŽ¯åˆ—
      
      // æœºåŠ æˆæœ¬å‚æ•°
      lcm := select( macroPlan, LogisticsCostMachining, tempLCM, tempLCM.Factory() = factory and tempLCM.Product() = c );
      // è¿è¾“成本参数
      lct := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Origin()      = ifexpr( factory = "大连工厂", "CC", "DL" ) and
                                                                 tempLCT.Destination() = ifexpr( factory = "大连工厂", "DL", "CC" ) and
                                                                 tempLCT.Product()     = c );
      // åˆå§‹åŒ–机加成本参数报表行
      mlcrr := macroPlan.MachineLogisticsCostReportRow( relnew, Category := c, Factory := factory );
      // å¾ªçŽ¯æ‰€æœ‰æ—¶é—´åˆ—åˆ›å»ºæ•°æ®
      traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) {
        cell := mlcrr.MachineLogisticsCostReportCell( relnew );
        // æœºåŠ æˆæœ¬å‚æ•°
        lcm  := select( macroPlan, LogisticsCostMachining, tempLCM, tempLCM.Factory() = mlcrr.Factory() and tempLCM.Product() = mlcrr.Category()
                        and tempLCM.StartDate() <= mlcrc.StartDate() and tempLCM.EndDate() >= mlcrc.StartDate().StartOfNextMonth() );
        
        // è¿è¾“成本参数
        lct  := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = mlcrr.Category() and
                        tempLCT.Origin() = "长春外租库" and tempLCT.Destination() = "CC åŽ‚å†…åº“" );
        cell := mlcrr.MachineLogisticsCostReportCell( relnew );
        // è®¾ç½®åŒ…装费用(包装量 * åŒ…装单价)
        packageQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, 
                                tempPPC.PackagingPlanRow().Category()             = c                         and
                                tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
                                tempPPC.PackagingPlanRow().Factory()              = factory                   and
                                tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                tempPPC.Package() );
    //    cell.PackingCharges( packageQuantity * guard( lcm.PackagePrice(), 1 ) );
        cell.PackingCharges( packageQuantity * guard( lcm.PackagePrice(), 1 ) );
        // è®¾ç½®æ‹†åŒ…费用(拆包量 * æ‹†åŒ…单价)
        unpackingQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, 
                                  tempPPC.PackagingPlanRow().Category()             = c                         and
                                  tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
                                  tempPPC.PackagingPlanRow().Factory()              = factory                   and
                                  tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                  tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                  tempPPC.Unpacking() );
    //    cell.UnpackingCost( unpackingQuantity * guard( lcm.UnpackingPrice(), 1 ) );
        cell.UnpackingCost( unpackingQuantity * guard( lcm.UnpackingPrice(), 1 ) );
        // è®¾ç½®ç¼“冲纸费用(包装类 * ç¼“冲纸单价)
    //    cell.BufferPaperCost( packageQuantity * guard( lcm.BufferPaperPrice(), 1 ) );
        // è®¾ç½®æœ¨ç®±å•ä»·
    //    cell.UnitPriceOfWoodenCrate( guard( lcm.WoodenCratePrice(), 1 ) );
        cell.BufferPaperCost( packageQuantity * guard( lcm.BufferPaperPrice(), 1 ) );
          // è®¾ç½®æœ¨ç®±å•ä»·
        cell.WoodenCratePriceReal( guard( lcm.WoodenCratePrice(), 1 ) );
        // è®¾ç½®è°ƒæ‹¨è´¹ç”¨ï¼ˆè°ƒæ‹¨æ•°é‡ / åŒ…装容量 / è£…载容量 * è¿è¾“单价)
        transferQuantity := sum( macroPlan, TransferPlanRow.TransferPlanCell, tempTPC,
                                 tempTPC.TransferPlanRow().Category()              = c                                                      and
                                 tempTPC.TransferPlanRow().Category()              = mlcrr.Category()                                       and
                                 tempTPC.TransferPlanRow().Name()                  = ifexpr( factory = "大连工厂", "CC to DL", "DL to CC" ) and
                                 tempTPC.TransferPlanColumn().ColumnDate().Year()  = mlcrc.StartDate().Year()                               and
                                 tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(),
                                 [Number]tempTPC.Value() );
    //    cell.TransferCost( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) );
        cell.TransferCost( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) );
        // å¤–租库入库费用(入库量[包装量] / åŒ…装容量 * å…¥åº“单价)
    //    cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) );
      //  cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) );
        // å¤–租库出库费用(出库量[拆包量] / åŒ…装容量 * å‡ºåº“单价)
    //    cell.OutboundExpensesForRentedWarehouses( unpackingQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.OutboundPrice(), 1 ) );
      //  cell.OutboundExpensesForRentedWarehouses( unpackingQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.OutboundPrice(), 1 ) );
        // å¤–租库运输费用(运输数量 / åŒ…装容量 / è£…载容量 * è¿è¾“单价)
        
        cell.MachineLogisticsCostReportColumn( relset, mlcrc );
_Main/BL/Type_NewAssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
@@ -61,7 +61,7 @@
                               );
      
      u           := select( macroPlan, Unit, tempU, tempU.ID() = pl );
      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "拉空" ), false ) );
      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "拉空" ) or tempP.Event().Subject().Regex( "排空" ), false ) );
      lineLyingPs := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "铺线" ), false ) );
      
      // å¤„理拉空
@@ -69,13 +69,24 @@
      traverse ( drainPs, Elements, p ) {
        traverse ( p, ExplicitTimeInterval, eti ) {
    //      info( "开始时间:", eti.Start().Format( "Y-M2-D2" ), "    ç»“束时间:", eti.End().Format( "Y-M2-D2" ) );
          naopc := select( macroPlan, NewAssemblyOnlinePlanColumn, tempNAOPC, tempNAOPC.StartDate() = ( eti.Start().Date() - 1 ) );
          
          cell  := maxselect( macroPlan, NewAssemblyOnlinePlanRow.NewAssemblyOnlinePlanCell, tempNAOPCell, 
                              tempNAOPCell.NewAssemblyOnlinePlanRow().ProductionLine() = pl                         and
                              tempNAOPCell.NewAssemblyOnlinePlanColumn().StartDate()   = ( eti.Start().Date() - 1 ) and
                              tempNAOPCell.NewAssemblyOnlinePlanRow().Type()           = "1",
                              tempNAOPCell.NewAssemblyOnlinePlanRow().ProductionLine() = pl    and
                              tempNAOPCell.NewAssemblyOnlinePlanColumn()               = naopc and
                              tempNAOPCell.NewAssemblyOnlinePlanRow().Type()           = "1"   and
                              tempNAOPCell.Quantity()                                  > 0,
                              tempNAOPCell.OrderNr() ); 
          while ( isnull( cell ) and not isnull( naopc ) ){
            naopc := naopc.PreviousNAOPColumn();
            cell  := maxselect( macroPlan, NewAssemblyOnlinePlanRow.NewAssemblyOnlinePlanCell, tempNAOPCell,
                              tempNAOPCell.NewAssemblyOnlinePlanRow().ProductionLine() = pl    and
                              tempNAOPCell.NewAssemblyOnlinePlanColumn()               = naopc and
                              tempNAOPCell.NewAssemblyOnlinePlanRow().Type()           = "1"   and
                              tempNAOPCell.Quantity()                                  > 0,
                              tempNAOPCell.OrderNr() );
          }
          if ( not isnull( cell ) ) {
            cell.Quantity( cell.Quantity() - targetQuantity );
          }
_Main/BL/Type_PackagingPlanCell/StaticMethod_Package.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Package (
  MacroPlan macroPlan,
  PackagingPlanRow ppr,
  PackagingPlanColumn ppc,
  output Number needPackagingQuantity
)
{
  TextBody:
  [*
    // è®¡åˆ’开始时间
    plannedStartDate := macroPlan.StartOfPlanning().Date();
    traverse ( ppr, PackagingPlanCell, ppcell, ppcell.PackagingPlanColumn() = ppc ) {
      // Product_MP
      pmp                     := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() );
      // åŒ…装lotsize
      ppls                    := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() = ppr.Factory() and
                                         tempPPLS.ProductID() = ifexpr( exists( macroPlan, PackagingPlanLotSize, tempPPLS1, tempPPLS1.ProductID() = pmp.ID() ),
                                                                        pmp.ID(),
                                                                        pmp.ParentID() ) );
      // ä¸€æ—¥åŒ…装容量
      ppnc                    := select( macroPlan, PackagingPlanNewCapability, tempPPNC, tempPPNC.Factory() = ppr.Factory() and
                                         tempPPNC.ProductID() = ifexpr( exists( macroPlan, PackagingPlanNewCapability, tempPPNC1, tempPPNC1.ProductID() = pmp.ID() ),
                                                                        pmp.ID(),
                                                                        pmp.ParentID() ) );
      // Unit
      us                      := selectset( macroPlan, Unit, tempU, tempU.ID().Regex( ppr.FactoryAbbreviation() + " " + ppr.Category() ) );
      // åŒ…装库存出现负值,需要设置包装量
      if ( not isnull( ppls ) and not isnull( ppnc ) ) {
        // åŒ…装开始的索引
        indexPPCell           := ppcell.Previous();
    //      info( "产线个数:", us.Size(), "    å¼€å§‹æ—¶é—´ï¼š", ppcell.StartDate().Format( "Y-M2-D2" ), "    åŒ…装库存数量:", ppcell.PackagingInventory(), "    éœ€è¦åŒ…装的数量:", needPackagingQuantity,
    //            "    åŒ…装lotsize:",guard( ppls.LotSize(), 0 ), "    æœ€å¤§åŒ…装容量:", ppnc.MaximumDailyPackagingQuantity() );
        while ( not isnull( indexPPCell )                                                   and
                indexPPCell.StartDate() >= plannedStartDate                                 and
                exists( us, Elements.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan, tempSP,
                        tempSP.UnitPeriodTime().StartDate() = indexPPCell.StartDate(),
                        tempSP.Outcome() <> "" )                                            and
                needPackagingQuantity > 0 ) {
          // èƒ½åŒ…装的数量
          canPackagingQuantity  := ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ),
                                           ceil( needPackagingQuantity / ppls.LotSize() ),
                                           floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ) ) * ppls.LotSize();
    //        info( "开始包装的日期:", indexPPCell.StartDate().Format( "Y-M2-D2" ), "    èƒ½åŒ…装的数量:", canPackagingQuantity );
          indexPPCell.Package( canPackagingQuantity );
          Transaction::Transaction().Propagate( attribute( PackagingPlanCell, PackagingInventory ) );
          Transaction::Transaction().Propagate( attribute( PackagingPlanCell, UnpackagedInventory ) );
          needPackagingQuantity := needPackagingQuantity - canPackagingQuantity;
          indexPPCell           := indexPPCell.Previous();
        }
      }
    }
  *]
}
_Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl
@@ -6,9 +6,12 @@
{
  TextBody:
  [*
    // è®¡åˆ’开始时间
    plannedStartDate := macroPlan.StartOfPlanning().Date();
    // è®¾ç½®åŒ…装值(符合lotsize和一日最大包装量)
    traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "大连工厂" and ppr.ProductID() = "06K103011CM" ) {
      traverse ( ppr, PackagingPlanCell, ppcell, ppcell.StartDate() <= Date::Construct( 2025, 1, 3 ) ) {
    traverse ( macroPlan, PackagingPlanRow, ppr/*, ppr.Factory() = "大连工厂" and ppr.ProductID() = "06K103011CM"*/ ) {
      traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) {
        // Product_MP
        pmp                     := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() );
        // åŒ…装lotsize
@@ -22,7 +25,7 @@
                                                                          pmp.ID(),
                                                                          pmp.ParentID() ) );
        // Unit
        u                       := select( macroPlan, Unit, tempU, tempU.ID().Regex( ppr.FactoryAbbreviation() + " " + ppr.Category() ) );
        us                      := selectset( macroPlan, Unit, tempU, tempU.ID().Regex( ppr.FactoryAbbreviation() + " " + ppr.Category() ) );
         
        // åŒ…装库存出现负值,需要设置包装量
        if ( ppcell.PackagingInventory() < 0 and not isnull( ppls ) and not isnull( ppnc ) ) {
@@ -31,17 +34,24 @@
          // åŒ…装开始的索引
          indexPPCell           := ppcell.Previous();
          
          info( "产线名:", u.ID(), "    å¼€å§‹æ—¶é—´ï¼š", ppcell.StartDate().Format( "Y-M2-D2" ), "    åŒ…装库存数量:", ppcell.PackagingInventory(), "    éœ€è¦åŒ…装的数量:", needPackagingQuantity,
                "    åŒ…装lotsize:",guard( ppls.LotSize(), 0 ), "    æœ€å¤§åŒ…装容量:", ppnc.MaximumDailyPackagingQuantity() );
    //      info( "产线个数:", us.Size(), "    å¼€å§‹æ—¶é—´ï¼š", ppcell.StartDate().Format( "Y-M2-D2" ), "    åŒ…装库存数量:", ppcell.PackagingInventory(), "    éœ€è¦åŒ…装的数量:", needPackagingQuantity,
    //            "    åŒ…装lotsize:",guard( ppls.LotSize(), 0 ), "    æœ€å¤§åŒ…装容量:", ppnc.MaximumDailyPackagingQuantity() );
          
          while ( not isnull( indexPPCell ) and needPackagingQuantity > 0 ) {
          while ( not isnull( indexPPCell )                                                   and
                  indexPPCell.StartDate() >= plannedStartDate                                 and
                  exists( us, Elements.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan, tempSP,
                          tempSP.UnitPeriodTime().StartDate() = indexPPCell.StartDate(),
                          tempSP.Outcome() <> "" )                                            and
                  needPackagingQuantity > 0 ) {
            // èƒ½åŒ…装的数量
            canPackagingQuantity  := ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ),
                                             ceil( needPackagingQuantity / ppls.LotSize() ),
                                             floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ) ) * ppls.LotSize();
            info( "开始包装的日期:", indexPPCell.StartDate().Format( "Y-M2-D2" ), "    èƒ½åŒ…装的数量:", canPackagingQuantity );
    //        info( "开始包装的日期:", indexPPCell.StartDate().Format( "Y-M2-D2" ), "    èƒ½åŒ…装的数量:", canPackagingQuantity );
            
            indexPPCell.Package( canPackagingQuantity );
            Transaction::Transaction().Propagate( attribute( PackagingPlanCell, PackagingInventory ) );
            Transaction::Transaction().Propagate( attribute( PackagingPlanCell, UnpackagedInventory ) );
            
            needPackagingQuantity := needPackagingQuantity - canPackagingQuantity;
            indexPPCell           := indexPPCell.Previous();
@@ -50,6 +60,36 @@
      }
    }
    
    // è®¾ç½®åŒ…装值(符合大类下所有产品包装量加和不能大于最大包装量)
    // è®¾ç½®åŒ…装值(符合大类下所有产品非包装量库存加和不能大于系统值)
    factorys               := selectuniquevalues( macroPlan, PackagingPlanRow, tempPPR, true, tempPPR.FactoryAbbreviation() );
    categorys              := selectuniquevalues( macroPlan, PackagingPlanRow, tempPPR, true, tempPPR.Category() );
    traverse ( factorys, Elements, f/*, f = "DL"*/ ) {
      traverse ( categorys, Elements, c/*, c = "ZKG"*/ ) {
        // ç³»ç»Ÿè§„定的最大非包装库存数量
        ppmqReflection     := Reflection::FindAttribute( "PackagingPlanMaximumQuantity", f + "_" + c );
        maxPackageQuantity := guard( ppmqReflection.GetNumber( macroPlan.PackagingPlanMaximumQuantity() ), 0 );
        // å½“前工厂下一类产品行
        pprs               := selectset( macroPlan, PackagingPlanRow, tempPPR, tempPPR.FactoryAbbreviation() = f and tempPPR.Category() = c );
    //    info( "当前工厂:", f, "    å½“前大类:", c, "    å¤§ç±»ä¸‹çš„æœ€å¤§åŒ…装数量:", maxPackageQuantity );
        traverse ( macroPlan, PackagingPlanColumn, ppc, ppc.StartDate() > plannedStartDate and maxPackageQuantity > 0 ) {
          sumUnpackagedInventoryQuantity := sum( pprs, Elements.PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc, tempPPCell.UnpackagedInventory() ).Round( 0 );
          // éœ€è¦åŒ…装
          if ( sumUnpackagedInventoryQuantity > maxPackageQuantity ) {
            // éœ€è¦åŒ…装的数量
            needPackagingQuantity := [Number] ( sumUnpackagedInventoryQuantity - maxPackageQuantity );
            // æŒ‰éžåŒ…装库存排序后的行
            itemPPRs              := selectsortedset( pprs, Elements, tempPPR, true,
                                                      -select( tempPPR, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc ).UnpackagedInventory() );
    //        info( "需要包装时间:", ppc.StartDate().Format( "Y-M2-D2" ), "    éœ€è¦åŒ…装的数量:", needPackagingQuantity );
            traverse ( itemPPRs, Elements, ppr, needPackagingQuantity > 0 ) {
              PackagingPlanCell::Package( macroPlan, ppr, ppc, needPackagingQuantity );
            }
          }
        }
      }
    }
  *]
}
_Main/Sys/Repr/Global/MachineLogisticsCostReportCell.qrp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
Quintiq file version 2.0
#parent: #root
TypeRepresentation MachineLogisticsCostReportCell
{
  AttributeRepresentation BufferPaperCost
  {
    AttributeKey: '[413988.0.1462991459]'
    Synonym: '缓冲纸费用'
  }
  AttributeRepresentation Coefficient
  {
    AttributeKey: '[413988.0.1462991559]'
    Synonym: '系数'
  }
  AttributeRepresentation EstimatedTotalCost
  {
    AttributeKey: '[413988.0.1462991539]'
    Synonym: '预计总费用'
  }
  AttributeRepresentation ExternalRentalWarehouseTransportationCosts
  {
    AttributeKey: '[413988.0.1462991519]'
    Synonym: '外租库运输费用'
  }
  AttributeRepresentation OutboundExpensesForRentedWarehouses
  {
    AttributeKey: '[413988.0.1462991509]'
    Synonym: '外租库出库费用'
  }
  AttributeRepresentation PackingCharges
  {
    AttributeKey: '[413988.0.1462991439]'
    Synonym: '包装费用'
  }
  AttributeRepresentation QuantityOfWoodenCrates
  {
    AttributeKey: '[413988.0.1462991469]'
    Synonym: '木箱数量'
  }
  AttributeRepresentation RentalWarehouseStorageFees
  {
    AttributeKey: '[413988.0.1462991529]'
    Synonym: '外租库仓储费用'
  }
  AttributeRepresentation StorageFeesForRentedWarehouses
  {
    AttributeKey: '[413988.0.1462991499]'
    Synonym: '外租库入库费用'
  }
  AttributeRepresentation TotalCost
  {
    AttributeKey: '[413988.0.1462991549]'
    Synonym: '总费用'
  }
  AttributeRepresentation TransferCost
  {
    AttributeKey: '[413988.0.1462991489]'
    Synonym: '调拨费用'
  }
  AttributeRepresentation UnpackingCost
  {
    AttributeKey: '[413988.0.1462991449]'
    Synonym: '拆包费用'
  }
  AttributeRepresentation WoodenCrateCost
  {
    AttributeKey: '[413988.0.1462991479]'
    Synonym: '木箱费用'
  }
  RelationRepresentation MachineLogisticsCostReportColumn { RelationKey: '[413988.0.1462991383]' Visibility: 'Normal' }
}
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_dhSelectedFactoryMCRR_OnCreated.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: dhSelectedFactoryMCRR
Response OnCreated () id:Response_MacroPlanner_ApplicationMacroPlanner_dhSelectedFactoryMCRR_OnCreated
{
  #keys: '[415754.0.430191699]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  QuillAction
  {
    Body:
    [*
      this.Data( "大连工厂" );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def
@@ -223,5 +223,16 @@
        Taborder: 59
      ]
    }
    Component dhSelectedFactoryMCRR
    {
      #keys: '[415754.0.434272020]'
      BaseType: 'WebDataHolder'
      Databinding: 'String*'
      Properties:
      [
        Description: '机加物流成本报表工厂参数'
        Taborder: 60
      ]
    }
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def
@@ -14,6 +14,8 @@
    Body:
    [*
      MachineLogisticsCostReportCell::CreateData( MacroPlan, ddslFactory.Text() );
      WebMessageBox::Success( Translations::A_VWED_Success() );
    *]
    GroupServerCalls: false
  }
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_ddslFactory_OnCreated.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: pHeader/ddslFactory
Response OnCreated () id:Response_pHeader_ddslFactory_OnCreated
{
  #keys: '[415754.0.425324701]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  QuillAction
  {
    Body:
    [*
      this.Text( dhSelectedFactoryMCRR.Data() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_ddslFactory_OnUserSelectionChanged.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: pHeader/ddslFactory
Response OnUserSelectionChanged () id:Response_pHeader_ddslFactory_OnUserSelectionChanged
{
  #keys: '[415754.0.425324931]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebDropDownStringList_OnUserSelectionChanged'
  QuillAction
  {
    Body:
    [*
      dhSelectedFactoryMCRR.Data( this.Text() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/_ROOT_Component_FormMachineLogisticsCostReport.def
@@ -12,6 +12,7 @@
  ]
  Properties:
  [
    Description: '机加物流成本报表'
    Title: 'MachineLogisticsCostReport'
  ]
}
_Main/UI/MacroPlannerWebApp/Views/NewAssemblyOnlinePlan.vw
@@ -30,7 +30,7 @@
          FormNewAssemblyOnlinePlan_MatrixEditor515
          {
            gridColor: '#c4c4c4'
            totalHeaderWidth: 530
            totalHeaderWidth: 335
            attributeHeaderWidthRatio: 0.6
            nameHeaderWidthRatio: 0.4
            columnWidth: 100
@@ -87,7 +87,7 @@
          FormNewAssemblyOnlinePlan_MatrixEditor583
          {
            gridColor: '#c4c4c4'
            totalHeaderWidth: 532
            totalHeaderWidth: 340
            attributeHeaderWidthRatio: 0.6
            nameHeaderWidthRatio: 0.4
            columnWidth: 100
_Main/UI/MacroPlannerWebApp/Views/NewOfflinePlan.vw
@@ -30,7 +30,7 @@
          FormNewOfflinePlan_MatrixEditor515
          {
            gridColor: '#c4c4c4'
            totalHeaderWidth: 507
            totalHeaderWidth: 342
            attributeHeaderWidthRatio: 0.6
            nameHeaderWidthRatio: 0.4
            columnWidth: 100
@@ -87,7 +87,7 @@
          FormNewOfflinePlan_MatrixEditor583
          {
            gridColor: '#c4c4c4'
            totalHeaderWidth: 509
            totalHeaderWidth: 342
            attributeHeaderWidthRatio: 0.6
            nameHeaderWidthRatio: 0.4
            columnWidth: 100