external supply修改
product字段调整
| | |
| | | [* |
| | | // renhao Aug-14-2023 (created) |
| | | |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, true ); |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 ); |
| | | totalcount := listtodeal.Size(); |
| | | description := "å¨éå¨å¶"; |
| | | info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | |
| | | 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(businessTypes)){ |
| | | |
| | |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | externalSupply.UserQuantity(),description); |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | productMP, |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | } |
| | | externalSupply.UserQuantity(),description); |
| | | } |
| | | |
| | | } |
| | | |
| | | }else{ |
| | | info( "Invaild product" ); |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |
| | |
| | | moperation.ProductID() = item.ProductID(), |
| | | moperation.SequenceNumber() ).SequenceNumber() |
| | | if( item.SequenceNumber() = maxsn ){ |
| | | listtodealwithmaxsn.Add( item ); |
| | | listtodealwithmaxsn.Add( item ); |
| | | } |
| | | } |
| | | |
| | |
| | | } else { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( this, MappingProduct, item, item.KeyProduct() = true, 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(); |
| | |
| | | item.ProductSubclassType(), |
| | | "PCS", |
| | | item.ProductSubclassType(), |
| | | 0.0 |
| | | 0.0,false,false |
| | | ); |
| | | } |
| | | productsubclasstype := item.ProductSubclassType(); |
| | | if( productsubclasstype="" ){ |
| | | productsubclasstype := productmajortype; |
| | | productsubclasstype := productmajortype; |
| | | } |
| | | |
| | | if( not item.ID() = "" ){ |
| | |
| | | item.ID(), |
| | | item.UnitOfMeasureName(), |
| | | item.Name(), |
| | | item.ShelfLife() |
| | | item.ShelfLife(), |
| | | item.KeyProduct(),item.IsCommon() |
| | | ); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | *] |
| | | } |