| | |
| | | macroPlan.MachineLogisticsCostReportRow( relflush ); |
| | | macroPlan.MachineLogisticsCostReportColumn( relflush ); |
| | | |
| | | // åå§åä¸å¹´æ°æ®å |
| | | // åå»ºè¡ |
| | | categories := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf() and |
| | | exists( tempPMP, AllParent.AsParent, tempPMP1, tempPMP1.ID() = "æºå ä»¶" ), |
| | | tempPMP.ParentID() ); |
| | | traverse ( categories, Elements, c ) { |
| | | macroPlan.MachineLogisticsCostReportRow( relnew, Factory := "大è¿å·¥å", Category := c ); |
| | | macroPlan.MachineLogisticsCostReportRow( relnew, Factory := "é¿æ¥å·¥å", Category := c ); |
| | | } |
| | | |
| | | // å建å |
| | | indexDate := macroPlan.StartOfPlanning().Date().StartOfMonth(); |
| | | for ( i := 0; i < 12; i++ ) { |
| | | macroPlan.MachineLogisticsCostReportColumn( relnew, StartDate := indexDate ); |
| | | indexDate := indexDate.StartOfNextMonth(); |
| | | } |
| | | |
| | | // æ¾åºææå¤§ç±»ï¼åå»ºæ°æ® |
| | | categories := selectuniquevalues( macroPlan, PackagingPlanRow, tempPPR, true, tempPPR.Category() ); |
| | | |
| | | traverse ( categories, Elements, c ) { |
| | | // å建åå
æ ¼ |
| | | traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr ) { // 循ç¯è¡ |
| | | info( "å½åéåçè¡ï¼", mlcrr.Factory(), " ", mlcrr.Category() ); |
| | | traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) { // 循ç¯å |
| | | |
| | | // æºå ææ¬åæ° |
| | | lcm := select( macroPlan, LogisticsCostMachining, tempLCM, tempLCM.Factory() = factory and tempLCM.Product() = c ); |
| | | |
| | | // è¿è¾ææ¬åæ° |
| | | lct := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Origin() = ifexpr( factory = "大è¿å·¥å", "CC", "DL" ) and |
| | | tempLCT.Destination() = ifexpr( factory = "大è¿å·¥å", "DL", "CC" ) and |
| | | tempLCT.Product() = c ); |
| | | |
| | | // åå§åæºå ææ¬åæ°æ¥è¡¨è¡ |
| | | mlcrr := macroPlan.MachineLogisticsCostReportRow( relnew, Category := c, Factory := factory ); |
| | | |
| | | // å¾ªç¯æææ¶é´ååå»ºæ°æ® |
| | | traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) { |
| | | cell := mlcrr.MachineLogisticsCostReportCell( relnew ); |
| | | // æºå ææ¬åæ° |
| | | lcm := select( macroPlan, LogisticsCostMachining, tempLCM, tempLCM.Factory() = mlcrr.Factory() and tempLCM.Product() = mlcrr.Category() |
| | | and tempLCM.StartDate() <= mlcrc.StartDate() and tempLCM.EndDate() >= mlcrc.StartDate().StartOfNextMonth() ); |
| | | |
| | | // è¿è¾ææ¬åæ° |
| | | |
| | | // å½åææ«æåä¸å¤©æ¥æ |
| | | lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1; |
| | | |
| | | cell := mlcrr.MachineLogisticsCostReportCell( relnew ); |
| | | |
| | | // 设置å
è£
è´¹ç¨ï¼å
è£
é * å
è£
åä»·ï¼ |
| | | packageQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, |
| | | tempPPC.PackagingPlanRow().Category() = c and |
| | | tempPPC.PackagingPlanRow().Category() = mlcrr.Category() and |
| | | tempPPC.PackagingPlanRow().Factory() = factory and |
| | | tempPPC.PackagingPlanColumn().StartDate().Year() = mlcrc.StartDate().Year() and |
| | | tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(), |
| | | tempPPC.Package() ); |
| | | // cell.PackingCharges( packageQuantity * guard( lcm.PackagePrice(), 1 ) ); |
| | | |
| | | cell.PackingCharges( packageQuantity * guard( lcm.PackagePrice(), 1 ) ); |
| | | |
| | | // 设置æå
è´¹ç¨ï¼æå
é * æå
åä»·ï¼ |
| | | unpackingQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC, |
| | | tempPPC.PackagingPlanRow().Category() = c and |
| | | tempPPC.PackagingPlanRow().Category() = mlcrr.Category() and |
| | | tempPPC.PackagingPlanRow().Factory() = factory and |
| | | tempPPC.PackagingPlanColumn().StartDate().Year() = mlcrc.StartDate().Year() and |
| | | tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(), |
| | | tempPPC.Unpacking() ); |
| | | // cell.UnpackingCost( unpackingQuantity * guard( lcm.UnpackingPrice(), 1 ) ); |
| | | |
| | | cell.UnpackingCost( unpackingQuantity * guard( lcm.UnpackingPrice(), 1 ) ); |
| | | |
| | | // 设置ç¼å²çº¸è´¹ç¨ï¼å
è£
ç±» * ç¼å²çº¸åä»·ï¼ |
| | | // cell.BufferPaperCost( packageQuantity * guard( lcm.BufferPaperPrice(), 1 ) ); |
| | | |
| | | // 设置æ¨ç®±åä»· |
| | | // cell.UnitPriceOfWoodenCrate( guard( lcm.WoodenCratePrice(), 1 ) ); |
| | | |
| | | cell.BufferPaperCost( packageQuantity * guard( lcm.BufferPaperPrice(), 1 ) ); |
| | | |
| | | // 设置æ¨ç®±åä»· |
| | | cell.WoodenCratePriceReal( guard( lcm.WoodenCratePrice(), 1 ) ); |
| | | |
| | | // è®¾ç½®è°æ¨è´¹ç¨ï¼è°æ¨æ°é / å
è£
容é / è£
载容é * è¿è¾åä»·ï¼ |
| | | transferQuantity := sum( macroPlan, TransferPlanRow.TransferPlanCell, tempTPC, |
| | | tempTPC.TransferPlanRow().Category() = c and |
| | | 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(), |
| | | [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 ) ); |
| | | |
| | | // å¤ç§åºè¿è¾è´¹ç¨ï¼è¿è¾æ°é / å
è£
容é / è£
载容é * è¿è¾åä»·ï¼ |
| | | |
| | | cell.MachineLogisticsCostReportColumn( relset, mlcrc ); |