diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs
index e2aacd275..58495dce2 100644
--- a/Nomina/Nomina.aspx.cs
+++ b/Nomina/Nomina.aspx.cs
@@ -8147,7 +8147,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
if (objnom.GetDispersionNominaBanorte(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
- CrearLayoutNominaBanorte(objnom.DtResultados, "66564");
+ CrearLayoutNominaBanorte(objnom.DtResultados, "66564",1);
}
}
@@ -8270,475 +8270,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
Alert(SbErrores.ToString(), TipoMensaje.MsgAdvertencia);
}
-
-
- //private void CrearLayoutAltaBanorte(DataTable DTNomina, string Promotor, string NIE, string RazonSocial)
- //{
- // StringBuilder sb = new StringBuilder();
- // StringBuilder SbErrores = new StringBuilder();
-
- // char Cero = '0';
- // char Espacio = ' ';
-
- // bool ErrorProceso = false;
-
-
-
- // Promotor = Promotor.Trim();
- // NIE = NIE.Trim();
- // RazonSocial = RazonSocial.Trim();
-
- // //SbErrores.AppendLine("Se detectaron los siguientes errores en la generación del layout");
-
-
-
- // if (DTNomina.Rows.Count > 0)
- // {
-
- // //Tip oRegistro 1 1-1
- // //Clave servicio 2 2-3
- // sb.Append($"HNE");
-
-
- // //Promotor 8 4-11
- // if (Promotor.Length > 0 && Promotor.Length <= 8)
- // {
- // sb.Append(Promotor.PadLeft(8, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"Promotor {Promotor} debe de tener una logitud de entre 1 y 8
");
- // ErrorProceso = true;
- // }
-
- // //NIE 5 12-26
- // if (ErrorProceso == false && NIE.Length > 0 && NIE.Length <= 5)
- // {
- // sb.Append(NIE.PadLeft(5, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"NIE {NIE} debe de tener una logitud de entre 1 y 8
");
- // ErrorProceso = true;
- // }
-
-
- // //Nombre de Empresa ó Razón Social 40 17-56
- // if (ErrorProceso == false && RazonSocial.Length > 0 && RazonSocial.Length <= 40)
- // {
- // sb.Append(RazonSocial.PadLeft(40, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"RazonSocial {RazonSocial} debe de tener una logitud de entre 1 y 40
");
- // ErrorProceso = true;
- // }
-
- // //57-58consecutivo 1
- // sb.Append("1");
-
-
- // //Número de registros N 6 59-64
- // sb.Append(DTNomina.Rows.ToString().PadRight(6, Espacio));
-
- // //Filler A 283 65-347
- // sb.Append(DTNomina.Rows.ToString().PadLeft(283, Espacio));
-
-
-
- // if (!ErrorProceso)
- // {
- // foreach (DataRow dRow in DTNomina.Rows)
- // {
-
-
- // string CodigoEmpleado = dRow["Codigo"].ToString().Trim();
- // string Nombres = dRow["Nombres"].ToString().Trim();
- // string APaterno = dRow["APaterno"].ToString().Trim();
- // string Amaterno = dRow["AMaterno"].ToString().Trim();
- // string CodigoNacionalOperacion = dRow["CodigoNacionalOperacion"].ToString().Trim();
- // string NombreCorto = dRow["NombreCorto"].ToString().Trim();
- // string TipoDeVia = dRow["TipoDeVia"].ToString().Trim();
- // string Direccion = dRow["Direccion"].ToString().Trim();
- // string NumExt = dRow["NumExt"].ToString().Trim();
- // string TipoDeVivienda = dRow["TipoDeVivienda"].ToString().Trim();
- // string Colonia = dRow["Colonia"].ToString().Trim();
- // string DelegacionMunicipio = dRow["DelegacionMunicipio"].ToString().Trim();
- // string ClaveEstado = dRow["ClaveEstado"].ToString().Trim();
- // string CP = dRow["CP"].ToString().Trim();
- // string Sexo = dRow["Sexo"].ToString().Trim();
- // DateTime FechaNacimiento = dRow["FechaNacimiento"].ToString().ToDate();
- // string Nacionalidad = dRow["Nacionalidad"].ToString().Trim();
- // string EstadoCivil = dRow["EstadoCivil"].ToString().Trim();
- // string Escolaridad = dRow["Escolaridad"].ToString().Trim();
- // string TipoEmpleado = dRow["TipoEmpleado"].ToString().Trim();
- // string RFC = dRow["RFC"].ToString().Trim();
- // string TipoAlta = dRow["TipoAlta"].ToString().Trim();
- // string TipoDeTarjeta = dRow["TipoDeTarjeta"].ToString().Trim();
- // string CodigoDeBanco = dRow["CodigoDeBanco"].ToString().Trim();
- // string TipoCuenta = dRow["TipoCuenta"].ToString().Trim();
- // string Cuenta = dRow["Cuenta"].ToString().Trim();
- // string ImpresionContrato = dRow["ImpresionContrato"].ToString().Trim();
-
-
- // //Tipo de registro A 1 1-1
- // sb.AppendLine("D");
-
-
- // //CodigoEmpleado A 10 2-11
- // if (ErrorProceso == false && CodigoEmpleado.Length > 0 && CodigoEmpleado.Trim().Length <= 10)
- // {
- // sb.Append(CodigoEmpleado.PadLeft(10, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"Codigo {CodigoEmpleado} debe de tener una logitud de entre 1 y 10
");
- // ErrorProceso = true;
- // }
-
-
- // //Nombres A 20 12-31
- // if (ErrorProceso == false && Nombres.Length > 0 && Nombres.Trim().Length <= 20)
- // {
- // sb.Append(Nombres.PadRight(20, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Nombre {Nombres} debe de tener una logitud de entre 1 y 20
");
- // ErrorProceso = true;
- // }
-
-
- // //Apellido Paterno A 20 32-51
- // if (ErrorProceso == false && APaterno.Length > 0 && APaterno.Trim().Length <= 20)
- // {
- // sb.Append(APaterno.PadRight(20, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Apellido Paterno {APaterno} debe de tener una logitud de entre 1 y 20
");
- // ErrorProceso = true;
- // }
-
-
- // //Aperllido Materno A 20 52-71
- // if (ErrorProceso == false && Amaterno.Length > 0 && Amaterno.Trim().Length <= 20)
- // {
- // sb.Append(Amaterno.PadRight(20, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Apellido Materno {Amaterno} debe de tener una logitud de entre 1 y 20
");
- // ErrorProceso = true;
- // }
-
- // // Dependencia A 5 72-76
- // sb.Append(string.Empty.PadRight(5, Espacio)); // No requerido
-
-
- // //CodigoNacionalOperacion N 2 77-78 Anexo 1
- // if (ErrorProceso == false && CodigoNacionalOperacion.Length > 0 && CodigoNacionalOperacion.Trim().Length <= 2)
- // {
- // sb.Append(CodigoNacionalOperacion.PadLeft(2, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Codigo Nacional de Operación {CodigoNacionalOperacion} debe de tener una logitud de entre 1 y 20
");
- // ErrorProceso = true;
- // }
-
-
- // //NombreCorto A 19 79-97
- // if (ErrorProceso == false && NombreCorto.Length > 0 && NombreCorto.Trim().Length <= 19)
- // {
- // sb.Append(NombreCorto.PadRight(19, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Nombre Corto{NombreCorto} debe de tener una logitud de entre 1 y 19
");
- // ErrorProceso = true;
- // }
-
-
- // //TipoDeVia A 2 98-99 Anexo 2
- // if (ErrorProceso == false && TipoDeVia.Length > 0 && TipoDeVia.Trim().Length <= 2)
- // {
- // sb.Append(TipoDeVia.PadRight(2, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Tipo De Via {TipoDeVia} debe de tener una logitud de entre 1 y 2
");
- // ErrorProceso = true;
- // }
-
-
-
- // //Calle A 24 100-123
- // if (ErrorProceso == false && Direccion.Length > 0 && Direccion.Trim().Length <= 24)
- // {
- // sb.Append(Direccion.PadRight(24, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Calle {Direccion} debe de tener una logitud de entre 1 y 24
");
- // ErrorProceso = true;
- // }
-
-
-
- // //Numero A 7 124-130
- // if (ErrorProceso == false && NumExt.Length > 0 && NumExt.Trim().Length <= 7)
- // {
- // sb.Append(NumExt.PadRight(7, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Tipo De Via {NumExt} debe de tener una logitud de entre 1 y 7
");
- // ErrorProceso = true;
- // }
-
- // //TipoDeVivienda N 2 131-132
- // if (ErrorProceso == false && TipoDeVivienda.Length > 0 && TipoDeVivienda.Trim().Length <= 2)
- // {
- // sb.Append(TipoDeVivienda.PadLeft(2, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Tipo de Vivienda {TipoDeVivienda} debe de tener una logitud de entre 1 y 2
");
- // ErrorProceso = true;
- // }
-
- // //Entrada A 2 133-134
- // sb.Append(string.Empty.PadRight(2, Espacio)); // No requerido
-
- // //Piso A 5 135-136
- // sb.Append(string.Empty.PadRight(2, Espacio)); // No requerido
-
- // //Deparatmento A 4 137-140
- // sb.Append(string.Empty.PadRight(4, Espacio)); // No requerido
-
-
- // //Colonia A 40 141-180
- // if (ErrorProceso == false && Colonia.Length > 0 && Colonia.Trim().Length <= 40)
- // {
- // sb.Append(Colonia.PadRight(40, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Colonia Municipio {Colonia} debe de tener una logitud de entre 1 y 40
");
- // ErrorProceso = true;
- // }
-
-
- // //DelegacionMunicipio N 3 181-183
- // if (ErrorProceso == false && DelegacionMunicipio.Length > 0 && DelegacionMunicipio.Trim().Length <= 3)
- // {
- // sb.Append(DelegacionMunicipio.PadLeft(3, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Delegacion Municipio {DelegacionMunicipio} debe de tener una logitud de entre 1 y 3
");
- // ErrorProceso = true;
- // }
-
- // //ClaveEstado N 2 184-185
- // if (ErrorProceso == false && ClaveEstado.Length > 0 && ClaveEstado.Trim().Length <= 2)
- // {
- // sb.Append(ClaveEstado.PadLeft(2, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Clave Estado {ClaveEstado} debe de tener una logitud de entre 1 y 2
");
- // ErrorProceso = true;
- // }
-
- // //Codigo Postal N 5 186-190
- // if (ErrorProceso == false && CP.Length > 0 && CP.Trim().Length <= 5)
- // {
- // sb.Append(CP.PadLeft(5, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Codigo Postal {CP} debe de tener una logitud de entre 1 y 5
");
- // ErrorProceso = true;
- // }
-
- // //Telefono A 12 191-202
- // sb.Append(string.Empty.PadRight(12, Espacio)); // No requerido
-
- // //Sexo A 1 203-203
- // sb.Append(Sexo); // No requerido
-
-
- // //Fecha Nacimiento A N 204-211
- // sb.Append(FechaNacimiento.ToString("yyyyMMdd"));
-
- // //Nacionalidad N 3 212-214 Anexo 6
- // if (ErrorProceso == false && Nacionalidad.Length > 0 && Nacionalidad.Trim().Length <= 3)
- // {
- // sb.Append(Nacionalidad.PadLeft(3, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Nacionalidad {Nacionalidad} debe de tener una logitud de entre 1 y 2
");
- // ErrorProceso = true;
- // }
-
- // //Estado Civil N 3 215-215 Anexo 7
- // if (ErrorProceso == false && EstadoCivil.Length > 0 && EstadoCivil.Trim().Length <= 1)
- // {
- // sb.Append(EstadoCivil);
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Estado Civil {EstadoCivil} debe de tener una logitud de 1
");
- // ErrorProceso = true;
- // }
-
- // //Regimen Matrimonial A 1 216-216
- // sb.Append(string.Empty.PadRight(1, Espacio)); // No requerido Anexo 8
-
-
- // //Escolaridad N 3 217-219 Anexo 9
- // if (ErrorProceso == false && Escolaridad.Length > 0 && Escolaridad.Trim().Length <= 3)
- // {
- // sb.Append(Escolaridad.PadLeft(3, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Escolaridad {Escolaridad} debe de tener una logitud de entre 1 y 3
");
- // ErrorProceso = true;
- // }
-
- // //Titulo Profecional N 5 220-223
- // sb.Append(string.Empty.PadLeft(3, Cero)); // No requerido Anexo 10
-
-
- // //RFC N 13 225-237
- // if (ErrorProceso == false && RFC.Length > 0 && RFC.Trim().Length <= 13)
- // {
- // sb.Append(RFC.PadRight(13, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} RFC {RFC} debe de tener una logitud de entre 1 y 13
");
- // ErrorProceso = true;
- // }
-
- // //Curp A 18 238-255
- // sb.Append(string.Empty.PadLeft(18, Espacio)); // No requerido
-
-
- // //Tipo de Alta N 2 256-257
- // if (ErrorProceso == false && TipoAlta.Length > 0 && TipoAlta.Trim().Length <= 2)
- // {
- // sb.Append(TipoAlta.PadLeft(3, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Tipo de Alta {TipoAlta} debe de tener una logitud de entre 1 y 2
");
- // ErrorProceso = true;
- // }
-
- // //TipoDeTarjeta N 1 258-258
- // sb.Append(TipoDeTarjeta);
-
-
- // //Número de Tarjeta de Débito N 16 259-274
- // sb.Append(string.Empty.PadLeft(16, Cero)); // No requerido
-
- // //Clave del Producto de la Cuenta N 4 275-278
- // sb.Append(string.Empty.PadLeft(4, Cero)); // No requerido
-
-
- // //Código de Banco de la Cuenta N 3 279-281
- // if (ErrorProceso == false && CodigoDeBanco.Length > 0 && CodigoDeBanco.Trim().Length <= 3)
- // {
- // sb.Append(CodigoDeBanco.PadLeft(3, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Codigo De Banco {CodigoDeBanco} debe de tener una logitud de entre 1 y 3
");
- // ErrorProceso = true;
- // }
-
- // //Tipo Cuenta N 2 282-283
- // if (ErrorProceso == false && TipoCuenta.Length > 0 && TipoCuenta.Trim().Length <= 2)
- // {
- // sb.Append(TipoCuenta.PadLeft(2, Cero));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Tipo Cuenta {TipoCuenta} debe de tener una logitud de entre 1 y 2
");
- // ErrorProceso = true;
- // }
-
-
- // //Numero cuenta 18 284-301
- // if (ErrorProceso == false && Cuenta.Length > 0 && Cuenta.Trim().Length <= 18)
- // {
- // sb.Append(Cuenta.PadRight(18, Espacio));
- // }
- // else
- // {
- // SbErrores.AppendLine($"{CodigoEmpleado} Numero cuenta {Cuenta} debe de tener una logitud de entre 1 y 18
");
- // ErrorProceso = true;
- // }
-
- // //CR Chequera N 4 302-305
- // sb.Append(string.Empty.PadLeft(4, Cero)); // No requerido
-
- // //Impresion Contrato A 1 306-306
- // sb.Append("S");
-
- // //Sueldo N 15 307-321
- // sb.Append(string.Empty.PadLeft(15, Cero)); // No requerido
-
- // //Numero targeta N 16 307-321
- // sb.Append(string.Empty.PadLeft(16, Cero)); // No requerido
-
- // //Filler A 10 338-347
- // sb.Append(string.Empty.PadLeft(10, Cero)); // Relleno
-
- // }
-
-
-
-
-
- // if (!ErrorProceso)
- // {
- // Response.Clear();
- // Response.ClearHeaders();
- // Response.AppendHeader("Content-Length", sb.ToString());
- // Response.ContentType = "text/plain";
- // //Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina{DateTime.Now.ToString("yyyyMMddhhmmss").ToString()}.txt\"");
- // Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Alta_Banorte_{DdlPeriodo.SelectedItem.Text }.txt\"");
- // Response.Write(sb.ToString());
- // this.RegistraScript("$('#ModalLayoutBancos').modal('hide');");
- // Response.Flush();
- // Response.End();
- // }
- // else
- // {
- // this.Alert($"Errores {SbErrores.ToString()}", TipoMensaje.ToastAdventencia);
- // }
-
-
- // }
-
-
- // }
-
- // #endregion
-
-
-
- //}
-
-
-
- private void CrearLayoutNominaBanorte(DataTable DTNomina, string Emisora)
+ private void CrearLayoutNominaBanorte(DataTable DTNomina, string Emisora, int Consecutivo )
{
StringBuilder sb = new StringBuilder();
StringBuilder SbErrores = new StringBuilder();
@@ -8779,7 +8311,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
//Accion N 1 88-88
sb.Append("0");
//filler 77 89-165
- sb.Append(string.Empty.PadLeft(77, Cero));
+ sb.Append(string.Empty.PadLeft(77, Espacio));
if (!ErrorProceso)
{
@@ -8857,7 +8389,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
Response.ClearHeaders();
Response.AppendHeader("Content-Length", sb.ToString());
Response.ContentType = "text/plain";
- Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina_Banorte_{DdlPeriodo.SelectedItem.Text }.txt\"");
+ Response.AppendHeader("Content-Disposition", $"attachment;filename=\"NI{Emisora.PadLeft(5, Cero)}{Consecutivo.ToString("00")}.PAG\"");
Response.Write(sb.ToString());
this.RegistraScript("$('#ModalLayoutBancos').modal('hide');");
Response.Flush();