| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateData ( |
| | | MacroPlan macroPlan, |
| | | String factory |
| | | MacroPlan macroPlan |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | 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() ); |
| | |
| | | // 设置æå
è´¹ç¨ï¼æå
é * æå
åä»·ï¼ |
| | | 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() ); |
| | |
| | | |
| | | // è®¾ç½®è°æ¨è´¹ç¨ï¼è°æ¨æ°é / å
è£
容é / è£
载容é * è¿è¾åä»·ï¼ |
| | | 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 ); |
| | | } |