| Quintiq file version 2.0 | 
| #parent: #root | 
| Function CalcNewSupplyPurchasingQuantity | 
| { | 
|   TextBody: | 
|   [* | 
|     value := 0.0; | 
|      | 
|     if( this.ChildOfProductDimension( relsize ) = 0 ) | 
|     { | 
|      // Case 3 - Aggregated PISPIP: aggregate value from base level | 
|       value := sum( this.GetChildrenOfPeriodDimension(), Elements, child, | 
|                     child.NewSupplyPurchasingQuantity() ); | 
|      | 
|     } | 
|     else  | 
|     {  | 
|       value := sum( this, ChildOfProductDimension, copd, | 
|                     not copd.ProductInStockingPoint_MP().IsExcluded(), | 
|                     copd.NewSupplyPurchasingQuantity() * copd.ProductInStockingPoint_MP().ParentPISPConversionFactor() ); | 
|     } | 
|      | 
|     this.NewSupplyPurchasingQuantity( value ); | 
|   *] | 
| } |