TipoIvaAsistenteResumenCriterioCaja.cs
1 using System;
2 using System.Windows.Forms;
3 using sage.ew.global;
4 using sage.ew.articulo.Clases;
5 using sage.ew.functions;
7 using System.Drawing;
8 
9 namespace sage.ew.articulo.UserControls
10 {
14  public partial class TipoIvaAsistenteResumenCriterioCaja :
16  {
17 
18  #region PROPIEDADES
19 
23  public override DatosIva _DatosIva
24  {
25  get
26  {
27  return _oDatos;
28  }
29  set
30  {
31  _oDatos = value;
32 
33  ewCodigo.Text = _oDatos._Codigo;
34  ewNombre.Text = _oDatos._Nombre;
35 
36  if (txtCuentaReper.Created)
37  {
38  txtCuentaSopor.DataBindings.Clear();
39  txtCuentaSopor.DataBindings.Add("_Codigo", _oDatos, "_CuentaSoportadoPte");
40  }
41 
42  if (txtCuentaReper.Created)
43  {
44  txtCuentaReper.DataBindings.Clear();
45  txtCuentaReper.DataBindings.Add("_Codigo", _oDatos, "_CuentaRepercutidoPte");
46  }
47 
48  if (txtCuentaRecargoSopor.Created)
49  {
50  txtCuentaRecargoSopor.DataBindings.Clear();
51  txtCuentaRecargoSopor.DataBindings.Add("_Codigo", _oDatos, "_CuentaRecargoSoportadoPte");
52  }
53 
54  if (txtCuentaRecargoReper.Created)
55  {
56  txtCuentaRecargoReper.DataBindings.Clear();
57  txtCuentaRecargoReper.DataBindings.Add("_Codigo", _oDatos, "_CuentaRecargoRepercutidoPte");
58  }
59 
60  ewPanelCuentaRecargoReper.Visible = _oDatos._AplicaRecargo && _oDatos._Recargo > 0;
61  ewPanelCuentaRecargoSopor.Visible = _oDatos._AplicaRecargo && _oDatos._Recargo > 0;
62 
63  }
64  }
65 
66  private void _Codigo_Cambiado_Before_Extended(object sender, String tcValorCandidato, ref bool tlOk, DatosIva.TipoCuenta toTipoCuenta)
67  {
68  if (!_oDatos._ComprobarIva(tcValorCandidato, toTipoCuenta))
69  {
70  FUNCTIONS._MessageBox(_oDatos._ErroMessage, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, DialogResult.OK);
71  tlOk = false;
72  }
73  }
74 
75  #endregion PROPIEDADES
76 
77 
78  #region CONSTRUCTORES
79 
84  {
85  InitializeComponent();
86  }
87 
88 
89 
90  #endregion CONSTRUCTORES
91 
92  private void TipoIvaAsistenteResumenDatos_Load(object sender, EventArgs e)
93  {
94  txtCuentaSopor._Validar_Codigo = false;
95  txtCuentaReper._Validar_Codigo = false;
96  txtCuentaRecargoSopor._Validar_Codigo = false;
97  txtCuentaRecargoReper._Validar_Codigo = false;
98 
99  txtCuentaSopor._CrearManteSiCodigoNoExiste = false;
100  txtCuentaReper._CrearManteSiCodigoNoExiste = false;
101  txtCuentaRecargoSopor._CrearManteSiCodigoNoExiste = false;
102  txtCuentaRecargoReper._CrearManteSiCodigoNoExiste = false;
103 
104  txtCuentaSopor._Browser_Condicion = "LEFT(CODIGO,3) = '" + (string.IsNullOrWhiteSpace(_oDatos._IvaPendSop3) ? _oDatos._IvaSop3 : _oDatos._IvaPendSop3) + "'";
105  txtCuentaReper._Browser_Condicion = "LEFT(CODIGO,3) = '" + (string.IsNullOrWhiteSpace(_oDatos._IvaPendRep3) ? _oDatos._IvaRep3 : _oDatos._IvaPendRep3) + "'";
106  txtCuentaRecargoSopor._Browser_Condicion = "LEFT(CODIGO,3) = '" + (string.IsNullOrWhiteSpace(_oDatos._IvaRecPendSop3) ? _oDatos._IvaRecSop3 : _oDatos._IvaRecPendSop3) + "'";
107  txtCuentaRecargoReper._Browser_Condicion = "LEFT(CODIGO,3) = '" + (string.IsNullOrWhiteSpace(_oDatos._IvaRecPendRep3) ? _oDatos._IvaRecRep3 : _oDatos._IvaRecPendRep3) + "'";
108 
109  txtCuentaSopor._Codigo_Cambiado_Before_Extended += (object cuenta, string tcValorCandidato, ref bool tlOk) => _Codigo_Cambiado_Before_Extended(cuenta, tcValorCandidato, ref tlOk, DatosIva.TipoCuenta.PTE_SOPORTADO);
110  txtCuentaReper._Codigo_Cambiado_Before_Extended += (object cuenta, string tcValorCandidato, ref bool tlOk) => _Codigo_Cambiado_Before_Extended(cuenta, tcValorCandidato, ref tlOk, DatosIva.TipoCuenta.PTE_REPERCUTIDO);
111  txtCuentaRecargoSopor._Codigo_Cambiado_Before_Extended += (object cuenta, string tcValorCandidato, ref bool tlOk) => _Codigo_Cambiado_Before_Extended(cuenta, tcValorCandidato, ref tlOk, DatosIva.TipoCuenta.PTE_RECARGO_SOPORTADO);
112  txtCuentaRecargoReper._Codigo_Cambiado_Before_Extended += (object cuenta, string tcValorCandidato, ref bool tlOk) => _Codigo_Cambiado_Before_Extended(cuenta, tcValorCandidato, ref tlOk, DatosIva.TipoCuenta.PTE_RECARGO_REPERCUTIDO);
113 
114  Size loSizeNecesaria = TextRenderer.MeasureText(new String('M', DatosIva._LenCodigo), this.Font);
115  ewCodigo.Width = loSizeNecesaria.Width;
116 
117  txtCuentaSopor.Focus();
118  }
119  }
120 }
Interface para los UserControls del asistente de IVA
TipoCuenta
Indica el tipo de cuenta
static Int32 _LenCodigo
Longitud del campo código de TIPO de IVA
Clase base para los UserControls del asistente de IVA
Calse para guardar los datos del asistente de IVA
String _Codigo
Código del TIPO_IVA