admin
2024-10-31 602aee97554a09ab36ac0396bd4cd155ab590a80
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -60,7 +60,9 @@
                           tempMRTCell.MaterialRackTotalRow().Generation() = dlerr.Generation()        and
                           tempMRTCell.MaterialRackTotalRow().MLB_MQB()    = dlerr.MLB_MQB()           and
                           tempMRTCell.MaterialRackColumn().Month()        = dlerc.StartDate().Month() );
        cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
        if ( dlerr.Generation() = "350bar" and dlerr.MLB_MQB() = "MQB" ) {
          cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
        }
       
        // 大连外租库空料架数量:【350bar MQB料架总数量 - 所有350bar MQB总库存 / 包装容量 - 客户库料架数量】* 大连外租库空料架比例
        plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
@@ -84,8 +86,8 @@
                                        tempF.StartDate().Year()        = dlerc.StartDate().Year()  and
                                        tempF.StartDate().Month()       = dlerc.StartDate().Month(),
                                        tempF.FulfilledQuantity() );
        info( "时间:", dlerc.StartDate().Format( "Y-M2-D2" ), "    入库数量:", transportationQuantity1, "    包装容量:", guard( lce.PackagingCapacity(), 0 ),
              "    入库单价:", guard( lcmrCC.WarehousingPrice(), 0 ) ); // 测试输出
    //    info( "时间:", dlerc.StartDate().Format( "Y-M2-D2" ), "    入库数量:", transportationQuantity1, "    包装容量:", guard( lce.PackagingCapacity(), 0 ),
    //          "    入库单价:", guard( lcmrCC.WarehousingPrice(), 0 ) ); // 测试输出
        cell.CCStorageFeesForRentedWarehouses( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity(), 0 ) * lcmrCC.WarehousingPrice() ) );
        
        // CC外租库出库费用:发动机销量 / 包装容量(向上取整)* 料架出库单价
@@ -96,14 +98,15 @@
        
        // CC长途运输费用:调拨数量 / 包装容量 / 装载容量 * 料架运输单价
        transportationQuantity2 := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, 
                                        tempPIT.Product_MP().Generation()                                                =  dlerr.Generation()      and
                                        tempPIT.Product_MP().MQBMLB()                                                    =  dlerr.MLB_MQB()         and
                                        tempPIT.Trip().Departure().Date()                                                >= dlerc.StartDate()       and
                                        tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth      and
                                        tempPIT.Product_MP().Generation()                                                =  dlerr.Generation()       and
                                        tempPIT.Product_MP().MQBMLB()                                                    =  dlerr.MLB_MQB()          and
                                        tempPIT.Trip().Departure().Date().Year()                                         = dlerc.StartDate().Year()  and
                                        tempPIT.Trip().Departure().Date().Month()                                        = dlerc.StartDate().Month() and
                                        tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "大连厂内库"              and
                                        tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "大连发动机的长春外租库",
                                        tempPIT.Quantity()
                                       );
    //    info( "数量:", transportationQuantity2 );
        cell.CCLineHaulCost( [Number] ( guard( transportationQuantity2 / lce.PackagingCapacity() / lct1.LoadingCapacity(), 0 ) * guard( lct1.TransportPrice(), 1 ) ) );
        
        // CC短途运输费用:调拨数量 / 包装容量 / 装载容量 * 料架运输单价
@@ -133,7 +136,14 @@
        cell.DLOutboundExpensesForRentedWarehouses( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.OutboundPrice(), 1 ) ) );
        
        // DL外租库运输费用:发动机运输量 / 包装容量 / 装载容量(向上取整)* 料架运输单价
        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( inventoryQuantity / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
        outboundQuantity1 := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), tempPISPIPPL,
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().Generation() = dlerr.Generation()  and
                                 tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().MQBMLB()     = dlerr.MLB_MQB()     and
                                 tempPISPIPPL.ProductInStockingPoint_MP().StockingPointID()         = "大连外租库"        and
                                 tempPISPIPPL.Start().Date()                                        >= dlerc.StartDate()  and
                                 tempPISPIPPL.End().Date()                                          <= lastDayOfThisMonth,
                                 tempPISPIPPL.NewSupplyQuantity() );
        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( outboundQuantity1 / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
        
        // 大连外租库仓储费用:【350bar MQB料架总数量-所有350bar MQB总库存/包装容量-客户库料架数量】*大连外租库空料架比例
        // DL外租库仓储费用:料架总数量 - 发动机库存 / 包装容量(向上取整)* 空料架仓储单价