Erase one various fields once in customer register

Hello guys
Please help me

Excuse me but
my English is not very good

now I need other help

I need to create a way to delete a specific field of all clients at once

it’s possible?

I bought version 5 but I am still using version 4

as I am new to sambapos

We have a PUP and did sambapos work with electronic commanding

how to solve this?

Best Regards

You want to delete the field or the value in it?

the value
but all files
Can you help me

Files?

Batch entity editor probably the simplest way, how many entities you have?

You can just do;

Down
Delete
Down
Delete
Down
Delete
Down
Delete
ETC ETC ETC

You could setup a loop value automation but bit over the top if its a one of.
V5 you could script something but again if its a one of and not 1000’s of entities easier just to use bulk entity editor.

1 Like

I want to delete only the value.
I need to clear the field value
But of all the files at once

I do not understand programming
But they told me that could create a script
that would solve the problem

Can you help me?

Depends on how many enties your talking, a script is not a 2-3 minute job, entity data is stored in json within sql so would need to use included handlers/parse json in a jscript, if it was column per field SQL query would be fairly simple but not the case for custom fields.
If your only talking a 10’s or couple of hundred its will probably be quicker just to do manually in batch editor as above.
Oh and also scripts not available in V4 :slight_smile:

OK
BUT I HAVE LICENSED VERSION 5
HOW TO SCRIPT?
TO SOLVE THIS PROBLEM

NO NEED TO SHOUT!! YOU POSTING IN V4 SECTION OF THE FORUM :stuck_out_tongue:

You need to call a list of entities for the entity type, then for loop thorough them updating the data field to blank.
Youll also need an entity count to set the number of loops in the for loop.

Not sure if there are helpers/easier way for getting the list or loop, my system used SQL queries for the list and count.

SQL function for entity count;

function sqlEntityCount(inputEntityType) {																												//--Entity count by entity type
	qry =  " SELECT COUNT([Name]) as [CT] 							";
	qry += " FROM [Entities] 										";
	qry += " WHERE [EntityTypeId]= 									";
	qry += "					(									";
	qry += "					SELECT [Id]							";
	qry += "					FROM [EntityTypes] 					";
	qry += "					WHERE [Name]='"+inputEntityType+"' 	";
	qry += "					) 									";																					//--QRY Variable + 'roomEntityType' Variable
	var entityCount = sql.Query(qry).First;																												//--SQL Query responce -> entityCount Variable
	return entityCount;																																	//--Return
}

SQL for entity list;

function sqlEntityList(inputEntityType) {																												//--Entity list by entity type
	qry =  " SELECT [Name] 											";
	qry += " FROM [Entities] 										";
	qry += " WHERE [EntityTypeId]= 									";
	qry += "					( 									";
	qry += "					SELECT [Id] 						";
	qry += "					FROM [EntityTypes] 					";
	qry += "					WHERE [Name]='"+inputEntityType+"'	";
	qry += "					) 									";
	qry += " ORDER BY [Name]										";																					//--QRY Variable + 'roomEntityType' Variable
	var entityList = sql.Query(qry).Delimit('~').All;																									//--SQL Query responce -> entitiesList Variable (~ seperated list of entities)
	return entityList;																																	//--Return
}

Define the count and list as variables;

	var entityCount 					= sqlEntityCount(***ENTITYTYPE***);																				//--SQL Query responce -> entityCount Variable
	var entityList 						= sqlEntityList(***ENTITYTYPE***);																				//--SQL Query responce -> entities Variable (comma seperated list of entities)

Use this loop to cycle through entities;

for (var e = 0; e<entityCount; e++) {

Within the loop define the ‘loop entity’ like this;

var loopRoomName = entityList[e];

Use the entity data helper to clear the value;

api.Entity(loopRoomName).Data(***FieldName***).Update('');

You obviously need to set the ***FieldName*** and ***ENTITYTYPE*** value - it will be in quotes if a static string.

Resulting in something like this;

function clearEntityDataFields(entityType,entityField) {
  var entityCount = sqlEntityCount(entityType);
  var entityList = sqlEntityList(entityType);
  var loopRoomName = '';
  for (var e = 0; e<entityCount; e++) {
  var loopRoomName = entityList[e];
  api.Entity(loopRoomName).Data(entityField).Update('');
  }
  return 'Done'
}

function sqlEntityCount(inputEntityType) {								
	qry =  " SELECT COUNT([Name]) as [CT] 							";
	qry += " FROM [Entities] 										";
	qry += " WHERE [EntityTypeId]= 									";
	qry += "					(									";
	qry += "					SELECT [Id]							";
	qry += "					FROM [EntityTypes] 					";
	qry += "					WHERE [Name]='"+inputEntityType+"' 	";
	qry += "					) 									";	
	var entityCount = sql.Query(qry).First;		
	return entityCount;		
}

function sqlEntityList(inputEntityType) {		
	qry =  " SELECT [Name] 											";
	qry += " FROM [Entities] 										";
	qry += " WHERE [EntityTypeId]= 									";
	qry += "					( 									";
	qry += "					SELECT [Id] 						";
	qry += "					FROM [EntityTypes] 					";
	qry += "					WHERE [Name]='"+inputEntityType+"'	";
	qry += "					) 									";
	qry += " ORDER BY [Name]										";		
	var entityList = sql.Query(qry).Delimit('~').All;
	return entityList;
}

Which you would run using function clearEntityDataFields('***ENTITYTYPE***','***FieldName***')
You would need to add the handler if running outside of the script window using the test field.

1 Like

thank you friend…
As always
Very helpful

Hi friend…
I need help

I added a self-service to my business
And I wanted to know if it’s possible mine weighing-machine
Weigh food Automatically send the weight of the food to the program
Without having to type on the numeric keypad

I do not know how to do this procedure.
To send the command to the scale and she responds with the weight of the food

MY PRINTER IS TOLEDO 3 PLUS
My printer is Ttoledo 3 Plus

Your manual says it is necessary to use a communication protocol
To obtain the balance weight.

The application sends to the balance via the serial port:
[ENQ]

The printer responds:
[STX][ppppp][ETX] or [STX][I I I I I][ETX] or [STX][NNNNN][ETX] or [STX][SSSSS][ETX]

Where:
[STX]=character ASCII (02 H);

[Ppppp] = Weight field consisting of 5 ASCII characters, the first two characters being relative to the whole part of the And the other three to the decimal part. All zeros on the left should exist;

[I I I I I] = 5 ASCII characters (49 H) representing unstable weight;
[NNNNN] = 5 ASCII characters (4E H) representing negative weight;
[SSSSS] = 5 ASCII characters (53 H) representing weight overload.
[ETX] = ASCII character (03 H).
Example: 14.385 (14 kilograms and 385 grams).
[STX] [14385] [ETX]

I have to create some kind of script for the two to communicate

If you can help me, I would appreciate it.
A friend hug
Edson

Maybe try looking on the forum;

1 Like

thank you friend…
As always
Very helpful

The Brazil sends you a hug

Hi! my Friend

I want to split the bill from the table.

In 2 or more people and print in ticket

I found a topic related to this but did not work

When I add the command

{DISCOUNTS}
[Total Gift:|{ORDER STATE TOTAL:Gift}]
[Payment By Guest:|[=F(TN(’{TICKET TOTAL}’) / TN(’{SETTING:NUMBERPAD}’))]]

On the ticket so displays


BAR E RESTAURANTE PIERROT

Data:01/02/2017
Hora:10:42
Mesa: S-05

  • 1 Aipim Frito 16,00
  • 1 Fanta Laranja Lat 4,00
  • 1 File de Tilapia 54,90
  • 1 Carangueijo 6,90
  • 1 Camarao VG 79,00
    ==============================
    Sub-Total:
    Payment By Guest: +Infinito <<<<<=============== this is the problem
    Total: R$ 160,80
    ==============================
    • OBRIGADO POR VIR *
    • THANK YOU FOR COMMING *
      • GRACIAS POR VENIR *

  * CUPOM NÃO FISCAL *

OBS: Displays the word infinity, not the total divided

CAN YOU HELP ME

THANK YOU MY FRIEND…

You might be better to impliment a ticket covers setup using say tag and use the tag to divide for the split.
Even if it is only on a specific split bill print button.
Something strong like a tag would be more reliable than trying to use number pad directly.

How are you specifying of its a split bill or not in order to show a split amount value?

Something simple like a [?prompt] expression to set the tag before printing would suffice and would mean the value would remain for further prints…