Skip to content
Saleculator
Saleculator
  • Features
  • Downloads
  • Docs
  • Pricing
  • Blog
  • Partners
  • Contact

Printing reports in thermal receipt printer

HomePrinting reports in thermal receipt printer

Get Support

Getting Started

  • Introduction
  • Installing Saleculator on Windows
  • Printer setup
  • Performing your first sale!
  • Basic POS Operations
  • Understand Saleculator User Interface
  • Keyboard Shortcuts
  • Building a low cost POS System with Raspberry Pi and Saleculator
  • Activating Saleculator
  • Building a Saleculator Point of Sale System (Linux)
  • Using MySQL for Saleculator
  • Saleculator Webin Introduction

What's New?!

  • Dynamic product labeling and more
  • Updates focusing multi-retail management
  • Introducing a whole new UI
  • Custom POS Reports and more
  • Cash counting while closing
  • Now Print, Email, or Save your reports with a single click! Check the latest update.

Saleculator Features

  • Different Billing Methods or Modes in Saleculator
  • Cash Closing in Saleculator
  • Close cash reports
  • Multiple outlet control from a single point
  • Bill settlement

Tutorials

  • Cashier Guide
  • Manager Guide
  • Administrator Guide

How To's

  • Happy hour sale
  • Edited bills report
  • Printing reports in thermal receipt printer
  • Assign product categories to user roles
  • Printing encoded product cost on label
  • Installing AnyDesk in Saleculator
  • Get quantity from price embedded barcodes
  • Print Open Items in Close Cash Report
  • Update cumulative stock balance in stock diary
  • Using Saleculator for subscription based billing
  • Automatic Billing On Events
  • Printing Expiry Date On Product Labels
  • Dynamic item pricing based on auxiliary item
  • Applying tax on an open item
  • VAT Update Resources for UAE and KSA
  • Apply discount on a selected item
  • Print total amount in words
  • GST Update for India
  • Setting offer to choose any 5 items for the price of 3
  • Buy One Get One Sale
  • Tag-Along items
  • Print accounts report on every 1st of month
  • Show stock of selected item or stop selling out of stock item
  • Change warehouse for current sale
  • Stock movement in close cash report
  • Configure second display with Saleculator
  • Allowing Saleculator to access gmail account for sending mails
  • Setting a shortcut on sales screen to call another screen
  • Updating Saleculator to the latest version
  • Assign dining tables to waiters
  • Payment report based on payment type
  • Dynamic printer or print format selection
  • Tax based on customer
  • Multiple taxes
  • Setting Printer.Ticket for 80 column pre-printed form
  • Get the credit card type
  • How to backup Saleculator data
  • Support for individual person billing sitting in the same table
  • Print Token/Sequence number in receipt & KOT
  • Print total amount in Arabic numerals
  • How to setup KOT Printing
  • How to use auxiliary product as item note or modifier
  • Calculate cash balance in the drawer
  • Printer item wise sales report in close cash report
  • Foreign currency support
  • Print last bill from sales screen
  • Automatically return to billing mode after KOT
  • Embedding Chrome browser in Saleculator POS
  • HO to Branch Sale
  • Print priority notification on KOT
  • Restrict KOT cancellation
  • Calculating quantity from amount
  • Price/Weight/Quantity embedded barcode configuration
  • Installing Saleculator Webin on Windows
  • How To Bulk load data using Saleculator Webin
  • Laundry Operations With Saleculator POS
  • Handling Customer Debts Using Saleculator Software
  • Assigning USB printer to LPT port in Windows
  • Using Saleculator for Salon Business
  • Setting Static IP for the Raspberry LAN connection
  • Reset Saleculator from Root Shell
  • How to setup receipt and KOT on the same printer
  • Adding Taxes to the bill receipt
  • Printing Receipt with KOT
  • How to print duplicate receipt copy
  • Remote access WEBIN and Putty
  • Deleting Products and Categories from Saleculator POS Menu
  • How to restore a backup from the raspberry root using a flash drive
  • Adding service charge button and resource
  • Adding Menu Search option on the sales screen
  • Printing receipts on A4 & A5 printer sheets
  • Adding shortcut buttons for Cash, Card and Debt payment modes
  • Downloading PLU file for Label Scale
  • Transaction cutting above certain amount limits
  • Retrieve The License Key from the Root
  • Protected: PIN Reset
  • Installing Saleculator on Android Tab/Phone
  • Manual Update of Date and Time from Raspberry root
  • Print Barcode Label using WEBIN
  • How to enable the buzzer sound (Beep) for your KOT printers
  • Create User Roles as per your needs and permissions (E.g, Create a Role for sending KOT only!)
  • Change product button size
  • Billing transaction for Advance payment customers
  • IMPORTANT! Close cash report changed in version 3.8 U2 onwards
  • Adding new reports in Close Cash report
  • Accepting advance payment
  • How to setup Saleculator Kitchen Display System – KDS
  • Automatic data backup
  • Delete transactional data older than given days
  • Customize product button font style
  • Payment report based on card service provider
  • Setting customer reward points
  • Printing discount amount/service charge below the total amount in the receipt
  • Updating Webin to the latest version
  • Category wise sales report with parent category and profit
  • How to print barcode labels from Saleculator
  • Print category wise sales report in Close Cash
  • Print receipt log in Close Cash report
  • Setting a default tariff for all new bills
  • Apply a discount or tariff based on customer category
  • Round Off the total bill amount
  • Discount on total bill amount
  • Printing a coupon along with the receipt
  • Capture additional information and store in receipt
  • Capture additional information about an item from sales screen
  • Setting product property
  • Adding ZATCA Approved QR code to the invoice
  • Adding a payment option for Tip collection
  • Print Arabic product names on the receipts
  • How to delete the pictures from all product buttons
  • How to add Onscreen Keyboard for Saleculator on Raspberry Pi
  • Adding UPI enabled Payment QR code on the Bill Receipt
  • Access Raspberry Root using only LAN cable and Putty App (Without Internet)
  • MySQL command to Update Tax to all the products on the catalog automatically
  • Connect your Raspberry to the WiFi network
  • How to setup KOT4 for additional printer
  • Setting Up the Server and Client (Windows)

Hardware Setup

  • Setting-up Network thermal printer
  • Connect a network thermal printer directly with Saleculator
  • Setup HP or Samsung Laser/Deskjet Printers
  • A4 Laser printer setup for reports
  • Using Bluetooth weighing scale with Saleculator on Raspberry Pi
  • Using Label Scale with Saleculator

Troubleshooting

  • Fixing Database Not Loading error in Saleculator M5
  • Fixing issue, which required double tapping on touch screen to get click working
  • Protecting Saleculator Database from Ransomware Attacks
  • Enabling Tapping To Click for touchpads
  • Installing WiFi adpaters
  • Enabling support for more than 4 serial devices
  • Switch screen mode from portrait to landscape
  • Running remote Saleculator in Windows using Putty
  • Recover data from ibdata and .frm files
  • Resources supporting 42 character printer
  • Disable Saleculator screen turning blank due to inactivity
  • Persistent names for usb and serial devices
  • A quick rescue to free space when mysql run out of space
  • Remove duplicate item entry in sales screen
  • Recover data from a crashed MySQL instance
  • Using Putty to remote access Saleculator command shell
  • Updating Saleculator SSL certificates manually in JAVA keystore
  • Fixing issue of CUPS pausing the printer
  • How to solve repeated activation key requests?
  • MySQL Warning: IP address ‘192.168.1.98’ could not be resolved: Name or service not known
  • How to fix if Saleculator is stuck on loading screen
  • Installing eGalax touchscreen driver on Linux
  • Saleculator stuck at command shell
  • Fixing “Not enough stock” error when billing products
  • How to fix no network connection issues while activating the license key
  • Delete transactions for heavy back-office data
  • Fixing “This product does not have attributes” error!
  • How to resolve “Danger: Cannot connect to database. Database not available” error on Windows
  • Corrupted/Damaged SD Card issues
  • Fixing Arabic language issue on the barcode label printout
  • How to reset the negative inventory unit values to zero
  • How to fix the disordered sequence of Ticket# in the sales log report
  • Fixing “mysqld.exe System Error” while installing MySQL on Windows
  • Fixing error “The entity name must immediately follow the ‘&’ in the entity reference.”
  • Fix issue of monitor turning blank while Saleculator loading
  • Solving common disk errors
  • Find tag ending issues in XML resources
  • Fixing “There is no stock of this item” error when trying to refund an item.
  • Data backup using command prompt (Windows)

Reference

  • Objects and Methods
  • Home
  • Documentation
  • How To's

Printing reports in thermal receipt printer

Here is how to add custom reports in Saleculator which can be printed in thermal receipt printer. This feature is available only from version 4.0 u2 onwards.


Procedure

Go to Administration Menu > Maintenance > Resources

1. Add the below line in Menu.Root:

group.addPanel("/com/posics/images/posreports.png", "Menu.POSReports", "com.posics.pos.reports.JPanelPOSReports");

2. Add below line in Roles:

<class name="com.posics.pos.reports.JPanelPOSReports"/>

3. Create a new text resource with the name POS.Reports and copy-paste below lines:

<?xml version="1.0" encoding="UTF-8"?>
<!--
        Posics Saleculator - Billing System.
        Copyright (C) 2009 Posics
        This file is part of Posics Saleculator.
 -->
<configuration>
<button key="button.print" titlekey="Sales Log" template="POS.Report.SalesLog"/>
<button key="button.print" titlekey="Product Sales" template="POS.Report.ProductSales"/>
<button key="button.print" titlekey="Current Inventory" template="POS.Report.CurrentInventory"/>
<button key="button.print" titlekey="Cash Closed" template="POS.Report.CashClosed"/>
<button key="button.print" titlekey="Payments" template="POS.Report.Payments"/>
<button key="button.print" titlekey="Payments" template="POS.Report.ProfitandLoss"/>
<button key="button.print" titlekey="Payments" template="POS.Report.Tax"/>
</configuration>

Save

Sales Log Report:

Create a new text resource with the name POS.Report.SalesLog and copy-paste below lines:

<?xml version="1.0" encoding="UTF-8"?>
<!--
       Posics Saleculator - Billing System.
       Copyright (C) 2009 Posics
       This file is part of Posics Saleculator.
-->
<output>
    <sql><![CDATA[ 
    
    SELECT TICKETS.TICKETID, RECEIPTS.DATENEW, 
    SUM((TICKETLINES.PRICE + TICKETLINES.PRICE * TAXES.RATE) * TICKETLINES.UNITS), 
    SUM((TICKETLINES.PRICE * TAXES.RATE) * TICKETLINES.UNITS)
    FROM RECEIPTS
    JOIN TICKETS ON RECEIPTS.ID = TICKETS.ID AND (TICKETS.TICKETTYPE=0 OR TICKETS.TICKETTYPE=1)
    JOIN TICKETLINES ON TICKETLINES.TICKET = RECEIPTS.ID
    JOIN TAXES ON TICKETLINES.TAXID = TAXES.ID 
    WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
    GROUP BY RECEIPTS.ID 
    ORDER BY RECEIPTS.DATENEW
    
    ]]></sql>
    <ticket>
        <image>Printer.Ticket.Logo</image>
        <line></line>
        <line size="1">
            <text align ="center" length="48" bold="true">Sales Log</text>
        </line>
        <line></line>
        <line>
            <text length="12">Start Date:</text>
            <text length="36">$startDate</text>
        </line>
        <line>
            <text length="12">End Date:</text>
            <text length="36">$endDate</text>
        </line>
        <line>
        </line>
        <line>
            <text align ="left" length="5">#</text>
            <text align ="left" length="20">Date</text>
            <text align ="right" length="13">Total</text>
            <text align ="right" length="10">Tax</text>
        </line>
        <line>
            <text>------------------------------------------------</text>
        </line>
        #foreach ($line in $posreport.getResult())
        <line>
            <text align ="left" length="5">${line.printValue(0)}</text>
            <text align ="left" length="20">${line.printDate(1)}</text>
            <text align ="right" length="13">${line.printCurrency(2)}</text>
            <text align ="right" length="10">${line.printCurrency(3)}</text>
        </line>
        #end
        <line>
            <text>------------------------------------------------</text>
        </line>
        <line>
            <text align ="left" length="5">Total</text>
            <text align ="left" length="20"></text>
            <text align ="right" bold="true" length="13">$posreport.printTotal(2)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(3)</text>
        </line>
        </ticket>
</output>

Save

Payments Report:

Create a new text resource with the name POS.Report.Payments and copy-paste below lines:

<?xml version="1.0" encoding="UTF-8"?>
<!--
       Posics Saleculator - Billing System.
       Copyright (C) 2009 Posics
       This file is part of Posics Saleculator.
-->
<output>
    <sql><![CDATA[ 
    
    SELECT RECEIPTS.DATENEW, TICKETS.TICKETID, PAYMENTS.PAYMENT, PAYMENTS.TOTAL, ACCOUNTHEADS.NAME, PAYMENTS.NOTES
    FROM PAYMENTS
    JOIN RECEIPTS ON PAYMENTS.RECEIPT = RECEIPTS.ID
    LEFT JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
    JOIN ACCOUNTHEADS ON ACCOUNTHEADS.ID = RECEIPTS.ACCOUNTHEAD
    WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate 
    ORDER BY RECEIPTS.DATENEW
        
    ]]></sql>
    <ticket>
        <image>Printer.Ticket.Logo</image>
        <line></line>
        <line size="1">
            <text align ="center" length="48" bold="true">Payments</text>
        </line>
        <line></line>
        <line>
            <text length="12">Start Date:</text>
            <text length="36">$startDate</text>
        </line>
        <line>
            <text length="12">End Date:</text>
            <text length="36">$endDate</text>
        </line>
        <line>
        </line>
        <line>
            <text align ="left" length="20">Date</text>
            <text align ="left" length="10">Receipt</text>
            <text align ="left" length="8">Type</text>
            <text align ="right" length="10">Total</text>
        </line>
        <line>
            <text>------------------------------------------------</text>
        </line>
        #foreach ($line in $posreport.getResult())
        <line>
            <text align ="left" length="20">${line.printDate(0)}</text>
            <text align ="left" length="10">${line.printValue(1)}</text>
            <text align ="left" length="8">${line.printValue(2)}</text>
            <text align ="right" length="10">${line.printCurrency(3)}</text>
        </line>
        #if(!$line.printValue(5).equals(""))
        <line>
            <text>${line.printValue(4)} - ${line.printValue(5)}</text>
        </line>
        #end
        #end
        <line>
            <text>------------------------------------------------</text>
        </line>
        <line>
            <text align ="left" length="20">Total</text>
            <text align ="left" length="10"></text>
            <text align ="left" length="8"></text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(3)</text>
        </line>
        </ticket>
</output>

Save

Cash Closed Report

Create a new text resource with the name POS.Report.CashClosed and copy-paste below lines:

<?xml version="1.0" encoding="UTF-8"?>
<!--
       Posics Saleculator - Billing System.
       Copyright (C) 2009 Posics
       This file is part of Posics Saleculator.
-->
<output>
    <sql><![CDATA[ 
    
    SELECT CLOSEDCASH.MONEY AS ID, CLOSEDCASH.HOST, CLOSEDCASH.HOSTSEQUENCE, CLOSEDCASH.DATESTART, CLOSEDCASH.DATEEND, SUM(PAYMENTS.TOTAL) AS TOTAL 
    FROM CLOSEDCASH LEFT JOIN RECEIPTS ON RECEIPTS.MONEY = CLOSEDCASH.MONEY LEFT JOIN PAYMENTS ON PAYMENTS.RECEIPT = RECEIPTS.ID 
    WHERE CLOSEDCASH.DATEEND IS NOT NULL AND CLOSEDCASH.DATESTART >= $startDate AND CLOSEDCASH.DATESTART <= $endDate 
    GROUP BY CLOSEDCASH.MONEY ORDER BY CLOSEDCASH.HOSTSEQUENCE DESC
    
    ]]></sql>
    <ticket>
        <image>Printer.Ticket.Logo</image>
        <line></line>
        <line size="1">
            <text align ="center" length="48" bold="true">Cash Closed</text>
        </line>
        <line></line>
        <line>
            <text length="12">Start Date:</text>
            <text length="36">$startDate</text>
        </line>
        <line>
            <text length="12">End Date:</text>
            <text length="36">$endDate</text>
        </line>
        <line>
        </line>
        <line>
            <text align ="left" length="15">Host</text>
            <text align ="left" length="10">Sequence</text>
            <text align ="right" length="23">Total</text>
        </line>
        <line>
            <text>------------------------------------------------</text>
        </line>
        #foreach ($line in $posreport.getResult())
        <line>
            <text align ="left" length="15">${line.printValue(1)}</text>
            <text align ="left" length="10">${line.printValue(2)}</text>
            <text align ="right" length="23">${line.printCurrency(5)}</text>
        </line>
        <line>
            <text>${line.printDate(3)}  TO  ${line.printDate(4)}</text>
        </line>
        #end
        <line>
            <text>------------------------------------------------</text>
        </line>
        <line>
            <text align ="left" length="15">Total</text>
            <text align ="left" length="10"></text>
            <text align ="right" bold="true" length="23">$posreport.printTotal(5)</text>
        </line>
        </ticket>
</output>

Save

Current Inventory Report:

Create a new text resource with the name POS.Report.CurrentInventory and copy-paste below lines:

<?xml version="1.0" encoding="UTF-8"?>
<!--
       Posics Saleculator - Billing System.
       Copyright (C) 2009 Posics
       This file is part of Posics Saleculator.
-->
<output>
    <sql><![CDATA[ 
    
    SELECT PRODUCTS.NAME, PRODUCTS.CODE, SUM(STOCKCURRENT.UNITS) AS UNITS, (PRODUCTS.PRICEBUY*SUM(STOCKCURRENT.UNITS)) AS COST 
    FROM STOCKCURRENT JOIN PRODUCTS ON STOCKCURRENT.PRODUCT = PRODUCTS.ID GROUP BY PRODUCTS.ID ORDER BY PRODUCTS.NAME
    
    ]]></sql>
    <ticket>
        <image>Printer.Ticket.Logo</image>
        <line></line>
        <line size="1">
            <text align ="center" length="48" bold="true">Current Inventory</text>
        </line>
        <line></line>
        <line>
            <text>Date: $posreport.printDate()</text>
        </line>
        <line>
        </line>
        <line>
            <text align ="left" length="20">Product</text>
            <text align ="right" length="10">Units</text>
            <text align ="right" length="18">Value</text>
        </line>
        <line>
            <text>------------------------------------------------</text>
        </line>
        #foreach ($line in $posreport.getResult())
        <line>
            <text align ="left" length="20">${line.printValue(0)} (${line.printValue(1)})</text>
            <text align ="right" length="10">${line.printValue(2)}</text>
            <text align ="right" length="18">${line.printCurrency(3)}</text>
        </line>
        #end
        <line>
            <text>------------------------------------------------</text>
        </line>
        <line>
            <text align ="left" length="30">${posreport.printCount()} Products</text>
            <text align ="right" bold="true" length="18">$posreport.printTotal(3)</text>
        </line>
        </ticket>
</output>

Save

Product Sales Report:

Create a new text resource with the name POS.Report.ProductSales and copy-paste below lines:

<?xml version="1.0" encoding="UTF-8"?>
<!--
       Posics Saleculator - Billing System.
       Copyright (C) 2009 Posics
       This file is part of Posics Saleculator.
-->
<output>
    <sql><![CDATA[ 
    
    SELECT CATEGORIES.NAME, PRODUCTS.NAME, PRODUCTS.CODE, SUM(TICKETLINES.UNITS) AS UNITS, SUM(TICKETLINES.UNITS * TICKETLINES.PRICE) AS TOTAL 
    FROM RECEIPTS, TICKETS, TICKETLINES 
    LEFT JOIN PRODUCTS ON TICKETLINES.PRODUCT = PRODUCTS.ID 
    LEFT JOIN CATEGORIES ON CATEGORIES.ID=PRODUCTS.CATEGORY 
    WHERE RECEIPTS.ID = TICKETS.ID AND TICKETS.ID = TICKETLINES.TICKET AND 
    RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate 
    GROUP BY PRODUCTS.ID ORDER BY CATEGORIES.NAME, PRODUCTS.NAME
    
    ]]></sql>
    <ticket>
        <image>Printer.Ticket.Logo</image>
        <line></line>
        <line size="1">
            <text align ="center" length="48" bold="true">Product Sales</text>
        </line>
        <line></line>
        <line>
            <text length="12">Start Date:</text>
            <text length="36">$startDate</text>
        </line>
        <line>
            <text length="12">End Date:</text>
            <text length="36">$endDate</text>
        </line>
        <line>
        </line>
        <line>
            <text align ="left" length="25">Product</text>
            <text align ="right" length="10">Units</text>
            <text align ="right" length="13">Total</text>
        </line>
        <line>
            <text>------------------------------------------------</text>
        </line>
        #foreach ($line in $posreport.getResult())
        <line>
            <text align ="left" length="25">${line.printValue(1)} (${line.printValue(2)})</text>
            <text align ="right" length="10">${line.printValue(3)}</text>
            <text align ="right" length="13">${line.printCurrency(4)}</text>
        </line>
        #end
        <line>
            <text>------------------------------------------------</text>
        </line>
        <line>
            <text align ="left" length="25">Total</text>
            <text align ="right" length="10"></text>
            <text align ="right" bold="true" length="13">$posreport.printTotal(4)</text>
        </line>
        </ticket>
</output>

Save

Profit and Loss Report:

Create a new text resource with the name POS.Report.ProfitandLoss and copy-paste below lines:

<output>
    <sql><![CDATA[ 
    
	SELECT TICKETS.TICKETID, RECEIPTS.DATENEW, 
    SUM(TICKETLINES.PRICE * TICKETLINES.UNITS), 
    SUM((TICKETLINES.PRICE-PRODUCTS.PRICEBUY) * TICKETLINES.UNITS)
    FROM RECEIPTS
    JOIN TICKETS ON RECEIPTS.ID = TICKETS.ID AND (TICKETS.TICKETTYPE=0 OR TICKETS.TICKETTYPE=1)
    JOIN TICKETLINES ON TICKETLINES.TICKET = RECEIPTS.ID
    JOIN PRODUCTS ON PRODUCTS.ID= TICKETLINES.PRODUCT
    WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
    GROUP BY TICKETS.TICKETID, RECEIPTS.DATENEW 
    ORDER BY RECEIPTS.DATENEW;
    ]]></sql>
    <ticket>
        <image>Printer.Ticket.Logo</image>
        <line></line>
        <line size="1">
            <text align ="center" length="48" bold="true">Invoice Profit</text>
        </line>
        <line></line>
        <line>
            <text length="12">Start Date:</text>
            <text length="36">$startDate</text>
        </line>
        <line>
            <text length="12">End Date:</text>
            <text length="36">$endDate</text>
        </line>
        <line>
        </line>
        <line>
            <text align ="left" length="5">#</text>
            <text align ="left" length="20">Date</text>
            <text align ="right" length="13">Total</text>
            <text align ="right" length="10">Profit</text>
        </line>
        <line>
            <text>------------------------------------------------</text>
        </line>
        #foreach ($line in $posreport.getResult())
        <line>
            <text align ="left" length="5">${line.printValue(0)}</text>
            <text align ="left" length="20">${line.printDate(1)}</text>
            <text align ="right" length="13">${line.printCurrency(2)}</text>
            <text align ="right" length="10">${line.printCurrency(3)}</text>
        </line>
        #end
        <line>
            <text>------------------------------------------------</text>
        </line>
        <line>
            <text align ="left" length="5">Total</text>
            <text align ="left" length="20"></text>
            <text align ="right" bold="true" length="13">$posreport.printTotal(2)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(3)</text>
        </line>
        </ticket>
</output>

Save

Tax Report (SGST & CGST):

Create a new text resource with the name POS.Report.Tax and copy-paste below lines:

<?xml version="1.0" encoding="UTF-8"?>
<!--
       Posics Saleculator - Billing System.
       Copyright (C) 2009 Posics
       This file is part of Posics Saleculator.
-->
<output>
    <sql><![CDATA[ 

SELECT RECEIPTS.ID AS RECEIPT, RECEIPTS.DATENEW AS DATE, TICKETS.TICKETID, SUM(TICKETLINES.UNITS) AS QTY, 
IFNULL(TAXLINES.BASE,0)+(2*IFNULL(TAXLINES.AMOUNT,0))
+IFNULL(CGST6.BASE,0)+(2*IFNULL(CGST6.TAX,0))
+IFNULL(CGST9.BASE,0)+(2*IFNULL(CGST9.TAX,0))
+IFNULL(CGST12.BASE,0)+(2*IFNULL(CGST12.TAX,0)) AS TOTAL, 
IFNULL(TAXLINES.BASE, 0) AS GST5BASE, IFNULL(TAXLINES.AMOUNT,0) AS CGST25TAX, IFNULL(SGST25.TAX,0) AS SGST25TAX,
IFNULL(CGST6.BASE, 0) AS GST12BASE, IFNULL(CGST6.TAX,0) AS CGST6TAX, IFNULL(SGST6.TAX,0) AS SGST6TAX,
IFNULL(CGST9.BASE, 0) AS GST18BASE, IFNULL(CGST9.TAX,0) AS CGST9TAX, IFNULL(SGST9.TAX,0) AS SGST9TAX,
IFNULL(CGST12.BASE, 0) AS GST24BASE, IFNULL(CGST12.TAX,0) AS CGST12TAX, IFNULL(SGST12.TAX,0) AS SGST12TAX,
IFNULL(EXEMPT.BASE, 0) AS EXEMPTBASE, IFNULL(EXEMPT.TAX,0) AS EXEMPTTAX 

FROM RECEIPTS 

JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
LEFT JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
LEFT JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='5f864912-ae05-4594-9948-febe2fef454b'
LEFT JOIN TAXES ON TAXLINES.TAXID=TAXES.ID

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='666249c8-b5a5-4fda-b7bf-296bc7ac4c80'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) SGST25 ON RECEIPTS.ID=SGST25.RECEIPT

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='30f17067-3e48-4c76-a123-fc1da49ff3ae'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) CGST6 ON RECEIPTS.ID=CGST6.RECEIPT

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='db386ab4-b837-47fd-894b-10ec0f433710'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) SGST6 ON RECEIPTS.ID=SGST6.RECEIPT

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='249d73a7-b09e-4e4c-8863-a85957dd7191'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) CGST9 ON RECEIPTS.ID=CGST9.RECEIPT

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='c564d077-0c3a-42f8-a4ad-f74437a5e89f'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) SGST9 ON RECEIPTS.ID=SGST9.RECEIPT

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='27eefa5f-07ce-4437-93b3-1fa6cd5b7da6'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) CGST12 ON RECEIPTS.ID=CGST12.RECEIPT

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='715e7d89-70df-4aed-be72-92c9a71bc32a'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) SGST12 ON RECEIPTS.ID=SGST12.RECEIPT

LEFT JOIN ( 
SELECT RECEIPTS.ID AS RECEIPT, TICKETS.TICKETID, TAXES.NAME AS TAXNAME, TAXLINES.BASE, TAXLINES.AMOUNT AS TAX FROM RECEIPTS 
JOIN TICKETS ON TICKETS.ID=RECEIPTS.ID
JOIN TICKETLINES ON TICKETS.ID=TICKETLINES.TICKET
JOIN TAXLINES ON RECEIPTS.ID=TAXLINES.RECEIPT AND TAXLINES.TAXID='000'
JOIN TAXES ON TAXLINES.TAXID=TAXES.ID
WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID) EXEMPT ON RECEIPTS.ID=EXEMPT.RECEIPT

WHERE RECEIPTS.DATENEW >= $startDate AND RECEIPTS.DATENEW <= $endDate
GROUP BY RECEIPTS.ID
ORDER BY TICKETS.TICKETID
                
       ]]></sql>
       
         <ticket>
        <line></line>
         <line size="1">
            <text>Saleculator Point of Sale</text>
        </line>
        <line size="1">
            <text>GST Return</text>
        </line>
        <line></line>
        <line>
            <text length="12">Start Date:</text>
            <text length="36">$startDate</text>
        </line>
        <line>
            <text length="12">End Date:</text>
            <text length="36">$endDate</text>
        </line>
        <line>
        </line>
        <line>
            <text align ="left" length="20">DATE</text>
            <text align ="center" length="10">TICKET ID</text>
            <text align ="center" length="10">QTY</text>
            <text align ="right" length="10">TOTAL</text>
            <text align ="right" length="10">GST5BASE</text>
            <text align ="right" length="10">CGST2.5</text>
            <text align ="right" length="10">SGST2.5</text>
            <text align ="right" length="10">GST12BASE</text>
            <text align ="right" length="10">CGST6</text>
            <text align ="right" length="10">SGST6</text>
            <text align ="right" length="10">GST18BASE</text>
            <text align ="right" length="10">CGST9</text>
            <text align ="right" length="10">SGST9</text>
            <text align ="right" length="10">GST24BASE</text>
            <text align ="right" length="10">CGST12</text>
            <text align ="right" length="10">SGST12</text>
            <text align ="right" length="10">EXEMPT</text>
       </line>
         <line>
            <text></text>
        </line>
        #foreach ($line in $posreport.getResult())
        <line>
            <text align ="left" length="20">${line.printDate(1)}</text>
            <text align ="center" length="10">${line.printValue(2)}</text>
            <text align ="center" length="10">${line.printValue(3)}</text>
            <text align ="right" length="10">${line.printCurrency(4)}</text>
            <text align ="right" length="10">${line.printCurrency(5)}</text>
            <text align ="right" length="10">${line.printCurrency(6)}</text>
            <text align ="right" length="10">${line.printCurrency(7)}</text>
            <text align ="right" length="10">${line.printCurrency(8)}</text>
            <text align ="right" length="10">${line.printCurrency(9)}</text>
            <text align ="right" length="10">${line.printCurrency(10)}</text>
            <text align ="right" length="10">${line.printCurrency(11)}</text>
            <text align ="right" length="10">${line.printCurrency(12)}</text>
            <text align ="right" length="10">${line.printCurrency(13)}</text>
            <text align ="right" length="10">${line.printCurrency(14)}</text>
            <text align ="right" length="10">${line.printCurrency(15)}</text>
            <text align ="right" length="10">${line.printCurrency(16)}</text>
            <text align ="right" length="10">${line.printCurrency(17)}</text>
        </line>
        #end
        <line>
            <text></text>
        </line>
        <line>
            <text align ="left" length="20">Total</text>
            <text align ="left" length="10"></text>
            <text align ="center" bold="true" length="10">$posreport.printTotal(3)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(4)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(5)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(6)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(7)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(8)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(9)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(10)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(11)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(12)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(13)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(14)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(15)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(16)</text>
            <text align ="right" bold="true" length="10">$posreport.printTotal(17)</text>
        </line>
        </ticket>
</output>

Save

Note: Follow the below steps to find the Tax ID for different Tax Types

  1. Open MySQL prompt (Windows)
  2. Type SELECT * FROM TAXES; (Press Enter)
  3. This will show you an output listing all the available Taxes along with their IDs, double click on the ID to highlight and copy the same. (Refer to the below Image, Tax IDs are shown by the red tick marks)
The tax ID highlighted on this image is of the CGST 2.5


Methods used in POS Reports

$posreport.getResult(): Get result of the executed query
$posreport.roundDouble(value, decimals): Get rounded value
$posreport.formatCurrency(value): Get currency format of the value
$posreport.getTotal(field_number): Get total of the field
$posreport.printTotal(field_number): Print currency formatted total of the field
$posreport.printCount(): Print number of records in the result
$posreport.printDate(): Print current date and time

$line.printValue(field_number): Print field value as text
$line.printCurrency(field_number): Print field value as currency
$line.printDate(field_number): Print field value as date
$line.getDouble(field_number): Get double value of the field for calculation
$line.getInteger(field_number): Get integer value of the field for calculation
What are your Feelings
What are your Feelings
Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on March 1, 2021
Edited bills reportAssign product categories to user roles
Saleculator

Primary Pages

  • Home
  • About
  • Contact
  • Service

Pages

  • About
  • Pricing
  • Contact
  • Request for Demo

Template

  • Blog
  • Service
  • Downloads
  • Contact

Copyright © 2022 | Saleculator