CUSTOM REPORTS - Displaying ticket change

I know, right? That is the weird shit I am talking about. Lead with space-pipe or just pipe probably works too. There are things about the parser that are very strange sometimes, and there is no way to predict that. But we always find ways to break stuff that @emre was never expecting, and then we sometimes, somehow, come up with a work-around, even if it seems to make no sense at all.

It would be almost impossible for me to explain that quirk that I found, and have worked around by giving an empty column at the beginning with space-pipe or just pipe. Somehow, somewhere, sometime, I ran across that and scratched my head, where it was working, then it wasn’t on another line, and what was the difference? Then put the leading thing in and bang it works again.

How do you describe that to someone, nevermind explain the “why”.

1 Like

Inventive. I could never have come up with that, and would have given up and gone SQL looong before. :stuck_out_tongue_winking_eye:

Thanks Q, I’m enjoying finding the quirks!

I’d like to convert these REPORT SQL tags to CALL tags and store the SQL inside a script, but I can’t seem to successfully pass in the {Start} and {End} parameters in to a CALL. Do you know if it’s possible?

I am having an issue using an IF statement in a Custom Report

[=TN('{CALL:co.getChangeByType($1,2)}')] works perfectly and outputs either a 0 or the amount of change, but when I try to use this in an IF statment, it doesn’t seem to work (I don’t want to output the 0’s, I only want an output when change was givien).

This is not working (nothing is output regardless of the change amount). What am I doing wrong?
[='TN('{CALL:co.getChangeByType($1,2)}')' == '0' ? 'Change Given' : 'No Change']

Try this [=TN('{CALL:co.getChangeByType($1,2)}') == '0' ? 'Change Given' : 'No Change']

1 Like

Perfect, thanks @Jesse

PS. My IfTrue and IfFalse responses are the wrong way around, but that’s just a typo on my part :slight_smile: