Why Openbravo for Sauna POS

In the previous article, we discussed our logic for choosing the Openbravo POS as the base platform to build a Spa & Sauna POS system on top of it. This article will discuss how we extended the Openbravo POS, and provide additional documentation for configuring the Spa & Sauna POS System under development.

1. What is Openbravo POS?

Openbravo POS is the leading open source Point-of-Sale (POS) "desktop" application designed in the Java Programming language. It has been designed for the retail industry, especially for retail stores and restaurants. Openbravo POS can be configured to work in any Point-of-Sale environment, creating a feature-rich solution. Openbravo POS may be integrated with a "web-based" Openbravo ERP to provide a complete data processing solution for an organization. It can also be used as a standalone application without ERP functionalty.

2. What type of POS peripherals does Openbravo POS suppprt?

In order to support various POS hardware, the Openbravo POS is written as a "desktop" application as opposed to a "web-based" application. It can virtually support any POS peripherals provided that you are able to configure (or customize) the software. For Spa & Sauna POS, we've written a special module to support a webcam device as well as extending com.openbravo.pos.comm.CommStream to support a serial reader device. Additionally, Spa & Sauna POS supports receipt printers, cash drawer, touch screen and magnetic stripe readers - all natively supported by the Openbravo POS. Although supported by the Openbravo POS, Spa & Sauna POS does not use a pole display, barcode scanner or scale devices.

3. What operating platform Spa & Sauna POS will run on?

Although Openbravo POS is a platform independent application written in the Java programming language, we have chosen to use Windows XP as the client platform for the following reasons:

  • It is easier to install and use touch screen and magnetic stripe reader (MSR) device drivers.
  • Operators are already familiar with Windows XP environment. We've chosen Windows XP instead of the more recent Windows Vista operating system as it is considered more "stable" and widely accepted by the industry at the present time.

The database server will be running on a Linux environment for easier backup, replication, and management. Openbravo POS is not really a client/server software, but considered a peer-to-peer application running from a master database. A machine that has the database will be called a "server", although it may or may not run the client Openbravo POS application. We have chosen to use MySQL as the database engine. Beside MySQL database, the Openbravo POS supports HSQLDB, Apache Derby, PostgreSQL, and Oracle databases.

4. POS Configuration

Openbravo POS offers various configuration options in the "Configuration" and "Maintenance" menu. The hardware and database configuration options are available in the "Configuration" menu, and Openbravo POS offers a GUI screen to configure those settings. The software configuration (i.e. roles, permissions, printers, buttons, tickets and etc.) is available in the "Maintenance" menu, and the settings are configured via modifying XML. Openbravo POS uses XML format instead of the GUI to offer configuration changes.

4.1 Payment Options

Accepted payment types are configured in the "Maintenance" -> "Roles" menu. In the Administrator Role under the "permissions" block, comment out the "payment.cheque", "payment.paper" and "payment.debt" payment options. This will leave the "payment.cash", "payment.magcard" and "payment.free" payment options. "Maintenance" -> "Roles" is a somewhat odd location to configure payment options, but Openbravo POS v2.2 offers this option there. You'll NOT find this functionality in the "Maintenance" -> "Resources" menu item as anyone may have guessed.

4.2 Create a Discount button on Sales Panel

Per Openbravo POS FAQ, there are three different ways to apply a discount to a line item. We have chosen to use Openbravo POS Scripting button to add a new line with the discount. To create a working "Discount Button", we've followed the following steps.

  • Login to Openbravo POS as an administrator, click Maintenance -> Resources. Click, Ticket.Buttons and add the following line in the XML file.

  • < button key="button.discount" name="button.discount" code="Script.Discount" />
    

  • Create a new resource called "Script.Discount" in the Maintenance -> Resources panel, and add the following Java code. We are adding a new discount line with dollar amount shown.

  • import com.openbravo.format.Formats;
    import com.openbravo.pos.ticket.TicketLineInfo;
    import com.openbravo.pos.ticket.TicketProductInfo;
     
    discountamount = sales.getInputValue();
    
    index = sales.getSelectedIndex();
    if (index >= 0) {
        line = ticket.getLine(index);
        if (line.getPrice() > 0.0 && discountamount > 0.0) { 
      
            sdiscount = Formats.CURRENCY.formatValue(discountamount);
    
            ticket.insertLine(index + 1,
                new TicketLineInfo(
                        "Discount " + sdiscount,
                        line.getProductTaxCategoryID(),
                        line.getMultiply(), 
                        -discountamount,
                        line.getTaxInfo()));  
            sales.setSelectedIndex(index + 1);
        } else {  
             java.awt.Toolkit.getDefaultToolkit().beep();  
        }
    } else {
        java.awt.Toolkit.getDefaultToolkit().beep();  
    }
    

  • Add the permission in the Maintenance -> Roles menu. Discount can be only allowed to a user with the button.discount role. Add the following line to the user who can issue a discount.

  • < class name="button.discount" />
    

4.3 Printer Configuration

Openbravo POS supports several ESC/POS receipt/ticket printers connected to the same terminal ("station") and you can configure up to 3 receipt/ticket printers in the configuration panel. The first printer is generally configured as a "receipt" printer which prints order receipts. The second and third printers are used to print orders to a kitchen or a bar. Cash drawers are connected to the receipt printer and open with a printer command. The recommended receipt printer is the Epson TM88IV with a serial or parallel interface.

How do you install a receipt printer that has a USB interface?

Openbravo POS supports ESC/POS receipt printers that connect directly to a serial or parallel port, but there is no "direct" support for USB ports. However, there are two methods that allow the use of the ESC/POS protocol with an USB port in Openbravo POS. The two methods described here refers only to Windows operating systems:

1. Share the printer

  • Install the receipt printer using the Generic / Text only driver.




  • Share the printer by clicking on the printer icon with right-mouse button, and selecting "Properties" menu item.
  • Map the printer to the LPT1 port. Similarly, you may map the printer to a LPT2 or LPT3 by issuing the following commands.


  • C:> NET USE LPT1: /DELETE
    C:> NET USE LPT1: \\COMPUTER NAME\PRINTER /PERSISTENT:YES

  • To test a redirected printer, issue the following command.


  • C:> TYPE {filename} > LPT1:

How can I change the receipts printed to include my logo and other details?

In Openbravo POS much of the advanced configuration is managed from the resources panel rather than with a GUI. Printer receipts are fully configurable and are based on templates. To change those templates, login as an administrator and go to Administration > Maintenance > Resources. To change the receipts, edit the Printer.Ticket record. There are other templates in this panel which you are also free to modify.

How do you add 2nd and 3rd printers for a bar and kitchen?

The 2nd and 3rd printers are configured in the Configuration menu. To add 2nd and 3rd printer, you have to modify the Printer.Ticket resource located in Administration > Maintenance > Resources. The Ticket object may print a customer receipt, or an order in the bar or kitchen. When it finishes, it cuts the paper off. Ticket element may contain a printer attribute which identifies a printer.

< ticket printer=2> ... < /ticket>

Within the element, the following elements are supported:

  • line
  • < line size=3> ... < /line>
    

    The line element sets the text line in a receipt. It may contain a size parameter, which defines size of the text. Possible values are:

    • 0 - Normal size (by default)
    • 1 - Double height
    • 2 - Double weight
    • 3 - Double height and weight
  • text
  • Between line tags, element is used to print the text. The text element can contain the following parameters:

    < text align ="right" length="10" underline="true">Some text< /text>
    
    • align - defines the alignment of the text string. The available values are:
      • left - align text to the left. The default value.
      • right - align text to the right.
      • center - sets the text in the center.
    • length - defines the length in characters used to fit the text strings.
    • bold - defines whether if the text is bold or not. By default false.
    • underline - defines whether if the text is underlined or not. By default false
  • image
  • < image>Your image< /image>
    

    An image in the receipt. It contains the resource name that contains the image file. The image is converted to B/W before sending it to the printer.

  • barcode
  • < barcode>the number< /barcode>
    

    A barcode. It contains a number of the barcode in EAN-13 format.

  • opendrawer
  • < opendrawer/>
    

    Opens the cash drawer attached to the receipt printer.

    In the Printer.Ticket receipt template, you may use any of the public methods available in net.adrianromero.tpv.ticket.TicketInfo class in the $ticket variable and the public methods available in net.adrianromero.tpv.ticket.TicketLineInfo class in the $ticketlines variable.

How do you print different product item to different printers?

In a restaurant operation, we need to be able to send hot food items to a kitchen printer and cold drinks to a juice bar printer. We accomplish this by following the following configuration options.

How do you display and print Korean and English in the receipt printer?

Openbravo POS supports localization by providing a "Configuration" option. To minimize code changes, we'll add "alias" attribute in the product properties. We'll use the alias attribute as the English name of the Product, and it will be used to print the name of the product in English in the ticket.line.

How do I edit the Ticket Screen so that we have more room for additional menu items, and shorten the ticket lines?

You may login as an administrator, and choose [Configuration] -> [Maintenances] -> [Resources] option. Edit the Ticket.Buttons XML settings, and change the value to a larger value. For King Spa POS, we've used 275 for about 4 lines of menu items.

Privacy Notice    |    Conditions of Use    |    Shipping & Returns    |    Sitemap

Copyright touchPOS.net. All rights reserved.