Example #1
0
  private void printerStart() {

    String sresource = m_dlSystem.getResourceAsXML("Printer.Start");
    if (sresource == null) {
      m_TP.getDeviceDisplay().writeVisor(AppLocal.APP_NAME, AppLocal.APP_VERSION);
    } else {
      try {
        m_TTP.printTicket(sresource);
      } catch (TicketPrinterException eTP) {
        m_TP.getDeviceDisplay().writeVisor(AppLocal.APP_NAME, AppLocal.APP_VERSION);
      }
    }
  }
  private void printPayments(String report) {

    String sresource = m_dlSystem.getResourceAsXML(report);
    if (sresource == null) {
      MessageInf msg =
          new MessageInf(
              MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintticket"));
      msg.show(this);
    } else {
      try {
        ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
        script.put("payments", m_PaymentsToClose);
        m_TTP.printTicket(script.eval(sresource).toString());
        // JG 16 May 2012 use multicatch
      } catch (ScriptException | TicketPrinterException e) {
        MessageInf msg =
            new MessageInf(
                MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintticket"), e);
        msg.show(this);
      }
    }
  }