Query panel in the Number generator window
Query panel in the Number generator window

The Query panel is used to enter and edit the SQL query that generates the object number. The panel contains a multiline text box with the text of the query.

Figure 11.103. Query panel


The panel contains a multiline text field with the text of the query. The context menu of the field contains the following commands:

  • Test query – runs the query.

    Selecting this command opens the Query result window.

  • Cancel – undoes changes made to the query text.

    This command is available if the query text contains unsaved changes.

  • Cut – cuts the selection to the clipboard.

  • Copy – copies the selection to the clipboard.

  • Paste – pastes the selection from the clipboard to the specified location.

  • Delete – deletes the selection.

  • Select all – selects the entire text.

  • Find/Replace... (Ctrl+F) – contextual search and replacement.

    Selecting this command opens the Find/Replace... window.

Parameters to be used in the query
Stock-in records (tp_InputDocuments) %stor_ID - Store %part_ID - Partner %usr_ID - Employee %Date - Date Stock-out records (tp_OutputDocuments) %stor_ID - Store %part_ID - Partner %usr_ID - Employee %Date - Date Sales records (tp_SaleDocuments) %arch_ID - Business day %stor_ID - Store %usr_ID - Employee %Date - Date Stocktaking records (tp_StoreInventories) %stor_ID - Store %usr_ID - Employee %Date - Date Production records (tp_CompoundDocuments) %stor_ID - Store %usr_ID - Employee %Date - Date Butchering records (tp_DecomposeDocuments) %stor_ID - Store %usr_ID - Employee %Date - Date Stock movement records (tp_MoveDocuments) %stor_ID - Store %stor_ID_In - Sending store %stor_ID_Out - Sending store %usr_ID - Employee %Date - Date Stock adjustment records (tp_WriteOffDocuments) %stor_ID - Store %wdtp_ID - Stock adjustment record type %usr_ID - Employee %Date - Date Development records (tp_StoreExperiments) %stor_ID - Store %usr_ID - Employee %Date - Date Receipts (tp_Checks) %dvsn_ID - Division %arch_ID - Business day %dev_ID - POS terminal %usr_ID - Employee %Date - Date Bills (tp_PreChecks) %arch_ID - Business day %dev_ID - POS terminal %usr_ID - Employee %Date - Date Orders (tp_Orders) %dvsn_ID - Division %arch_ID - Business day %plac_ID - Table %dev_ID - POS terminal %usr_ID - Employee %Date - Date Guest tabs (tp_Guests) %dvsn_ID - Division %arch_ID - Business day %plac_ID - Table %dev_ID - POS terminal %usr_ID - Employee %Date - Date IDs (tp_Identifiers) %idnt_Name - ID name Regular customer account operations(tp_ClientPurseOperations) %clnt_ID - Regular customer %cptp_ID - Regular customer account type %usr_ID - Employee %atop_ID - Authorisation operationAuthorisation operation %Date - Date Regular customer points operations (tp_ClientDiscountPointOperations) %clnt_ID - Regular customer %dspt_ID - Point type %usr_ID - Employee %Date - Date Business days (tp_Archives) %dvsn_ID - Division %dev_ID - POS terminal %usr_ID - Employee %Date - Date Store period closure (tp_StoreArchives) %stgr_ID - Store group %Date - Date Planned cost records (tp_StoreGroupPlanPrices) %stgr_ID - Store group %Date - Date %usr_ID - Employee