rpts IVA, CXC CXP Periodo
This commit is contained in:
@@ -230,7 +230,7 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkOpenProrrateo" OnClick="LnkOpenProrrateo_Click" runat="server"><i class="fa fa-percent"></i> Prorrateo</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkLayoutContable" Visible="false" OnClick="LnkLayoutContable_Click" runat="server"><i class="fa fa-university" aria-hidden="true"></i>Layout banco</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
@@ -286,8 +286,7 @@
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkListaRaya" />
|
||||
<asp:PostBackTrigger ControlID="LnkFormatoTabular" />
|
||||
<asp:PostBackTrigger ControlID="LnkLayoutContable" />
|
||||
|
||||
<asp:PostBackTrigger ControlID="LnkLayoutContable" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -4213,6 +4212,67 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="ModalLayoutBancos" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel ID="UpModalBancosLayout" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Layout banco</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:RadioButtonList runat="server" ID="RBLModalBancosLayout" RepeatDirection="Horizontal" CssClass=" form-control input-sm" >
|
||||
<asp:ListItem Value="1" Selected="True">Generar Layout</asp:ListItem>
|
||||
<asp:ListItem Value="2">Altas Nomina</asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
<asp:Label runat="server" AssociatedControlID="RBLModalBancosLayout">Tipo Operacóon:</asp:Label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:DropDownList ID="DdlModalBancosLayout" CssClass=" form-control input-sm select2me" runat="server" Width="100%">
|
||||
<asp:ListItem Value="-1">Seleccione Uno</asp:ListItem>
|
||||
<asp:ListItem Value="1">Bancomer</asp:ListItem>
|
||||
<asp:ListItem Value="2">Banorte</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Label runat="server" AssociatedControlID="DdlModalBancosLayout">Banco:</asp:Label>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlModalBancosLayout" runat="server" CssClass="help-block errorimput" Display="none" InitialValue="-1" ControlToValidate="DdlModalBancosLayout"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Banco''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalBancoLayout">
|
||||
</asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="CERfvDdlModalBancosLayout" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModalBancosLayout" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
</div>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%-- <asp:UpdatePanel ID="UpModalBancosLayoutBotones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>--%>
|
||||
<button id="BtnModalBancosLayoutCerrar" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
<asp:Button Text="Generar" ID="BtnModalBancosProcesar" OnClick="BtnModalBancosProcesar_Click" CssClass="btn btn-primary" ValidationGroup="GrpModalBancoLayout" runat="server" />
|
||||
<%-- </ContentTemplate>
|
||||
</asp:UpdatePanel>--%>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnModalBancosProcesar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:TextBox ID="TxtCvePeriodo" CssClass="TxtCvePeriodo hidden" runat="server"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtCvePersonal" CssClass="TxtCvePersonal hidden" runat="server"></asp:TextBox>
|
||||
<asp:Button ID="BtnGeneratepdf" CssClass="BtnGeneratepdf hidden" OnClick="BtnGeneratepdf_Click" UseSubmitBehavior="false" runat="server" Text="Button" />
|
||||
|
||||
@@ -7662,108 +7662,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
}
|
||||
loadtablas();
|
||||
}
|
||||
private void CrearLayout(DataTable DTNomina)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder SbErrores = new StringBuilder();
|
||||
bool ErroresValidaciones = false;
|
||||
|
||||
|
||||
|
||||
SbErrores.AppendLine("Se detectaron los siguientes errores en la generación del layout");
|
||||
|
||||
foreach (DataRow dRow in DTNomina.Rows)
|
||||
{
|
||||
string RFC = dRow["RFC"].ToString();
|
||||
string Nombre = dRow["Nombre"].ToString();
|
||||
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
|
||||
decimal Importe = dRow["Importe"].ToString().ToDecimal();
|
||||
|
||||
|
||||
|
||||
if (RFC.Trim().Length == 0)
|
||||
SbErrores.AppendLine($"El RFC es requerido del empleado {Nombre}<br/>");
|
||||
|
||||
System.Text.RegularExpressions.Match Coincidencia = System.Text.RegularExpressions.Regex.Match(RFC, @"/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/");
|
||||
if (!Coincidencia.Success)
|
||||
{
|
||||
SbErrores.AppendLine($"El RFC {RFC} del empleado {Nombre} no es valido <br/>");
|
||||
ErroresValidaciones = true;
|
||||
}
|
||||
|
||||
if (BancoNumCuenta.Trim().Length != 10)
|
||||
{
|
||||
SbErrores.AppendLine($"Empleado {Nombre} numero de cuenta incorrecto, la cuenta debe de tener 10 caracteres<br/>"); // Bancomer 10 caracteres
|
||||
ErroresValidaciones = true;
|
||||
}
|
||||
|
||||
|
||||
if (Importe <= 0)
|
||||
{
|
||||
SbErrores.AppendLine($"Empleado {Nombre} el importe debe de ser mayor a 0 importe {Importe}"); // importe mayot a 0
|
||||
ErroresValidaciones = true;
|
||||
}
|
||||
}
|
||||
|
||||
ErroresValidaciones = false;
|
||||
|
||||
if (!ErroresValidaciones)
|
||||
{
|
||||
int Count = 1;
|
||||
foreach (DataRow dRow in DTNomina.Rows)
|
||||
{
|
||||
StringBuilder SbLinea = new StringBuilder();
|
||||
|
||||
string RFC = dRow["RFC"].ToString();
|
||||
string Nombre = dRow["Nombre"].ToString();
|
||||
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
|
||||
decimal Importe = dRow["Importe"].ToString().ToDecimal().RoundSQL(2);
|
||||
|
||||
SbLinea.Append(Count.ToString("000000000"));
|
||||
SbLinea.Append(RFC.Trim().PadRight(16));
|
||||
SbLinea.Append("03");
|
||||
SbLinea.Append(BancoNumCuenta.Trim().PadRight(20));
|
||||
SbLinea.Append(Importe.ToString("0000000000000.00").Replace(".", ""));
|
||||
|
||||
|
||||
if (Nombre.Trim().Length > 40)
|
||||
Nombre = Nombre.Substring(0, 40);
|
||||
|
||||
SbLinea.Append(Nombre.Trim().PadRight(40));
|
||||
|
||||
SbLinea.Append("012");
|
||||
SbLinea.Append("000");
|
||||
|
||||
sb.AppendLine(SbLinea.ToString());
|
||||
|
||||
|
||||
Count = Count + 1;
|
||||
}
|
||||
|
||||
|
||||
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=\"Nomina {DdlPeriodo.SelectedItem.Text }.txt\"");
|
||||
Response.Write(sb.ToString());
|
||||
Response.End();
|
||||
}
|
||||
else
|
||||
Alert(SbErrores.ToString(), TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
protected void LnkLayoutContable_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
using (ClsNominas objnom = new ClsNominas())
|
||||
{
|
||||
if (objnom.GetDispersionnomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CrearLayout(objnom.DtResultados);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void LnkAsistenciaIncidencias_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -8204,4 +8105,259 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
this.Alert("El Vacaciones_Empresas Se ha Eliminado");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region Layouts
|
||||
|
||||
protected void LnkLayoutContable_Click(object sender, EventArgs e)
|
||||
{
|
||||
RBLModalBancosLayout.SelectedValue = "1";
|
||||
DdlModalBancosLayout.SelectedValueExist("-1");
|
||||
this.RegistraScript("$('#ModalLayoutBancos').modal('show');");
|
||||
UpModalBancosLayout.Update();
|
||||
}
|
||||
|
||||
|
||||
protected void RBLModalBancosLayout_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void BtnModalBancosProcesar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(RBLModalBancosLayout.SelectedValue.ToEntero() == 1)
|
||||
{
|
||||
if (DdlModalBancosLayout.SelectedValue.ToEntero() == 1)
|
||||
{
|
||||
using (ClsNominas objnom = new ClsNominas())
|
||||
{
|
||||
if (objnom.GetDispersionnomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CrearLayoutNominaBancomer(objnom.DtResultados);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (DdlModalBancosLayout.SelectedValue.ToEntero() == 2)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else if (RBLModalBancosLayout.SelectedValue.ToEntero() == 2)
|
||||
{
|
||||
if(DdlModalBancosLayout.SelectedValue.ToEntero() == 1 )
|
||||
{
|
||||
|
||||
}
|
||||
else if (DdlModalBancosLayout.SelectedValue.ToEntero() == 2)
|
||||
{
|
||||
//Banorte
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void CrearLayoutNominaBancomer(DataTable DTNomina)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder SbErrores = new StringBuilder();
|
||||
bool ErroresValidaciones = false;
|
||||
|
||||
|
||||
SbErrores.AppendLine("Se detectaron los siguientes errores en la generación del layout");
|
||||
|
||||
foreach (DataRow dRow in DTNomina.Rows)
|
||||
{
|
||||
string RFC = dRow["RFC"].ToString();
|
||||
string Nombre = dRow["Nombre"].ToString();
|
||||
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
|
||||
decimal Importe = dRow["Importe"].ToString().ToDecimal();
|
||||
|
||||
|
||||
|
||||
if (RFC.Trim().Length == 0)
|
||||
SbErrores.AppendLine($"El RFC es requerido del empleado {Nombre}<br/>");
|
||||
|
||||
System.Text.RegularExpressions.Match Coincidencia = System.Text.RegularExpressions.Regex.Match(RFC, @"/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/");
|
||||
if (!Coincidencia.Success)
|
||||
{
|
||||
SbErrores.AppendLine($"El RFC {RFC} del empleado {Nombre} no es valido <br/>");
|
||||
ErroresValidaciones = true;
|
||||
}
|
||||
|
||||
if (BancoNumCuenta.Trim().Length != 10)
|
||||
{
|
||||
SbErrores.AppendLine($"Empleado {Nombre} numero de cuenta incorrecto, la cuenta debe de tener 10 caracteres<br/>"); // Bancomer 10 caracteres
|
||||
ErroresValidaciones = true;
|
||||
}
|
||||
|
||||
|
||||
if (Importe <= 0)
|
||||
{
|
||||
SbErrores.AppendLine($"Empleado {Nombre} el importe debe de ser mayor a 0 importe {Importe}"); // importe mayot a 0
|
||||
ErroresValidaciones = true;
|
||||
}
|
||||
}
|
||||
|
||||
ErroresValidaciones = false;
|
||||
|
||||
if (!ErroresValidaciones)
|
||||
{
|
||||
int Count = 1;
|
||||
foreach (DataRow dRow in DTNomina.Rows)
|
||||
{
|
||||
StringBuilder SbLinea = new StringBuilder();
|
||||
|
||||
string RFC = dRow["RFC"].ToString();
|
||||
string Nombre = dRow["Nombre"].ToString();
|
||||
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
|
||||
decimal Importe = dRow["Importe"].ToString().ToDecimal().RoundSQL(2);
|
||||
|
||||
SbLinea.Append(Count.ToString("000000000"));
|
||||
SbLinea.Append(RFC.Trim().PadRight(16));
|
||||
SbLinea.Append("03");
|
||||
SbLinea.Append(BancoNumCuenta.Trim().PadRight(20));
|
||||
SbLinea.Append(Importe.ToString("0000000000000.00").Replace(".", ""));
|
||||
|
||||
|
||||
if (Nombre.Trim().Length > 40)
|
||||
Nombre = Nombre.Substring(0, 40);
|
||||
|
||||
SbLinea.Append(Nombre.Trim().PadRight(40));
|
||||
|
||||
SbLinea.Append("012");
|
||||
SbLinea.Append("000");
|
||||
|
||||
sb.AppendLine(SbLinea.ToString());
|
||||
|
||||
|
||||
Count = Count + 1;
|
||||
}
|
||||
|
||||
|
||||
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=\"Nomina {DdlPeriodo.SelectedItem.Text }.txt\"");
|
||||
Response.Write(sb.ToString());
|
||||
this.RegistraScript("$('#ModalLayoutBancos').modal('hide');");
|
||||
Response.Flush();
|
||||
Response.End();
|
||||
}
|
||||
else
|
||||
Alert(SbErrores.ToString(), TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void CrearLayoutAltaBanorte(DataTable DTNomina, string Promotor, string NIE, string RazonSocial)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder SbErrores = new StringBuilder();
|
||||
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, '0'));
|
||||
}
|
||||
else
|
||||
{
|
||||
SbErrores.AppendLine($"Promotor {Promotor} debe de tener una logitud de entre 1 y 8<br/>");
|
||||
ErrorProceso = true;
|
||||
}
|
||||
|
||||
//NIE 5 12-26
|
||||
if (ErrorProceso == false && NIE.Length > 0 && NIE.Length <= 5)
|
||||
{
|
||||
sb.Append(NIE.PadLeft(5, ' '));
|
||||
}
|
||||
else
|
||||
{
|
||||
SbErrores.AppendLine($"NIE {NIE} debe de tener una NIE de entre 1 y 8<br/>");
|
||||
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, ' '));
|
||||
}
|
||||
else
|
||||
{
|
||||
SbErrores.AppendLine($"RazonSocial {RazonSocial} debe de tener una NIE de entre 1 y 40<br/>");
|
||||
ErrorProceso = true;
|
||||
}
|
||||
|
||||
//57-58consecutivo 1
|
||||
sb.Append("1");
|
||||
|
||||
|
||||
//Número de registros N 6 59-64
|
||||
sb.Append(DTNomina.Rows.ToString().PadRight(6, ' '));
|
||||
|
||||
//Filler A 283 65-347
|
||||
sb.Append(DTNomina.Rows.ToString().PadLeft(283, ' '));
|
||||
|
||||
|
||||
|
||||
if (!ErrorProceso)
|
||||
{
|
||||
foreach (DataRow dRow in DTNomina.Rows)
|
||||
{
|
||||
|
||||
|
||||
string CodigoEmpleado = dRow["CodigoEmpleado"].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, '0'));
|
||||
}
|
||||
else
|
||||
{
|
||||
SbErrores.AppendLine($"RazonSocial {RazonSocial} debe de tener una NIE de entre 1 y 40<br/>");
|
||||
ErrorProceso = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user