GQL Modules - GraphQL Modules for Remote Client Browsers

#Special Reports

Since the removal of all PHP code, the Modules require some “special” Custom Reports in SambaPOS.

:warning: You must create these Reports exactly as shown.


##GQLM Users

For User Authentication.

[Users:1,2,2,1,2,1]
>>id|name|PIN|roleId|role|isAdmin
{REPORT SQL DETAILS:
SELECT
 u.[Id] as [uId]
,u.[Name] as [uName]
,CONVERT(VARCHAR(max),HASHBYTES('SHA2_512',convert(varchar(32),u.[PinCode])),2) as [uPin]
,ur.[Id] as [urId]
,ur.[Name] as [urName]
,ur.[IsAdmin]
FROM [Users] u
left join [UserRoles] ur on ur.[Id]=u.[UserRole_Id]
ORDER BY u.[Name]
:F.uId,F.uName,F.uPin,F.urId,F.urName,F.IsAdmin}

##GQLM Custom Reports

Used by the Reports Module.

[Custom Reports:1,1,1,4,4,1,1,1,1]
>>id|reportType|displayInExplorer|name|template|pageSize|layouts|sortOrder|visualPrint
{REPORT SQL DETAILS:
SELECT
[Id]
,[ReportType]
,[DisplayInExplorer]
,[Name]
,convert(varchar(max),convert(varbinary(max),[Template]),2) as [Template]
,[PageSize]
,[Layouts]
,[SortOrder]
,[VisualPrint]
FROM [CustomReports]
WHERE [Name] not like 'GQLM%'
ORDER BY [SortOrder],[Name]
:F.Id,F.ReportType,F.DisplayInExplorer,F.Name,F.Template,F.PageSize,F.Layouts,F.SortOrder,F.VisualPrint}

##GQLM Task Types

Used by the Task Editor Module.

[Task Types:2,8]
>>id|name
{REPORT SQL DETAILS:
SELECT
 [Id]
,[Name]
FROM [TaskTypes]
ORDER BY [Name]
:F.Id,F.Name}

##GQLM Task Type Custom Fields

Used by the Task Editor Module.

[Task Type Custom Fields:1,1,4,4,2,2,2]
>>id|taskTypeId|taskType|name|fieldType|editingFormat|displayFormat
{REPORT SQL DETAILS:
SELECT
 cf.[Id]
,cf.[TaskTypeId]
,tt.[Name] as [TaskType]
,cf.[Name]
,CASE [FieldType]
 WHEN 0 THEN 'String'
 WHEN 1 THEN 'Number'
 WHEN 2 THEN 'Date'
 END as [FieldType]
,isnull([EditingFormat],'') as [EditingFormat]
,isnull([DisplayFormat],'') as [DisplayFormat]
FROM [TaskCustomFields] cf
JOIN [TaskTypes] tt on tt.[Id] = cf.[TaskTypeId]
ORDER BY tt.[Name], cf.[Id]
:F.Id,F.TaskTypeId,F.TaskType,F.Name,F.FieldType,F.EditingFormat,F.DisplayFormat}

##GQLM Terminals

Used by the POS Module.

##GQLM Terminals [0] (Report)##

Report Name: GQLM Terminals
Page Size:
Display in Report Explorer: unchecked
Visual Printing: unchecked

Template:

[Terminals:1,2]
>>dbId|name
{REPORT SQL DETAILS:
SELECT
 t.[Id] as [dbId]
,t.[Name] as [name]
FROM [Terminals] t
ORDER BY t.[Id]
:F.dbId,F.name}

##GQLM Ticket Type Entity Types

Used by the POS Module.

##GQLM Ticket Type Entity Types [0] (Report)##

Report Name: GQLM Ticket Type Entity Types
Page Size: 15cm
Display in Report Explorer: unchecked
Visual Printing: unchecked

Template:

[Ticket Type Entity Types:1,2,1,2,1,1,1,1]
>>id|name|ticketTypeId|ticketType|askBeforeCreatingTicket|state|copyToNewTickets|sortOrder
{REPORT SQL DETAILS:
SELECT
 [EntityTypeId] as [Id]
,[EntityTypeName] as [Name]
,[TicketTypeId] as [TicketTypeId]
,tt.[Name] as [TicketType]
,[AskBeforeCreatingTicket]
,[State]
,[CopyToNewTickets]
,et.[SortOrder]
--,et.[Id] as [dbId]
FROM [EntityTypeAssignments] et
JOIN [TicketTypes] tt on tt.[Id] = et.[TicketTypeId]
WHERE 1=1
AND tt.[Name] LIKE '$1'
ORDER BY tt.[SortOrder],et.[SortOrder],et.[EntityTypeName]

:F.Id,F.Name,F.TicketTypeId,F.TicketType,F.AskBeforeCreatingTicket,F.State,F.CopyToNewTickets,F.SortOrder}

##GQLM Automation Commands

Used by the POS Module.

[Automation Commands:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
>>id|name|buttonHeader|displayOnTicket|displayOnPayment|displayOnOrders|displayOnTicketList|displayUnderTicket|displayUnderTicket2|displayOnCommandSelector|displayOnNavigation|terminalId|terminal|departmentId|department|ticktTypeId|TicketType|roleId|role|enabledStates|visibleStates|fontSize|color|sortOrder|symbol|image|contentTemplate|navigationModule
{REPORT SQL DETAILS:
SELECT 
command.[Id]
,command.[Name]
,replace(replace(isnull([ButtonHeader],''),'\r','\\r'),char(13),'\\r') as [ButtonHeader]
,map.[DisplayOnTicket]
,map.[DisplayOnPayment]
,map.[DisplayOnOrders]
,map.[DisplayOnTicketList]
,map.[DisplayUnderTicket]
,map.[DisplayUnderTicket2]
,map.[DisplayOnCommandSelector]
,[DisplayOnNavigation]
,map.[TerminalId]
,isnull(term.[Name],'ANY') as [Terminal]
,map.[DepartmentId]
,isnull(dep.[Name],'ANY') as [Department]
,map.[TicketTypeId]
,isnull(tktType.[Name],'ANY') as [TicketType]
,map.[UserRoleId]
,isnull(ur.[Name],'ANY') as [UserRole]
,map.[EnabledStates]
,map.[VisibleStates]
,[FontSize]
,[Color]
,command.[SortOrder]
,[Symbol]
,[Image]
,[ContentTemplate]
,[NavigationModule]
FROM [AutomationCommands] command
JOIN [AutomationCommandMaps] map on map.[AutomationCommandId] = command.[Id]
LEFT JOIN [UserRoles] ur on ur.[Id] = map.[UserRoleId]
LEFT JOIN [Terminals] term on term.[Id] = map.[TerminalId]
LEFT JOIN [Departments] dep on dep.[Id] = map.[DepartmentId]
LEFT JOIN [TicketTypes] tktType on tktType.[Id] = map.[TicketTypeId]
WHERE 1=1
AND (   isnull(ur.[Name],'ANY') = 'ANY'
     OR isnull(ur.[Name],'ANY') = 'Admin'
    )
AND (   isnull(term.[Name],'ANY') != 'Server')
ORDER BY command.[SortOrder], command.[Name]
:F.Id,F.Name,F.ButtonHeader,F.DisplayOnTicket,F.DisplayOnPayment,F.DisplayOnOrders,F.DisplayOnTicketList,F.DisplayUnderTicket,F.DisplayUnderTicket2
,F.DisplayOnCommandSelector,F.DisplayOnNavigation,F.TerminalId,F.Terminal,F.DepartmentId,F.Department,F.F.TicketTypeId,F.TicketType
,F.UserRoleId,F.UserRole,F.EnabledStates,F.VisibleStates,F.FontSize,F.Color,F.SortOrder,F.Symbol,F.Image
,F.ContentTemplate,F.NavigationModule}
1 Like