xiaoding721
2024-10-10 7a687fce2b000f2c3414d757b78849921dcfade5
Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
已修改38个文件
已添加12个文件
已删除1个文件
747 ■■■■ 文件已修改
_Main/BL/Type_AssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQty.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQuantity.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_DLRentOtherCost.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostCell0/Function_CalcEstimateTotalCost.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Download.qbl 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Download.qbl 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_InitializeNew.qbl 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentEnterCost.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentOutCost.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/StaticMethod_Export.qbl 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CC_EngineRackCell/StaticMethod_Import.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ChangeLossSetting/Attribute_ShowChangeLossNumber.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ChangeLossSetting/Function_CalcShowChangeLossNumber.qbl 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineReport/Method_GenerateNew.qbl 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineRow/Attribute_ShowName.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineRow/StaticMethod_CraeteCellValueForRow.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionImportData/Function_CalcQuantity.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionRow/Method_Initialize#110.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesRow/Method_Initialize.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Attribute_CC_PackagingInventory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Attribute_CC_UnpackagedInventory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanRow/Function_CalcName.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_PackagingPlanRow/Method_FilterProduct.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TransferPlanCell/StaticMethod_GenerateReport.qbl 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/Sys/Repr/Global/DLEngineLogisticsCostCell.qrp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/Sys/Repr/Global/MachiningPipelineCell.qrp 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_dhSelectedFactory_OnCreated.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCC_EngineRackReport/Component_pHeader.def 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCC_EngineRackReport/Response_pHeader_bImport_OnClick.def 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormChangeLossSetting/Component_ListChangeLossSetting#568.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Component_MatrixEditorTable.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormEnginePipelineReport/Component_MatrixEditorTable.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_ddslFactorySelection_OnUserSelectionChanged.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/Change_loss_setting_view.vw 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_AssemblyOnlinePlanCell/StaticMethod_RefreshData.qbl
@@ -13,7 +13,10 @@
    // æ‰¾è£…配线行
    oprs := selectsortedset( opt, OfflinePlanRow, tempOPR, 
                             tempOPR.ProductionLine() = "DL MoMo" 
    //                         or tempOPR.ProductionLine() = "CC MoMo" or tempOPR.ProductionLine() = "DL ZKM"
                             or
                             tempOPR.ProductionLine() = "CC MoMo"
                             or
                             tempOPR.ProductionLine() = "DL ZKM"
                             , 
                             tempOPR.ProductionLine(), tempOPR.ProductID(), tempOPR.Type() );
    opcs := selectsortedset( opt, OfflinePlanColumn, tempOPC, true, tempOPC.ColumnDate() );
@@ -43,17 +46,17 @@
                               );
      
      u           := select( macroPlan, Unit, tempU, tempU.ID() = pl );
      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject() = "排空", false ) );
      lineLyingPs := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject() = "铺线", false ) );
      drainPs     := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "拉空" ), false ) );
      lineLyingPs := selectset( u, UnitCalendar.Participation, tempP, guard( tempP.Event().Subject().Regex( "铺线" ), false ) );
      
      // å¤„理排空
      info( "当前产线:", pl, "    å¤„理排空--------------------------" );
      info( "当前产线:", pl, "    å¤„理拉空--------------------------" );
      traverse ( drainPs, Elements, p ) {
        traverse ( p, ExplicitTimeInterval, eti ) {
          info( "开始时间:", eti.Start().Format( "Y-M2-D2" ), "    ç»“束时间:", eti.End().Format( "Y-M2-D2" ) );
          // å‰ä¸€å¤©æ—¥åކ
          aopc := select( macroPlan, AssemblyOnlinePlanColumn, tempAOPC, tempAOPC.ColumnDate() = ( eti.Start().Date() - 1 ) );
          info( "需要排空的上线计划时间:", aopc.ColumnDate().Format( "Y-M2-D2" ) );
          info( "需要拉空的上线计划时间:", aopc.ColumnDate().Format( "Y-M2-D2" ) );
          aoprs := selectset( macroPlan, AssemblyOnlinePlanRow, tempAOPR, tempAOPR.ProductionLine() = pl and tempAOPR.Type() = "2" and
                              exists( tempAOPR, AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc and tempAOPC.Value() <> "" ) );
          aopr  := maxselect( aoprs, Elements.AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc,
@@ -70,6 +73,15 @@
      traverse ( lineLyingPs, Elements, p ) {
        traverse ( p, ExplicitTimeInterval, eti ) {
          info( "开始时间:", eti.Start().Format( "Y-M2-D2" ), "    ç»“束时间:", eti.End().Format( "Y-M2-D2" ) );
          info( "需要铺线的上线计划时间:", eti.Start().Format( "Y-M2-D2" ) );
          aopc  := select( macroPlan, AssemblyOnlinePlanColumn, tempAOPC, tempAOPC.ColumnDate() = eti.Start().Date() );
          aoprs := selectset( macroPlan, AssemblyOnlinePlanRow, tempAOPR, tempAOPR.ProductionLine() = pl and tempAOPR.Type() = "2" and
                              exists( tempAOPR, AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc and tempAOPC.Value() <> "" ) );
          aopr  := minselect( aoprs, Elements.AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanColumn() = aopc,
                              [Number]tempAOPC.Value().ReplaceAll( "#0", "" ) );
          cell  := select( macroPlan, AssemblyOnlinePlanRow.AssemblyOnlinePlanCell, tempAOPC, tempAOPC.AssemblyOnlinePlanRow().ProductionLine() = pl and tempAOPC.AssemblyOnlinePlanColumn() = aopc and
                           tempAOPC.AssemblyOnlinePlanRow().Type() = "1" and tempAOPC.AssemblyOnlinePlanRow().ProductID() = aopr.AssemblyOnlinePlanRow().ProductID() );
          cell.Value( [String] ( [Number]cell.Value() + targetQuantity ) );
        }
      }
    }
_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQty.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute CCRentQty
{
  #keys: '3[415136.0.1184074701][415136.0.1184074700][415136.0.1184074702]'
  Description: '长春外租库数量'
  ValueType: Real
}
_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQuantity.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_DLRentOtherCost.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute DLRentOtherCost
{
  #keys: '3[415136.0.1184074682][415136.0.1184074681][415136.0.1184074683]'
  Description: '大连外租库其他费用'
  ValueType: Real
}
_Main/BL/Type_CCEngineLogisticsCostCell0/Function_CalcEstimateTotalCost.qbl
@@ -4,10 +4,10 @@
{
  TextBody:
  [*
    // ç”„兰鸽 Aug-12-2024 (created)
    // ç”„兰鸽 Aug-12-2024 (created)
    
    value := this.CCRentInCost() + this.CCRentOutOfCost() + this.CCLongTransCost() + this.CCShorTransCost() + this.CCRentStorCost()
    + this.DLRentInCost() + this.DLRentOutOfCost() + this.WerkToDLRentTransCost() + this.DLRentStorCost()
    + this.DLRentInCost() + this.DLRentOutOfCost() + this.WerkToDLRentTransCost() + this.DLRentStorCost() + this.DLRentOtherCost()
    
    this.EstimateTotalCost( value );
  *]
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Download.qbl
@@ -107,31 +107,31 @@
        }
        //外租库入库费用
        rententercostcellElement := xmlDOM.CreateElement( "cell" );
        rententercostcellElement.SetAttribute( "value", [String]c.RentInCost() );
        rententercostcellElement.SetAttribute( "value", c.RentInCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( rententercostcellElement );
        //外租库出库费用
        rentoutcostcellElement := xmlDOM.CreateElement( "cell" );
        rentoutcostcellElement.SetAttribute( "value", [String]c.RentOutOfCost() );
        rentoutcostcellElement.SetAttribute( "value", c.RentOutOfCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( rentoutcostcellElement );
        //厂内到外租库运输费用
        factorytorenttranscostcellElement := xmlDOM.CreateElement( "cell" );
        factorytorenttranscostcellElement.SetAttribute( "value", [String]c.WerkToRentTransCost() );
        factorytorenttranscostcellElement.SetAttribute( "value", c.WerkToRentTransCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( factorytorenttranscostcellElement );
        //外租库仓储费用
        rentstoragecostcellElement := xmlDOM.CreateElement( "cell" );
        rentstoragecostcellElement.SetAttribute( "value", [String]c.RentStorCost() );
        rentstoragecostcellElement.SetAttribute( "value", c.RentStorCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( rentstoragecostcellElement );
        //预计总费用
        estimatedtotalcostcellElement := xmlDOM.CreateElement( "cell" );
        estimatedtotalcostcellElement.SetAttribute( "value", [String]c.EstimateTotalCost() );
        estimatedtotalcostcellElement.SetAttribute( "value", c.EstimateTotalCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( estimatedtotalcostcellElement );
        //系数
        coefficientcellElement := xmlDOM.CreateElement( "cell" );
        coefficientcellElement.SetAttribute( "value", [String]c.Coefficient() );
        coefficientcellElement.SetAttribute( "value", c.Coefficient().Format( 'N(Dec)' ) );
        columnelement.AppendChild( coefficientcellElement );
        //总费用
        totalcostcellElement := xmlDOM.CreateElement( "cell" );
        totalcostcellElement.SetAttribute( "value", [String]c.AllCost() );
        totalcostcellElement.SetAttribute( "value", c.AllCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( totalcostcellElement );
      }
      tableElement.AppendChild( columnelement );  
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl
@@ -154,7 +154,7 @@
                if( not isnull( enginecost ) ){
                  periodtime   := pispip.Start().StartOfMonth().Date();
                  periodname   := periodtime.Format( "M2/D2/Y" );
                  quantity     := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                  quantity     := ceil( [Number]pispip.PlannedInventoryLevelEnd() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                  
                  column       := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
                  
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Download.qbl
@@ -147,51 +147,51 @@
        }
        //长春外租库入库费用
        ccrententercostcellElement := xmlDOM.CreateElement( "cell" );
        ccrententercostcellElement.SetAttribute( "value", [String]c.CCRentInCost() );
        ccrententercostcellElement.SetAttribute( "value", c.CCRentInCost().Format( 'N(Dec)' )  );
        columnelement.AppendChild( ccrententercostcellElement );
        //长春外租库出库费用
        ccrentoutcostcellElement := xmlDOM.CreateElement( "cell" );
        ccrentoutcostcellElement.SetAttribute( "value", [String]c.CCRentOutOfCost() );
        ccrentoutcostcellElement.SetAttribute( "value", c.CCRentOutOfCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( ccrentoutcostcellElement );
        //长春长途运输费用
        cclongtranscostcellElement := xmlDOM.CreateElement( "cell" );
        cclongtranscostcellElement.SetAttribute( "value", [String]c.CCLongTransCost() );
        cclongtranscostcellElement.SetAttribute( "value", c.CCLongTransCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( cclongtranscostcellElement );
        //长春短途运输费用
        ccshorttranscostcellElement := xmlDOM.CreateElement( "cell" );
        ccshorttranscostcellElement.SetAttribute( "value", [String]c.CCShorTransCost() );
        ccshorttranscostcellElement.SetAttribute( "value", c.CCShorTransCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( ccshorttranscostcellElement );
        //长春外租库仓储费用
        ccrentstoragecostcellElement := xmlDOM.CreateElement( "cell" );
        ccrentstoragecostcellElement.SetAttribute( "value", [String]c.CCRentStorCost() );
        ccrentstoragecostcellElement.SetAttribute( "value", c.CCRentStorCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( ccrentstoragecostcellElement );
        //大连外租库入库费用
        dlrententercostcellElement := xmlDOM.CreateElement( "cell" );
        dlrententercostcellElement.SetAttribute( "value", [String]c.DLRentInCost() );
        dlrententercostcellElement.SetAttribute( "value", c.DLRentInCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( dlrententercostcellElement );
        //大连外租库出库费用
        dlrentoutcostcellElement := xmlDOM.CreateElement( "cell" );
        dlrentoutcostcellElement.SetAttribute( "value", [String]c.DLRentOutOfCost() );
        dlrentoutcostcellElement.SetAttribute( "value", c.DLRentOutOfCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( dlrentoutcostcellElement );
        //厂内到外租库运输费用
        factorytorenttranscostcellElement := xmlDOM.CreateElement( "cell" );
        factorytorenttranscostcellElement.SetAttribute( "value", [String]c.WerkToDLRentTransCost() );
        factorytorenttranscostcellElement.SetAttribute( "value", c.WerkToDLRentTransCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( factorytorenttranscostcellElement );
        //大连外租库仓储费用
        dlrentstoragecostcellElement := xmlDOM.CreateElement( "cell" );
        dlrentstoragecostcellElement.SetAttribute( "value", [String]c.DLRentStorCost() );
        dlrentstoragecostcellElement.SetAttribute( "value", c.DLRentStorCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( dlrentstoragecostcellElement );
        //预计总费用
        estimatedtotalcostcellElement := xmlDOM.CreateElement( "cell" );
        estimatedtotalcostcellElement.SetAttribute( "value", [String]c.EstimateTotalCost() );
        estimatedtotalcostcellElement.SetAttribute( "value", c.EstimateTotalCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( estimatedtotalcostcellElement );
        //系数
        coefficientcellElement := xmlDOM.CreateElement( "cell" );
        coefficientcellElement.SetAttribute( "value", [String]c.Coefficient() );
        coefficientcellElement.SetAttribute( "value", c.Coefficient().Format( 'N(Dec)' ) );
        columnelement.AppendChild( coefficientcellElement );
        //总费用
        totalcostcellElement := xmlDOM.CreateElement( "cell" );
        totalcostcellElement.SetAttribute( "value", [String]c.AllCost() );
        totalcostcellElement.SetAttribute( "value", c.AllCost().Format( 'N(Dec)' ) );
        columnelement.AppendChild( totalcostcellElement );
      }
      tableElement.AppendChild( columnelement );  
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
@@ -62,7 +62,7 @@
                if( not isnull( enginecost ) ){
                  products.Add( product );
                  cell       := selectobject( row, Cell, cell, cell.Column() = column );
                  cell.CCRentQuantity( cell.CCRentQuantity() + quantity );
                  cell.CCRentQty( cell.CCRentQty() + quantity );
                  //长春外租库入库费用:入库量/包装容量*入库单价
                  entercost  := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                  //长春外租库出库费用: å‡ºåº“量/包装容量*出库单价
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_InitializeNew.qbl
@@ -35,11 +35,11 @@
    traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID().EndsWith( '外租库' ) ){
    //  unit                    := stockingpoint.Unit();
    //  parentunits             := unit.GetAllParent();
      //是否属于长春外租库
      //是否属于长春外租库用于长春外租库仓储费用
      isccrent                := stockingpoint.ID().StartsWith( '长春' ) or stockingpoint.ID().StartsWith( 'CC' );
      //是否属于大连发动机的长春外租库
      //是否属于大连发动机的长春外租库用于长春入库/出库费用
      isdltoccrent            := stockingpoint.ID().StartsWith( '大连发动机的长春' );
      //是否属于大连外租库
      //是否属于大连外租库用于大连外租库仓储费用
      isdlrent                := stockingpoint.ID().StartsWith( '大连' ) or stockingpoint.ID().StartsWith( 'DL' );
      if( isccrent or isdlrent ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() 
@@ -63,16 +63,15 @@
                  enginecost  := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date()
                                                     and engine.Factory() = ccfactory );
                   if( not isnull( enginecost ) ){
                     quantity :=   [Number]pispip.NewSupplyQuantity();
                     if( isccrent ){
                       cost        := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                       cell.CCRentStorCost( cell.CCRentStorCost() + cost );
                       cost        := ceil( pispip.PlannedInventoryLevelEnd() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                       cell.CCRentStorCost( cell.CCRentStorCost() + cost );//长春外租库仓储费用
                     }else{
                       cell.CCRentQuantity( cell.CCRentQuantity() + quantity );
                       //长春外租库入库费用:入库量/包装容量*入库单价
                       entercost  := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                       cell.CCRentQty( cell.CCRentQty() + pispip.NewSupplyQuantity() );
                       //长春外租库入库费用:入库量/包装容量*入库单价
                       entercost  := ceil( pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                       //长春外租库出库费用: å‡ºåº“量/包装容量*出库单价
                       outcost    := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.OutboundPrice();
                       outcost    := ceil( pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.OutboundPrice();
                       cell.CCRentInCost( cell.CCRentInCost() + entercost );
                       cell.CCRentOutOfCost( cell.CCRentOutOfCost() + outcost );
                     }
@@ -82,8 +81,8 @@
                  enginecost     := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date()
                                                     and engine.Factory() = dlfactory  );
                   if( not isnull( enginecost ) ){
                     cost        := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                     cell.DLRentStorCost( cell.DLRentStorCost() + cost );
                     cost        := ceil( [Number]pispip.PlannedInventoryLevelEnd() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//四舍五入
                     cell.DLRentStorCost( cell.DLRentStorCost() + cost );//大连外租库仓储费用
                   }
                }
              }   
@@ -242,18 +241,23 @@
          enginecosts         := selectset( owner, LogisticsCostEngine, engine, engine.PackagingCapacity() <> 0 and engine.Generation().ToLower() = product.Generation().ToLower() 
                                                 and engine.MLB_MQB() = product.MQBMLB()
                                                 and engine.Factory() = ccfactory );
          //在运输成本参数表里找到发动机对应运输单价和装载容量
          transcosts           := selectset( owner, LogisticsCostTransport, trans, trans.LoadingCapacity() <> 0 and trans.Origin() = '长春外租库'
                                                  and trans.Destination() = '客户库'
                                                  and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '发动机', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
          if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
            products.Add( forecast.Product_MP() );
            row               := table.GetRow( forecast.ProductID() );
            traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() > 0 ){
              enginecost      := selectobject( enginecosts, Elements, engine, engine.StartDate() <= psdip.StartDate() and engine.EndDate() >= psdip.StartDate() );
              transcost       := selectobject( transcosts, Elements, trans, trans.StartDate() <= psdip.StartDate() and trans.EndDate() >= psdip.StartDate() );
              if( not isnull( enginecost ) ){
                periodtime    := psdip.StartDate().StartOfMonth();
                periodname    := periodtime.Format( "M2/D2/Y" );
          //      info( '-------------------------', periodname, periodtime );
                column         := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
          //      info( '-------------------------', column.Name() );
                cost           := ceil( [Number]psdip.Quantity() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                cost           := ceil( ceil( [Number]psdip.Quantity() / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice();
                cell           := selectobject( row, Cell, cell, cell.Column() = column );
                cell.CCShorTransCost( cell.CCShorTransCost() + cost );
              }
@@ -269,7 +273,7 @@
      e.RowNr( i );
      i := i + 1;
    }
    info( '-------------------------------------end---------------------------------' );
    info( '-------------------------------------end----------------------------------' );
    //
    showtable.Generate( search, products );
  *]
_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentEnterCost.qbl
@@ -8,13 +8,15 @@
{
  TextBody:
  [*
    // ç”„兰鸽 Jun-24-2024 (created)
    // ç”„兰鸽 Jun-24-2024 (created)
    cell := selectobject( this, Cell, cell, cell.Column() = column );
    quantity      := [Number]fpcell.Value() - cell.CCRentQuantity();
    quantity      := fpcell.Quantity() - cell.CCRentQty();
    //入库量/包装容量*入库单价,入库量等于长春产量
    cost          := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
    othercost     := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.OtherPrice();
          
    value := cell.DLRentInCost() + cost;
    cell.DLRentInCost( value );
    cell.DLRentOtherCost( cell.DLRentOtherCost() + othercost );
  *]
}
_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentOutCost.qbl
@@ -10,7 +10,7 @@
  [*
    // ç”„兰鸽 Jun-24-2024 (created)
    cell := selectobject( this, Cell, cell, cell.Column() = column );
    quantity      := [Number]fscell.Value() - cell.CCRentQuantity();
    quantity      := [Number]fscell.Value() - cell.CCRentQty();
    //入库量/包装容量*入库单价,入库量等于长春产量
    cost          := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
          
_Main/BL/Type_CC_EngineRackCell/StaticMethod_CreateData.qbl
@@ -38,7 +38,7 @@
                        and tempLCMR.StartDate() <= ccerc.StartDate() and tempLCMR.EndDate() >= ccerc.StartDate().StartOfNextMonth() );
                        
        // è¿è¾“成本参数
        lct  := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "发动机" and tempLCT.Origin() = "CC åŽ‚å†…åº“" and tempLCT.Destination() = "长春外租库" );
        lct  := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "发动机料架" and tempLCT.Origin() = "长春外租库" and tempLCT.Destination() = "CC åŽ‚å†…åº“" );
        
        // å½“前月末最后一天日期                
        lastDayOfThisMonth := ccerc.StartDate().StartOfNextMonth() - 1; 
@@ -65,6 +65,7 @@
                            tempFSID.StartDate().Year()  = ccerc.StartDate().Year()                      and
                            tempFSID.StartDate().Month() = ccerc.StartDate().Month(),
                            tempFSID.Quantity() );
        cell.StorageFeesForRentedWarehouses( [Number] ( engineSales / guard( lce.PackagingCapacity(), 1 ) * guard( lcmr.WarehousingPrice(), 1 ) ) );
             
        // å¤–租库出库费用(发动机产量 / åŒ…装容量[向上取整] * æ–™æž¶å‡ºåº“单价)
@@ -87,6 +88,7 @@
                                       tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "长春外租库",
                                       tempPIT.Quantity()
                                      );
    //    info( "时间:", ccerc.StartDate().Format( "Y-M2-D2" ), "    è¿è¾“数据:", transportationQuantity, "     è¿è¾“单价:", lct.TransportPrice() );
        cell.ExternalRentalWarehouseTransportationCosts( transportationQuantity / guard( lce.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) );
             
        // å¤–租库仓储费用:料架总数量 - å‘动机库存 / åŒ…装容量(向上取整),再乘以空料架仓储单价得到空料架仓储费用。发动机库存取Actual inventories里取到长春外租库该发动机的仓储量,料架总数量需要手动维护。
_Main/BL/Type_CC_EngineRackCell/StaticMethod_Export.qbl
@@ -16,7 +16,7 @@
    firstColumn := xmlDOM.CreateElement( "column" );
    firstName   := xmlDOM.CreateElement( "name" );
    firstType   := xmlDOM.CreateElement( "type" );
    firstName.TextContent( "" );
    firstName.TextContent( "*" );
    firstType.TextContent( "String" );
    firstColumn.AppendChild( firstName );
    firstColumn.AppendChild( firstType );
@@ -40,7 +40,7 @@
    secondColumn := xmlDOM.CreateElement( "column" );
    secondName   := xmlDOM.CreateElement( "name" );
    secondType   := xmlDOM.CreateElement( "type" );
    secondName.TextContent( "" );
    secondName.TextContent( "*" );
    secondType.TextContent( "String" );
    secondColumn.AppendChild( secondName );
    secondColumn.AppendChild( secondType );
@@ -66,43 +66,43 @@
      cells := selectsortedset( cerc, CC_EngineRackCell, tempCELL, true, tempCELL.CC_EngineRackRow().Name() );
      traverse ( cells, Elements, c ) {
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.TotalQuantityOfMaterialRacks() ); // æ–™æž¶æ€»æ•°é‡
        cell.SetAttribute( "value", [String]c.TotalQuantityOfMaterialRacks().Round( 0 ) ); // æ–™æž¶æ€»æ•°é‡
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.NumberOfEmptyShelves() ); // ç©ºæ–™æž¶æ•°é‡
        cell.SetAttribute( "value", [String]c.NumberOfEmptyShelves().Round( 0 ) ); // ç©ºæ–™æž¶æ•°é‡
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.StorageFeesForRentedWarehouses() ); // å¤–租库入库费用
        cell.SetAttribute( "value", [String]c.StorageFeesForRentedWarehouses().Round( 0 ) ); // å¤–租库入库费用
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.OutboundExpensesForRentedWarehouses() ); // å¤–租库出库费用
        cell.SetAttribute( "value", [String]c.OutboundExpensesForRentedWarehouses().Round( 0 ) ); // å¤–租库出库费用
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.ExternalRentalWarehouseTransportationCosts() ); // å¤–租库运输费用
        cell.SetAttribute( "value", [String]c.ExternalRentalWarehouseTransportationCosts().Round( 0 ) ); // å¤–租库运输费用
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.RentalWarehouseStorageFees() ); // å¤–租库仓储费用
        cell.SetAttribute( "value", [String]c.RentalWarehouseStorageFees().Round( 0 ) ); // å¤–租库仓储费用
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.CleaningCost() ); // æ¸…洗费用
        cell.SetAttribute( "value", [String]c.CleaningCost().Round( 0 ) ); // æ¸…洗费用
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.EstimatedTotalCost() ); // é¢„计总费用
        cell.SetAttribute( "value", [String]c.EstimatedTotalCost().Round( 0 ) ); // é¢„计总费用
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.Coefficient() ); // ç³»æ•°
        cell.SetAttribute( "value", [String]c.Coefficient().Round( 0 ) ); // ç³»æ•°
        cellColumn.AppendChild( cell );
        
        cell := xmlDOM.CreateElement( "cell" );
        cell.SetAttribute( "value", [String]c.TotalCost() ); // æ€»è´¹ç”¨
        cell.SetAttribute( "value", [String]c.TotalCost().Round( 0 ) ); // æ€»è´¹ç”¨
        cellColumn.AppendChild( cell );
      }
      tableElement.AppendChild( cellColumn );
_Main/BL/Type_CC_EngineRackCell/StaticMethod_Import.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Import (
  MacroPlan macroPlan,
  GeneralExcelImportAndExportDataTable table
)
{
  TextBody: '//traverse ('
}
_Main/BL/Type_ChangeLossSetting/Attribute_ShowChangeLossNumber.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute ShowChangeLossNumber
{
  #keys: '3[415136.0.1184074662][415136.0.1184074661][415136.0.1184074663]'
  ValueType: String
}
_Main/BL/Type_ChangeLossSetting/Function_CalcShowChangeLossNumber.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
Quintiq file version 2.0
#parent: #root
Function CalcShowChangeLossNumber
{
  TextBody:
  [*
    // ç”„兰鸽 Oct-10-2024 (created)
    value := [String]this.ChangeLossNumber();
    this.ShowChangeLossNumber( value );
  *]
}
_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
@@ -29,13 +29,15 @@
      feedback := Translations::MP_LibCal_Event_ValidDatePeriod();
    }
    if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit and not ( cls.StartDate() > enddate or cls.EndDate() < startdate )
                and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 )
                      or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
                and cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) ){
    //            and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 )
    //                  or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
      feedback := Translations::MP_ChangeLossSetting_Exist()
    }
    if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit  and not ( cls.StartDate() > enddate or cls.EndDate() < startdate )
                and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 )
                      or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
                and cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) ){
    //            and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 )
    //                  or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
      feedback := Translations::MP_ChangeLossSetting_DateCoincide()
    }
    
_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
@@ -23,13 +23,13 @@
    models                  := selectuniquevalues( table, Column.Cell.Demand, demand, demand.Model() );
    cellnr                  := 5 + models.Size();
    //合计行
    sumrowproduction        := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '生产', rows.Size() * cellnr, true );
    sumrowproduction        := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '总产量', rows.Size() * cellnr, true );
    sumrowdlproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '大连产量', sumrowproduction.RowNr() + 1, false );
    sumrowccproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '长春产量', sumrowproduction.RowNr() + 2, false );
    sumrowdemand            := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '需求', sumrowproduction.RowNr() + 3, false );
    sumrowdemand            := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '总需求', sumrowproduction.RowNr() + 3, false );
    rowno                   := sumrowproduction.RowNr() + 4;
    traverse( models, Elements, model ){
      EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', model, rowno, false );
      EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', model.Concat( '需求' ), rowno, false );
      rowno                 := rowno + 1;
    }
    sumrowinventory         := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '库存', rowno, false );
@@ -38,10 +38,10 @@
    rownr                   := 0;
    traverse( rows, Elements, row, productids.Find( row.Name() ) >= 0 ){
    
      showrowproduction   := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '生产', rownr, true );;
      showrowproduction   := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '总生产', rownr, true );;
      showrowdlproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '大连产量', rownr + 1, false );
      showrowccproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '长春产量', rownr + 2, false );
      showrowdemand       := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '需求', rownr + 3, false );
      showrowdemand       := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '总需求', rownr + 3, false );
      rownr               := rownr + 4;
      modelsnr            := rownr + 3;
      models              := construct( Strings );
@@ -50,7 +50,7 @@
      traverse( uniquemodels, Elements, e ){
    
        if( rownr < modelsnr ){
          EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), e, rownr, false );
          EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), e.Concat( '需求' ), rownr, false );
          models.Add( e );
          rownr             := rownr + 1;
        }
@@ -114,8 +114,8 @@
          sumdemand.Value( [String]( [Real]sumdemand.Value() + cell.DemandQuantity() ) );
          
          traverse( cell, Demand, demand, exists( models, Elements, model, model = demand.Model() ) ){
            demandrow              := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model() ) );
            sumdemandrow           := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model() ) );
            demandrow              := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '需求' ) ) );
            sumdemandrow           := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '需求' ) ) );
    
            if( not isnull( demandrow ) ){
              demandcell             := column.CellValue( relnew, Value := [String]demand.Quantity() );
_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
@@ -29,10 +29,9 @@
      }
      if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){
        for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
          periodname          := start.Format( "M2/D2/Y" );
          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
          
          this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
          this.Column( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
        }
      }
    }
_Main/BL/Type_EnginePipelineReport/Method_GenerateNew.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,180 @@
Quintiq file version 2.0
#parent: #root
Method GenerateNew (
  EnginePipelineSearch search,
  Product_MPs products
)
{
  TextBody:
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    table                   := selectobject( this, Source.Report, report, not report.IsShow() );
    //清空之前存储的显示数据
    this.Clear( search.TimeUnit(), search.StartDate(), search.EndDate() );
    Transaction::Transaction().Propagate( attribute( EnginePipelineColumn, Index ) );
    Transaction::Transaction().Propagate( attribute( EnginePipelineCell, ProductionQuantity ) );
    Transaction::Transaction().Propagate( attribute( EnginePipelineCell, DemandQuantity ) );
    //过滤后的产品id
    productids              := selectuniquevalues( products, Elements, product, true, product.ID() );
    rows                    := selectsortedset( table, Row, row, row.RowNr() );
    //显示列
    productcolumn           := selectobject( this, Column, column, column.Index() = 0 );
    attricolumn             := selectobject( this, Column, column, column.Index() = 1 );
    models                  := selectuniquevalues( table, Column.Cell.Demand, demand, demand.Model() );
    cellnr                  := 5 + models.Size();
    //合计行
    sumrowproduction        := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '总产量', rows.Size() * cellnr, true );
    sumrowdlproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '大连产量', sumrowproduction.RowNr() + 1, false );
    sumrowccproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '长春产量', sumrowproduction.RowNr() + 2, false );
    sumrowdemand            := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '总需求', sumrowproduction.RowNr() + 3, false );
    rowno                   := sumrowproduction.RowNr() + 4;
    traverse( models, Elements, model ){
      EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', model.Concat( '需求' ), rowno, false );
      rowno                 := rowno + 1;
    }
    sumrowinventory         := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '库存', rowno, false );
    //行计数
    rownr                   := 0;
    traverse( rows, Elements, row, productids.Find( row.Name() ) >= 0 ){
    //产品显示行
      showrowproduction   := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '总生产', rownr, true );;
      showrowdlproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '大连产量', rownr + 1, false );
      showrowccproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '长春产量', rownr + 2, false );
      showrowdemand       := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '总需求', rownr + 3, false );
      rownr               := rownr + 4;
      modelsnr            := rownr + 3;
      models              := construct( Strings );
      uniquemodels        := selectuniquevalues( row, Cell.Demand, demand, true, demand.Model() );
    //需求显示
      traverse( uniquemodels, Elements, e ){
        if( rownr < modelsnr ){
          EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), e.Concat( '需求' ), rownr, false );
          models.Add( e );
          rownr             := rownr + 1;
        }
      }
    //空需求补充
      for( rownr := rownr; rownr < modelsnr; rownr ++ ){
        EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '', rownr, false );
      }
      showrowinventory    :=  EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '库存', rownr, false );
    //  traverse( this, Column, column ){
    //    //查询时间类型为day的单元格
    //    daycells          := selectset( row, Cell, daycell, daycell.Column().TimeUnit() = Translations::MP_GlobalParameters_Day() and
    //                                        cell.Column().StartDate() >= column.StartDate() and
    //                                        cell.Column().StartDate() <= column.EndaDate() );
      traverse( row, Cell, cell, cell.Column().TimeUnit() = search.TimeUnit() ){
        column            := selectobject( this, Column, column, column.Name() = cell.Column().Name() and column.TimeUnit() = search.TimeUnit() );
        if( not isnull( column ) ){
          //生产
          production              := column.CellValue( relnew, Value := [String]cell.ProductionQuantity() );
          showrowproduction.CellValue( relinsert, production );
          sumproduction           := selectobject( column, CellValue, c, c.Row() = sumrowproduction );
          if( isnull( sumproduction ) ){
            sumproduction         := column.CellValue( relnew, Value := [String]0 );
            sumrowproduction.CellValue( relinsert, sumproduction );
          }
          sumproduction.Value( [String]( [Real]sumproduction.Value() + cell.ProductionQuantity() ) );
          //大连产量
          dlproductionquantity     := guard( cell.Production().DLProduction(), 0 );
          dlproduction             := column.CellValue( relnew, Value := [String]dlproductionquantity );
          showrowdlproduction.CellValue( relinsert, dlproduction );
          sumdlproduction          := selectobject( column, CellValue, c, c.Row() = sumrowdlproduction );
          if( isnull( sumdlproduction ) ){
            sumdlproduction        := column.CellValue( relnew, Value := [String]0 );
            sumrowdlproduction.CellValue( relinsert, sumdlproduction );
          }
          sumdlproduction.Value( [String]( [Real]sumdlproduction.Value() + dlproductionquantity ) );
          //长春产量
          ccproductionquantity     := guard( cell.Production().CCProduction(), 0 );
          ccproduction             := column.CellValue( relnew, Value := [String]ccproductionquantity );
          showrowccproduction.CellValue( relinsert, ccproduction );
          sumccproduction          := selectobject( column, CellValue, c, c.Row() = sumrowccproduction );
          if( isnull( sumccproduction ) ){
            sumccproduction        := column.CellValue( relnew, Value := [String]0 );
            sumrowccproduction.CellValue( relinsert, sumccproduction );
          }
          sumccproduction.Value( [String]( [Real]sumccproduction.Value() + ccproductionquantity ) );
          //需求
          totaldemand              := column.CellValue( relnew, Value := [String]cell.DemandQuantity() );
          showrowdemand.CellValue( relinsert, totaldemand );
          sumdemand                := selectobject( column, CellValue, c, c.Row() = sumrowdemand );
          if( isnull( sumdemand ) ){
            sumdemand              := column.CellValue( relnew, Value := [String]0 );
            sumrowdemand.CellValue( relinsert, sumdemand );
          }
          sumdemand.Value( [String]( [Real]sumdemand.Value() + cell.DemandQuantity() ) );
          traverse( cell, Demand, demand, exists( models, Elements, model, model = demand.Model() ) ){
            demandrow              := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '需求' ) ) );
            sumdemandrow           := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '需求' ) ) );
            if( not isnull( demandrow ) ){
              demandcell             := column.CellValue( relnew, Value := [String]demand.Quantity() );
              demandrow.CellValue( relinsert, demandcell );
            }
            if( not isnull( sumdemandrow ) ){
            sumdemandcell          := selectobject( column, CellValue, c, c.Row() = sumdemandrow );
            if( isnull( sumdemandcell ) ){
              sumdemandcell        := column.CellValue( relnew, Value := [String]0 );
              sumdemandrow.CellValue( relinsert, sumdemandcell );
            }
            sumdemandcell.Value( [String]( [Real]sumdemandcell.Value() + demand.Quantity() ) );
            }
          }
          for( demandr := showrowdemand.RowNr() + 1; demandr < showrowinventory.RowNr(); demandr := demandr + 1 ){
            demandrow              := selectobject( this, Row, r, r.RowNr() = demandr and r.Name() = row.Name() );
            if( not isnull( demandrow ) and not exists( demandrow, CellValue, cv, cv.Column() = column ) ){
              demandcell           := column.CellValue( relnew, Value := '' );
              demandrow.CellValue( relinsert, demandcell );
            }
          }
          //库存
          inventory                := column.CellValue( relnew, Value := [String]cell.InventoryQuantity() );
          showrowinventory.CellValue( relinsert, inventory );
          suminventory             := selectobject( column, CellValue, c, c.Row() = sumrowinventory );
          if( isnull( suminventory ) ){
            suminventory           := column.CellValue( relnew, Value := [String]0 );
            sumrowinventory.CellValue( relinsert, suminventory );
          }
          suminventory.Value( [String]( [Real]suminventory.Value() + cell.InventoryQuantity() ) );
        }
      }
    }
    traverse( this, Column, column ){
      for( demandr := sumrowdemand.RowNr() + 1; demandr < sumrowinventory.RowNr(); demandr := demandr + 1 ){
        demandrow              := selectobject( this, Row, r, r.RowNr() = demandr and r.Name() = 'SUM' );
    //    info( '------------------14----------------' );
        if( not isnull( demandrow ) and not exists( demandrow, CellValue, cv, cv.Column() = column ) ){
          demandcell           := column.CellValue( relnew, Value := '' );
          demandrow.CellValue( relinsert, demandcell );
        }
      }
    }
    rows := selectsortedset( this, Row, row, row.Name(), row.RowNr() );
    i    := 0;
    traverse( rows, Elements, e ){
      e.RowNr( i );
      i := i + 1;
    }
  *]
}
_Main/BL/Type_EnginePipelineRow/Attribute_ShowName.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute ShowName
{
  #keys: '3[415136.0.1185710016][415136.0.1185710015][415136.0.1185710017]'
  ValueType: String
}
_Main/BL/Type_EnginePipelineRow/StaticMethod_CraeteCellValueForRow.qbl
@@ -21,6 +21,10 @@
    acell         := attricolumn.CellValue( relnew, Value := attriname );
    row.CellValue( relinsert, pcell );
    row.CellValue( relinsert, acell );
    traverse( table, Column, column, column.Index() > 1 ){
      cell        := column.CellValue( relnew, Value := '0' );
      row.CellValue( relinsert, cell );
    }
    return row;
  *]
}
_Main/BL/Type_FinancialProductionImportData/Function_CalcQuantity.qbl
@@ -6,7 +6,7 @@
  [*
    // ç”„兰鸽 Aug-8-2024 (created)
    
    value := guard( [Number]this.Cell().Value(), 0 );
    value := guard( [Number]this.Cell().Quantity(), 0 );
    
    this.Quantity( value );
  *]
_Main/BL/Type_FinancialProductionRow/Method_Initialize#110.qbl
@@ -13,7 +13,7 @@
    cell := column.FinancialProductionCell( relnew, Quantity := 0 );
    
    this.FinancialProductionCell( relinsert, cell );
    if( unit <> FinancialProductionReport::GetDefaultAllUnit() ){
    if( unit <> FinancialProductionReport::GetDefaultAllUnit() and not column.IsDay()){
      importdata := product.MacroPlan().FPImportData( relnew, Generation := product.Generation()
                                                      , MqbMlb := product.MQBMLB()
                                                      , Power := product.Power()
_Main/BL/Type_FinancialSalesRow/Method_Initialize.qbl
@@ -10,10 +10,10 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-24-2024 (created) 
    cell := column.FinancialSalesCell( relnew, Value := '' );
    cell := column.FinancialSalesCell( relnew, Value := '0' );
    
    this.FinancialSalesCell( relinsert, cell );
    if( unit <> FinancialProductionReport::GetDefaultAllUnit() ){
    if( unit <> FinancialProductionReport::GetDefaultAllUnit() and not column.IsDay() ){
      importdata := product.MacroPlan().FSImportData( relnew, Generation := product.Generation()
                                                      , MqbMlb := product.MQBMLB()
                                                      , Power := product.Power()
_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
@@ -9,6 +9,7 @@
  [*
    // ç”„兰鸽 Jun-24-2024 (created)
    owner.FinancialSalesSource( relflush );
    owner.FSImportData( relflush );
    products                  := construct( Product_MPs );
    allunit                   := FinancialSalesReport::GetDefaultAllUnit();
    ccunit                    := FinancialSalesReport::GetDefaultCCUnit();
_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
@@ -28,16 +28,17 @@
          this.InventorySummaryColumn( relnew, Name := periodname, StartDate := periodtime, EndaDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
        }
      }else if( timeunit = Translations::MP_GlobalParameters_Week() ){
        weekstartstr          := ' KW';
        for( start := starttime; start <= endtime; start := start.StartOfNextWeek() ){
          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
          
          this.InventorySummaryColumn( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
          this.InventorySummaryColumn( relnew, Name := weekend.Format( "M2/D2/Y" ).Concat( weekstartstr.Concat( weekend.Week().Format( 'N(LPad0(2))' ) ) ), StartDate := start.Date(), EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
        }
      }else if( timeunit = Translations::MP_GlobalParameters_Month() ){
        for( start := starttime; start <= endtime; start := start.StartOfNextMonth() ){
          monthend            := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date();
          
          this.InventorySummaryColumn( relnew, Name := monthend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
          this.InventorySummaryColumn( relnew, Name := monthend.Format( "M2/D2/Y" ).Concat( ' ' ).Concat( monthend.Format( "MM" ).Concat( '/').Concat( [String]monthend.Month() ).Concat( '月' ) ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
        }
      }
    }
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -47,10 +47,10 @@
            products.Add( pisp.Product_MP() );
            period            := pispip.Period_MP();
            periodtime        := period.Start().Date();
            periodname        := periodtime.Format( "M2/D2/Y" );
    //        periodname        := periodtime.Format( "M2/D2/Y" );
            
            //天,选择日颗粒度时,期末库存,最小库存,最大库存和平均库存的数值保持一致
            daycolumn         := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.StartDate() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
            daycolumn         := selectobject( table, InventorySummaryColumn, column, column.StartDate() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
            quantity          := ifexpr( pispip.Period_MP().IsHistorical(), [Number]pispip.ActualInventoryLevelEnd(), [Number]pispip.PlannedInventoryLevelEnd() );
            factoryrow.SetCellValue( daycolumn, quantity );
            allrow.SetCellValue( daycolumn, quantity );
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
@@ -30,10 +30,9 @@
      }
      if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){
        for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
          periodname          := start.Format( "M2/D2/Y" );
          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
          
          this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
          this.Column( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
        }
      }
    }
_Main/BL/Type_PackagingPlanCell/Attribute_CC_PackagingInventory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute CC_PackagingInventory
{
  #keys: '3[415754.0.351286657][415754.0.351286656][415754.0.351286658]'
  Description: '长春工厂包装库存'
  ValueType: Real
}
_Main/BL/Type_PackagingPlanCell/Attribute_CC_UnpackagedInventory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute CC_UnpackagedInventory
{
  #keys: '3[415754.0.351197962][415754.0.351197961][415754.0.351197963]'
  Description: '长春工厂非包装库存'
  ValueType: Real
}
_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
@@ -6,11 +6,13 @@
  [*
    // lihongji Jul-26-2024 (created)
    
    value := this.InitialPackagingInventory() + guard( this.Previous().PackagingInventory()                 +
                                                       guard( this.Previous().Package(), 0.0 )              -
    value := ifexpr( this.PackagingPlanRow().Factory() = "长春工厂", this.CC_PackagingInventory(),
                     this.InitialPackagingInventory() + guard( this.Previous().PackagingInventory()                 +
                                                       guard( this.Package(), 0.0 )                         -
                                                       ifexpr( this.TransferIn() > 0.0, 0, this.Unpacking() ), 
                                                       0.0 )
                                              - this.Out();
                                              - this.Out()
                    );
    
    this.PackagingInventory( value );
  *]
_Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl
@@ -6,7 +6,8 @@
  [*
    // lihongji Jul-24-2024 (created)
    
    value := guard( this.EndingInventory() - this.PackagingInventory(), 0.0 );
    value := ifexpr( this.PackagingPlanRow().Factory() = "长春工厂", this.CC_UnpackagedInventory(),
                     guard( this.EndingInventory() - this.PackagingInventory(), 0.0 ) );
    
    this.UnpackagedInventory( value );
  *]
_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -13,21 +13,26 @@
    planPre     := macroPlan.PackagingPlanColumn( relnew, StartDate := macroPlan.StartOfPlanning().Date() - 1 );
    
    // ç”ŸæˆæŠ¥è¡¨
    traverse ( macroPlan, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() ) {
    traverse ( macroPlan, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() and
               ( pisp.StockingPointID().Regex( "CC" ) or pisp.StockingPointID().Regex( "DL" ) or pisp.StockingPointID().Regex( "大连" ) or pisp.StockingPointID().Regex( "长春" ) ) ) {
      // å½“前pisp所处地点
      factory             := ifexpr( pisp.StockingPointID().Regex( "CC" ) or pisp.StockingPointID().Regex( "长春" ), "长春工厂", "大连工厂" );
      factoryAbbreviation := ifexpr( pisp.StockingPointID().Regex( "CC" ) or pisp.StockingPointID().Regex( "长春" ), "CC", "DL" );
      // åˆ›å»ºè¡Œ
      ppr := select( macroPlan, PackagingPlanRow, tempPPR, tempPPR.ProductID() = pisp.ProductID() and tempPPR.StockingPointID() = pisp.StockingPointID() );
      ppr := select( macroPlan, PackagingPlanRow, tempPPR, tempPPR.ProductID() = pisp.ProductID() and tempPPR.Factory() = factory );
      if ( isnull( ppr ) ) {
        ppr := macroPlan.PackagingPlanRow( relnew, ProductID := pisp.ProductID(), StockingPointID := pisp.StockingPointID(), Factory := "大连工厂", Category := "ZKG" );
        ppr := macroPlan.PackagingPlanRow( relnew, ProductID := pisp.ProductID(), StockingPointID := pisp.StockingPointID(), Factory := factory, Category := guard( pisp.Product_MP().ParentID(), "" ) );
      }
      
      // åˆ›å»ºè®¡åˆ’前一天格子
      planPreCell      := ppr.PackagingPlanCell( relnew, PackagingPlanColumn := planPre, InitialPackagingInventory := 200 );
      // å‡ºå‘地库存点Trip
      originTrips      := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID() = pisp.StockingPointID() );
      originTrips      := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( factoryAbbreviation )      and
                                     TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ) <> TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ) );
      // ç›®çš„地库存点Trip
      destinationTrips := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = pisp.StockingPointID() );
      destinationTrips := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( factoryAbbreviation ) and
                                     TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ) <> TransferPlanRow::IdentifyTheFactory( tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ) );
      
      // å¾ªçޝpispippl
      traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispipl, not pispipl.IsPeriodFrozen() ) {
        // åˆ›å»ºåˆ—
        ppc := select( macroPlan, PackagingPlanColumn, tempPPC, tempPPC.StartDate() = pispipl.Start().Date() );
@@ -38,25 +43,48 @@
        // åˆ›å»ºå•元格
        cell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc );
        if ( isnull( cell ) ) {
          cell := ppr.PackagingPlanCell( relnew, NetDemand := pispipl.DependentDemandAndSalesDemandQuantity() - pispipl.NewSupplyQuantity(), EndingInventory := pispipl.InventoryLevelEnd() );
          cell := ppr.PackagingPlanCell( relnew );
          cell.NetDemand( pispipl.DependentDemandAndSalesDemandQuantity() - pispipl.NewSupplyQuantity() );
          cell.EndingInventory( pispipl.InventoryLevelEnd() );
          cell.PackagingPlanColumn( relset, ppc );
        } else {
          cell.NetDemand( cell.NetDemand() + ( pispipl.DependentDemandAndSalesDemandQuantity() - pispipl.NewSupplyQuantity() ) );
          cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
        }
        
        // è®¾ç½®è°ƒå‡º&调进
        // è®¾ç½®è°ƒå‡º
        outs := selectset( originTrips, Elements, tempT, tempT.Departure().Date() = pispipl.Start().Date() );
        traverse ( outs, Elements, out ) {
          cell.Out( cell.Out() + out.Quantity() );
        traverse ( outs, Elements.ProductInTrip, outPIT, outPIT.ProductID() = pisp.ProductID() ) {
          cell.Out( cell.Out() + outPIT.Quantity() );
        }
        
        // è®¾ç½®è°ƒè¿›
        transferIns := selectset( destinationTrips, Elements, tempT, tempT.Arrival().Date() = pispipl.Start().Date() );
        traverse ( transferIns, Elements, ti ) {
          cell.TransferIn( cell.TransferIn() + ti.Quantity() );
        traverse ( transferIns, Elements.ProductInTrip, tiPIT, tiPIT.ProductID() = pisp.ProductID() ) {
          cell.TransferIn( cell.TransferIn() + tiPIT.Quantity() );
        }
        // é•¿æ˜¥å·¥åŽ‚ç‰¹æ®Šæƒ…å†µè®¾ç½®åŒ…è£…åº“å­˜å’ŒéžåŒ…è£…åº“å­˜
        if ( factory = "长春工厂" ) {
          if ( pisp.StockingPointID().Regex( "外租库" ) ) {
            cell.CC_PackagingInventory( pispipl.InventoryLevelEnd() );
          } else if ( pisp.StockingPointID().Regex( "线边库" ) ) {
            cell.CC_UnpackagedInventory( pispipl.InventoryLevelEnd() );
          }
        }
        
        // è®¾ç½®å‰ä¸€å¤©åº“å­˜
        if ( pispipl.Start().Date() = macroPlan.StartOfPlanning().Date() ) {
    //      prePISPIPL := pispipl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );
          planPreCell.EndingInventory( 2000 );
          prePISPIPL  := pispipl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf ); // å‰ä¸€ä¸ªpispippl
          // åˆ›å»ºè®¡åˆ’前一天格子
          preCell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = planPre );
          if ( isnull( preCell ) ) {
            preCell := ppr.PackagingPlanCell( relnew );
            preCell.EndingInventory( prePISPIPL.InventoryLevelEnd() );
            preCell.PackagingPlanColumn( relset, planPre );
          } else {
            preCell.EndingInventory( preCell.EndingInventory() + prePISPIPL.InventoryLevelEnd() );
          }
        }
      }
    }
@@ -66,46 +94,46 @@
    Transaction::Transaction().Propagate( relation( PackagingPlanCell, Next ) );
    
    // è®¾ç½®åŒ…装&拆包-数量
    traverse ( macroPlan, PackagingPlanRow, ppr, ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Bosch" ) or ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Components (Spain)" ) ) {
      traverse ( ppr, PackagingPlanCell, ppc/*, ppc.StartDate() = Date::Construct( 2020, 4, 1 )*/ ) {
        // è®¾ç½®åŒ…装数量
        if ( ppc.PackagingInventory() < ppc.Out() ) { // åŒ…装库存是否小于调出
          prePPC                := ppc.Previous();
          needPackagingQuantity := ppc.Out() - prePPC.PackagingInventory();
          while ( not isnull( prePPC ) and needPackagingQuantity > 0.0 ) {
            // èŽ·å–åŒ…è£…lotsize
            ppls                   := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() =  ppc.PackagingPlanRow().Factory()    and
                                                                                        tempPPLS.ProductID() = ppc.PackagingPlanRow().ProductID() );
            // èŽ·å–æœ€å¤§åŒ…è£…æ•°é‡
            maxPackageReflection   := Reflection::FindAttribute( "PackagingPlanCapability", ppc.PackagingPlanRow().FactoryAbbreviation() + "_" + ppc.PackagingPlanRow().Category() + "_Package" );
    //        maxPackageQuantity     := maxPackageReflection.GetNumber( macroPlan.PackagingPlanCapability() ); // æ­¤å¤„需要修改
            maxPackageQuantity     := 100000;
            // èŽ·å–æœ€ç»ˆåŒ…è£…æ•°é‡
            finalPackagingQuantity := minvalue( ceil( needPackagingQuantity / ppls.LotSize() ), ceil( ( maxPackageQuantity - prePPC.Package() ) / ppls.LotSize() ) ) * ppls.LotSize();
            needPackagingQuantity  := needPackagingQuantity - finalPackagingQuantity;
            // è®¾ç½®åŒ…装值
            prePPC.Package( prePPC.Package() + finalPackagingQuantity );
            //debuginfo( "需要包装数量:", needPackagingQuantity, "    lotsize: ", ppls.LotSize(), "    æœ€å¤§åŒ…装数量:", maxPackageQuantity, "    æœ€ç»ˆè¡¥çš„æ•°é‡ï¼š", finalPackagingQuantity );
            PackagingPlanCell::CalculationPackagingPlanProperties();
            prePPC := prePPC.Previous();
          }
        }
        // è®¾ç½®æ‹†åŒ…数量
        if ( ppc.TransferIn() > 0.0 ) { // æœ‰è°ƒå…¥æ•°é‡
          // èŽ·å–åŒ…è£…lotsize
          ppls                 := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() =  ppc.PackagingPlanRow().Factory()    and
                                                                                     tempPPLS.ProductID() = ppc.PackagingPlanRow().ProductID() );
          // è®¾ç½®æ‹†åŒ…值
          ppc.Unpacking( ppc.TransferIn() );
        }
      }
    }
    //traverse ( macroPlan, PackagingPlanRow, ppr, ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Bosch" ) or ( ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Components (Spain)" ) ) {
    //  traverse ( ppr, PackagingPlanCell, ppc/*, ppc.StartDate() = Date::Construct( 2020, 4, 1 )*/ ) {
    //    // è®¾ç½®åŒ…装数量
    //    if ( ppc.PackagingInventory() < ppc.Out() ) { // åŒ…装库存是否小于调出
    //      prePPC                := ppc.Previous();
    //      needPackagingQuantity := ppc.Out() - prePPC.PackagingInventory();
    //      while ( not isnull( prePPC ) and needPackagingQuantity > 0.0 ) {
    //        // èŽ·å–åŒ…è£…lotsize
    //        ppls                   := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() =  ppc.PackagingPlanRow().Factory()    and
    //                                                                                    tempPPLS.ProductID() = ppc.PackagingPlanRow().ProductID() );
    //
    //        // èŽ·å–æœ€å¤§åŒ…è£…æ•°é‡
    //        maxPackageReflection   := Reflection::FindAttribute( "PackagingPlanCapability", ppc.PackagingPlanRow().FactoryAbbreviation() + "_" + ppc.PackagingPlanRow().Category() + "_Package" );
    ////        maxPackageQuantity     := maxPackageReflection.GetNumber( macroPlan.PackagingPlanCapability() ); // æ­¤å¤„需要修改
    //        maxPackageQuantity     := 100000;
    //
    //        // èŽ·å–æœ€ç»ˆåŒ…è£…æ•°é‡
    //        finalPackagingQuantity := minvalue( ceil( needPackagingQuantity / ppls.LotSize() ), ceil( ( maxPackageQuantity - prePPC.Package() ) / ppls.LotSize() ) ) * ppls.LotSize();
    //        needPackagingQuantity  := needPackagingQuantity - finalPackagingQuantity;
    //
    //        // è®¾ç½®åŒ…装值
    //        prePPC.Package( prePPC.Package() + finalPackagingQuantity );
    //
    //        //debuginfo( "需要包装数量:", needPackagingQuantity, "    lotsize: ", ppls.LotSize(), "    æœ€å¤§åŒ…装数量:", maxPackageQuantity, "    æœ€ç»ˆè¡¥çš„æ•°é‡ï¼š", finalPackagingQuantity );
    //        PackagingPlanCell::CalculationPackagingPlanProperties();
    //
    //        prePPC := prePPC.Previous();
    //      }
    //    }
    //
    //    // è®¾ç½®æ‹†åŒ…数量
    //    if ( ppc.TransferIn() > 0.0 ) { // æœ‰è°ƒå…¥æ•°é‡
    //      // èŽ·å–åŒ…è£…lotsize
    //      ppls                 := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() =  ppc.PackagingPlanRow().Factory()    and
    //                                                                                 tempPPLS.ProductID() = ppc.PackagingPlanRow().ProductID() );
    //
    //      // è®¾ç½®æ‹†åŒ…值
    //      ppc.Unpacking( ppc.TransferIn() );
    //    }
    //  }
    //}
  *]
}
_Main/BL/Type_PackagingPlanRow/Function_CalcName.qbl
@@ -6,7 +6,7 @@
  [*
    // lihongji Jul-24-2024 (created)
    
    value := guard( this.ProductID() + " in " + this.StockingPointID(), this.ProductID() );
    value := guard( this.ProductID(), "" );
    
    this.Name( value );
  *]
_Main/BL/Type_PackagingPlanRow/Method_FilterProduct.qbl
@@ -1,12 +1,13 @@
Quintiq file version 2.0
#parent: #root
Method FilterProduct (
  Product_MPs products
  Product_MPs products,
  String factory
) declarative remote as Boolean
{
  TextBody:
  [*
    flag := exists( products, Elements, tempP, tempP.ID() = this.ProductID() );
    flag := exists( products, Elements, tempP, tempP.ID() = this.ProductID() ) and this.Factory() = factory;
    
    return flag;
  *]
_Main/BL/Type_TransferPlanCell/StaticMethod_GenerateReport.qbl
@@ -14,7 +14,12 @@
    // ç”Ÿæˆè°ƒæ‹¨è®¡åˆ’
    traverse ( macroPlan, Unit, u, u.HasCapacityTypeTransportQuantity() ) {
      traverse ( u, Lane.LaneLeg.Trip, t ) {
        traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0 and exists( pit.Product_MP(), AllParent.AsParent, tempP, tempP.ID() = "机加件" ) ) {
        originFactory      := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() );      // èµ·å§‹å·¥åŽ‚
        destinationFactory := TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ); // ç›®æ ‡å·¥åŽ‚
        traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0                                           and // æ•°é‡å¤§äºŽ0
                   exists( pit.Product_MP(), AllParent.AsParent, tempP, tempP.ID() = "机加件" )          and // åªå–机加件
                   originFactory                                                   <> destinationFactory     // èµ·å§‹å·¥åŽ‚ä¸èƒ½å’Œç›®æ ‡å·¥åŽ‚ä¸€è‡´
                  ) {
          // æ‰¾è¡Œ
          tpr := TransferPlanRow::FindTransferPlanRowTypeIndex( TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP() ),
                                                                TransferPlanRow::IdentifyTheFactory( t.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP() ),
_Main/Sys/Repr/Global/DLEngineLogisticsCostCell.qrp
@@ -42,6 +42,11 @@
    AttributeKey: '[415136.0.1160164787]'
    Synonym: '大连外租库入库费用'
  }
  AttributeRepresentation DLRentOtherCost
  {
    AttributeKey: '[415136.0.1184074681]'
    Synonym: '大连外租库其他费用'
  }
  AttributeRepresentation DLRentOutOfCost
  {
    AttributeKey: '[415136.0.1160164795]'
_Main/Sys/Repr/Global/MachiningPipelineCell.qrp
@@ -15,12 +15,12 @@
  AttributeRepresentation CCProductionQty
  {
    AttributeKey: '[415136.0.886711530]'
    Synonym: 'CC生产计划'
    Synonym: 'CC机加计划'
  }
  AttributeRepresentation CCTransferQty
  {
    AttributeKey: '[415136.0.894481175]'
    Synonym: 'CC调拨计划'
    Synonym: 'CC to DL'
  }
  AttributeRepresentation DLAssemblyPlanQty
  {
@@ -35,12 +35,12 @@
  AttributeRepresentation DLProductionQty
  {
    AttributeKey: '[415136.0.894481151]'
    Synonym: 'DL生产计划'
    Synonym: 'DL机加计划'
  }
  AttributeRepresentation DLTransferQty
  {
    AttributeKey: '[415136.0.894481185]'
    Synonym: 'DL调拨计划'
    Synonym: 'DL to CC'
  }
  AttributeRepresentation TotalInventoryQty
  {
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_dhSelectedFactory_OnCreated.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: dhSelectedFactory
Response OnCreated () id:Response_MacroPlanner_ApplicationMacroPlanner_dhSelectedFactory_OnCreated
{
  #keys: '[415754.0.350439844]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  QuillAction
  {
    Body:
    [*
      this.Data( "大连工厂" );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/_ROOT_Component_ApplicationMacroPlanner.def
@@ -212,5 +212,16 @@
        Taborder: 58
      ]
    }
    Component dhSelectedFactory
    {
      #keys: '[415754.0.350439827]'
      BaseType: 'WebDataHolder'
      Databinding: 'String*'
      Properties:
      [
        Description: '包装计划所选工厂'
        Taborder: 59
      ]
    }
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCC_EngineRackReport/Component_pHeader.def
@@ -22,6 +22,18 @@
      Properties:
      [
        Image: 'EXPORT1'
        Label: '导出'
        Taborder: 2
      ]
    }
    Component bImport
    {
      #keys: '[415754.0.345743565]'
      BaseType: 'WebButton'
      Properties:
      [
        Image: 'IMPORT1'
        Label: '导入'
        Taborder: 1
      ]
    }
_Main/UI/MacroPlannerWebApp/Component_FormCC_EngineRackReport/Response_pHeader_bImport_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
Quintiq file version 2.0
#parent: pHeader/bImport
Response OnClick () id:Response_pHeader_bImport_OnClick
{
  #keys: '[415754.0.345782016]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
  QuillAction
  {
    Body:
    [*
      try {
        uploadJsonString := Application.GetFile();
        if ( uploadJsonString <> "" ) {
          uploadJson := JSON::Parse( uploadJsonString );
          Archive::VerifyTheFileName( uploadJson );
          fileName := uploadJson.Get( "name" ).GetString();
          base64String := uploadJson.Get( "data" ).GetString();
          webFileBinaryData := BinaryData::FromBase64EncodedString( base64String ).AsBinaryValue();
          generalExcelImportAndExportDataSource := GeneralExcelImportAndExportDataSource::Upload( RecycleBin, webFileBinaryData, fileName );
          generalExcelImportAndExportDataSource.ReadStructure();
          selection := select( generalExcelImportAndExportDataSource, GeneralExcelImportAndExportDataTable, tempGEIAEDT, tempGEIAEDT.Name() = "Sheet1" );
          CC_EngineRackCell::Import( MacroPlan, selection );
          // åŽç»­åˆ é™¤
          generalExcelImportAndExportDataSource.Delete();
          WebMessageBox::Success( Translations::A_VWED_Success() );
        }
      } onerror {
        WebMessageBox::Error( e.GeneralInformation() );
      }
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormChangeLossSetting/Component_ListChangeLossSetting#568.def
@@ -28,7 +28,7 @@
      ]
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit.ID","title":"Unit","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Unit.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductFirst.ID","title":"Product1","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductFirst.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSecond.ID","title":"Product2","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductSecond.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"StartDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"EndDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ChangeLossNumber","title":"ChangeLossNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ChangeLossNumber"}}]'
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit.ID","title":"Unit","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Unit.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductFirst.ID","title":"Product1","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductFirst.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSecond.ID","title":"Product2","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductSecond.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"StartDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"EndDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ShowChangeLossNumber","title":"ChangeLossNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ShowChangeLossNumber"}}]'
        ContextMenu: 'listContextMenuChangeLossSetting'
        Taborder: 2
      ]
_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Component_MatrixEditorTable.def
@@ -26,7 +26,7 @@
      ]
      Properties:
      [
        Attributes: 'CCRentInCost;CCRentOutOfCost;CCLongTransCost;CCShorTransCost;CCRentStorCost;DLRentInCost;DLRentOutOfCost;WerkToDLRentTransCost;DLRentStorCost;EstimateTotalCost;Coefficient;AllCost'
        Attributes: 'CCRentInCost;CCRentOutOfCost;CCLongTransCost;CCShorTransCost;CCRentStorCost;DLRentInCost;DLRentOutOfCost;WerkToDLRentTransCost;DLRentStorCost;DLRentOtherCost;EstimateTotalCost;Coefficient;AllCost'
        Column: 'Column'
        Row: 'Row'
        Taborder: 0
_Main/UI/MacroPlannerWebApp/Component_FormEnginePipelineReport/Component_MatrixEditorTable.def
@@ -53,7 +53,7 @@
      ]
      Properties:
      [
        Legend: 'RowNr'
        Legend: 'ShowName'
        SortCriteria: 'RowNr'
        Taborder: 1
      ]
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def
@@ -45,8 +45,8 @@
          Properties:
          [
            DataType: 'MacroPlan'
            FilterArguments: 'products:QLibMacroPlannerWebUI::ApplicationMacroPlanner.DataHolderCheckedProduct'
            FixedFilter: 'object.FilterProduct( products )'
            FilterArguments: 'products:QLibMacroPlannerWebUI::ApplicationMacroPlanner.DataHolderCheckedProduct;factory:QLibMacroPlannerWebUI::ApplicationMacroPlanner.dhSelectedFactory'
            FixedFilter: 'object.FilterProduct( products, factory )'
            Source: 'MacroPlan'
            Taborder: 0
            Transformation: 'PackagingPlanRow'
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
@@ -61,6 +61,7 @@
      BaseType: 'WebDropDownStringList'
      Properties:
      [
        InitialValue: '大连工厂'
        Label: '工厂'
        Sorting: 'none'
        Strings: '大连工厂;长春工厂'
_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_ddslFactorySelection_OnUserSelectionChanged.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: pHeader/ddslFactorySelection
Response OnUserSelectionChanged () id:Response_pHeader_ddslFactorySelection_OnUserSelectionChanged
{
  #keys: '[415754.0.350720104]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebDropDownStringList_OnUserSelectionChanged'
  QuillAction
  {
    Body:
    [*
      dhSelectedFactory.Data( this.Text() );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Views/Change_loss_setting_view.vw
@@ -78,14 +78,14 @@
              subtotals: ''
              width: 150
            }
            column_ChangeLossNumber
            column_ShowChangeLossNumber
            {
              columnId: 'ChangeLossNumber'
              dataPath: 'ChangeLossNumber'
              dataType: 'real'
              columnId: 'ShowChangeLossNumber'
              dataPath: 'ShowChangeLossNumber'
              dataType: 'string'
              index: 5
              subtotals: ''
              width: 183
              width: 150
            }
          }
        }