yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Quintiq file version 2.0
#parent: #root
Method RoundToNextMultipleForOperation (
  Real quantity
) remote as Real
{
  Description: "Round the entered quantity in new supply to next valid multiple of the operation's lot size."
  TextBody:
  [*
    // soh yee Jun-17-2013 (created)
    
    periodtaskoperation := this.GetPeriodTaskOperation();
    minquantity := 0.0;
    
    if( not isnull( periodtaskoperation ) )
    {
      minquantity := this.GetPeriodTaskOperationQuantity( quantity ); // Given desired quantity for new supply, calculate how much period task quantity is needed
      minquantity := periodtaskoperation.RoundToNextMultiple( minquantity );     // Return suggested period task quantity out
      minquantity := PeriodTaskOperation::GetNewSupplyQuantity( minquantity, this.ProcessOutput(), this.RelativeDuration() );    // Convert to how many new supply can be produced, given the quantity out of period task
    }
    
    return minquantity;
  *]
}