3 using System.Collections.Generic;
4 using System.ComponentModel;
23 #region Propiedades privadas 24 private DataTable _dtPeriodos = null;
25 private bool _lPeriodosRetenciones =
false;
26 #endregion Propiedades privadas 28 #region Propiedades públicas 29 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
33 public bool _PeriodosRetenciones
35 get {
return _lPeriodosRetenciones; }
38 if (_lPeriodosRetenciones != value)
40 FUNCTIONS._DisposeDatatable(ref _dtPeriodos);
42 _lPeriodosRetenciones = value;
50 #endregion Propiedades públicas 58 InitializeComponent();
60 _Mostrar_Browser =
true;
61 _Mostrar_Mante =
false;
62 _Mostrar_Mensaje =
true;
65 _Codigo_Cambiado_Before +=
new Delegar_Codigo_Cambiado_Before(txtPeriodo__Codigo_Cambiado_Before);
67 #endregion Constructor 69 #region Métodos públicos 70 public void _Periodos(DataTable tdtDatatable)
76 _dtPeriodos = tdtDatatable;
78 FUNCTIONS._DisposeDatatable(_DataTable);
84 #endregion Métodos públicos 86 #region Métodos protected override 87 protected virtual DataTable _Periodos()
93 if (_dtPeriodos != null)
97 if (_lPeriodosRetenciones)
112 _Mensaje_No_Existe =
"El periodo no existe";
113 _Mostrar_Mante =
false;
114 _Esconder_Label =
false;
118 _Browser_Clave =
"periodo";
119 _Browser_Campo_Predet =
"periodo";
120 _Browser_Campos =
"periodo,reper";
121 _Browser_Titulos_Campos =
"Código,Fecha final";
122 _Browser_Titulo =
"Listado de periodos";
124 _TooltipBrowser =
"Consultar periodos";
129 #endregion Métodos protected override 131 #region Métodos privados 132 private void CargarDataTable()
137 if (Convert.ToBoolean(EW_GLOBAL._GetVariable(
"wl_Parti")))
140 if (_DataTable == null)
142 DataTable ldtPeriodosTemp = _Periodos();
144 bool llPeriodoejer = _dtPeriodos != null && Convert.ToBoolean(EW_GLOBAL._GetVariable(
"wl_Parti")) && ldtPeriodosTemp.Columns.Contains(
"periodoejer");
146 DataTable ldtPeriodos =
new DataTable();
148 ldtPeriodos.Columns.Add(
new DataColumn(
"periodo", Type.GetType(
"System.String")));
149 ldtPeriodos.Columns.Add(
new DataColumn(
"reper", Type.GetType(
"System.String")));
151 foreach (DataRow ldrPeriodoTemp
in ldtPeriodosTemp.Rows)
153 DataRow ldrPeriodo = ldtPeriodos.NewRow();
156 ldrPeriodo[
"periodo"] = Convert.ToString(ldrPeriodoTemp[
"periodoejer"]).Trim();
158 ldrPeriodo[
"periodo"] = Convert.ToString(ldrPeriodoTemp[
"periodo"]).Trim();
160 ldrPeriodo[
"reper"] = Convert.ToDateTime(ldrPeriodoTemp[
"reper"]).ToShortDateString();
161 ldtPeriodos.Rows.Add(ldrPeriodo);
164 _DataTable = ldtPeriodos;
165 _Browser_Datatable_Personalizado = _DataTable;
176 private string IVARetencion()
178 if (_lPeriodosRetenciones)
179 return "retenciones";
181 return Convert.ToString(EW_GLOBAL._GetVariable(
"wc_iva")).Trim();
188 private void txtPeriodo__Codigo_Cambiado_Before(ref
bool tlOk)
190 string lcPeriodo = ewtextbox.Text;
192 if (!(
string.IsNullOrWhiteSpace(lcPeriodo)) && (lcPeriodo !=
"Todos") && (this._Browser_Datatable_Personalizado != null))
194 if (this._Browser_Datatable_Personalizado != null && (this._Browser_Datatable_Personalizado.Rows.Count == 0))
196 FUNCTIONS._MessageBox(
"No hay periodos de " + IVARetencion() +
" definidos." + Environment.NewLine +
197 "Por favor defina antes los periodos de " + IVARetencion() + Environment.NewLine +
198 "en la opción de periodos de " + IVARetencion() +
" en el menú" + Environment.NewLine +
199 "archivos de contabilidad.", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, DialogResult.OK);
206 DataRow[] ldrPeriodo = this._Browser_Datatable_Personalizado.Select(
"periodo = '" + lcPeriodo +
"'");
208 if ((ldrPeriodo != null) && (ldrPeriodo.Count() == 0))
210 FUNCTIONS._MessageBox(
"El periodo " + lcPeriodo +
" no existe.",
"Validar periodo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
215 #endregion Métodos privados
static DataTable _PeriodosIVALiquidados(bool tlDesglosarEmpresa=false)
Devuelve un Datatable con los periodos de IVA Liquidados teniendo en cuenta si trabajamos con ejercic...
Filtro de periodo liquidado a utilizar en la generación de los modelos fiscales
override void _Cargar_Propiedades()
Redefinición del método Cargar_Propiedades()
Clase EW_GLOBAL para gestionar las variables públicas de Eurowin, variables de empresa, variables de anchuras de campo, variables de mascaras, etc.
static DataTable _PeriodosRetencionLiquidados(bool tlDesglosarEmpresa=false)
Devuelve un Datatable con los periodos de Retención Liquidados teniendo en cuenta si trabajamos con e...
Clase base para controles de tipo txtcodlabelf