private void CargarS1(bool conectar) { try { S1PrinterData data = fiscal.GetS1PrinterData(); NumeroFactura = data.LastInvoiceNumber.ToString("00000000"); montoZ = data.TotalDailySales; ultimoZ = data.DailyClosureCounter + 1; NumeroRegistro = data.RegisteredMachineNumber; RIF = data.RIF; Fecha = data.CurrentPrinterDateTime.Date; } catch (TfhkaNet.IF.PrinterException x) { throw new Exception(string.Format("Error de impresora: {0}, estatus {1}", x.Message, fiscal.Estado)); } catch (Exception x) { throw new Exception(string.Format("Error de conexión\n{0}\nEstatus {1}", x.Message, fiscal.Status_Error)); } }
public void ReporteZ() { try { S1PrinterData d = fiscal.GetS1PrinterData(); if (d.QuantityOfInvoicesToday < 1) { throw new Exception("No hay facturas aún hoy"); } ultimoZ = d.DailyClosureCounter + 2; //************ Imprimir Reporte Z ******************* fiscal.SendCmd("I0Z"); } catch (TfhkaNet.IF.PrinterException x) { throw new Exception(string.Format("Error de impresora: {0}, estatus {1}", x.Message, fiscal.Estado)); } catch (Exception x) { throw new Exception(string.Format("Error de conexión\n{0}\nEstatus {1}", x.Message, fiscal.Status_Error)); } }