| 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 ); | 
|       } | 
|     } | 
|   *] | 
| } |