2 using System.Collections.Generic;
3 using System.ComponentModel;
23 using Sage.Reporting.Model;
34 #region PROPIEDADES PRIVADAS 36 private string _QRVeriFac =
string.Empty;
38 #endregion PROPIEDADES PRIVADAS 41 #region PROPIEDADES PROTECTED 42 #endregion PROPIEDADES PROTECTED 45 #region PROPIEDADES INTERFICIE IUserControlFacturarAlbaranVenta 50 public string _TituloPagina
52 get {
return _cTituloPagina; }
53 set { _cTituloPagina = value; }
55 private string _cTituloPagina =
"";
60 public dynamic _Documento
62 get {
return _oDocumento; }
63 set { _oDocumento = value; }
65 private dynamic _oDocumento = null;
72 get {
return loDatos; }
76 #endregion PROPIEDADES INTERFICIE IUserControlFacturarAlbaranVenta 79 #region PROPIEDADES PUBLICAS 84 public virtual bool _ReadOnly
86 get {
return _lReadOnly; }
87 set { _lReadOnly = value; }
89 private bool _lReadOnly =
false;
91 #endregion PROPIEDADES PUBLICAS 101 InitializeComponent();
104 #endregion CONSTRUCTORES 107 #region METODOS PRIVADOS 112 private void ConfigurarControles()
121 private void DefinirTextos()
125 ewPanelTituloInformacionFactura._Titulo =
"Información del ticket";
126 ewlabelFactura.Text =
"Ticket:";
130 ewPanelTituloInformacionFactura._Titulo =
"Información de la factura modificada";
131 ewlabelFactura.Text =
"Factura modificada:";
135 ewPanelTituloInformacionFactura._Titulo =
"Información de la factura";
136 ewlabelFactura.Text =
"Factura:";
144 private void EstadoControles()
146 txtFactura._ReadOnly = _lReadOnly;
147 ewtextboxFechaExpedicion.ReadOnly = _lReadOnly;
148 txtTerminal.ReadOnly = _lReadOnly;
149 txtCodigoSeguro.ReadOnly = _lReadOnly;
150 txtFichero.ReadOnly = _lReadOnly;
152 ewcomboboxSistema.Enabled = !_lReadOnly;
153 ewcomboboxTerritorio.Enabled = !_lReadOnly;
157 private string GetEnumDescription(Enum value)
160 FieldInfo fi = value.GetType().GetField(value.ToString());
161 DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute),
false);
163 if (attributes.Length > 0)
164 return attributes[0].Description;
166 return value.ToString();
169 private Image GenerarImagenQr(
string tcText)
173 loGen._Texto = tcText;
175 return loGen._Generar();
178 private void lnkAccesoAEAT_Click(
object sender, EventArgs e)
180 if (!
string.IsNullOrWhiteSpace(_QRVeriFac))
181 System.Diagnostics.Process.Start(_QRVeriFac);
190 private void btVerDocumento_Click(
object sender, EventArgs e)
192 string lcFile = txtFichero.Text;
193 if (
string.IsNullOrWhiteSpace(txtFichero.Text))
195 FUNCTIONS._MessageBox(
"No existe fichero.",
"Datos certificación", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1);
199 lcFile = Path.Combine(factucert.GetRutaXmlVeriFactu(), lcFile);
200 if (!File.Exists(lcFile))
202 FUNCTIONS._MessageBox(
"No se ha encontrado el fichero.",
"Datos certificación", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1);
209 frmRespuesta.ShowDialog();
213 #endregion METODOS PRIVADOS 216 #region METODOS PROTECTED 223 if (!IsDisposed && !Disposing && !this.Visible)
229 base.OnCreateControl();
231 this.ConfigurarControles();
232 this.EstadoControles();
235 #endregion METODOS PROTECTED 238 #region METODOS PUBLICOS 249 loDatos = ((dynamic)_Documento._Addons[
"FACTUCERT"])._DatosAdicionalesFactura;
253 loDatos = ((dynamic)_Documento._Addons[
"FACTUCERT"])._DatosAdicionales;
259 txtFactura._Letra = loDatos.
_Letra;
263 txtFactura.__BindearControl(
"_Factura", loDatos,
"_Numero");
266 ewtextboxFechaExpedicion.Text = loDatos.
_Hora != null ? loDatos.
_Hora +
" " + loDatos.
_HusoHora :
"";
268 txtTerminal.DataBindings.Clear();
269 txtTerminal.__BindearControl(
"Text", loDatos,
"_Terminal");
271 txtCodigoSeguro.DataBindings.Clear();
272 txtCodigoSeguro.__BindearControl(
"Text", loDatos,
"_CSV");
274 txtFichero.DataBindings.Clear();
275 txtFichero.__BindearControl(
"Text", loDatos,
"_FicheroXML");
282 ewcomboboxSistema.DataBindings.Clear();
283 ewcomboboxSistema.__BindearControl(
"SelectedValue", loDatos,
"_Sistema");
285 ewcomboboxTerritorio.DataBindings.Clear();
286 ewcomboboxTerritorio.__BindearControl(
"SelectedValue", loDatos,
"_Territorio");
288 ewlblEstadoFactura.Text = $
@"{(loDatos._Anulado == 0 ? "Certificada" : "Anulada
")}\{GetEnumDescription((EstadoFactuCert)loDatos._Estado)}";
293 if (FACTUCERT._FactuCertConfig._Territorio == Convert.ToInt32(
TerritoriosFactuCert.Guipuzcoa) ||
296 this.ewlblEntornoEnvio.Visible =
false;
313 int minEntorno = Convert.ToInt32(Enum.GetValues(typeof(
TipoEnvio)).Cast<
TipoEnvio>().First());
314 int maxEntorno = Convert.ToInt32(Enum.GetValues(typeof(
TipoEnvio)).Cast<
TipoEnvio>().Last());
317 this.ewlblEntornoEnvio.Visible =
true;
318 ewlblEntornoEnvio.Text = $
@"{GetEnumDescription((TipoEnvio)loDatos._TipoEnvio)}";
324 this.ewlblEntornoEnvio.Visible =
false;
327 ewImagenQR.Image = GenerarImagenQr(loDatos.
_QRVERIFAC);
328 ewImagenQR.SizeMode = PictureBoxSizeMode.StretchImage;
335 #endregion METODOS PUBLICOS
Factura certificada anulada
SistemasFacturacionCertificada
SistemasFacturacionCertificada
Este es el espacio de nombres de su módulo. Puede encontrar más información y ayuda en el fichero rea...
int _TipoEnvio
Entorno de envio (0-No enviado aún, 1-Enviado a PRE, 2-Enviado a PRO)
TerritoriosFactuCert
Territorios
TipoDocCrearFactura _TipoCert
TIPO_CERT de tipo entero, valor por defecto 0. Guardará el tipo de factura y los posibles valores ser...
Clase documento de venta TPV
static System.Drawing.Bitmap icon_eye16
Busca un recurso adaptado de tipo System.Drawing.Bitmap.
TipoDocCrearFactura
Enumeración para la creación de las facturas
Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc.
override void _Binding()
Asociacion de los binding
Clase para generar códigos de barras/QR a partir de SageReports
TipoEnvio
Entorno de envío PRE/PRO
_oDatosFacturaCertificaVeriFactu()
Constructor
eTipoDocumento
Detalle los tipos de documento posibles de ventas y compras
Clase que se utilizará como base para "DatosAdicionalesFacturarAlbaran" y "DatosAdicionalesTicket" qu...
Usercontrol para los datos de certificación de factura para VeriFactu
string _HusoHora
Huso horario
DateTime _Hora
HORA, guardará la hora en la que se ha certificado la factura o ticket. Mientras no se certifique ha ...
string _QRVERIFAC
QR_VERIFAC de tipo text. Guardará el valor que se usará para imprimir código QR en el documento cuand...
override void OnCreateControl()
Cuando se crea el control
BarcodeSymbology _TipoCodigo
Tipo