| | |
| | | product := selectobject( owner, Product_MP, product, product.ID() = tprow.ProductID() ); |
| | | productparents := product.GetAllParent(); |
| | | if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//æ¥è¯¢äº§åç±»åæ¯å卿º |
| | | //æ¥è¯¢å¯¹åºçå卿ºææ¬ |
| | | enginecost := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation() |
| | | and engine.MLB_MQB() = product.MQBMLB() |
| | | and engine.Factory() = ccunit |
| | | and exists( productparents, Elements, e, e.ID() = engine.Product() ) ); |
| | | //å¨è¿è¾ææ¬åæ°è¡¨éæ¾å°å卿ºå¯¹åºè¿è¾åä»·åè£
载容é |
| | | transcost := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = dlline |
| | | and trans.Destination() = dlrent |
| | | and exists( productparents, Elements, e, e.ID() = trans.Product() ) ); |
| | | if( not isnull( enginecost ) and not isnull( transcost ) ){ |
| | | row := table.GetRow( product.ID() ); |
| | | products.Add( product ); |
| | | traverse( tprow,TransferPlanCell, tpcell ){ |
| | | periodtime := tpcell.TransferPlanColumn().ColumnDate().StartOfMonth(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | column := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime ); |
| | | |
| | | cost := ceil( ceil( [Number]tpcell.Value() / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice(); |
| | | cell := selectobject( row, Cell, cell, cell.Column() = column ); |
| | | cell.CCLongTransCoat( cell.CCLongTransCoat() + cost ); |
| | | } |
| | | } |
| | | //èµ·å§åºåç¹æ¯å¦æ¯å¤§è¿ |
| | | originsp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.SourceStockpoingPointID() ); |
| | | isdl := table.IsInUnit( originsp, dlunit ); |
| | | //ç®çå°åºåç¹æ¯å¦æ¯é¿æ¥ |
| | | destisp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.TargetStockpoingPointID() ); |
| | | iscc := table.IsInUnit( destisp, ccunit ); |
| | | if( isdl and iscc ){ |
| | | //æ¥è¯¢å¯¹åºçå卿ºææ¬ |
| | | enginecost := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation() |
| | | and engine.MLB_MQB() = product.MQBMLB() |
| | | and engine.Factory() = ccunit |
| | | and exists( productparents, Elements, e, e.ID() = engine.Product() ) ); |
| | | //å¨è¿è¾ææ¬åæ°è¡¨éæ¾å°å卿ºå¯¹åºè¿è¾åä»·åè£
载容é |
| | | transcost := selectobject( owner, LogisticsCostTransport, trans, trans.Origin() = dlline |
| | | and trans.Destination() = dlrent |
| | | and exists( productparents, Elements, e, e.ID() = trans.Product() ) ); |
| | | if( not isnull( enginecost ) and not isnull( transcost ) ){ |
| | | row := table.GetRow( product.ID() ); |
| | | products.Add( product ); |
| | | traverse( tprow,TransferPlanCell, tpcell ){ |
| | | periodtime := tpcell.TransferPlanColumn().ColumnDate().StartOfMonth(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | column := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime ); |
| | | |
| | | cost := ceil( ceil( [Number]tpcell.Value() / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice(); |
| | | cell := selectobject( row, Cell, cell, cell.Column() = column ); |
| | | cell.CCLongTransCoat( cell.CCLongTransCoat() + cost ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //é¿æ¥çéè¿è¾è´¹ç¨ï¼å®¢æ·éæ±æ°é/å
è£
容é/è£
载容é*è¿è¾åä»·ï¼å®¢æ·éæ±æ°éåèªforecastésales segmentä¸ºé¿æ¥çæ°éæ±æ»ï¼åç¨å
¬å¼è®¡ç®ï¼æåº¦è¿è¡æ±æ»ï¼å客æ·éæ±æ°éæ¢ç®æè½¦æ¬¡ï¼ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method SetCellTransferValue ( |
| | | MachiningPipelineColumn column, |
| | | Boolean iscc, |
| | | Real quantity |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | cell := selectobject( this, Cell, cell, cell.Column() = column ); |
| | | |
| | | if( iscc ){ |
| | | cell.CCTransferQty( cell.CCTransferQty() + quantity ); |
| | | } else { |
| | | cell.DLTransferQty( cell.DLTransferQty() + quantity ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | if( iscc or isdl ){ |
| | | row.SetCellInventoryValue( daycolumn, iscc, [Real]inventoryquantity ); |
| | | if( weekcolumn.EndDate() = pispip.Start().Date() or pispip.Period_MP() = endperiod ){ |
| | | // if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){ |
| | | // weekstart := ( weekstart + Duration::Days( 7 ) ).Date(); |
| | | row.SetCellInventoryValue( weekcolumn, iscc, [Real]inventoryquantity ); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //çæè°æ¨æ°æ® |
| | | traverse( owner, TransferPlanRow, tprow, ( tprow.SourceStockpoingPointID() = 'CC' and tprow.TargetStockpoingPointID() = 'DL' ) or ( tprow.SourceStockpoingPointID() = 'DL' and tprow.TargetStockpoingPointID() = 'CC' ) ){ |
| | | row := selectobject( table, Row, row, row.Name() = tprow.Name() ); |
| | | traverse( table, Column, column ){ |
| | | cell := selectobject( row, Cell, cell, cell.Column() = column ); |
| | | if( column.TimeUnit() = Translations::MP_GlobalParameters_Day() ){ |
| | | tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = column.StartDate() ); |
| | | if( tprow.SourceStockpoingPointID() = 'CC' and tprow.TargetStockpoingPointID() = 'DL' ){ |
| | | cell.CCTransferQty( [Real]tpcell.Value() ); |
| | | }else if( tprow.SourceStockpoingPointID() = 'DL' and tprow.TargetStockpoingPointID() = 'CC' ){ |
| | | cell.DLTransferQty( [Real]tpcell.Value() ); |
| | | } |
| | | }else if( column.TimeUnit() = Translations::MP_GlobalParameters_Week() ){ |
| | | period := column.StartDate() + Duration::Days( 6 ); |
| | | tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = period.Date() ); |
| | | |
| | | if( tprow.SourceStockpoingPointID() = 'CC' and tprow.TargetStockpoingPointID() = 'DL' ){ |
| | | cell.CCTransferQty( [Real]tpcell.Value() ); |
| | | }else if( tprow.SourceStockpoingPointID() = 'DL' and tprow.TargetStockpoingPointID() = 'CC' ){ |
| | | cell.DLTransferQty( [Real]tpcell.Value() ); |
| | | traverse( owner, TransferPlanRow, tprow ){ |
| | | product := selectobject( owner, Product_MP, product, product.ID() = tprow.ProductID() ); |
| | | productparents := product.GetAllParent(); |
| | | if( exists( productparents, Elements, e, e.ID() = productparent ) ){//æ¥è¯¢äº§åç±»åæ¯å卿º |
| | | //èµ·å§åºåç¹æ¯å¦æ¯å¤§è¿oré¿æ¥ |
| | | originsp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.SourceStockpoingPointID() ); |
| | | originunit := originsp.Unit(); |
| | | originparentunits := originunit.GetAllParent(); |
| | | originiscc := originsp.ID() = ccunit or originunit.ID() = ccunit or exists( originparentunits, Elements, punit, punit.ID() = ccunit ); |
| | | originisdl := originsp.ID() = dlunit or originunit.ID() = dlunit or exists( originparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | //ç®çå°æ¯å¦æ¯é¿æ¥å¤ç§åº |
| | | destisp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.TargetStockpoingPointID() ); |
| | | destiunit := originsp.Unit(); |
| | | destiparentunits := destiunit.GetAllParent(); |
| | | destiiscc := destisp.ID() = ccunit or destiunit.ID() = ccunit or exists( destiparentunits, Elements, punit, punit.ID() = ccunit ); |
| | | destiisdl := destisp.ID() = dlunit or destiunit.ID() = dlunit or exists( destiparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | if( ( originiscc and destiisdl ) or ( originisdl and destiiscc ) ){ |
| | | row := selectobject( table, Row, row, row.Name() = tprow.Name() ); |
| | | traverse( tprow, TransferPlanCell, tpcell ){ |
| | | //天 |
| | | daycolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), tpcell.TransferPlanColumn().ColumnDate() ); |
| | | //å¨ |
| | | weekcolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), tpcell.TransferPlanColumn().ColumnDate() ); |
| | | quantity := [Real]tpcell.Value();//åèäºå
¥ |
| | | |
| | | row.SetCellTransferValue( daycolumn, ( originiscc and destiisdl ), quantity ); |
| | | row.SetCellTransferValue( weekcolumn, ( originiscc and destiisdl ), quantity ); |
| | | } |
| | | } |
| | | } |