Quintiq file version 2.0
|
#parent: #root
|
StaticMethod FromSupplyPlanning (
|
MacroPlan macroPlan,
|
MacroPlan mappingRoot,
|
ProductInStockingPointInPeriod pispip
|
) as PRData
|
{
|
TextBody:
|
[*
|
// yypsybs Sep-12-2023 (created)
|
result := macroPlan.PRData( relnew );
|
result.InterfaceSourceCode( "Quintiq" );
|
|
pisp := pispip.ProductInStockingPoint_MP();
|
product := pisp.Product_MP();
|
stockingPoint := pisp.StockingPoint_MP();
|
period := pispip.Period_MP();
|
mappingProduct := MappingProduct::GetByProductId( mappingRoot, product.ID() );
|
// 接口/中间表暂无
|
mappingProviderCapacity := "暂无";
|
erpData := "暂无";
|
|
// 根据pispip
|
result.MRPCalverNo( pispip.MRPCalverNo() );
|
result.Quantity( pispip.NewSupplyQuantity() );
|
|
// 根据product
|
result.ProductID( product.ID() );
|
result.ProductName( product.Name() );
|
|
// 根据stockingPoint
|
result.StockingPointID( stockingPoint.ID() );
|
|
// 根据period
|
result.ProduceRequiredDate( period.StartDate() );
|
result.PRSuggestionDate( ifexpr( (result.ProduceRequiredDate() - Duration::Days( 7 )).Date() >= Date::Today(),
|
Date::Today(), (result.ProduceRequiredDate() - Duration::Days( 7 )).Date() ) );
|
|
// 根据product中间表
|
result.BusinessType( mappingProduct.BusinessType() );
|
result.OrganCode( mappingProduct.OrgCode() );
|
result.UnitOfMeasure( mappingProduct.UnitOfMeasureName() );
|
|
// 根据供应商能力中间表
|
result.ProviderCode( mappingProviderCapacity );
|
result.ProductName( mappingProviderCapacity );
|
|
// 根据erp接口 固定值
|
result.RequisitionType( "PURCHASE" );
|
result.DestinationTypeCode( "INVENTORY" );
|
result.UnitPrice( 1.0 );
|
result.AuthorizationStatus( "INCOMPLETE" );
|
result.LineTypeId( "1" );
|
result.LineType( "货物" );
|
// 根据erp接口 todo
|
result.PreparerId( erpData );
|
result.HeaderDescription( erpData );
|
result.DestinationOrganizationID( erpData );
|
result.DeliverToRequestorId( erpData );
|
result.LineAttribute1( erpData );
|
result.LineAttribute6( erpData );
|
result.OrgId( erpData );
|
|
// 生成id todo
|
result.DataID( [String]Number::Random( Number::MinNumber(), Number::MaxNumber() ) );
|
|
// 发送信息
|
result.SendStatus( "" );
|
result.SendBy( "" );
|
result.SendTIme( DateTime::MinDateTime() );
|
|
return result;
|
*]
|
}
|