lihongji
2024-10-17 84164725476db1befaa4aa2b837a79b6247a0ab6
机加物流成本报表优化
已修改3个文件
已添加1个文件
64 ■■■■ 文件已修改
_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachineLogisticsCostReportRow/Method_Filter.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Component_MatrixEditor912.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
@@ -1,8 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateData (
  MacroPlan macroPlan,
  String factory
  MacroPlan macroPlan
)
{
  TextBody:
@@ -36,15 +35,24 @@
                        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 åŽ‚å†…åº“" );
        lct  := select( macroPlan, LogisticsCostTransport, tempLCT,
                        tempLCT.Product()     = mlcrr.Category()                                                   and
                        tempLCT.Origin()      = ifexpr( mlcrr.Factory() = "大连工厂", "长春外租库", "大连厂内库" ) and
                        tempLCT.Destination() = ifexpr( mlcrr.Factory() = "大连工厂", "大连场内库", "长春外租库" ) );
        lct1 := select( macroPlan, LogisticsCostTransport, tempLCT,
                        tempLCT.Product()     = mlcrr.Category()                                                   and
                        tempLCT.Origin()      = ifexpr( mlcrr.Factory() = "大连工厂", "大连厂内库", "CC åŽ‚å†…åº“" ) and
                        tempLCT.Destination() = ifexpr( mlcrr.Factory() = "大连工厂", "大连外租库", "长春外租库" ) );
         // å½“前月末最后一天日期
        lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1;
        
        cell := mlcrr.MachineLogisticsCostReportCell( relnew );
          
        // è®¾ç½®åŒ…装费用(包装量 * åŒ…装单价)
        packageQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, 
                                tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
                                tempPPC.PackagingPlanRow().Factory()              = factory                   and
                                tempPPC.PackagingPlanRow().Factory()              = mlcrr.Factory()           and
                                tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                tempPPC.Package() );
@@ -53,7 +61,7 @@
        // è®¾ç½®æ‹†åŒ…费用(拆包量 * æ‹†åŒ…单价)
        unpackingQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, 
                                  tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
                                  tempPPC.PackagingPlanRow().Factory()              = factory                   and
                                  tempPPC.PackagingPlanRow().Factory()              = mlcrr.Factory()           and
                                  tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                  tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                  tempPPC.Unpacking() );
@@ -67,20 +75,40 @@
          
        // è®¾ç½®è°ƒæ‹¨è´¹ç”¨ï¼ˆè°ƒæ‹¨æ•°é‡ / åŒ…装容量 / è£…载容量 * è¿è¾“单价)
        transferQuantity := sum( macroPlan, TransferPlanRow.TransferPlanCell, tempTPC,
                                 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(),
                                 tempTPC.TransferPlanRow().Category()                      = mlcrr.Category()                                               and
                                 tempTPC.TransferPlanRow().Name()                          = ifexpr( mlcrr.Factory() = "大连工厂", "CC to DL", "DL to CC" ) and
                                 guard( tempTPC.TransferPlanColumn().ColumnDate().Year()   = mlcrc.StartDate().Year(), false )                              and
                                 guard(  tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), false ),
                                 [Number]tempTPC.Value() );
        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 ) );
          
        // å¤–租库运输费用(运输数量 / åŒ…装容量 / è£…载容量 * è¿è¾“单价)
        transportationQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
                                       tempPIT.Product_MP().ParentID()                                                  =  mlcrr.Category()   and
                                       tempPIT.Trip().Departure().Date()                                                >= mlcrc.StartDate()  and
                                       tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth and
                                       tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "CC åŽ‚å†…åº“"         and
                                       tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "长春外租库",
                                       tempPIT.Quantity()
                                      );
        cell.ExternalRentalWarehouseTransportationCosts( transportationQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct1.LoadingCapacity(), 1 ) * guard( lct1.TransportPrice(), 1 ) );
        // å¤–租库仓储费用:仓储数量/包装容量*仓储单价
        plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf()                                                                 and
                                 exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() =  "机加件" )         and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().ParentID()                                         =  mlcrr.Category()   and
                                 tempPISPIP.Start().Date()                                                                              >= mlcrc.StartDate()  and
                                 tempPISPIP.End().Date()                                                                                <= lastDayOfThisMonth and
                                 tempPISPIP.ProductInStockingPoint_MP().StockingPointID()                                               =  ifexpr( mlcrr.Factory() = "大连工厂", "大连外租库", "长春外租库" ),
                                 tempPISPIP.PlannedInventoryLevelEnd() );
        cell.RentalWarehouseStorageFees( plannedInventory / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.StoragePrice(), 1 ) );
        
        cell.MachineLogisticsCostReportColumn( relset, mlcrc );
      }
_Main/BL/Type_MachineLogisticsCostReportRow/Method_Filter.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Method Filter (
  String factory
) declarative remote as Boolean
{
  TextBody: 'return this.Factory() = factory;'
}
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Component_MatrixEditor912.def
@@ -45,6 +45,8 @@
          Properties:
          [
            DataType: 'MacroPlan'
            FilterArguments: 'factory:QLibMacroPlannerWebUI::ApplicationMacroPlanner.dhSelectedFactoryMCRR'
            FixedFilter: 'object.Filter( factory )'
            Source: 'MacroPlan'
            Taborder: 0
            Transformation: 'MachineLogisticsCostReportRow'
_Main/UI/MacroPlannerWebApp/Component_FormMachineLogisticsCostReport/Response_pHeader_bRefresh_OnClick.def
@@ -13,7 +13,7 @@
  {
    Body:
    [*
      MachineLogisticsCostReportCell::CreateData( MacroPlan, ddslFactory.Text() );
      MachineLogisticsCostReportCell::CreateData( MacroPlan );
      
      WebMessageBox::Success( Translations::A_VWED_Success() );
    *]