Merge branch 'dev_release'
Conflicts:
_Main/BL/Type_MacroPlan/Method_InitialUnitAndStockingPoint.qbl
| | |
| | | OthersMayFlushTable: true |
| | | OthersMayInsertRow: true |
| | | Parameters: '/owner="YUXTEST"' |
| | | PrimaryKeyColumns: ISENABLED |
| | | PrimaryKeyColumns: PRODUCTID |
| | | PrimaryKeyColumns: SOURCEUNITOFMEASURENAME |
| | | PrimaryKeyColumns: TARGETUNITOFMEASURENAME |
| | | RecordModificationHintStrategy: 'None' |
| | | EDIODBCLinkColumn FACTOR |
| | | { |
| | |
| | | PrimaryKeyColumns: PlantName |
| | | PrimaryKeyColumns: ProcessSection |
| | | PrimaryKeyColumns: ProductID |
| | | PrimaryKeyColumns: SequenceNumber |
| | | TargetType: MappingOperation |
| | | TypeIndex: MappingOperationTypeIndex |
| | | EDIMLColumn ActualCapacity { Attribute: ActualCapacity ValueType: Real } |
| | |
| | | { |
| | | EDIMLTable MappingProduct |
| | | { |
| | | PrimaryKeyColumns: BusinessType |
| | | PrimaryKeyColumns: ID |
| | | TargetType: MappingProduct |
| | | TypeIndex: MappingProductTypeIndex |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateLaneFromJson ( |
| | | JSON datarow |
| | | JSON datarow, |
| | | MacroPlan macroplan |
| | | ) as Lane |
| | | { |
| | | Description: 'Read the json data and use it to create lane data' |
| | |
| | | userleadtime := datarow.Get( "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.IsNull() ) |
| | | { |
| | | processingtime := Duration::Zero(); |
| | |
| | | }; |
| | | |
| | | unit := Unit::FindUnitTypeIndex( unitid ); |
| | | if( isnull( unit)){ |
| | | unit :=macroplan.Unit( relnew, |
| | | ID := unitid, |
| | | Name := unitid, |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | result := Lane::CreateLane( unit, id, name, processingtime); |
| | | |
| | |
| | | for( i:=0; i<data_length; i++ ) |
| | | { |
| | | datarow := data.Get( i ); |
| | | a := Lane::CreateLaneFromJson( datarow ); |
| | | a := Lane::CreateLaneFromJson( datarow ,this); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( this, Unit.Lane, l, true ); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method DeleteSnaityCheck |
| | | { |
| | | TextBody: |
| | | [* |
| | | // renhao Sep-13-2023 (created) |
| | | //å 餿²¡ææ±ççè´§å¸ |
| | | traverse( this,Currency_MP,currency,not currency.IsBase() and currency.CurrencyRate_MP( relsize ) = 0 ){ |
| | | currency.Delete(); |
| | | } |
| | | //å 餿²¡æäº§åç车é |
| | | traverse( this,Unit.Lane,lane,not isnull( lane) and lane.ProductInLane(relsize )=0 ){ |
| | | lane.Delete(); |
| | | } |
| | | //å 餿²¡æç¨å°äº§åålaneçåºåç¹ |
| | | traverse( this,StockingPoint_MP,stock,stock.ProductInStockingPoint_MP(relsize ) = 0 ){ |
| | | stock.Delete(); |
| | | } |
| | | *] |
| | | } |
| | |
| | | [* |
| | | // Administrator Sep-1-2023 (created) |
| | | |
| | | unitOfMeasure_MP := UnitOfMeasure_MP::FindByName( this, "PCS" ); |
| | | if ( isnull( unitOfMeasure_MP ) ) { |
| | | unitOfMeasure_MP := UnitOfMeasure_MP::Create( this, "PCS", false, false ); |
| | | } |
| | | |
| | | //Set the Default values |
| | | unitofmeasurename := "PCS"; |
| | | currencyid := "CNY"; |
| | | startdate := Date::Date( 1900, 1, 1 ); |
| | | enddate := Date::Date( 9999, 12, 31 ); |
| | | capacitytype := "Transport quantity"; |
| | | |
| | | if ( isnull( Unit::FindById( this, "空è¿" ) ) ) { |
| | | Unit::Create( "空è¿", this, "空è¿", unitOfMeasure_MP, null( Unit ), capacitytype, "", null( SupplyChainView ), 0, 0, false ); |
| | | } |
| | | if( isnull( Unit::FindById( this, "空è¿" ) ) ){ |
| | | this.Unit( relnew, |
| | | ID := "空è¿", |
| | | Name := "空è¿", |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | if ( isnull( Unit::FindById( this, "åºåäºå¡å¤ç" ) ) ) { |
| | | Unit::Create( "åºåäºå¡å¤ç", this, "åºåäºå¡å¤ç", unitOfMeasure_MP, null( Unit ), capacitytype, "", null( SupplyChainView ), 0, 0, false ); |
| | | if( isnull( Unit::FindById( this, "åºåäºå¡å¤ç" ) ) ){ |
| | | this.Unit( relnew, |
| | | ID := "åºåäºå¡å¤ç", |
| | | Name := "åºåäºå¡å¤ç", |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | unitofmeasurename := "PCS"; |
| | | name := "æå¨å建åºåç¹"; |
| | | currencyname := "CNY"; |
| | | isplannedinfinite := false; |
| | | datestart := Date::Construct(1900, 1, 1) ; |
| | | dateend := Date::Construct(9999, 12, 31); |
| | | groupname := " "; |
| | | description := " "; |
| | | isfromdb := true; |
| | | |
| | | if ( isnull( StockingPoint_MP::FindById( this, "F13_FG_STOCK" ) ) ) { |
| | | StockingPoint_MP::Create( "F13_FG_STOCK", this, null( Unit ), "F13_FG_STOCK", null( SupplyChainView ), 0, 0, false ); |
| | | if( isnull( StockingPoint_MP::FindById( this, "F13_FG_STOCK" ) ) ){ |
| | | StockingPoint_MP::Create( this, |
| | | "F13_FG_STOCK", |
| | | "F13", |
| | | name, |
| | | unitofmeasurename, |
| | | currencyname, |
| | | isplannedinfinite, |
| | | datestart, |
| | | dateend, |
| | | groupname, |
| | | description, |
| | | isfromdb ); |
| | | } |
| | | |
| | | if ( isnull( StockingPoint_MP::FindById( this, "H10_SA_STOCK" ) ) ) { |
| | | StockingPoint_MP::Create( "H10_SA_STOCK", this, null( Unit ), "H10_SA_STOCK", null( SupplyChainView ), 0, 0, false ); |
| | | if( isnull( StockingPoint_MP::FindById( this, "H10_SA_STOCK" ) ) ){ |
| | | StockingPoint_MP::Create( this, |
| | | "H10_SA_STOCK", |
| | | "H10", |
| | | name, |
| | | unitofmeasurename, |
| | | currencyname, |
| | | isplannedinfinite, |
| | | datestart, |
| | | dateend, |
| | | groupname, |
| | | description, |
| | | isfromdb ); |
| | | } |
| | | |
| | | if ( isnull( StockingPoint_MP::FindById( this, "Q10_FG_STOCK" ) ) ) { |
| | | StockingPoint_MP::Create( "Q10_FG_STOCK", this, null( Unit ), "Q10_FG_STOCK", null( SupplyChainView ), 0, 0, false ); |
| | | if( isnull( StockingPoint_MP::FindById( this, "Q10_FG_STOCK" ) ) ){ |
| | | StockingPoint_MP::Create( this, |
| | | "Q10_FG_STOCK", |
| | | "Q10", |
| | | name, |
| | | unitofmeasurename, |
| | | currencyname, |
| | | isplannedinfinite, |
| | | datestart, |
| | | dateend, |
| | | groupname, |
| | | description, |
| | | isfromdb ); |
| | | } |
| | | |
| | | if ( isnull( Currency_MP::FindById( this, "CNY" ) ) ) { |
| | | Currency_MP::Create( "CNY", this, "CNY", "", false, false ); |
| | | } |
| | | existcurrency := Currency_MP::FindById( this, "CNY" ); |
| | | if( isnull( existcurrency ) ){ |
| | | Currency_MP::CreateCurrency( this, "CNY", "CNY", "", true ); |
| | | currency := Currency_MP::FindById( this, "EUR" ); |
| | | currency.IsBase(false); |
| | | Transaction::Transaction().Propagate(); |
| | | } |
| | | |
| | | isproductcatagory := false; |
| | | isfromdb := false; |
| | | if ( isnull( ProductLevel_MP::FindProductLevelTypeIndex( "1" ) ) ) { |
| | | existproductlevel := ProductLevel_MP::FindProductLevelTypeIndex( "2" ); |
| | | if( isnull( existproductlevel ) ){ |
| | | ProductLevel_MP::Create( "1", isproductcatagory, this, isfromdb ); |
| | | } |
| | | if ( isnull( ProductLevel_MP::FindProductLevelTypeIndex( "2" ) ) ) { |
| | | ProductLevel_MP::Create( "2", isproductcatagory, this, isfromdb ); |
| | | } |
| | | if ( isnull( ProductLevel_MP::FindProductLevelTypeIndex( "3" ) ) ) { |
| | | ProductLevel_MP::Create( "3", isproductcatagory, this, isfromdb ); |
| | | } |
| | | } |
| | | |
| | | existsalestlevel := SalesLevel_MP::FindSalesLevelTypeIndex( "2") |
| | | if( isnull( existsalestlevel ) ){ |
| | | SalesLevel_MP::Create( "1",this,isfromdb); |
| | | SalesLevel_MP::Create( "2",this,isfromdb); |
| | | } |
| | | *] |
| | | } |
| | |
| | | } |
| | | queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | | listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate and item.OrderDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate /*and item.OrderDate() <= queryEndDate*/, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) ); |
| | | |
| | | totalcount := listToDeal.Size(); |
| | | info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | priorityName :="Normal"; |
| | | // å¤ç |
| | | traverse( listToDeal, Elements, item ) { |
| | | count := count + 1; |
| | |
| | | // info( item.ProductID().AsQUILL() ); |
| | | CustomerOrder::CreateOrUpdate( this, item.CurrencyID(), item.Customer(), item.CustomerID(), item.ID(), |
| | | item.OrderDate(), item.OrderID(), item.OrderLineID(), item.Price(), |
| | | item.PriorityName(), item.ProductID(), |
| | | priorityName, item.ProductID(), |
| | | item.StockPointID(), |
| | | item.SalesSegmentName(), |
| | | item.Quantity(), item.UnitOfMeasureName(), item.OrderType(), item.IsAvailable()); |
| | |
| | | TextBody: |
| | | [* |
| | | // renhao Aug-14-2023 (created) |
| | | |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, true ); |
| | | queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 and externalSupply.Date() >= queryStartDate /*and externalSupply.Date() <= queryEndDate*/); |
| | | totalcount := listtodeal.Size(); |
| | | description := "å¨éå¨å¶"; |
| | | info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | |
| | | count := count + 1; |
| | | if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "ExternalSupply " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID() and product.KeyProduct() = nuclear,true); |
| | | } |
| | | product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID(),true); |
| | | |
| | | |
| | | if( not isnull( product)){ |
| | | productMP := select( this,Product_MP,productMP,productMP.ID() = externalSupply.ProductID() ,true); |
| | | productMP := Product_MP :: FindProductTypeIndex( externalSupply.ProductID()); |
| | | stockingpoint := select( this,StockingPoint_MP,st,st.ID() = externalSupply.StockingPointID(),true); |
| | | if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | if( not isnull(businessTypes)){ |
| | | |
| | | for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | externalSupply.UserQuantity(),description); |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | productMP, |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | } |
| | | externalSupply.UserQuantity(),description); |
| | | } |
| | | |
| | | } |
| | | |
| | | }else{ |
| | | info( "Invaild product" ); |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |
| | |
| | | // å¾
å¤çæ°æ® |
| | | listToDeal := construct( structured[MappingForecast] ); |
| | | if( isnull( businessTypes ) or businessTypes.Size() = 0 ) { |
| | | listToDeal := selectset( this, MappingForecast, item, true ); |
| | | listToDeal := selectset( this, MappingForecast, item, item.Quantity() > 0 ); |
| | | } else { |
| | | listToDeal := selectset( this, MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 ); |
| | | listToDeal := selectset( this, MappingForecast, item, businessTypes.Find( item.BusinessType() ) <> -1 and item.Quantity()>0 ); |
| | | } |
| | | queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date(); |
| | | queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() ); |
| | |
| | | info( "Forecast has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | priorityName := "Normal"; |
| | | // å¤ç |
| | | traverse( listToDeal, Elements, item ) { |
| | | count := count + 1; |
| | |
| | | } |
| | | // if( not isnull( Product_MP::FindById( this, item.ProductID() ) ) ){ |
| | | Forecast::CreateOrUpdate( this, |
| | | item.ProductID(), item.SalesSegmentName(), item.StockingPointID(), item.PriorityName(), |
| | | item.ProductID(), item.SalesSegmentName(), item.StockingPointID(), priorityName, |
| | | item.CurrencyID(), item.UnitOfMeasureName(), |
| | | item.ID(), item.StartDate(), item.EndDate(), item.Quantity(), item.Price()); |
| | | // }else{ |
| | |
| | | |
| | | keyProductList := construct( Strings ); |
| | | if( isKeyProduct ) { |
| | | keyProductList := selectuniquevalues( this, MappingProduct, item, item.KeyProduct(), item.ID() ); |
| | | keyProductList := selectuniquevalues( this, MappingProduct, item, item.ProductMajorType()="æå" or item.ProductMajorType()="åæå", item.ID() ); |
| | | } |
| | | bomList := selectsortedset( this, MappingBOM, item, |
| | | ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0, |
| | | true, |
| | | // businessTypes.Difference( businessTypes.Difference( item.BusinessType().Tokenize( ", " ) ) ).Size() > 0 ) |
| | | businessTypes.Find( item.BusinessType() ) >= 0 ) |
| | | and ifexpr( isKeyProduct, |
| | | keyProductList.Size() > 0 and keyProductList.Find( item.ComponentCode() ) >= 0, |
| | | true ), |
| | | // and ifexpr( isKeyProduct, |
| | | // keyProductList.Size() > 0 and keyProductList.Find( item.ComponentCode() ) >= 0, |
| | | // true ) |
| | | , |
| | | item.OrganCode() + "_" + item.ProductCode() + "_" + item.ProcessSection() ); |
| | | // æroutingåroutingStepåç» |
| | | routingIds := selectuniquevalues( bomList, Elements, item, true, item.OrganCode() + "_" + item.ProductCode() ); |
| | |
| | | routingRows := selectset( bomList, Elements, item, true, routingId = item.OrganCode() + "_" + item.ProductCode() ); |
| | | if( routingRows.Size() > 0 ) { |
| | | firstRow := routingRows.Element( 0 ); |
| | | stockingPointId := firstRow.OrganCode() + "_" + firstRow.ProductType() + "_Stock"; |
| | | inputStockingPointId := firstRow.OrganCode() + "_" + firstRow.ComponentType() + "_Stock"; |
| | | // stockingPointId := firstRow.OrganCode() + "_" + firstRow.ProductType() + "_Stock"; |
| | | // inputStockingPointId := firstRow.OrganCode() + "_" + firstRow.ComponentType() + "_Stock"; |
| | | stockingPointId := firstRow.OrganCode() + "_Stock"; |
| | | |
| | | // ========æ£æ¥======== |
| | | product := Product_MP::FindProductTypeIndex( firstRow.ProductCode() ); |
| | | if( not isnull( product ) ) { |
| | | // error( "product : " + firstRow.ProductCode() + " not found" ); |
| | | stockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( stockingPointId ); |
| | | inputStockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( inputStockingPointId ); |
| | | |
| | | // info( stockingPointId.AsQUILL() ); |
| | | // if( isnull( stockingPoint ) ) { |
| | | // error( "stockingPoint : " + stockingPointId + " not found" ); |
| | |
| | | // ========åç»å¤çè¾å
¥======== |
| | | |
| | | } |
| | | if( not isnull( inputStockingPoint)){ |
| | | this.MappingOperationBOMDataRouting( routing,routingRows,inputStockingPoint,keyProductList); |
| | | if( not isnull( stockingPoint)){ |
| | | if( isKeyProduct){ |
| | | keyRows := selectset( routingRows,Elements,routingrow,keyProductList.Find( routingrow.ComponentCode())>=0); |
| | | this.MappingOperationBOMDataRouting( routing,keyRows); |
| | | }else{ |
| | | this.MappingOperationBOMDataRouting( routing,routingRows); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if( createPurchaseSupplyMaterial ) { |
| | | toCreateBomList := selectuniquevalues( bomList, Elements, item, |
| | | item.ProductType() = "P", item.OrganCode() + item.ComponentCode()); |
| | | item.ComponentType() = "P", item.OrganCode() + item.ComponentCode()); |
| | | traverse( toCreateBomList, Elements, key ) { |
| | | boms := selectset( bomList, Elements, item, item.ProductType() = "P" and item.OrganCode() + item.ComponentCode() = key ); |
| | | boms := selectset( bomList, Elements, item, item.ComponentType() = "P" and item.OrganCode() + item.ComponentCode() = key ); |
| | | bom := boms.First(); |
| | | this.MappingOperationBOMDataSupplyPurchase( bom.OrganCode(), bom.ComponentCode(), bom.ComponentType()); |
| | | } |
| | |
| | | #parent: #root |
| | | Method MappingOperationBOMDataRouting ( |
| | | Routing routing, |
| | | MappingBOMs routingRows, |
| | | StockingPoint_MP stockingPoint, |
| | | Strings keyProductIds |
| | | MappingBOMs routingRows |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | if( not isnull( component ) ) { |
| | | // error( "component : " + noAlterRow.ComponentCode() + " not found" ); |
| | | // è¿æ¥äº§åä¸operation |
| | | // inputStockingPointId := noAlterRow.OrganCode() + "_" + noAlterRow.ComponentType() + "_Stock"; |
| | | inputStockingPointId := noAlterRow.OrganCode() + "_Stock"; |
| | | stockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( inputStockingPointId); |
| | | pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint ); |
| | | trash := construct( OperationBOMs ); |
| | | operationBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp, |
| | |
| | | // } |
| | | traverse( routingStep, Operation, toLink ) { |
| | | // è¿æ¥äº§åä¸operation |
| | | // inputStockingPointId := firstAlterRow.OrganCode() + "_" + firstAlterRow.ComponentType() + "_Stock"; |
| | | inputStockingPointId := firstAlterRow.OrganCode() + "_Stock"; |
| | | stockingPoint := StockingPoint_MP::FindStockingPointTypeIndex( inputStockingPointId); |
| | | pisp := ProductInStockingPoint_MP::CreateIfNotFound( component, stockingPoint ); |
| | | trash := construct( OperationBOMs ); |
| | | mainBOM := toLink.LinkProduct( component, true, BaseOperationLink::GetGroupID( toLink, true, false ), pisp, |
| | |
| | | alterProd := Product_MP::FindById( this, alterRow.AlternativeMaterialCode() ); |
| | | if( not isnull( alterProd ) ) { |
| | | // error( "alterProd : " + alterRow.AlternativeMaterialCode() + " not found" ); |
| | | stockingPointIdAlter := alterRow.OrganCode() + "_" + alterRow.ProductType() + "_Stock"; |
| | | // stockingPointIdAlter := alterRow.OrganCode() + "_" + alterRow.ComponentType() + "_Stock"; |
| | | stockingPointIdAlter := alterRow.OrganCode() + "_Stock"; |
| | | stockingPointAlter := StockingPoint_MP::FindById( this, stockingPointIdAlter ); |
| | | if( isnull( stockingPointAlter ) ) { |
| | | error( "stockingPoint : " + stockingPointIdAlter + " not found" ); |
| | | } |
| | | pispAlter := ProductInStockingPoint_MP::CreateIfNotFound( alterProd, stockingPointAlter ); |
| | | mainInput := toLink.LastOperationInput(); |
| | | //mainInput := toLink.LastOperationInput(); |
| | | mainInput := select( toLink,OperationInput,operationInut,operationInut.ProductID()=alterRow.ComponentCode()); |
| | | trash := construct( OperationBOMs ); |
| | | if( not isnull( mainInput ) ) { |
| | | alterBom := mainInput.Operation().LinkPISP( pispAlter, true, mainInput.OperationLinkGroupID(), trash ); |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | routingId := "PR_"+orgCode + "_" + productId; |
| | | unitId := "ä¾åºå"; |
| | | routingStepName := "Purchase"; |
| | | operationId := orgCode + "_PR_" + productId; |
| | | routing := Routing::CreateOrUpdate( this, routingId ); |
| | | toDeleteSteps := selectset( routing, RoutingStep, routingStep, true ); |
| | | RoutingStep::Delete( toDeleteSteps ); |
| | | routingStep := RoutingStep::Create( routing, routingStepName, "", true ); |
| | | |
| | | product := Product_MP::FindById( this, productId ); |
| | | if( isnull( product ) ) { |
| | | info( "product : " + productId + " not found" ); |
| | | } |
| | | stockingPointId := orgCode + "_" + productType + "_Stock"; |
| | | stockingPointId := orgCode + "_Stock"; |
| | | stockingPoint := StockingPoint_MP::FindById( this, stockingPointId ); |
| | | if( isnull( stockingPoint ) ) { |
| | | info( "stockingPoint : " + stockingPointId + " not found" ); |
| | | } |
| | | |
| | | if( not isnull( product) and not isnull( stockingPoint)){ |
| | | routingId := "PR_"+orgCode + "_" + productId; |
| | | unitId := "ä¾åºå"; |
| | | routingStepName := "Purchase"; |
| | | operationId := orgCode + "_PR_" + productId; |
| | | routing := Routing::CreateOrUpdate( this, routingId ); |
| | | toDeleteSteps := selectset( routing, RoutingStep, routingStep, true ); |
| | | RoutingStep::Delete( toDeleteSteps ); |
| | | routingStep := RoutingStep::Create( routing, routingStepName, "", true ); |
| | | unit := Unit::FindById( this, unitId ); |
| | | if( isnull( unit ) ) { |
| | | unit := this.Unit( relnew, |
| | |
| | | moperation.ProductID() = item.ProductID(), |
| | | moperation.SequenceNumber() ).SequenceNumber() |
| | | if( item.SequenceNumber() = maxsn ){ |
| | | listtodealwithmaxsn.Add( item ); |
| | | listtodealwithmaxsn.Add( item ); |
| | | } |
| | | } |
| | | |
| | |
| | | [* |
| | | // Administrator Aug-16-2023 (created) |
| | | // list to deal |
| | | //info( "Get list to deal of product" ); |
| | | info( "Get list to deal of product" ); |
| | | listToDeal := construct( structured[MappingProduct] ); |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | |
| | | } |
| | | } else { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true, businesstypes.Find( item.BusinessType()) > 0 ); |
| | | } |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true and businesstypes.Find( item.BusinessType()) >= 0 ); |
| | | } |
| | | else{ |
| | | listToDeal := selectset( this, MappingProduct, item, businesstypes.Find( item.BusinessType()) > 0 ); |
| | | listToDeal := selectset( this, MappingProduct, item, businesstypes.Find( item.BusinessType()) >= 0 ); |
| | | } |
| | | } |
| | | totalcount := listToDeal.Size(); |
| | |
| | | "å
¨é¨ç©æäº§å", |
| | | "PCS", |
| | | "å
¨é¨ç©æäº§å", |
| | | 0.0 |
| | | 0.0,false,false |
| | | ); |
| | | count := 0; |
| | | // Get the ProductMajorType list & ProductSubclassType list |
| | |
| | | item.ProductMajorType(), |
| | | "PCS", |
| | | item.ProductMajorType(), |
| | | 0.0 |
| | | 0.0,false,false |
| | | ); |
| | | } |
| | | productmajortype := item.ProductMajorType(); |
| | |
| | | productmajortype := "å
¨é¨ç©æäº§å"; |
| | | } |
| | | |
| | | if( not item.ProductSubclassType() = "" ){ |
| | | Product_MP::CreateOrUpdate( this, |
| | | item.ProductSubclassType(), |
| | | productmajortype, |
| | | item.ProductSubclassType(), |
| | | "PCS", |
| | | item.ProductSubclassType(), |
| | | 0.0 |
| | | ); |
| | | } |
| | | productsubclasstype := item.ProductSubclassType(); |
| | | if( productsubclasstype="" ){ |
| | | productsubclasstype := productmajortype; |
| | | } |
| | | // if( not item.ProductSubclassType() = "" ){ |
| | | // Product_MP::CreateOrUpdate( this, |
| | | // item.ProductSubclassType(), |
| | | // productmajortype, |
| | | // item.ProductSubclassType(), |
| | | // "PCS", |
| | | // item.ProductSubclassType(), |
| | | // 0.0,false,false |
| | | // ); |
| | | // } |
| | | // productsubclasstype := item.ProductSubclassType(); |
| | | // if( productsubclasstype="" ){ |
| | | // productsubclasstype := productmajortype; |
| | | // } |
| | | |
| | | if( not item.ID() = "" ){ |
| | | Product_MP::CreateOrUpdate( this, |
| | | item.ID(), |
| | | productsubclasstype, |
| | | productmajortype, |
| | | item.ID(), |
| | | item.UnitOfMeasureName(), |
| | | item.Name(), |
| | | item.ShelfLife() |
| | | item.ShelfLife(), |
| | | item.KeyProduct(),item.IsCommon() |
| | | ); |
| | | } |
| | | } |
| | |
| | | |
| | | //Set the Default values |
| | | unitofmeasurename := "PCS"; |
| | | infinite := "Infinite"; |
| | | capacitytype := "Transport quantity"; |
| | | |
| | | // Get the root data |
| | |
| | | "天马éå¢", |
| | | "天马éå¢", |
| | | "", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | // Get the sub root data |
| | |
| | | "ç产", |
| | | "ç产", |
| | | "天马éå¢", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | Unit::CreateOrUpdate( this, |
| | | "ä¾åºå", |
| | | "ä¾åºå", |
| | | "天马éå¢", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | Unit::CreateOrUpdate( this, |
| | |
| | | item.OrganCode(), |
| | | OrgName, |
| | | "ç产", |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | //Get the second level unit |
| | |
| | | secondlevelid, |
| | | secondlevelid, |
| | | item.OrganCode(), |
| | | capacitytype, |
| | | infinite, |
| | | unitofmeasurename ); |
| | | |
| | | //Get the third level unit |
| | |
| | | // 订åéæ±-18 |
| | | CustomerOrder::DoSync( macroPlan, businessTypes ); |
| | | |
| | | //å é¤å¤ä½æ¥éæ°æ®-19 |
| | | macroPlan.DeleteSnaityCheck(); |
| | | |
| | | //// todo ä¾åºåè½å |
| | | //info( "ProviderCapacity::DoSync" ) |
| | | |
| | |
| | | Attribute SequenceNumber |
| | | { |
| | | #keys: '3[412960.0.86978408][412960.0.86978407][412960.0.86978409]' |
| | | IsReadOnly: true |
| | | ValueType: Number |
| | | } |
| | |
| | | [ |
| | | TypeIndexAttribute |
| | | { |
| | | ModelElement: Line |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | | ModelElement: BusinessType |
| | | ModelElement: ProcessSection |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | | ModelElement: OrganCode |
| | | ModelElement: BusinessType |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | | ModelElement: Line |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | | ModelElement: ProcessSection |
| | | ModelElement: SequenceNumber |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | | ModelElement: OrganCode |
| | | } |
| | | ] |
| | | } |
| | |
| | | Attribute BusinessType |
| | | { |
| | | #keys: '3[414480.0.61560268][414480.0.61560267][414480.0.61560269]' |
| | | IsReadOnly: true |
| | | ValueType: String |
| | | } |
| | |
| | | { |
| | | ModelElement: ID |
| | | } |
| | | TypeIndexAttribute |
| | | { |
| | | ModelElement: BusinessType |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute BusinessTypeCommon |
| | | { |
| | | #keys: '3[414480.0.138606036][414480.0.138606035][414480.0.138606037]' |
| | | ValueType: Boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute KeyProduct |
| | | { |
| | | #keys: '3[414480.0.138606008][414480.0.138606007][414480.0.138606009]' |
| | | ValueType: Boolean |
| | | } |
| | |
| | | String name, |
| | | String unitofmeasurename, |
| | | String description, |
| | | Real shelflife |
| | | Real shelflife, |
| | | Boolean keyproduct, |
| | | Boolean businesstypecommon |
| | | ) |
| | | { |
| | | TextBody: |
| | |
| | | //info( productid ); |
| | | |
| | | if( isnull( product ) ){ |
| | | Product_MP::Create( owner, |
| | | product := Product_MP::Create( owner, |
| | | productid, |
| | | parentid, |
| | | name, |
| | |
| | | isexcludedfromfulfilmentkpis, |
| | | isfromdb |
| | | ); |
| | | |
| | | product.KeyProduct(keyproduct); |
| | | product.BusinessTypeCommon(businesstypecommon); |
| | | }else{ |
| | | product.Update( productid, |
| | | name, |
| | |
| | | isexcludedfromfulfilmentkpis, |
| | | isfromdb |
| | | ); |
| | | product.KeyProduct(keyproduct); |
| | | product.BusinessTypeCommon(businesstypecommon); |
| | | } |
| | | *] |
| | | } |