yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Quintiq file version 2.0
#parent: #root
StaticMethod ValidateInput (
  output String feedback_o,
  Operations operations,
  OperationCosts operationCosts,
  Account_MP account,
  String costDriver,
  Date start,
  String timeUnit,
  Number lengthOfTime,
  Real cost,
  AccountCost accountCost
) declarative remote as Boolean
{
  Description: '(Web) Combined validation for unique cost for the input'
  TextBody:
  [*
    // 1. Check the account is not null
    // 2. Check the input is unique
    // 3. Check the input is allowed
    
    // sanitycheckfb is not used in web client
    sanitycheckfb := '';
    
    if( not isnull( account ) )
    {
      isUnique := OperationCost::GetIsUniqueCost( feedback_o,
                                                  operations,
                                                  operationCosts,
                                                  account.Name(),
                                                  costDriver,
                                                  start );
      if( isUnique )
      {
        AccountCost::ValidateInput( feedback_o,
                                    sanitycheckfb,
                                    account,
                                    costDriver,
                                    start,
                                    timeUnit,
                                    lengthOfTime,
                                    cost,
                                    accountCost );
      }
    }
    
    return feedback_o = '';
  *]
}