public void finalize() throws Throwable {

    m_fiscal.setDeviceEnabled(false);
    m_fiscal.release();
    m_fiscal.close();

    super.finalize();
  }
 public void printTotal(String sPayment, double dpaid) {
   try {
     // el primer valor es el total calculado por la aplicacion.
     // al poner 0 no se debe chequear: CAPCHECKTOTAL = false.
     m_fiscal.printRecTotal(0, roundFiscal(dpaid), sPayment);
   } catch (JposException e) {
   }
 }
  /** Creates new form DeviceFiscalPrinterJavaPOSPanel */
  public DeviceFiscalPrinterJavaPOS(String sDeviceFiscalPrinterName) throws TicketPrinterException {
    m_sName = sDeviceFiscalPrinterName;

    m_fiscal = new FiscalPrinter();
    try {
      m_fiscal.open(m_sName);
      m_fiscal.claim(10000);
      m_fiscal.setDeviceEnabled(true);
      // m_printer.setMapMode(POSPrinterConst.PTR_MM_METRIC);  // unit = 1/100 mm - i.e. 1 cm = 10
      // mm = 10 * 100 units

      m_fiscal.setCheckTotal(false);

    } catch (JposException e) {
      throw new TicketPrinterException(e.getMessage(), e);
    }

    initComponents();
  }
 public void printLine(String sproduct, double dprice, double dunits, int taxinfo) {
   try {
     m_fiscal.printRecItem(
         sproduct,
         roundFiscal(dprice * dunits),
         (int) (dunits * 1000),
         taxinfo,
         roundFiscal(dprice),
         "");
   } catch (JposException e) {
   }
 }
 public void printMessage(String smessage) {
   try {
     m_fiscal.printRecMessage(smessage);
   } catch (JposException e) {
   }
 }
 public void endReceipt() {
   try {
     m_fiscal.endFiscalReceipt(false);
   } catch (JposException e) {
   }
 }
 public void beginReceipt() {
   try {
     m_fiscal.beginFiscalReceipt(true);
   } catch (JposException e) {
   }
 }
 public void printXReport() {
   try {
     m_fiscal.printXReport();
   } catch (JposException e) {
   }
 }