I am trying to not show closed lines in my sales o...
# advancedpdf
b
I am trying to not show closed lines in my sales order template. Please let me know if you know the error in this statement: <#if item.isclosed == 'No'>
a
I guess I wouldn't assume it would automatically valuate to a string "No". You could cast to a String before evaluating, or do a boolean comparison? Are you getting an error message at all? Or it just isn't working?
b
It just isn't working, I am not getting a error message.
I will try a 0 and see if that works
I tried a 0 and here is the error that I got: Can't compare values of these types. Allowed comparisons are between two numbers, two strings, two dates, or two booleans. Left hand operand is a hash+boolean (wrapper: com.netledger.templates.model.BooleanModel). Right hand operand is a number (wrapper: f.t.SimpleNumber). The blamed expression: ==> item.isclosed == 0 [in template "template" at line 118, column 6] ---- FTL stack trace ("~" means nesting-related): - Failed at: #if item.isclosed == 0 [in template "template" at line 118, column 1] ----
this is what I had typed in: <#if item.isclosed == 0>
a
what about
== false
?
or just
<#if !item.isclosed>
otherwise you could try
<#if item.isclosed?string == 'false'>
or
<#if item.isclosed?string == 'no'>
or
<#if item.isclosed?string == 'F'>
one of those ought to work
b
Trying those now
isclosed worked but it only showed closed lines not open ones
I am trying isnotclosed, isopen, and the other ones that you had sent
a
did you put the
!
in front
<#if !item.isclosed>
b
Bingo that worked perfectly