0

I want to use condition to print certain terms and conditions according to value set.

For example, there are 10 "Terms and Conditions" for payment. The default rate is "rate1" but if "rate2" is choosen, conditions no 3 and 4 should be change to something else.

If "rate1" is set then,

1. This is condition for both (1 or 2)
2. This is condition for both (1 or 2)
3. This is condition for rate 1
4. This is condition for rate 1
.
.
.
9. This is condition for both (1 or 2)
10. This is condition for both (1 or 2)

If "rate2" is set then,

1. This is condition for both (1 or 2)
2. This is condition for both (1 or 2)
3. This is condition for rate 2
4. This is condition for rate 2
.
.
.
9. This is condition for both (1 or 2)
10. This is condition for both (1 or 2)

Terms and conditions are "static", not stored in object.

My RML is like this:

<tr>
    <td><para>1</para></td>
    <td><para>This is condition for both (1 or 2)</para></td>
</tr>
<tr>
    <td><para>2</para></td>
    <td><para>This is condition for both (1 or 2)</para></td>
</tr>
<tr>
    <td><para>3</para></td>
    <td><para>This is condition for rate 1</para></td>
</tr>

Is there any way that I can use "condition" in line 3.

Thank you in advance.

Lekha
  • 11
  • 4

1 Answers1

0

I am not sure if it has exactly "if else conditions" in RML.

But in my case, I managed to solve as follows, and may be helpful for somebody like me.

[[ r.rate2 != '']]
[['3. Condition for Rate 2 '']]
[[ r.rate1 != '']]
[['3. Condition for Rate 1 '']]

OR

[[(r.rate1 == 0 and ' ') or '3. Condition for Rate 1']]
[[(r.rate2 == 0 and ' ') or '3. Condition for Rate 2']]

It doesn't seems a good way, but fixed the problem.

If found a better way, will always be appreciated.

Lekha
  • 11
  • 4