When a client is selected (while issuing a document), it is possible to execute SQL code.

This is set in Settings-> Purchases / Sales-> Customer’s, run SQL.

After client is selected by the user, the variables sent by EMDI to the SQL code are:

: cd Line number of document type “eidhpar”.”Aa”
: rd Related document “eidhpar”.”parallhlo”
: pd Parent document “eidhpar”.”Koino”
: cl Customer Line Number “pelates”.”Aa” or “pvlhseis”.”Kvdikospelath”

EMDI receives content from the variables and defines it accordingly:

im_documentseries -> Document series “pvlhseis”.”Seira”
im_related -> Related documents “pvlhseis”.”Sxetika”
im_notes -> Notes “pvlhseis”.”Sxolio”
im_shippingaddress -> Place of shipment
im_loadingplace -> Place of loading
im_sign -> Signature
im_devicessentlist -> List of items sent to the documents
im_custom -> General scope (If the fifth part contains the product code that is pasted on the virtual keyboard then it is ignored)

im_message -> Open informative message
im_messagw -> Open a warning message

The following example puts the loyalties total points in the sales comment and compares it with the product custom field “points”.
If it is larger than the custom field then a message is displayed.