TestFormula

C code posted
created at 17 Oct 14:51, updated at 25 Oct 15:38

Edit | Back
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
IF(SBQQ__NonDiscountable__c,
    (Partner_Role_Discount_Base__c*100),
    IF(ISBLANK(SBQQ__Quote__r.SBQQ__CustomerDiscount__c),
        (IF(NOT(ISBLANK(SBQQ__Discount__c)),
            ((Partner_Role_Discount_Base__c + SBQQ__Discount__c)*100),
            IF(NOT(ISBLANK(SBQQ__AdditionalDiscountAmount__c)),
                ((Partner_Role_Discount_Base__c + (SBQQ__AdditionalDiscountAmount__c / SBQQ__ListPrice__c))*100),
                (Partner_Role_Discount_Base__c*100)
            )
        )),
        (IF(ISBLANK(SBQQ__Discount__c),
            (IF(ISBLANK(SBQQ__AdditionalDiscountAmount__c),
                ((Partner_Role_Discount_Base__c + SBQQ__Quote__r.SBQQ__CustomerDiscount__c)*100),
                ((Partner_Role_Discount_Base__c + (SBQQ__AdditionalDiscountAmount__c / SBQQ__ListPrice__c))*100)
            )),
            ((Partner_Role_Discount_Base__c + SBQQ__Discount__c)*100)
        ))
    )
)


IF(SBQQ__NonDiscountable__c,
    (SBQQ__ListPrice__c * (1 - Partner_Role_Discount_Base__c)),
    IF(ISBLANK(SBQQ__Quote__r.SBQQ__CustomerDiscount__c),
        (IF(NOT(ISBLANK(SBQQ__Discount__c)),
            (SBQQ__ListPrice__c * (1 - (Partner_Role_Discount_Base__c + SBQQ__Discount__c))),
            IF(NOT(ISBLANK(SBQQ__AdditionalDiscountAmount__c)),
                (((1 - Partner_Role_Discount_Base__c) * SBQQ__ListPrice__c) - SBQQ__AdditionalDiscountAmount__c),
                (SBQQ__ListPrice__c * (1 - Partner_Role_Discount_Base__c))))),
        (IF(ISBLANK(SBQQ__Discount__c),
            (IF(ISBLANK(SBQQ__AdditionalDiscountAmount__c),
                (SBQQ__ListPrice__c * (1 - (Partner_Role_Discount_Base__c + SBQQ__Quote__r.SBQQ__CustomerDiscount__c))),
                (((1 - Partner_Role_Discount_Base__c) * SBQQ__ListPrice__c) - SBQQ__AdditionalDiscountAmount__c))),
            (SBQQ__ListPrice__c * (1 - (Partner_Role_Discount_Base__c + SBQQ__Discount__c)))))
    )
)
1.89 KB in 4 ms with coderay