|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // å¤ç§åºè¿è¾è´¹ç¨ï¼å卿ºè¿è¾é / å
è£
容é / è£
载容éï¼åä¸åæ´ï¼ * ææ¶è¿è¾åä»· | 
|---|
|  |  |  | transportationQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, | 
|---|
|  |  |  | tempPIT.Product_MP().Generation()                                                =  ccerr.Generation() and | 
|---|
|  |  |  | tempPIT.Product_MP().MQBMLB()                                                    =  ccerr.MLB_MQB()    and | 
|---|
|  |  |  | tempPIT.Trip().Departure().Date()                                                >= ccerc.StartDate()  and | 
|---|
|  |  |  | tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth and | 
|---|
|  |  |  | tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "CC åå
åº"         and | 
|---|
|  |  |  | tempPIT.Product_MP().Generation()                                                = ccerr.Generation()        and | 
|---|
|  |  |  | tempPIT.Product_MP().MQBMLB()                                                    = ccerr.MLB_MQB()           and | 
|---|
|  |  |  | tempPIT.Trip().Departure().Date().Year()                                         = ccerc.StartDate().Year()  and | 
|---|
|  |  |  | tempPIT.Trip().Departure().Date().Month()                                        = ccerc.StartDate().Month() and | 
|---|
|  |  |  | tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "CC åå
åº"               and | 
|---|
|  |  |  | tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "é¿æ¥å¤ç§åº", | 
|---|
|  |  |  | tempPIT.Quantity() | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | 
|---|
|  |  |  | 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å¤ç§åºåºåºè´¹ç¨ï¼å卿ºéé / å
è£
容éï¼åä¸åæ´ï¼* ææ¶åºåºåä»· | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 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çéè¿è¾è´¹ç¨ï¼è°æ¨æ°é / å
è£
容é / è£
载容é * ææ¶è¿è¾åä»· | 
|---|
|  |  |  | 
|---|
|  |  |  | 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å¤ç§åºä»å¨è´¹ç¨ï¼ææ¶æ»æ°é - å卿ºåºå / å
è£
容éï¼åä¸åæ´ï¼* ç©ºææ¶ä»å¨åä»· | 
|---|
|  |  |  | 
|---|
|  |  |  | allProductionLines := selectuniquevalues( newNOPT, NewOfflinePlanRow, tempNOPR, true, tempNOPR.ProductionLine() ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | traverse ( allProductionLines, Elements, pl | 
|---|
|  |  |  | //           , pl = "eMotor Assy (France)" | 
|---|
|  |  |  | //           , pl = "CC MoMo" | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | // ä¸çº¿è®¡åå½å产线ä¸çè¡ | 
|---|
|  |  |  | 
|---|
|  |  |  | preNOPCell := null( NewOfflinePlanCell ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | traverse ( newNOPT, NewOfflinePlanColumn, nopc | 
|---|
|  |  |  | //             , nopc.StartDate() >= macroPlan.StartOfPlanning().Date() and nopc.StartDate() <= Date::Construct( 2024, 4, 17 ) // æµè¯æ¶å¯ä»¥è¿æ»¤æ¶é´ | 
|---|
|  |  |  | //             , nopc.StartDate() >= macroPlan.StartOfPlanning().Date() and nopc.StartDate() <= Date::Construct( 2025, 1, 16 ) // æµè¯æ¶å¯ä»¥è¿æ»¤æ¶é´ | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | for ( i := 1; i < 10; i++ ) { | 
|---|
|  |  |  | nopcell := select( noprs, Elements.NewOfflinePlanCell, tempNOPC, tempNOPC.NewOfflinePlanColumn() = nopc and tempNOPC.OrderNr() = i ); | 
|---|
|  |  |  | nopcell := select( noprs, Elements.NewOfflinePlanCell, tempNOPC, tempNOPC.NewOfflinePlanColumn() = nopc and tempNOPC.OrderNr() = i and tempNOPC.Order() <> "" ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // æ¢åæå¤±åæ° | 
|---|
|  |  |  | cls     := select( macroPlan, ChangeLossSetting, tempCLS, | 
|---|
|  |  |  | tempCLS.ProductFirst().ID()  = guard( preNOPCell.NewOfflinePlanRow().ProductID(), "" ) and | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // æ£åæ¢åæå¤± | 
|---|
|  |  |  | if ( not isnull( preNOPCell ) and not isnull( nopcell ) and not isnull( cls ) ) { | 
|---|
|  |  |  | preNOPCell.Quantity( preNOPCell.Quantity() - cls.ChangeLossNumber() ); | 
|---|
|  |  |  | //        info( "å½å产ååºå·ï¼", nopcell.OrderNr(),  "    ", nopcell.Order(), "    ", i ); | 
|---|
|  |  |  | //        info( "å½ååæ¶é´ï¼", nopc.StartDate().Format( "Y-M2-D2" ), | 
|---|
|  |  |  | //              "    ä¸ä¸ä¸ªäº§åå½ååºå·ï¼", preNOPCell.Order(), "    ä¸ä¸ä¸ªäº§åæ°éï¼", preNOPCell.Quantity(), "    ä¸ä¸ä¸ªäº§ååï¼", preNOPCell.NewOfflinePlanRow().ProductID(), | 
|---|
|  |  |  | //              "    å½å产ååºå·ï¼"      , nopcell.Order()   , "    å½åäº§åæ°éï¼"     , nopcell.Quantity(), "    å½å产ååï¼"  , nopcell.NewOfflinePlanRow().ProductID() ); | 
|---|
|  |  |  | //              "    å½å产ååºå·ï¼"      , nopcell.Order()   , "    å½åäº§åæ°éï¼"     , nopcell.Quantity(), "    å½å产ååï¼"  , nopcell.NewOfflinePlanRow().ProductID(), | 
|---|
|  |  |  | //              "    éè¦æ£åçæ°éï¼", cls.ChangeLossNumber() ); | 
|---|
|  |  |  | preNOPCell.Quantity( preNOPCell.Quantity() - cls.ChangeLossNumber() ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è®¾ç½®ä¸ä¸ä¸ªç产ç产åCell | 
|---|
|  |  |  | 
|---|
|  |  |  | PackagingPlanCell::CalculationPackagingPlanProperties(); | 
|---|
|  |  |  | Transaction::Transaction().Propagate( relation( PackagingPlanCell, Next ) ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è®¾ç½®å
è£
&æå
-æ°é | 
|---|
|  |  |  | PackagingPlanCell::SetPackagingAndUnpackingValues( macroPlan ); | 
|---|
|  |  |  | // è®¾ç½®å
è£
&æå
-æ°éï¼å¤§è¿å·¥åï¼ | 
|---|
|  |  |  | PackagingPlanCell::SetPackagingAndUnpackingValuesDL( macroPlan ); | 
|---|
|  |  |  | // è®¾ç½®å
è£
&æå
-æ°éï¼é¿æ¥å·¥åï¼ | 
|---|
|  |  |  | PackagingPlanCell::SetPackagingAndUnpackingValuesCC( macroPlan ); | 
|---|
|  |  |  | //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 )*/ ) { | 
|---|
|  |  |  | //    // è®¾ç½®å
è£
æ°é | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | Quintiq file version 2.0 | 
|---|
|  |  |  | #parent: #root | 
|---|
|  |  |  | StaticMethod SetPackagingAndUnpackingValuesCC ( | 
|---|
|  |  |  | MacroPlan macroPlan | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | TextBody: | 
|---|
|  |  |  | [* | 
|---|
|  |  |  | traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "é¿æ¥å·¥å" /*and ppr.ProductID() = "06K103011CM"*/ ) { | 
|---|
|  |  |  | traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) { | 
|---|
|  |  |  | unpackagedQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, | 
|---|
|  |  |  | tempPIT.ProductID()          = ppcell.PackagingPlanRow().ProductID()                               and | 
|---|
|  |  |  | tempPIT.Trip().Departure().Date() = ppcell.StartDate()                                             and | 
|---|
|  |  |  | tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "å¤ç§åº" )      and | 
|---|
|  |  |  | tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "线边åº" ), | 
|---|
|  |  |  | tempPIT.Quantity() | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | ppcell.Unpacking( unpackagedQuantity ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | packagedQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, | 
|---|
|  |  |  | tempPIT.ProductID()          = ppcell.PackagingPlanRow().ProductID()                               and | 
|---|
|  |  |  | tempPIT.Trip().Departure().Date() = ppcell.StartDate()                                             and | 
|---|
|  |  |  | tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "线边åº" )      and | 
|---|
|  |  |  | tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "å¤ç§åº" ), | 
|---|
|  |  |  | tempPIT.Quantity() | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | ppcell.Package( packagedQuantity ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | *] | 
|---|
|  |  |  | } | 
|---|
| ÎļþÃû´Ó _Main/BL/Type_PackagingPlanCell/StaticMethod_SetPackagingAndUnpackingValues.qbl ÐÞ¸Ä | 
|  |  |  | 
|---|
|  |  |  | Quintiq file version 2.0 | 
|---|
|  |  |  | #parent: #root | 
|---|
|  |  |  | StaticMethod SetPackagingAndUnpackingValues ( | 
|---|
|  |  |  | StaticMethod SetPackagingAndUnpackingValuesDL ( | 
|---|
|  |  |  | MacroPlan macroPlan | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | plannedStartDate := macroPlan.StartOfPlanning().Date(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è®¾ç½®å
è£
å¼ï¼ç¬¦ålotsizeå䏿¥æå¤§å
è£
éï¼ | 
|---|
|  |  |  | traverse ( macroPlan, PackagingPlanRow, ppr/*, ppr.Factory() = "大è¿å·¥å" and ppr.ProductID() = "06K103011CM"*/ ) { | 
|---|
|  |  |  | traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "大è¿å·¥å" /*and ppr.ProductID() = "06K103011CM"*/ ) { | 
|---|
|  |  |  | traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) { | 
|---|
|  |  |  | // Product_MP | 
|---|
|  |  |  | pmp                     := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() ); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è®¾ç½®æå
å¼ï¼ç¬¦ålotsizeå䏿¥æå¤§å
è£
éï¼ | 
|---|
|  |  |  | traverse ( macroPlan, PackagingPlanRow, ppr/*, ppr.Factory() = "大è¿å·¥å" and ppr.ProductID() = "06K103011CM"*/ ) { | 
|---|
|  |  |  | traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "大è¿å·¥å" /*and ppr.ProductID() = "06K103011CM"*/ ) { | 
|---|
|  |  |  | traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) { | 
|---|
|  |  |  | // Product_MP | 
|---|
|  |  |  | pmp                     := select( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and tempPMP.ID() = ppr.ProductID() ); | 
|---|