Quintiq file version 2.0
|
#parent: #root
|
StaticMethod CreasteFromMapping (
|
const GlobalOTDTable globalOTDTable,
|
MacroPlan macroPlan
|
)
|
{
|
TextBody:
|
[*
|
// Administrator Oct-31-2023 (created)
|
updates := construct( Lanes );
|
traverse( globalOTDTable, Global_MappingLane, gl, true )
|
{
|
id := gl.ID();
|
unitid := gl.UnitID();
|
name := gl.Name();
|
userleadtime := gl.UserLeadTime();
|
processingtime := Duration::Zero();
|
|
unitofmeasurename := "PCS";
|
currencyid := "CNY";
|
startdate := Date::Date( 1900, 1, 1 );
|
enddate := Date::Date( 9999, 12, 31 );
|
capacitytype := "Transport quantity";
|
if( userleadtime.Length() = 0 )
|
{
|
processingtime := Duration::Zero();
|
}
|
else
|
{
|
processingtime := Duration::Hours( [Number]userleadtime );
|
};
|
|
unit := Unit::FindById( macroPlan, unitid );
|
if( isnull( unit)){
|
unit :=macroPlan.Unit( relnew,
|
ID := unitid,
|
Name := unitid,
|
UnitOfMeasureName := unitofmeasurename,
|
CurrencyID := currencyid,
|
StartDate := startdate,
|
EndDate := enddate,
|
CapacityType := capacitytype );
|
}
|
|
a := Lane::CreateLane( macroPlan, unit, id, name, processingtime);
|
updates.Add( a );
|
}
|
origindataset := selectset( macroPlan, Unit.Lane, l, true );
|
obsoletes := origindataset.Difference( updates );
|
// delete obsoleted
|
difflength := obsoletes.Size();
|
for( j:=0; j<difflength; j++ )
|
{
|
obsolete := obsoletes.Element( j );
|
obsolete.Delete();
|
}
|
*]
|
}
|