All Implemented Interfaces:
Runnable
Direct Known Subclasses:
PrintRecItemFuel, PrintRecItemRefund, PrintRecItemRefundVoid, PrintRecItemVoid

public class PrintRecItem extends OutputRequest
Output request executor for FiscalPrinter method PrintRecItem, output request base for several PrintRec... methods with quantity and price data.
  • Constructor Details

    • PrintRecItem

      public PrintRecItem(FiscalPrinterProperties props, String description, long price, int quantity, int vatInfo, long unitPrice, String unitName)
      Constructor. Stores given parameters for later use.
      Parameters:
      props - Property set of device service.
      description - Text describing the item sold.
      price - Price of the item.
      quantity - Number of items.
      vatInfo - VAT rate identifier or amount.
      unitPrice - Price of each item.
      unitName - Name of the unit.
  • Method Details

    • getQuantity

      public int getQuantity()
      FiscalPrinter method parameter quantity, see UPOS specification.
      Returns:
      PrintRecItem parameter quantity.
    • getUnitPrice

      public long getUnitPrice()
      FiscalPrinter method parameter unitPrice, see UPOS specification.
      Returns:
      PrintRecItem parameter unitPrice.
    • getUnitName

      public String getUnitName()
      FiscalPrinter method parameter unitName, see UPOS specification.
      Returns:
      PrintRecItem parameter unitName.
    • invokeMethod

      public void invokeMethod() throws jpos.JposException
      Invokes the command. Must be implemented in derived class. Calls finished() to wake up potentially waiting threads.
      Replacement for invoke in derived classes. Should neither call super.invoke nor super.invokeMethod in derived classes because the calling method just calls super.invoke.
      Throws:
      jpos.JposException - FiscalPrinterException thrown by the command to be executed.
    • getDescription

      public String getDescription()
      FiscalPrinter method parameter description, see specific method.
      Returns:
      parameter description.
    • getVatInfo

      public int getVatInfo()
      FiscalPrinter method parameter vatInfo, see specific method.
      Returns:
      parameter vatInfo.
    • getAmount

      public long getAmount()
      FiscalPrinter method parameter amount, see specific method.
      Returns:
      parameter amount.
    • getPostLine

      public String getPostLine()
      Returns contents of property PostLine at the time where this instance has been created.
      Returns:
      Contents of PostLine during request creation.
    • getPreLine

      public String getPreLine()
      Returns contents of property PreLine at the time where this instance has been created.
      Returns:
      Contents of PreLine during request creation.
    • invoke

      public void invoke() throws jpos.JposException
      Description copied from class: OutputRequest
      This function should be called whenever a printing method has been invoked. Therefore, it is the perfect place to signal processing has finished to implicitly waiting synchronous methods.
      Overrides:
      invoke in class OutputRequest
      Throws:
      jpos.JposException - If the invoked method throws an exception.