Set Discount On line Level

Rami Keyrouz

Hi,

Am creating a validation condition to set a specific discount percentage on line level based on the total document amount.

The system is working perfectly when amount is above 50.000,00 and set the correct discount which is 4% on line level when pressing the Add\Update button but it is not working well for the other parameters.

Below you can find my whole code am using.

 

IF (
    $[$4.0.0] = '10001'
    AND $[$22.0.0] < '50.000,00'
    AND $[$BOYX_20.0.0] IN (
        'Norwegian Joy',
        'Norwegian Jewel',
        'Norwegian Pearl',
        'Norwegian Gem',
        'Norwegian Jade',
        'Norwegian Escape',
        'Norwegian Epic'
    )
)
BEGIN
    SELECT 'Action' FOR BROWSE      -- 4% discount on line level
END

ELSE IF (
    $[$4.0.0] = '10001'
    AND $[$22.0.0] >= '50.000,00'
    AND $[$22.0.0] < '100.000,00'
    AND $[$BOYX_20.0.0] IN (
        'Norwegian Joy',
        'Norwegian Jewel',
        'Norwegian Pearl',
        'Norwegian Gem',
        'Norwegian Jade',
        'Norwegian Escape',
        'Norwegian Epic'
    )
)
BEGIN
    SELECT 'Action1' FOR BROWSE     -- 6% discount on line level
END

ELSE IF (
    $[$4.0.0] = '10001'
    AND $[$22.0.0] >= '100.000,00'
    AND $[$BOYX_20.0.0] IN (
        'Norwegian Joy',
        'Norwegian Jewel',
        'Norwegian Pearl',
        'Norwegian Gem',
        'Norwegian Jade',
        'Norwegian Escape',
        'Norwegian Epic'
    )
)
BEGIN
    SELECT 'Action2' FOR BROWSE     -- 8% discount on line level
END

Do you think is there something wrong with this code logic?

Comments

0 comments

Please sign in to leave a comment.