I have setup my Customer entity type with “NIT” (Tax Income Number) as the primary field and “Nombre” (Name in Spanish) as a custom field.
I have created two custom “Update Ticket Tag” actions to collect the NIT and the Nombre of the customer before printing an invoice. When I use a rule with these two actions I get this dialog:
If the ticket already has a customer associated, then those text boxes will be populated with the corresponding values since the actions have “ENTITY NAME:Customer” and “ENTITY DATA:Customer:Nombre” as default values.
What I need is the ability to search for a customer when the user has entered the NIT. If the client is found then the Nombre text box should be populated with it.
It would also be great to be able to store a new client when the two values were entered and no customer was found.
In the payment window I have a “Imprimir Factura” (Print Invoice) button. To print the invoice I need the customer’s NIT (Tax Income Number) and Nombre (Name).
In any case, if the user types a NIT (or overwrites the current one) the dialog should display the corresponding Nombre for such NIT. If there is no customer for such NIT then the NIT and Nombre values should be used to create a new customer entity when the user clicks OK.
As you said maybe the “Search Customer” screen can be reused for that task. In that pursuit I have created a Change Ticket Entity action: