Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -84,66 +84,73 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
|
||||
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
|
||||
LblMsgAcreditable.Text = ""; // lbl de mensajes de negativos
|
||||
|
||||
ClsContabilidad ObjCont = new ClsContabilidad();
|
||||
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, DdlCuenta.SelectedValue.ToEntero(), Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||
|
||||
if (TT.ActiveTabIndex == 0)
|
||||
{
|
||||
GvT.DataSource = ObjCont.DtResultados;
|
||||
DtIVATrasladado = ObjCont.DtResultados;
|
||||
ClsContabilidad ObjCont = new ClsContabilidad();
|
||||
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, DdlCuenta.SelectedValue.ToEntero(), Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||
{
|
||||
GvT.DataSource = ObjCont.DtResultados;
|
||||
DtIVATrasladado = ObjCont.DtResultados;
|
||||
|
||||
if (UsuarioActual.Empresa.Funcionalidad(713) == "1")
|
||||
{
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
if (UsuarioActual.Empresa.Funcionalidad(713) == "1")
|
||||
{
|
||||
GvIEPSA.DataSource = ObjCont.DtResultados;
|
||||
DtIEPSA = ObjCont.DtResultados;
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvIEPSA.DataSource = ObjCont.DtResultados;
|
||||
DtIEPSA = ObjCont.DtResultados;
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvIVAA.DataSource = ObjCont.DtResultados;
|
||||
DtIVAA = ObjCont.DtResultados;
|
||||
}
|
||||
|
||||
}
|
||||
ObjCont.Dispose();
|
||||
GvIEPSA.DataBind();
|
||||
GvIVAA.DataBind();
|
||||
GvT.DataBind();
|
||||
}
|
||||
if (TT.ActiveTabIndex == 1)
|
||||
{
|
||||
ClsContabilidad ObjCont = new ClsContabilidad();
|
||||
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, DdlCuenta.SelectedValue.ToEntero(), Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||
{
|
||||
GvA.DataSource = ObjCont.DtResultados;
|
||||
DtIVAAcreditable = ObjCont.DtResultados;
|
||||
if (DtIVAAcreditable.FiltraParametros("IVA < 0 OR IEPS < 0 ").Rows.Count > 0)
|
||||
{
|
||||
LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT";
|
||||
}
|
||||
//GvA.Columns[11].Visible = DtIVAAcreditable.SUM("valorActosImp1516") > 0; // sino tiene valor la columna de importación de oculta
|
||||
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvIVA2.DataSource = ObjCont.DtResultados;
|
||||
}
|
||||
|
||||
if (UsuarioActual.CveEmpresa == 119)
|
||||
{
|
||||
divRetIVA.Visible = true;
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 4, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvRetIVA.DataSource = ObjCont.DtResultados;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvIVAA.DataSource = ObjCont.DtResultados;
|
||||
DtIVAA = ObjCont.DtResultados;
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, DdlCuenta.SelectedValue.ToEntero(), Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||
{
|
||||
GvA.DataSource = ObjCont.DtResultados;
|
||||
DtIVAAcreditable = ObjCont.DtResultados;
|
||||
if (DtIVAAcreditable.FiltraParametros("IVA < 0 OR IEPS < 0 ").Rows.Count > 0)
|
||||
{
|
||||
LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT";
|
||||
}
|
||||
|
||||
//GvA.Columns[11].Visible = DtIVAAcreditable.SUM("valorActosImp1516") > 0; // sino tiene valor la columna de importación de oculta
|
||||
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvIVA2.DataSource = ObjCont.DtResultados;
|
||||
}
|
||||
|
||||
if (UsuarioActual.CveEmpresa == 119)
|
||||
{
|
||||
divRetIVA.Visible=true;
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 4, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvRetIVA.DataSource = ObjCont.DtResultados;
|
||||
}
|
||||
}
|
||||
}
|
||||
ObjCont.Dispose();
|
||||
GvT.DataBind();
|
||||
GvA.DataBind();
|
||||
GvIEPSA.DataBind();
|
||||
GvIVAA.DataBind();
|
||||
GvIVA2.DataBind();
|
||||
GvRetIVA.DataBind();
|
||||
ObjCont.Dispose();
|
||||
GvA.DataBind();
|
||||
GvIVA2.DataBind();
|
||||
GvRetIVA.DataBind();
|
||||
}
|
||||
|
||||
UpDatos.Update();
|
||||
|
||||
String Str = "Se Consultó el Reporte de IVA. - " + UsuarioActual.Usuario;
|
||||
Str.GuardaLog();
|
||||
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
@@ -336,7 +343,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
|
||||
if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
|
||||
{
|
||||
if (txtFechaI.Text.ToDate().Year < 2025) // años anteriores al 2025
|
||||
if (txtFechaI.Text.ToDate() < "2025/01/31".ToDate()) // años anteriores al enero 2025
|
||||
{
|
||||
foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0)
|
||||
{
|
||||
@@ -378,62 +385,62 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
SBDIOT.AppendLine(
|
||||
Drow["TipoTercero"].ToString() + "|" +
|
||||
Drow["TipoOperacion"].ToString() + "|" +
|
||||
Drow["RFC"].ToString() + "|" +
|
||||
Drow["RFC_DIOT"].ToString() + "|" +
|
||||
Drow["NumeroIDFiscal"].ToString() + "|" +
|
||||
Drow["NombreExtranjero"].ToString() + "|" +
|
||||
Drow["PaisResidencia"].ToString() + "|" +
|
||||
Drow["Nacionalidad"].ToString() + "|" +
|
||||
Drow["Jurisdiccion"].ToString() + "|" +
|
||||
// 3.2 valor de los actos o actividades
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // actos norte
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // desc norte
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // actos sur
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // desc sur
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // desc 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // importacion 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // desc importacion 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // importacion intangibles 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // desc intangibles 16%
|
||||
LV0(Drow["ActosFN"].ToString()) + "|" + // actos norte
|
||||
LV0(Drow["ActosDevFN"].ToString()) + "|" + // desc norte
|
||||
LV0(Drow["ActosFS"].ToString()) + "|" + // actos sur
|
||||
LV0(Drow["ActosDevFS"].ToString()) + "|" + // desc sur
|
||||
LV0(Drow["Actos16"].ToString()) + "|" + // 16%
|
||||
LV0(Drow["ActosDev16"].ToString()) + "|" + // desc 16%
|
||||
LV0(Drow["ActosImp16"].ToString()) + "|" + // importacion 16%
|
||||
LV0(Drow["ActosImpDev16"].ToString()) + "|" + // desc importacion 16%
|
||||
LV0(Drow["ActosImpNotan16"].ToString()) + "|" + // importacion intangibles 16%
|
||||
LV0(Drow["ActosImpNotanDev16"].ToString()) + "|" + // desc intangibles 16%
|
||||
// 3.3 IVA Acreditable
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // actos norte
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // proporcion actos norte
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // actos sur
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // proporcion actos sur
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // proporcion 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // importacion 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // proporción importacion 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // intangibles 16%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // proporcion intangibles 16%
|
||||
LV0(Drow["AcredFN"].ToString()) + "|" + // actos norte
|
||||
LV0(Drow["AcreNoFN"].ToString()) + "|" + // proporcion actos norte
|
||||
LV0(Drow["AcredFS"].ToString()) + "|" + // actos sur
|
||||
LV0(Drow["AcredNoFS"].ToString()) + "|" + // proporcion actos sur
|
||||
LV0(Drow["Acred16"].ToString()) + "|" + // 16%
|
||||
LV0(Drow["AcredIva16"].ToString()) + "|" + // proporcion 16%
|
||||
LV0(Drow["AcredImp16"].ToString()) + "|" + // importacion 16%
|
||||
LV0(Drow["AcredNoImp16"].ToString()) + "|" + // proporción importacion 16%
|
||||
LV0(Drow["AcredImpIntan16"].ToString()) + "|" + // intangibles 16%
|
||||
LV0(Drow["AcredNoImpIntan16"].ToString()) + "|" + // proporcion intangibles 16%
|
||||
// 3.4 IVA NO Acreditable
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredFN"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredNoFN"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredExentaFN"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredNoObjetoFN"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredFS"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredNoFS"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredExentaFS"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredNoObjetoFS"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcred16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredNo16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredExenta16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredNoObjeto16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredIntan16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredIntanNo16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredIntanExenta16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredIntanNoObjeto16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredImp16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredImpNo16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredImpExenta16"].ToString()) + "|" +
|
||||
LV0(Drow["NoAcredImpNoObjeto16"].ToString()) + "|" +
|
||||
// 3.5 datos adicionales
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // VA retenido por el contribuyente
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + //Actos o actividades pagados en la importación de bienes y servicios por los que no se pagara el IVA (Exentos)
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // Actos o actividades pagados por los que no se pagará el IVA(Exentos)
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // Demás actos o actividades pagados a la tasa del 0%
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // Actos o actividades no objeto del IVA realizados en
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|" + // Actos o actividades no objeto del IVA por no contar on establecimiento en territorio nacion
|
||||
LV(Drow["valorActosImp8"].ToString()) + "|"); // Manifiesto que se dio efectos fiscales a los comprobantes que amparan las operaciones realizadas con el proveedor
|
||||
LV0(Drow["DAIvaRetenido"].ToString()) + "|" + // VA retenido por el contribuyente
|
||||
LV0(Drow["DAIvaExentoImpo"].ToString()) + "|" + //Actos o actividades pagados en la importación de bienes y servicios por los que no se pagara el IVA (Exentos)
|
||||
LV0(Drow["DAIvaExento"].ToString()) + "|" + // Actos o actividades pagados por los que no se pagará el IVA(Exentos)
|
||||
LV0(Drow["DATasa0"].ToString()) + "|" + // Demás actos o actividades pagados a la tasa del 0%
|
||||
LV0(Drow["DANoObjetoTN"].ToString()) + "|" + // Actos o actividades no objeto del IVA realizados en
|
||||
LV0(Drow["DANoObjetoNoTN"].ToString()) + "|" + // Actos o actividades no objeto del IVA por no contar on establecimiento en territorio nacion
|
||||
(Drow["DAManifiesto"].ToString())); // Manifiesto que se dio efectos fiscales a los comprobantes que amparan las operaciones realizadas con el proveedor
|
||||
|
||||
//LV(Drow["valorActos1516"].ToString()) + "|" +
|
||||
//LV(Drow["valorActos15"].ToString()) + "|" +
|
||||
@@ -513,6 +520,10 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
{
|
||||
return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : "";
|
||||
}
|
||||
protected string LV0(string Valor)
|
||||
{
|
||||
return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : "0";
|
||||
}
|
||||
|
||||
protected void GvCompara_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
|
||||
@@ -1033,23 +1033,15 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen)
|
||||
End If
|
||||
|
||||
If Not DtDatos.Columns.Contains("CveSeccion") Then
|
||||
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("CveSeccion") Then DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
||||
|
||||
If Not DtDatos.Columns.Contains("Lote") Then
|
||||
DtDatos.Columns.Add("Lote", GetType(String))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Lote") Then DtDatos.Columns.Add("Lote", GetType(String))
|
||||
|
||||
If Not DtDatos.Columns.Contains("FechaCaducidad") Then
|
||||
DtDatos.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Seleccionado") Then
|
||||
DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then
|
||||
DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("FechaCaducidad") Then DtDatos.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
|
||||
If Not DtDatos.Columns.Contains("Seleccionado") Then DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
|
||||
|
||||
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
|
||||
DivCodigoSeriePS.Visible = True
|
||||
@@ -1347,7 +1339,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros("", DistinctColumns:={"Lote", "FechaCaducidad"}).Rows
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||
Dim Cad As String = ""
|
||||
If dr("FechaCaducidad").ToString <> "" Then Cad = $"- Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} {Cad}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||
Next
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
@@ -8,6 +8,7 @@ Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Globalization
|
||||
Imports System.Data.SqlTypes
|
||||
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||
Imports Microsoft.AspNet.SignalR.Infrastructure
|
||||
|
||||
Partial Class RH_Personal
|
||||
Inherits ClsPaginas
|
||||
@@ -1058,11 +1059,42 @@ Partial Class RH_Personal
|
||||
DVDdlTipoSangre.Visible = True
|
||||
End If
|
||||
|
||||
If Not CvePersonal > 0 Then
|
||||
AsignaSiguienteCodigo()
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
AgregarEventosAsincronosGvVacaciones()
|
||||
End Sub
|
||||
|
||||
Private Sub AsignaSiguienteCodigo()
|
||||
Dim ObjPersonal As New ClsRH()
|
||||
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim MaxCodigo As Integer = 1
|
||||
|
||||
If ObjPersonal.DtResultados.Rows.Count > 0 Then
|
||||
MaxCodigo = ObjPersonal.DtResultados.AsEnumerable() _
|
||||
.Select(Function(row)
|
||||
Dim codigoStr As String = row.Field(Of String)("Codigo")
|
||||
If Not String.IsNullOrWhiteSpace(codigoStr) Then
|
||||
Dim codigo As Integer
|
||||
If Integer.TryParse(codigoStr, codigo) Then
|
||||
Return codigo
|
||||
End If
|
||||
End If
|
||||
Return 0
|
||||
End Function) _
|
||||
.DefaultIfEmpty(0) _
|
||||
.Max()
|
||||
End If
|
||||
|
||||
TxtCodigo.Text = (MaxCodigo + 1).ToString("000")
|
||||
|
||||
End If
|
||||
ObjPersonal.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub LoadDefaultValues()
|
||||
DdlDepartamento.SelectedIndex = 1
|
||||
|
||||
Reference in New Issue
Block a user