Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute EndDate |
| | | { |
| | | #keys: '3[415136.0.1304620060][415136.0.1304620059][415136.0.1304620061]' |
| | | ValueType: Date |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method CalcEngineCost ( |
| | | ProductInStockingPointInPeriods pispips, |
| | | LogisticsCostEngines enginecosts |
| | | ) as Real |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Nov-14-2024 (created) |
| | | cost := 0.0; |
| | | enginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() <= this.StartDate() and engine.EndDate() >= this.EndDate() ); |
| | | if( isnull( enginecost ) ){ |
| | | fenginecost := selectobject( enginecosts, Elements, engine, engine.EndDate() > this.StartDate() and engine.EndDate() <= this.EndDate() and engine.StartDate() < this.StartDate() ); |
| | | if( not isnull( fenginecost ) ){ |
| | | pinvqty := sum( pispips, Elements, pispip, pispip.Start().Date() >= fenginecost.StartDate() and pispip.Start().Date() <= fenginecost.EndDate(), pispip.PlannedInventoryLevelEnd() ); |
| | | cost := cost + ceil( pinvqty / fenginecost.PackagingCapacity() ) * fenginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | menginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() > this.StartDate() and engine.EndDate() < this.EndDate() ); |
| | | if( not isnull( menginecost ) ){ |
| | | pinvqty := sum( pispips, Elements, pispip, pispip.Start().Date() >= menginecost.StartDate() and pispip.Start().Date() <= menginecost.EndDate(), pispip.PlannedInventoryLevelEnd() ); |
| | | cost := cost + ceil( pinvqty / menginecost.PackagingCapacity() ) * menginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | benginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() > this.StartDate() and engine.StartDate() <= this.EndDate() and engine.EndDate() > this.EndDate() ); |
| | | if( not isnull( benginecost ) ){ |
| | | pinvqty := sum( pispips, Elements, pispip, pispip.Start().Date() >= benginecost.StartDate() and pispip.Start().Date() <= benginecost.EndDate(), pispip.PlannedInventoryLevelEnd() ); |
| | | cost := cost + ceil( pinvqty / benginecost.PackagingCapacity() ) * benginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | }else{ |
| | | pinvqty := sum( pispips, Elements, pispip, pispip.PlannedInventoryLevelEnd() ); |
| | | cost := cost + ceil( pinvqty / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | return cost; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute EndDate |
| | | { |
| | | #keys: '3[415136.0.1304630050][415136.0.1304630049][415136.0.1304630051]' |
| | | ValueType: Date |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method CalcEngineCost ( |
| | | ProductInStockingPointInPeriods pispips, |
| | | LogisticsCostEngines enginecosts, |
| | | LogisticsCostTransports transcosts, |
| | | String factory, |
| | | output Real entercost, |
| | | output Real othercost, |
| | | output Real outcost, |
| | | output Real storecost, |
| | | output Real transcost |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Nov-14-2024 (created) |
| | | enginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() <= this.StartDate() and engine.EndDate() >= this.EndDate() and engine.Factory() = factory ); |
| | | if( isnull( enginecost ) ){ |
| | | fenginecost := selectobject( enginecosts, Elements, engine, engine.EndDate() > this.StartDate() and engine.EndDate() <= this.EndDate() and engine.StartDate() < this.StartDate() and engine.Factory() = factory ); |
| | | if( not isnull( fenginecost ) ){ |
| | | fpispips := selectset( pispips, Elements, pispip, pispip.Start().Date() >= fenginecost.StartDate() and pispip.Start().Date() <= fenginecost.EndDate() ); |
| | | if( entercost.IsMaxInfinity() ){ |
| | | newsqty := sum( fpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | entercost := entercost + ceil( newsqty / fenginecost.PackagingCapacity() ) * fenginecost.WarehousingPrice(); |
| | | } |
| | | if( othercost.IsMaxInfinity() ){ |
| | | newsqty := sum( fpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | othercost := othercost + ceil( newsqty / fenginecost.PackagingCapacity() ) * fenginecost.OtherPrice(); |
| | | } |
| | | if( outcost.IsMaxInfinity() ){ |
| | | newsqty := sum( fpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | outcost := outcost + ceil( newsqty / fenginecost.PackagingCapacity() ) * fenginecost.OutboundPrice(); |
| | | } |
| | | if( storecost.IsMaxInfinity() ){ |
| | | pinvqty := sum( fpispips, Elements, e, e.PlannedInventoryLevelEnd() ); |
| | | storecost := storecost + ceil( pinvqty / fenginecost.PackagingCapacity() ) * fenginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | if( transcost.IsMaxInfinity() ){ |
| | | this.CalcTransCost( fpispips, transcosts, fenginecost, transcost ); |
| | | } |
| | | } |
| | | menginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() > this.StartDate() and engine.EndDate() < this.EndDate() and engine.Factory() = factory ); |
| | | if( not isnull( menginecost ) ){ |
| | | mpispips := selectset( pispips, Elements, pispip, pispip.Start().Date() >= menginecost.StartDate() and pispip.Start().Date() <= menginecost.EndDate() ); |
| | | if( entercost.IsMaxInfinity() ){ |
| | | newsqty := sum( mpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | entercost := entercost + ceil( newsqty / menginecost.PackagingCapacity() ) * menginecost.WarehousingPrice(); |
| | | } |
| | | if( othercost.IsMaxInfinity() ){ |
| | | newsqty := sum( mpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | othercost := othercost + ceil( newsqty / menginecost.PackagingCapacity() ) * menginecost.OtherPrice(); |
| | | } |
| | | if( outcost.IsMaxInfinity() ){ |
| | | newsqty := sum( mpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | outcost := outcost + ceil( newsqty / menginecost.PackagingCapacity() ) * menginecost.OutboundPrice(); |
| | | } |
| | | if( storecost.IsMaxInfinity() ){ |
| | | pinvqty := sum( mpispips, Elements, e, e.PlannedInventoryLevelEnd() ); |
| | | storecost := storecost + ceil( pinvqty / menginecost.PackagingCapacity() ) * menginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | if( transcost.IsMaxInfinity() ){ |
| | | this.CalcTransCost( mpispips, transcosts, menginecost, transcost ); |
| | | } |
| | | } |
| | | benginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() > this.StartDate() and engine.StartDate() <= this.EndDate() and engine.EndDate() > this.EndDate() and engine.Factory() = factory ); |
| | | if( not isnull( benginecost ) ){ |
| | | bpispips := selectset( pispips, Elements, pispip, pispip.Start().Date() >= benginecost.StartDate() and pispip.Start().Date() <= benginecost.EndDate() ) |
| | | if( entercost.IsMaxInfinity() ){ |
| | | newsqty := sum( bpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | entercost := entercost + ceil( newsqty / benginecost.PackagingCapacity() ) * benginecost.WarehousingPrice(); |
| | | } |
| | | if( othercost.IsMaxInfinity() ){ |
| | | newsqty := sum( bpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | othercost := othercost + ceil( newsqty / benginecost.PackagingCapacity() ) * benginecost.OtherPrice(); |
| | | } |
| | | if( outcost.IsMaxInfinity() ){ |
| | | newsqty := sum( bpispips, Elements, e, e.NewSupplyQuantity() ); |
| | | outcost := outcost + ceil( newsqty / benginecost.PackagingCapacity() ) * benginecost.OutboundPrice(); |
| | | } |
| | | if( storecost.IsMaxInfinity() ){ |
| | | pinvqty := sum( bpispips, Elements, e, e.PlannedInventoryLevelEnd() ); |
| | | storecost := storecost + ceil( pinvqty / benginecost.PackagingCapacity() ) * benginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | if( transcost.IsMaxInfinity() ){ |
| | | this.CalcTransCost( bpispips, transcosts, benginecost, transcost ); |
| | | } |
| | | } |
| | | }else{ |
| | | if( entercost.IsMaxInfinity() ){ |
| | | newsqty := sum( pispips, Elements, pispip, pispip.NewSupplyQuantity() ); |
| | | entercost := entercost + ceil( newsqty / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice(); |
| | | } |
| | | if( othercost.IsMaxInfinity() ){ |
| | | newsqty := sum( pispips, Elements, pispip, pispip.NewSupplyQuantity() ); |
| | | othercost := othercost + ceil( newsqty / enginecost.PackagingCapacity() ) * enginecost.OtherPrice(); |
| | | } |
| | | if( outcost.IsMaxInfinity() ){ |
| | | newsqty := sum( pispips, Elements, pispip, pispip.NewSupplyQuantity() ); |
| | | outcost := outcost + ceil( newsqty / enginecost.PackagingCapacity() ) * enginecost.OutboundPrice(); |
| | | } |
| | | if( storecost.IsMaxInfinity() ){ |
| | | pinvqty := sum( pispips, Elements, pispip, pispip.PlannedInventoryLevelEnd() ); |
| | | storecost := storecost + ceil( pinvqty / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//åèäºå
¥ |
| | | } |
| | | if( transcost.IsMaxInfinity() ){ |
| | | this.CalcTransCost( pispips, transcosts, enginecost, transcost ); |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method CalcTransCost ( |
| | | ProductInStockingPointInPeriods pispips, |
| | | LogisticsCostTransports transcosts, |
| | | LogisticsCostEngine enginecost, |
| | | output Real transcost |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Nov-14-2024 (created) |
| | | tran := selectobject( transcosts, Elements, trans, trans.StartDate() <= this.StartDate() and trans.EndDate() >= this.StartDate() ); |
| | | if( isnull( tran ) ){ |
| | | ftranscost := selectobject( transcosts, Elements, trans, trans.EndDate() > this.StartDate() and this.EndDate() <= this.EndDate() and trans.StartDate() < this.StartDate() ); |
| | | if( not isnull( ftranscost ) ){ |
| | | newsqty := sum( pispips, Elements, pispip, pispip.Start().Date() >= ftranscost.StartDate() and pispip.Start().Date() <= ftranscost.EndDate(), pispip.NewSupplyQuantity() ); |
| | | transcost := transcost + ceil( ceil( newsqty / enginecost.PackagingCapacity() ) / ftranscost.LoadingCapacity() ) * ftranscost.TransportPrice(); |
| | | } |
| | | mtranscost := selectobject( transcosts, Elements, trans, trans.StartDate() > this.StartDate() and trans.EndDate() < this.EndDate() ); |
| | | if( not isnull( mtranscost ) ){ |
| | | newsqty := sum( pispips, Elements, pispip, pispip.Start().Date() >= mtranscost.StartDate() and pispip.Start().Date() <= mtranscost.EndDate(), pispip.NewSupplyQuantity() ); |
| | | transcost := transcost + ceil( ceil( newsqty / enginecost.PackagingCapacity() ) / mtranscost.LoadingCapacity() ) * mtranscost.TransportPrice(); |
| | | } |
| | | btranscost := selectobject( transcosts, Elements, trans, trans.StartDate() > this.StartDate() and trans.StartDate() <= this.EndDate() and trans.EndDate() > this.EndDate() ); |
| | | if( not isnull( btranscost ) ){ |
| | | newsqty := sum( pispips, Elements, pispip, pispip.Start().Date() >= btranscost.StartDate() and pispip.Start().Date() <= btranscost.EndDate(), pispip.NewSupplyQuantity() ); |
| | | transcost := transcost + ceil( ceil( newsqty / enginecost.PackagingCapacity() ) / btranscost.LoadingCapacity() ) * btranscost.TransportPrice(); |
| | | } |
| | | }else{ |
| | | newsqty := sum( pispips, Elements, pispip, pispip.NewSupplyQuantity() ); |
| | | transcost := transcost + ceil( ceil( newsqty / enginecost.PackagingCapacity() ) / tran.LoadingCapacity() ) * tran.TransportPrice(); |
| | | } |
| | | *] |
| | | } |
| | |
| | | //æ¾ç¤ºæåå
æ ¼ |
| | | showcell := showrow.Cell( relnew, RentInCost := cell.RentInCost(), RentOutOfCost := cell.RentOutOfCost(), WerkToRentTransCost := cell.WerkToRentTransCost(), RentStorCost := cell.RentStorCost(), CoefficientValue := cell.CoefficientValue(), AllCost := cell.EstimateTotalCost() * [Real]cell.CoefficientValue() ); |
| | | column.Cell( relinsert, showcell ); |
| | | showcell.EstimateTotalCost( showcell.CalcEstimateTotalCost() ); |
| | | showcell.AllCost( showcell.EstimateTotalCost() * [Real]showcell.CoefficientValue() ); |
| | | //æ¾ç¤ºå¹´åå
æ ¼ |
| | | yearcell.RentInCost( cell.RentInCost() + yearcell.RentInCost() ); |
| | | yearcell.RentOutOfCost( cell.RentOutOfCost() + yearcell.RentOutOfCost() ); |
| | |
| | | cell.IsRentStorCostUpdate( exists( cell.Column(), Cell, acell, acell.IsRentStorCostUpdate() ) ); |
| | | cell.IsWerkToRentTransCostUpdate( exists( cell.Column(), Cell, acell, acell.IsWerkToRentTransCostUpdate() ) ); |
| | | } |
| | | rows := selectsortedset( this, Row, row, row.Name() ); |
| | | i := 0; |
| | | traverse( rows, Elements, e ){ |
| | | e.RowNr( i ); |
| | | i := i + 1; |
| | | } |
| | | *] |
| | | } |
| | |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | this.Column( relnew, Name := periodname, StartDate := periodtime ); |
| | | this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date() ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Aug-12-2024 (created) |
| | | owner.CCEngineLogisticsCostReport( relflush ); |
| | | //owner.CCEngineLogisticsCostReport( relflush ); |
| | | produtparent := CCEngineLogisticsCostReport::GetDefaultProductParent(); |
| | | name := CCEngineLogisticsCostReport::GetDefaultName(); |
| | | allunit := CCEngineLogisticsCostReport::GetDefaultAllUnit(); |
| | |
| | | //startofyear := startofplanning.StartOfYear(); |
| | | startofnextyear := startofplanning.StartOfNextYear(); |
| | | |
| | | table := owner.CCEngineLogisticsCostReport( relnew, ID := name, Name := name ); |
| | | owner.CCEngineLogisticsCostReport( relnew, ID := name + 'Show', Name := name, IsShow := true ); |
| | | table := selectobject(owner, CCEngineLogisticsCostReport, report, report.ID() = name ); |
| | | if( isnull( table ) ){ |
| | | owner.CCEngineLogisticsCostReport( relnew, ID := name, Name := name ); |
| | | } |
| | | showname := name + 'Show'; |
| | | if( exists( owner, CCEngineLogisticsCostReport, report, report.ID() = showname and report.IsShow() ) ){ |
| | | owner.CCEngineLogisticsCostReport( relnew, ID := showname, Name := name, IsShow := true ); |
| | | } |
| | | if( isnull( owner.CCEngineLogisticsCostSearch() ) ){ |
| | | owner.CCEngineLogisticsCostSearch( relnew, Generation := allunit, MqbMlb := allunit, Power := allunit ); |
| | | } |
| | | |
| | | products := construct( Product_MPs ); |
| | | |
| | |
| | | if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){ |
| | | row := table.GetRow( pisp.ProductID() ); |
| | | products.Add( product ); |
| | | //å½product planningçæ¥æåºé´å¨éè¦çæ¥æåºé´å
|
| | | // traverse( table, Column, column ){ |
| | | // pispips := selectset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.PlannedInventoryLevelEnd() <> 0 |
| | | // and pispip.Start().Date() < column.StartDate().StartOfNextMonth() and pispip.Start().Date() >= column.StartDate() ); |
| | | traverse( table, Column, column ){ |
| | | |
| | | traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.PlannedInventoryLevelEnd() <> 0 ){ |
| | | enginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date() ); |
| | | if( not isnull( enginecost ) ){ |
| | | periodtime := pispip.Start().StartOfMonth().Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | quantity := ceil( pispip.PlannedInventoryLevelEnd() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//åèäºå
¥ |
| | | |
| | | column := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime ); |
| | | |
| | | row.SetRentStorageCost( column, quantity ); |
| | | pispips := selectset( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start().Date() >= column.StartDate() |
| | | and pispip.Start().Date() < column.StartDate().StartOfNextMonth() |
| | | and pispip.PlannedInventoryLevelEnd() <> 0 ); |
| | | cost := column.CalcEngineCost( pispips, enginecosts ); |
| | | row.SetRentStorageCost( column, cost ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //rows := selectsortedset( table, Row, row, row.Name() ); |
| | | //i := 0; |
| | | //traverse( rows, Elements, e ){ |
| | | // e.RowNr( i ); |
| | | // i := i + 1; |
| | | //} |
| | | // |
| | | //showtable.Generate( search, products ); |
| | | *] |
| | | } |
| | |
| | | , CoefficientValue := cell.CoefficientValue() |
| | | , AllCost := cell.EstimateTotalCost() * [Real]cell.CoefficientValue() ); |
| | | column.Cell( relinsert, showcell ); |
| | | showcell.EstimateTotalCost( showcell.CalcEstimateTotalCost() ); |
| | | showcell.AllCost( showcell.EstimateTotalCost() * [Real]showcell.CoefficientValue() ); |
| | | //æ¾ç¤ºå¹´åå
æ ¼ |
| | | yearcell.CCRentInCost( cell.CCRentInCost() + yearcell.CCRentInCost() ); |
| | | yearcell.CCRentOutOfCost( cell.CCRentOutOfCost() + yearcell.CCRentOutOfCost() ); |
| | |
| | | cell.IsEstimateTotalCostUpdate( exists( cell.Column(), Cell, acell, acell.IsEstimateTotalCostUpdate() ) ); |
| | | cell.IsWerkToDLRentTransCostUpdate( exists( cell.Column(), Cell, acell, acell.IsWerkToDLRentTransCostUpdate() ) ); |
| | | } |
| | | rows := selectsortedset( this, Row, row, row.Name() ); |
| | | i := 0; |
| | | traverse( rows, Elements, e ){ |
| | | e.RowNr( i ); |
| | | i := i + 1; |
| | | } |
| | | info( '-------------------------g------------end---------------------------------' ); |
| | | *] |
| | | } |
| | |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | this.Column( relnew, Name := periodname, StartDate := periodtime ); |
| | | this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Initialize ( |
| | | MacroPlan owner |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Aug-12-2024 (created) |
| | | owner.DLEngineLogisticsCostReport( relflush ); |
| | | produtparent := DLEngineLogisticsCostReport::GetDefaultProductParent(); |
| | | name := DLEngineLogisticsCostReport::GetDefaultName(); |
| | | allunit := DLEngineLogisticsCostReport::GetDefaultAllUnit(); |
| | | ccfactory := DLEngineLogisticsCostReport::GetCCFactory(); |
| | | dlfactory := DLEngineLogisticsCostReport::GetDLFactory(); |
| | | |
| | | startofplanning := owner.StartOfPlanning().Date(); |
| | | startofnextyear := startofplanning.StartOfNextYear(); |
| | | |
| | | table := owner.DLEngineLogisticsCostReport( relnew, ID := name, Name := name ); |
| | | owner.DLEngineLogisticsCostReport( relnew, ID := name + 'Show', Name := name, IsShow := true ); |
| | | owner.DLEngineLogisticsCostSearch( relnew, Generation := allunit, MqbMlb := allunit, Power := allunit ); |
| | | |
| | | products := construct( Product_MPs ); |
| | | |
| | | table.GenerateColumn( owner ); |
| | | //å¤ç§åºä»å¨è´¹ç¨ï¼ä»å¨æ°é/å
è£
容é*ä»å¨åä»·ï¼å¨Actual inventorieséåå°é¿æ¥å¤ç§åº/大è¿å¤ç§åºè¯¥å卿ºçä»å¨éï¼æ ¹æ®å卿ºå·æ¾å°å¯¹åºçGeneration 忍ªçºµå¶ï¼å¨å卿ºææ¬åæ°è¡¨éæ¾å°å¯¹åºçä»å¨åä»·åå
è£
容éï¼ç¨å
¬å¼è®¡ç®ï¼æåº¦è¿è¡æ±æ» |
| | | //é¿æ¥å¤ç§åºå
¥åº/åºåºè´¹ç¨ï¼å¤§è¿å卿ºçé¿æ¥å¤ç§åºçNew supply |
| | | traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID().EndsWith( 'å¤ç§åº' ) ){ |
| | | isdltoccrent := stockingpoint.ID().StartsWith( '大è¿å卿ºçé¿æ¥' ); |
| | | isdlrent := not isdltoccrent and stockingpoint.ID().StartsWith( '大è¿' ) or stockingpoint.ID().StartsWith( 'DL' ); |
| | | if( isdlrent or isdltoccrent){ |
| | | traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() |
| | | and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ) ) ){ |
| | | //è·åè¡ |
| | | product := pisp.Product_MP(); |
| | | productparents := product.GetAllParent(); |
| | | if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//æ¥è¯¢äº§åç±»åæ¯å卿º |
| | | row := table.GetRow( pisp.ProductID() ); |
| | | enginecosts := selectset( owner, LogisticsCostEngine, engine, engine.PackagingCapacity() <> 0 and engine.Generation().ToLower() = product.Generation().ToLower() and engine.MLB_MQB() = product.MQBMLB() ); |
| | | transcosts := selectset( owner, LogisticsCostTransport, trans, trans.LoadingCapacity() <> 0 and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( 'å卿º', 0 ) >= 0, e.ID() = produtparent, e.ID() = trans.Product() ) ) ); |
| | | if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){ |
| | | traverse( table, Column, column ){ |
| | | pispips := selectset( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start().Date() >= column.StartDate() |
| | | and pispip.Start().Date() < column.StartDate().StartOfNextMonth() |
| | | and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ) ); |
| | | cell := selectobject( row, Cell, cell, cell.Column() = column ); |
| | | entercost := 0.0; |
| | | othercost := 0.0; |
| | | outcost := 0.0; |
| | | storecost := 0.0; |
| | | transcost := 0.0; |
| | | if( isdltoccrent){ |
| | | othercost := Real::MaxReal(); |
| | | transset := selectset( transcosts, Elements, trans, trans.Origin() = 'é¿æ¥å¤ç§åº' and trans.Destination() = '客æ·åº' ); |
| | | column.CalcEngineCost( pispips, enginecosts, transset, ccfactory, entercost, othercost, outcost, storecost, transcost ); |
| | | cell.CCRentQty( cell.CCRentQty() + sum( pispips, Elements, pispip, pispip.NewSupplyQuantity() ) ); |
| | | cell.CCRentInCost( cell.CCRentInCost() + entercost ); |
| | | cell.CCRentOutOfCost( cell.CCRentOutOfCost() + outcost ); |
| | | cell.CCRentStorCost( cell.CCRentStorCost() + storecost );//é¿æ¥å¤ç§åºä»å¨è´¹ç¨ |
| | | cell.CCShorTransCost( cell.CCShorTransCost() + transcost );//é¿æ¥çéè¿è¾è´¹ç¨ |
| | | } else { |
| | | outcost := Real::MaxReal(); |
| | | transset := selectset( transcosts, Elements, trans, trans.Origin() = '大è¿åå
åº' and trans.Destination() = '大è¿å¤ç§åº' ); |
| | | column.CalcEngineCost( pispips, enginecosts, transset, dlfactory, entercost, othercost, outcost, storecost, transcost ); |
| | | cell.DLRentStorCost( cell.DLRentStorCost() + storecost );//大è¿å¤ç§åºä»å¨è´¹ç¨ |
| | | cell.DLRentOtherCost( cell.DLRentOtherCost() + othercost );//大è¿å¤ç§åºå
¶ä»è´¹ç¨ |
| | | cell.DLRentInCost( cell.DLRentInCost() + entercost );//大è¿å¤ç§åºå
¥åºè´¹ç¨ |
| | | cell.WerkToDLRentTransCost( cell.WerkToDLRentTransCost() + transcost );//åå
å°å¤§è¿å¤ç§åºè¿è¾è´¹ç¨ |
| | | } |
| | | } |
| | | products.Add( pisp.Product_MP() ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //é¿æ¥é¿éè¿è¾è´¹ç¨ï¼è°æ¨æ°é/å
è£
容é/è£
载容é*è¿è¾åä»·ï¼è°æ¨è®¡åéæ¾å°è¯¥äº§åä»DLå°CCçè°æ¨æ°éï¼å³èµ·å§å°å¤§è¿è£
é
线边åºï¼ç®çå°ä¸ºé¿æ¥å¤ç§åºå¯¹åºçè¿è¾æ°éï¼å¨å卿ºææ¬åæ°è¡¨æ¾å°å¯¹åºçå
è£
容éï¼å¨è¿è¾ææ¬åæ°è¡¨éæ¾å°å卿ºå¯¹åºè¿è¾åä»·åè£
载容éï¼ç¨å
¬å¼è®¡ç®å¾åºç»æï¼æåº¦è¿è¡æ±æ» |
| | | traverse( owner, Unit.Lane.LaneLeg, laneleg ){ |
| | | //èµ·å§åºåç¹æ¯å¦æ¯å¤§è¿(大è¿åå
åºï¼ |
| | | isdl := laneleg.OriginStockingPointID().EndsWith( 'åå
åº' ) and ( laneleg.OriginStockingPointID().StartsWith( '大è¿' ) or laneleg.OriginStockingPointID().StartsWith( 'DL' ) ); |
| | | //ç®çå°åºåç¹æ¯å¦æ¯é¿æ¥ï¼é¿æ¥å¤ç§åºï¼ |
| | | iscc := laneleg.DestinationStockingPointID() = '大è¿å卿ºçé¿æ¥å¤ç§åº'; |
| | | if( isdl and iscc ){ |
| | | traverse( table, Column, column){//, column.StartDate().Month() = 1 |
| | | alltrips := selectset( laneleg, Trip, trip, trip.Arrival().Date() < column.StartDate().StartOfNextMonth() and trip.Arrival().Date() >= column.StartDate() ); |
| | | enginecosts := selectset( owner, LogisticsCostEngine, engine, engine.PackagingCapacity() <> 0 and engine.StartDate() <= column.StartDate() and engine.EndDate() >= column.StartDate() ); |
| | | transcosts := selectset( owner, LogisticsCostTransport, trans, trans.LoadingCapacity() <> 0 and trans.StartDate() <= column.StartDate() and trans.EndDate() >= column.StartDate() ); |
| | | if( not isnull( enginecosts ) and enginecosts.Size() > 0 and not isnull( transcosts ) and transcosts.Size() > 0 ){ |
| | | producttrips := selectuniquevalues( alltrips, Elements.ProductInTrip, pit, pit.Quantity() <> 0 and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = produtparent ), pit.ProductID() ); |
| | | traverse( producttrips, Elements, producttrip ){//, producttrip = '6912' |
| | | |
| | | row := table.GetRow( producttrip ); |
| | | product := selectobject( owner, Product_MP, product, product.ID() = producttrip ); |
| | | products.Add( product ); |
| | | quantity := sum( alltrips, Elements.ProductInTrip, pit, pit.Product_MP() = product, pit.Quantity() ); |
| | | enginecost := selectobject( enginecosts, Elements, engine, engine.Generation().ToLower() = product.Generation().ToLower() |
| | | and engine.MLB_MQB() = product.MQBMLB() |
| | | and engine.Factory() = ccfactory ); |
| | | //å¨è¿è¾ææ¬åæ°è¡¨éæ¾å°å卿ºå¯¹åºè¿è¾åä»·åè£
载容é |
| | | transcost := selectobject( transcosts, Elements, trans, trans.Origin() = laneleg.OriginStockingPointID() |
| | | and trans.Destination() = laneleg.DestinationStockingPointID() |
| | | and exists( product.GetAllParent(), Elements, e, ifexpr( trans.Product().FindString( 'å卿º', 0 ) >= 0, e.ID() = produtparent, e.ID() = trans.Product() ) ) ); |
| | | |
| | | if( not isnull( enginecost ) and not isnull( transcost ) ){ |
| | | cost := ceil( ceil( quantity / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice();//åèäºå
¥ |
| | | cell := selectobject( row, Cell, cell, cell.Column() = column ); |
| | | cell.CCLongTransCost( cell.CCLongTransCost() + cost ) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //traverse( owner, TransferPlanRow, tprow ){ |
| | | // product := selectobject( owner, Product_MP, product, product.ID() = tprow.ProductID() ); |
| | | // productparents := product.GetAllParent(); |
| | | // if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//æ¥è¯¢äº§åç±»åæ¯å卿º |
| | | // //èµ·å§åºåç¹æ¯å¦æ¯å¤§è¿(大è¿åå
åºï¼ |
| | | // isdl := tprow.SourceStockpoingPointID().EndsWith( 'åå
åº' ) and ( tprow.TargetStockpoingPointID().StartsWith( '大è¿' ) or tprow.TargetStockpoingPointID().StartsWith( 'DL' ) ); |
| | | // //ç®çå°åºåç¹æ¯å¦æ¯é¿æ¥ï¼é¿æ¥å¤ç§åºï¼ |
| | | // iscc := tprow.TargetStockpoingPointID().EndsWith( 'å¤ç§åº' ) and ( tprow.TargetStockpoingPointID().StartsWith( 'é¿æ¥' ) or tprow.TargetStockpoingPointID().StartsWith( 'CC' ) ); |
| | | // if( isdl and iscc ){ |
| | | // //æ¥è¯¢å¯¹åºçå卿ºææ¬ |
| | | // enginecosts := selectset( owner, LogisticsCostEngine, engine, engine.PackagingCapacity() <> 0 and engine.Generation().ToLower() = product.Generation().ToLower() |
| | | // and engine.MLB_MQB() = product.MQBMLB() |
| | | // and engine.Factory() = ccfactory ); |
| | | // //å¨è¿è¾ææ¬åæ°è¡¨éæ¾å°å卿ºå¯¹åºè¿è¾åä»·åè£
载容é |
| | | // transcosts := selectset( owner, LogisticsCostTransport, trans, trans.LoadingCapacity() <> 0 and trans.Origin() = tprow.SourceStockpoingPointID() |
| | | // and trans.Destination() = tprow.TargetStockpoingPointID() |
| | | // and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( 'å卿º', 0 ) >= 0, e.ID() = produtparent, e.ID() = trans.Product() ) ) ); |
| | | // if( not isnull( enginecosts ) and enginecosts.Size() > 0 and not isnull( transcosts ) and transcosts.Size() > 0 ){ |
| | | // row := table.GetRow( product.ID() ); |
| | | // products.Add( product ); |
| | | // traverse( tprow,TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() and [Number]tpcell.Value() > 0){ |
| | | // tpcolumndate := tpcell.TransferPlanColumn().ColumnDate(); |
| | | // enginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() <= tpcolumndate and engine.EndDate() >= tpcolumndate ); |
| | | // transcost := selectobject( transcosts, Elements, trans, trans.StartDate() <= tpcolumndate and trans.EndDate() >= tpcolumndate ); |
| | | // if( not isnull( enginecost ) and not isnull( transcost ) ){ |
| | | // periodtime := tpcolumndate.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.CCLongTransCost( cell.CCLongTransCost() + cost ); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | //é¿æ¥çéè¿è¾è´¹ç¨ï¼å®¢æ·éæ±æ°é/å
è£
容é/è£
载容é*è¿è¾åä»·ï¼å®¢æ·éæ±æ°éåèªforecastésales segmentä¸ºé¿æ¥çæ°éæ±æ»ï¼åç¨å
¬å¼è®¡ç®ï¼æåº¦è¿è¡æ±æ»ï¼å客æ·éæ±æ°éæ¢ç®æè½¦æ¬¡ï¼ |
| | | allforecast := selectset( owner, SalesDemand.astype( Forecast ), forecast, forecast.Quantity() > 0 and not isnull( forecast.SalesSegment_MP() ) and forecast.StartDate() < startofnextyear and //forecast.ProductID() = '6912' and forecast.StartDate().Month() = 1 and |
| | | // ( forecast.SalesSegment_MP().Name().StartsWith( 'Changchun' ) or exists( forecast.SalesSegment_MP().GetAllParent(), Elements, psalessegment, psalessegment.Name().StartsWith( 'Changchun' ) ) or |
| | | ( forecast.SalesSegment_MP().Name().StartsWith( 'Foshan' ) or forecast.SalesSegment_MP().Name().StartsWith( 'Tianjin' ) |
| | | or exists( forecast.SalesSegment_MP().GetAllParent(), Elements, psalessegment, psalessegment.Name().StartsWith( 'Foshan' ) or psalessegment.Name().StartsWith( 'Tianjin' ) ) ) |
| | | and exists( forecast.Product_MP().GetAllParent(), Elements, e, e.ID() = produtparent ) ); |
| | | //ccforecasts := selectset( allforecast, Elements, forecast, forecast.SalesSegment_MP().Name().StartsWith( 'Changchun' ) or exists( forecast.SalesSegment_MP().GetAllParent(), Elements, psalessegment, psalessegment.Name().StartsWith( 'Changchun' ) ) ); |
| | | //ccproducts := selectuniquevalues( ccforecasts, Elements, forecast, forecast.ProductID() ); |
| | | dlforecasts := selectset( allforecast, Elements, forecast, forecast.SalesSegment_MP().Name().StartsWith( 'Foshan' ) or forecast.SalesSegment_MP().Name().StartsWith( 'Tianjin' ) |
| | | or exists( forecast.SalesSegment_MP().GetAllParent(), Elements, psalessegment, psalessegment.Name().StartsWith( 'Foshan' ) or psalessegment.Name().StartsWith( 'Tianjin' ) ) ); |
| | | dlproducts := selectuniquevalues( dlforecasts, Elements, forecast, forecast.ProductID() );; |
| | | //traverse( ccproducts, Elements, ccproduct){ |
| | | // product := selectobject( owner, Product_MP, product, product.ID() = ccproduct ); |
| | | //// info( '************', product.ID(), exists( ccforecasts, Elements, forecast, forecast.Quantity() > 0 )); |
| | | // //æ¥è¯¢å¯¹åºçå卿ºææ¬ |
| | | // enginecosts := selectset( owner, LogisticsCostEngine, engine, engine.PackagingCapacity() <> 0 and engine.Generation().ToLower() = product.Generation().ToLower() |
| | | // and engine.MLB_MQB() = product.MQBMLB()and engine.Factory() = ccfactory ); |
| | | // //å¨è¿è¾ææ¬åæ°è¡¨éæ¾å°å卿ºå¯¹åºè¿è¾åä»·åè£
载容é |
| | | // transcosts := selectset( owner, LogisticsCostTransport, trans, trans.LoadingCapacity() <> 0 and trans.Origin() = 'é¿æ¥å¤ç§åº' |
| | | // and trans.Destination() = '客æ·åº' |
| | | // and exists( product.GetAllParent(), Elements, e, ifexpr( trans.Product().FindString( 'å卿º', 0 ) >= 0, e.ID() = produtparent, e.ID() = trans.Product() ) ) ); |
| | | // if( not isnull( enginecosts ) and enginecosts.Size() > 0 and not isnull( transcosts ) and transcosts.Size() > 0 ){ |
| | | // row := table.GetRow( ccproduct ) |
| | | // products.Add( product ); |
| | | // traverse( table, Column, column ){ |
| | | // allpsdips := selectset( ccforecasts, Elements.PlanningSalesDemandInPeriod, psdip, psdip.ProductID() = ccproduct and psdip.Quantity() > 0 and psdip.StartDate() < column.StartDate().StartOfNextMonth() and psdip.StartDate() >= column.StartDate() ); |
| | | // enginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() <= column.StartDate() and engine.EndDate() >= column.StartDate() ); |
| | | // transcost := selectobject( transcosts, Elements, trans, trans.StartDate() <= column.StartDate() and trans.EndDate() >= column.StartDate() ); |
| | | // if( not isnull( enginecost ) and not isnull( transcost ) ){ |
| | | // quantity := sum( allpsdips, Elements, psdip, psdip.Quantity() ); |
| | | // cost := ceil( ceil( quantity / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice(); |
| | | // cell := selectobject( row, Cell, cell, cell.Column() = column ); |
| | | // cell.CCShorTransCost( cell.CCShorTransCost() + cost ); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | traverse( dlproducts, Elements, ccproduct){ |
| | | |
| | | row := table.GetRow( ccproduct ) |
| | | product := selectobject( owner, Product_MP, product, product.ID() = ccproduct ); |
| | | //æ¥è¯¢å¯¹åºçå卿ºææ¬ |
| | | enginecosts := selectset( owner, LogisticsCostEngine, engine, engine.PackagingCapacity() <> 0 and engine.Generation().ToLower() = product.Generation().ToLower() |
| | | and engine.MLB_MQB() = product.MQBMLB()and engine.Factory() = dlfactory ); |
| | | if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){ |
| | | traverse( table, Column, column ){ |
| | | allpsdips := selectset( dlforecasts, Elements.PlanningSalesDemandInPeriod, psdip, psdip.ProductID() = ccproduct and psdip.Quantity() > 0 and psdip.StartDate() < column.StartDate().StartOfNextMonth() and psdip.StartDate() >= column.StartDate() ); |
| | | enginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() <= column.StartDate() and engine.EndDate() >= column.StartDate() ); |
| | | if( not isnull( enginecost ) ){ |
| | | products.Add( product ); |
| | | quantity := sum( allpsdips, Elements, psdip, psdip.Quantity() );// + psdip.FulfilledQuantity() |
| | | |
| | | cost := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.OutboundPrice(); |
| | | row.SetDLRentOutCost( column, cost ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //rows := selectsortedset( table, Row, row, row.Name() ); |
| | | //i := 0; |
| | | //traverse( rows, Elements, e ){ |
| | | // e.RowNr( i ); |
| | | // i := i + 1; |
| | | //} |
| | | info( '-------------------------------------end----------------------------------' ); |
| | | // |
| | | //showtable.Generate( search, products ); |
| | | *] |
| | | } |
| | |
| | | enginecost := selectobject( enginecosts, Elements, engine, engine.StartDate() <= column.StartDate() and engine.EndDate() >= column.StartDate() ); |
| | | if( not isnull( enginecost ) ){ |
| | | products.Add( product ); |
| | | quantity := sum( allpsdips, Elements, psdip, psdip.Quantity() ); |
| | | quantity := sum( allpsdips, Elements, psdip, psdip.Quantity() );// + psdip.FulfilledQuantity() |
| | | |
| | | cost := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.OutboundPrice(); |
| | | row.SetDLRentOutCost( column, cost ); |
| | |
| | | tempSP.Outcome() <> "" ) and |
| | | needPackagingQuantity > 0 ) { |
| | | // è½å
è£
çæ°é |
| | | canPackagingQuantity := ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ), |
| | | canPackagingQuantity := [Number]ifexpr( ceil( needPackagingQuantity / ppls.LotSize() ) < floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ), |
| | | ceil( needPackagingQuantity / ppls.LotSize() ), |
| | | floor( ppnc.MaximumDailyPackagingQuantity() / ppls.LotSize() ) ) * ppls.LotSize(); |
| | | // æ¹ç±»ä¸å
¶ä»äº§åå
è£
æ»å |
| | | categoryPackageQuantity := sum( indexPPCell, PackagingPlanColumn.PackagingPlanCell, tempPPCell, |
| | | tempPPCell <> indexPPCell and |
| | | tempPPCell.PackagingPlanRow().Factory() = indexPPCell.PackagingPlanRow().Factory() and |
| | | tempPPCell.PackagingPlanRow().Category() = indexPPCell.PackagingPlanRow().Category(), |
| | | tempPPCell.Package() ); |
| | | canPackagingQuantity := minvalue( [Number] ( ppnc.MaximumDailyPackagingQuantity() - categoryPackageQuantity ), canPackagingQuantity ); |
| | | // info( "å¼å§å
è£
çæ¥æï¼", indexPPCell.StartDate().Format( "Y-M2-D2" ), " è½å
è£
çæ°é:", canPackagingQuantity ); |
| | | |
| | | indexPPCell.Package( canPackagingQuantity ); |
| | |
| | | { |
| | | 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 ); |
| | | traverse ( macroPlan, PackagingPlanRow, ppr, ppr.Factory() = "é¿æ¥å·¥å" /*and ppr.Category() = "ZKG" and ppr.ProductID() = "06K103011CP"*/ ) { |
| | | |
| | | 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 ); |
| | | u := select( macroPlan, Unit, tempU, tempU.ID() = "CC " + ppr.Category() + " 线边åå¤ç§åºé´"); |
| | | |
| | | ts := selectset( u, Lane.LaneLeg.Trip, tempT, |
| | | guard( select( tempT, ProductInTrip, tempPIT, tempPIT.ProductID() = ppr.ProductID() ).Quantity() > 0, false ) ); |
| | | |
| | | traverse ( ts, Elements.ProductInTrip, pit, pit.Quantity() > 0 and pit.ProductID() = ppr.ProductID() ) { |
| | | ppcell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn().StartDate() = pit.Trip().Departure().Date() ); |
| | | |
| | | if ( pit.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "å¤ç§åº" ) and pit.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "线边åº" ) ) { |
| | | ppcell.Unpacking( pit.Quantity() ); |
| | | } |
| | | |
| | | if ( pit.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID().Regex( "线边åº" ) and pit.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID().Regex( "å¤ç§åº" ) ) { |
| | | ppcell.Package( pit.Quantity() ); |
| | | } |
| | | } |
| | | // traverse ( ppr, PackagingPlanCell, ppcell/*, ppcell.StartDate() <= Date::Construct( 2025, 1, 4 )*/ ) { |
| | | // unpackagedQuantity := sum( u, 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 ); |
| | | // } |
| | | } |
| | | *] |
| | | } |