It would help to know the expression your comparing to.
If you quote either side of the != Comparason it should force string value. So generally we quote because we are looking at non numerical values like states or tags etc.
When it’s numerical it would depend on the output of the expressions as if it returned identical number in any format it would work but as string values 0 in format of 0 and 0.00 are not identical.
The TN(’’) wrap forces the contained expression to be evaluated as a numerical.number value and should also make a null value 0.
Using this is a must for large/smaller expressions as you can get a ==/=! Expression to work while treating numbers as stings however larger smaller 100% need numbers.
Without seeing for full expression it’s hard to say.
Next is what is actually happening? Guessing it’s a commission type calculation.
What’s with empl1 through 4? And why would it seem they are all on same rate or at least rate called from same entity?
honestly I don’t know what I am doing =F
since I could not find a syntax tutorial.
I collected information bit by bit from other topics. until my setup started working.
Цитата
Next is what is actually happening? Guessing it’s a commission type calculation.
What’s with empl1 through 4? And why would it seem they are all on same rate or at least rate called from same entity?
I make a setting that automatically calculates the salary of employees depending on the percentage specified in their account, as well as the number of employees on the stream.
when you add a new order to the order are added order state empl1 or empl2 or empl3 or empl4
which one to add depends on whether the previous one is busy (if empl1 != ‘’ add to empl2 etc.)
(4 is used as this is the maximum number of workers in the stream)
also added order state count he adds the number of workers on the stream(then to correctly calculate the salary because it is divided by the number of workers on the stream)
Even made himself a special sign so as not to miss anything when entering into Sambapos
Why came out such a big formula?
in one day there may be a different number of employees depending on the workload, and the same employee can punchin and punchout several times a day, so the same employee can be both empl1 and empl2, etc.
as the payroll occurs at punchout and the worker can be several times punchin\punchout -TN('{ACCOUNT TRANSACTION TOTAL:Нарахування зарплати (Payroll):{ENTITY NAME}}'))]
checks to not pay the salary again.
setting is ready and works at 99% (maybe when I write the tutorial )
there is only one problem.
if employee punchin to work and earned nothing, and punchout (salary = 0), then instead of creating a transaction, shows standard transaction window
F I believe is financial maybe but believe it turns to you set curancy decimals.
TN forces number but believe it will show the number as is without forcing decimals.
Did you understand my comment about simplifying the formula?
You have duplicated calls to TN(’{REPORT ENTITY DETAILS:EC.Pay Rate percent of sale:(EN={ENTITY NAME})}’) which in the same event would return the same each time.
Also since I guess that refers to employee entity suprised you haven’t needed to specify entity type to avoid confusion with other entity types like table or customer.
everything is already working, but I try to explain.
I have a restaurant
where there are several cooking streams:
sushi, pizza, meat, bar.
each employee only works on his own stream.
There are many workers, for example, there are 10 sushi-workers.
up to 4 sushi-workers work on shift at the same time.
and they are paid a salary on the number of prepared dishes.
but not always the sushi worker works the whole shift, he can work for several hours (not all works period), or work a few hours, go on a break, then continue again…
for this, I add to each check the sushi-workers who work on the dish, as well as count of sushi-workers in shift (at the moment).
the calculation salary formula looks like this:
X/Y/100*Z= employee salary
X = order price
Y = count of workers in shift
Z = percent salary (for each employee is different, depending on the experience etc.).