Touch > Tools > Select right arrow once > Server Tools > Print Custom Reports
Description
This menu item allows for the creation of custom SQL scripts that will print out a column formatted report on Receipt Printers directly from the SwiftPOS Touch terminal. Sometimes, there may be a requirement for more information than there is available in the standard supplied X/Z Reports. This feature makes a request to the SwiftPOS Back Office and returns the data back to the SwiftPOS Touch terminal to print on the Receipt Printer.
To Be Considered
- SwiftPOS is available to write custom scripts, please contact your reseller to obtain a quote.
Pre-Requisites
- The SwiftPOS Connect service must be running.
- One or more Custom Reports in the form of a SQL Scripts (.SQL) must be available in the C:\Users\Public\Documents\SwiftPOS Connect\Custom Reports folder.
Custom Reports
|
This screen is accessed from here.
Footer
|
Operation
- Create a SQL Script (see below) and place the SQL file in the folder mentioned above in Pre-requisites.
- Send a Full Update to the SwiftPOS Touch terminals. This will ensure the reports placed in the above folder will be available to be added at SwiftPOS Touch terminals.
- To add a report and include it as part of, for example the Z Report, do as follows:
- In Touch > Tools > Select right arrow once > Server Tools > Print Custom Reports.
- Select Add Report.
- Enter a Report Name.
- Select the Select Report button and select one of the reports in the Custom Reports search screen.
- Select a Date Range or From/To dates.
- Select a Family, Product Range and/or PLU Range to filter the report.
- Select the Print button to request data to be retrieved from the Back Office and retuned to the SwiftPOS Touch Terminal.
- Select Close to exit the Custom Reports screen.
- Now using the Add Custom button Report Settings screen, select the Report to be added from the Custom Reports search screen.
- Save the changes to the Report Settings.
- Select the Print Report POS Key to print the Z Report.
- The selected Custom Report is now included in the Z Report.
How it works
- The SQL is passed back to the SwiftPOS Back Office via the Connect service (which needs to be running).
- The data is generated in SwiftPOS Back Office and then zipped and placed in the Outbox for the SwiftPOS Touch terminal.
- This is then picked up and sent to the SwiftPOS Touch terminal's Inbox at which point it is seen, extracted and the .dat file created in the Print Files folder.
- From there it is extracted and sent to the Receipt Printer in the same manner as a normal sales receipt.
Writing custom SQL Scripts
Rules for Custom Report SQL Scripts
- Columns - There is a limit of up to 4 columns with set lengths:
- For 2 or 4 columns the column sizes (in characters) are as follows:
- First column = 16
- Last column = 12
- Other columns = 6
- For 3 columns column sizes (in characters) are as follows:
- First column = 20
- Middle column = 8
- Last column = 12
- Filters - The following are available:
- Customer Set filters are available in the Custom report filters screen:
- @FromDate
- @ToDate
- @FromPLU
- @ToPLU
- @Filter
- @FamilyID
- POS Set filters automatically set be SwiftPOS Touch:
- @LocationGroupID
- @LocationNumber
- @TerminalID
Below are examples of SQL scripts for the following reports:
Volume Sales By Master Groups Report
SELECT
[MASTERGROUP] AS [MASTER GROUP],
[QTY],
[VOL],
[SALES]
FROM
(
SELECT
0 AS ID,
LEFT(MasterProductGroupTable.MasterGroupDescription,16) AS [MASTERGROUP],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.QTY * PRODUCTTABLE.UNITSPERCASE) AS [VOL],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK) INNER JOIN EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.
TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
INNER JOIN INVENTORYGRPTABLE WITH(NOLOCK) ON PRODUCTTABLE.PRODUCT_GROUP = INVENTORYGRPTABLE.GROUP_NUMBER
INNER JOIN MasterProductGroupTable WITH(NOLOCK) ON INVENTORYGRPTABLE.MasterGroup = MasterProductGroupTable.MasterGroup
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
EJITEMSTABLE.SALES <> 0
GROUP BY
LEFT(MasterProductGroupTable.MasterGroupDescription,16)
UNION ALL
SELECT
1 AS ID,
'TOTAL' AS [MASTER GROUP],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.QTY * PRODUCTTABLE.UNITSPERCASE) AS [VOL],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK) INNER JOIN EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.
TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
INNER JOIN INVENTORYGRPTABLE WITH(NOLOCK) ON PRODUCTTABLE.PRODUCT_GROUP = INVENTORYGRPTABLE.GROUP_NUMBER
INNER JOIN MasterProductGroupTable WITH(NOLOCK) ON INVENTORYGRPTABLE.MasterGroup = MasterProductGroupTable.MasterGroup
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
EJITEMSTABLE.SALES <> 0
) AS DATA
ORDER BY
DATA.ID,
DATA.MASTERGROUP
Volume Sales By Price Levels Report
SELECT
[PRICELEVEL] AS [PRICE LEVEL],
[QTY],
[VOL],
[SALES]
FROM
(
SELECT
0 AS ID,
LEFT(PriceLevelNamesTable.PriceLevelDescription,16) AS [PRICELEVEL],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.QTY * PRODUCTTABLE.UNITSPERCASE) AS [VOL],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK) INNER JOIN EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.
TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
INNER JOIN PriceLevelNamesTable WITH(NOLOCK) ON EJITEMSTABLE.Price_Level = PriceLevelNamesTable.PriceLevel
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
EJITEMSTABLE.SALES <> 0
GROUP BY
LEFT(PriceLevelNamesTable.PriceLevelDescription,16)
UNION ALL
SELECT
1 AS ID,
'TOTAL' AS [PRICELEVEL],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.QTY * PRODUCTTABLE.UNITSPERCASE) AS [VOL],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK) INNER JOIN EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.
TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
INNER JOIN PriceLevelNamesTable WITH(NOLOCK) ON EJITEMSTABLE.Price_Level = PriceLevelNamesTable.PriceLevel
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
EJITEMSTABLE.SALES <> 0
) AS DATA
ORDER BY
DATA.ID,
DATA.PRICELEVEL
Volume Sales By Product Groups Report
SELECT
[PRODUCTGROUP] AS [PRODUCT GROUP],
[QTY],
[VOL],
[SALES]
FROM
(
SELECT
0 AS ID,
LEFT(INVENTORYGRPTABLE.GROUP_DESCRIPTION,16) AS [PRODUCTGROUP],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.QTY * PRODUCTTABLE.UNITSPERCASE) AS [VOL],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK)
INNER JOIN EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
INNER JOIN INVENTORYGRPTABLE WITH(NOLOCK) ON PRODUCTTABLE.PRODUCT_GROUP = INVENTORYGRPTABLE.GROUP_NUMBER
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
EJITEMSTABLE.SALES <> 0
GROUP BY
LEFT(INVENTORYGRPTABLE.GROUP_DESCRIPTION,16)
UNION ALL
SELECT
1 AS ID,
'TOTAL' AS [PRODUCTGROUP],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.QTY * PRODUCTTABLE.UNITSPERCASE) AS [VOL],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK)
INNER JOIN EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
INNER JOIN INVENTORYGRPTABLE WITH(NOLOCK) ON PRODUCTTABLE.PRODUCT_GROUP = INVENTORYGRPTABLE.GROUP_NUMBER
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
EJITEMSTABLE.SALES <> 0
) AS DATA
ORDER BY
DATA.ID,
DATA.PRODUCTGROUP
Account Charges by Product
Note : This report by default only reports on charges associated with Account/Member No 1. To report on another Account/Member, ensure the set @MEMBERNO = 1 statement below is changed. For example, set @MEMBERNO = 11
declare @MEMBERNO int
set @MEMBERNO = 1
SELECT
[PRODUCT],
[QTY],
[SALES]
FROM
(
SELECT
0 AS ID,
LEFT(ProductTable.DESCRIPTION,20) AS [PRODUCT],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK) INNER JOIN
EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
(EJTABLE.MEMBER_NUMBER = @MEMBERNO) AND
EJITEMSTABLE.SALES <> 0
GROUP BY
LEFT(ProductTable.DESCRIPTION,20)
UNION ALL
SELECT
1 AS ID,
'TOTAL' AS [PRODUCT],
SUM(EJITEMSTABLE.QTY) AS [QTY],
SUM(EJITEMSTABLE.SALES) AS [SALES]
FROM
EJTABLE WITH(NOLOCK) INNER JOIN
EJITEMSTABLE WITH(NOLOCK) ON EJTABLE.TRANSACTION_NUMBER = EJITEMSTABLE.TRANSACTION_NUMBER
INNER JOIN PRODUCTTABLE WITH(NOLOCK) ON EJITEMSTABLE.INVENTORYCODE = PRODUCTTABLE.INVENTORY_CODE
WHERE
(EJTABLE.RECEIPT_DATE_TIME BETWEEN @FROMDATE AND @TODATE) AND
(EJTABLE.LOCATION_NUMBER = @LOCATIONNUMBER) AND
EJITEMSTABLE.SALES <> 0 AND
(EJTABLE.MEMBER_NUMBER = @MEMBERNO)
) AS DATA
ORDER
BY DATA.ID,
DATA.PRODUCT
Clerks Clocked On
Below is an example of a Report that will show all Clerks currently Clocked On.
SELECT
CONVERT(NCHAR(23),
LEFT(CLERK_NAME,23)) + ' - ' + CONVERT(NVARCHAR,CLOCKON,3) + ' ' + left(CONVERT(NVARCHAR,CLOCKON,108),5) As [Clerks Clocked On]
FROM
CLERKTABLE WITH(NOLOCK)
INNER JOIN CLERKTIMECLOCKTABLE WITH(NOLOCK) ON CLERKTABLE.CLERK_NUMBER = CLERKTIMECLOCKTABLE.CLERK
WHERE
ISNULL(CLERKTIMECLOCKTABLE.CLOCKOFF,'2050-1-1') = '2050-1-1' AND
CLERKTIMECLOCKTABLE.LOCATION = @LOCATIONNUMBER
ORDER BY
CLERKTABLE.CLERK_NAME
Related Topics
- POS Configuration Index - Reporting Configuration
- POS Operation
- POS Operation Index - Reporting Features
- Reports