This topic contains 5 replies, has 0 voices, and was last updated by kastnerd 8 years, 11 months ago.

  • Author
    Posts
  • #2201

    corey

    I am trying to print out credits on an invoice but only if the value is greater than zero. I have tried

    PHP Code:

     

    and I get

    PHP Code:

    The template cannot be saved due to the following errors: 
        The only legal comparisons are between two numbers, two strings, or two dates.. Left hand operand is a com.netledger.templates.model.EmptyModel. Right hand operand is a freemarker.template.SimpleNumber. 

    And

    PHP Code:

    0)> 

    Same result.

    I think the problem is that paid/credits is sort of a roll up field? Anyone done this?
    This is a cached copy. Click here to see the original post.

  • #2202

    jwenzer

    Have you tried record.amountremaining ?


    corey replied on 02/17/2015, 09:42 AM: That one I can check against (it’s a number) and I guess I could check to see if it matches total but I would rather understand how to check for credits.

  • #2203

    carl.billings

    Hey Corey

    Drop me a line. I think i know the issue here but rather than write 20 postings to confirm lets walk through it

  • #2204

    PatrickAlc

    PHP Code:

  • #2205

    michoel

    From the Freemarker manual:

    There’s a problem with >= and >. FreeMarker interprets the > character as the closing character of the FTL tag. To prevent this, you can uselt instead of <, lte instead of and gte instead of >=, like in . Another trick it to put the expression into parentheses like in y)>, although it’s considered to be less elegant.

    Also, you may need to convert the field to a number first:

    Code:

  • #2206

    kastnerd

    any luck getting this to work?

You must be logged in to reply to this topic.