It’s not random. The behaviour you are experiencing is due to lines overflowing - so the display can display 20 characters per line over 2 lines, if anything overflows even just one character over that 20 characters, it moves the “cursor” to the next line, and therefore will mess up the layout. The only way to fix this is to clear the display each time you send something to it. The command to do that will depend on your model, I notice you mentioned some codes but you will have to check the command reference manual to check exactly which ones to use.
From my own experience, I have setup a 20x2 line customer display before and I tended to put the description on one line and the price on the other, since the description is usually what overflows. Also with V5, you can use substr function on a string to limit the number of characters.
I had to test clear template for each pole display use ‘12’ at header for clear
But still randomly.
This for begining run SambaPos
12
SELAMAT DATANG
WELCOME
this is for pole item, if i add ‘12’, still randomly
[LAYOUT]
{ORDERS}
Total: {TICKET TOTAL}
[ORDERS]
{QUANTITY} {NAME} |:| {TOTAL AMOUNT}
this for the end transaction, i clear all
12
TERIMA KASIH
ATAS KUNJUNGAN ANDA
randomly i mean, 1 transaction pole display show correctly, after it standby 1 menit with no transaction, and i try to transaction, it diplay not corectly. randomly happen if standby.
So i logout and login again, pole display show correct again, sometimes not correctly
i use win 7 sp1.
at the start of every template you send to customer display
Also, this line:
{QUANTITY} {NAME} |: {TOTAL AMOUNT}
has potential to be over 20 characters. If it is, then it will mess up the display. So like my suggestion, limit number of characters. Displaying quantity, name and total on one line might be too much, especially your currency is in thousands.
If you consider you have 1 digit quantity, then you have per line 2 spaces (between quantity and name, between name and total) + one :, your price if 9,999 or less you have only 11 characters for your {NAME}. If you have 2 digit quantity and your price is 10,000 or higher, you only have 9 characters for {NAME}. So you can use substr on {NAME} to force it to be maximum 9 characters. I believe the syntax would be [='{NAME}'.substr(0,9)].
I also found sometimes you get unexpected results on customer displays when using <J> for a line.
If you don’t need running total, you can consider item template like this, gives you more flexibility with name length. Also, try the command I use below instead of 12 - this is the one that works with my customer display: