Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method Update ( 
 | 
  Real quantity, 
 | 
  Boolean hasquantitybyuser, 
 | 
  Boolean autoadjustquantity 
 | 
) 
 | 
{ 
 | 
  Description: 'The update method to update the quantity of the period task in the campaign type, also setting the boolean' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // oceaned Feb-10-2016 (created) 
 | 
     
 | 
    if( hasquantitybyuser or autoadjustquantity ) 
 | 
    { 
 | 
      oldquantity := this.Quantity(); 
 | 
      gap := quantity - oldquantity; 
 | 
     
 | 
      ptquantity := this.PeriodTaskOperation().Quantity(); 
 | 
      this.PeriodTaskOperation().Update( ptquantity + gap, hasquantitybyuser );  
 | 
    } 
 | 
     
 | 
    this.Quantity( quantity ); 
 | 
    this.HasQuantitySetByUser( hasquantitybyuser ); 
 | 
  *] 
 | 
} 
 |