XML Receipt Text Comparisons

I'm having problems comparing two text fields.

Why doesn't this work?

"Freight"

...

Entry.Item.ItemLookupCode = LookupCodeFreight Entry.Item.ItemLookupCode " Is Freight" Entry.Item.ItemLookupCode " Is Not Freight"

Results are always false ie. Freight Is Not Freight

If I could only add tax to shipping, this would not be an issue.

Reply to
Mick Hardy
Loading thread data ...

Because the stupid XML template language doesn't allow text comparisons. According to the documentation, it also doesn't include the Item ID as a variable, but you could try comparing against Entry.Item.ID anyway

- sometimes the doc is wrong...

You might be able to change the LookupCode to a number (then change "Freight" to an alias) and get around it that way, but that may stil not work since the lookupcode is still technically a string...

Glenn Adams Tiber Creek C> I'm having problems comparing two text fields.

Reply to
Glenn Adams [MVP - Retail Mgmt]

Reply to
Mick Hardy

Ahhh, I see. Thanks for that bit of wisdom. Pulled my hair out for hours over this one as my original code was quite complicated. I'm sure I've read other posts where the suggested solution was to make the text string a variable.

I should be able to make the LookupCode a number and use an alias as I can then print anything on the Invoice. I was trying to remove freight from the picking slip and delivery docket and make it a one line entry on our work orders and invoices.

Thanks again for your help Glenn.

Reply to
Mick Hardy

Blank post was my fault - pre coffee clickety clickety.

I tried the Entry.Item.ID but it doesn't exist.

Compiler Error: Token 'Entry.Item.ID' was not found.

Reply to
Mick Hardy

I've made it a number and it still doesn't work. Any ideas?

342

...

(Entry.Item.ItemLookupCode = LookupCodeFreight) "||" Entry.Item.ItemLookupCode " Is " LookupCodeFreight "||" Entry.Item.ItemLookupCode " Is Not " LookupCodeFreight

Results of this are always false ie.

001 Is Not 342 342 Is Not 342
Reply to
Mick Hardy

I'm a self confessed moron. Text comparisons work fine.

I spelt Condition wrong - ooops.

Entry.Item.ItemLookupCode = LookupCodeFreight

Reply to
Mick Hardy

And just to follow up after further testing. Glenn is correct, as per usual.

Text comparisons do NOT work, although they may appear to work.

During my original testing (with condition spelt correctly), I must have only tested LookupCodes that were numeric. When we went live, the real database had lookup codes that are alphanumeric. As can be seen below, when using text comparisons, anything that is alphanumeric tested true and pure numeric codes tested false. No wonder I've been confused.

Text comparison results using real products instead of my numeric test codes.

PLEXT122412 Is Freight

9311744017119 Is Not Freight PLEXT121206 Is Freight 001 Is Not Freight 002 Is Not Freight Freight Is Freight

Numeric comparisons using the same products but with Freight set to a numeric code.

PLEXT122412 Is Not 342

9311744017119 Is Not 342 PLEXT121206 Is Not 342 001 Is Not 342 002 Is Not 342 342 Is 342

I wonder if this is a bug or by design?

Reply to
Mick Hardy

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.