diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index 76cec5493..fa3d8bd00 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -27,6 +27,265 @@ Partial Class General_SaldosIniciales
End If
End Sub
+ Private Function ValidaCuentasSaldoInicial(ByRef ObjConta As ClsContabilidad, ByRef NombreCuenta As String) As Boolean
+ Dim retorno As Boolean = True
+
+ Dim listaCuentas As New List(Of String)
+ listaCuentas.Add("_GLOBAL")
+ listaCuentas.Add("_ESTADISTICAS")
+ listaCuentas.Add("_ACTIVO")
+ listaCuentas.Add("_CAPITAL")
+ listaCuentas.Add("_CUADRE")
+ listaCuentas.Add("_ORDEN")
+ listaCuentas.Add("_PASIVO")
+ listaCuentas.Add("_UTILIDAD")
+ listaCuentas.Add("_RACREEDOR")
+ listaCuentas.Add("_RDEUDOR")
+
+ Dim CveCuentaGlobal As Integer = -1
+ Dim CveCuentaEstadistica As Integer = -1
+ Dim CveCuentaActivo As Integer = -1
+ Dim CveCuentaCapital As Integer = -1
+ Dim CveCuentaCuadre As Integer = -1
+ Dim CveCuentaOrden As Integer = -1
+ Dim CveCuentaPasivo As Integer = -1
+ Dim CveCuentaUtilidad As Integer = -1
+ Dim CveCuentaAcreedor As Integer = -1
+ Dim CveCuentaDeudor As Integer = -1
+
+ For Each Cuenta In listaCuentas
+ Select Case Cuenta
+ Case "_GLOBAL"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaGlobal = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaGlobal <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(-2, Cuenta, "Cuenta Global", "A", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaGlobal = IdNew
+ Else
+ Exit For
+ End If
+ End If
+ Case "_ESTADISTICAS"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaEstadistica = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaEstadistica <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(-2, Cuenta, "Cuentas Estadísticas", "I", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaEstadistica = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+
+ Case "_ACTIVO"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaActivo = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaActivo <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaGlobal, Cuenta, "Cuentas de Activo", "A", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaActivo = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+
+ Case "_CAPITAL"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaCapital = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaCapital <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaGlobal, Cuenta, "Cuentas de Activo", "F", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaCapital = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+
+ Case "_CUADRE"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaCuadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaCuadre <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaGlobal, Cuenta, "Cuenta de Cuadre", "A", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaCuadre = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+ Case "_ORDEN"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaOrden = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaOrden <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaGlobal, Cuenta, "Cuentas de Orden", "K", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaOrden = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+ Case "_PASIVO"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaPasivo = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaPasivo <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaGlobal, Cuenta, "Cuentas de Pasivo", "D", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaPasivo = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+
+ Case "_UTILIDAD"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaUtilidad = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaUtilidad <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaCapital, Cuenta, "Utilidad o Pérdida del Ejercicio", "F", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaUtilidad = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+
+ Case "_RACREEDOR"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaAcreedor = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaAcreedor <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaGlobal, Cuenta, "Cuentas de Resultados Acreedoras", "H", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaAcreedor = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+
+ Case "_RDEUDOR"
+ NombreCuenta = Cuenta
+
+ If ObjConta.GetCuentas(-1, Cuenta, -1, UsuarioActual.CveEmpresa) Then
+ If ObjConta.DtResultados.Rows.Count > 0 Then
+ CveCuentaDeudor = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
+ End If
+ End If
+
+ If CveCuentaDeudor <= 0 Then
+ Dim IdNew = ObjConta.AddCuenta(CveCuentaGlobal, Cuenta, "Cuentas de Resultados Deudoras", "G", 2, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
+ If IdNew > 0 Then
+ CveCuentaDeudor = IdNew
+ Else
+ Exit For
+ End If
+
+ End If
+ End Select
+ Next
+
+ If CveCuentaGlobal <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaEstadistica <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaActivo <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaCapital <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaCuadre <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaOrden <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaPasivo <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaUtilidad <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaAcreedor <= 0 Then
+ retorno = False
+ End If
+
+ If CveCuentaDeudor <= 0 Then
+ retorno = False
+ End If
+
+ Return retorno
+ End Function
+
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable
@@ -647,7 +906,7 @@ Partial Class General_SaldosIniciales
Dim DTCuentasContables As New DataTable
- If UsuarioActual.Empresa.TipoContabilizacion = 1 Or UsuarioActual.CveEmpresa.Contiene(172) Then
+ If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
@@ -702,64 +961,64 @@ Partial Class General_SaldosIniciales
Dim NuevaClasificacion As Boolean = False
For Each Row As DataRow In dt.Rows
- Dim Codigo As String = Row("Codigo").ToString()
- Dim Descripcion As String = Row("Descripcion").ToString()
- Dim TipoPS As String = Row("Tipo").ToString().Trim.ToUpper
- Dim CodigoBarras As String = Row("Código Barras").ToString()
- Dim UnidadMedida As String = Row("Unidad Medida").ToString().Trim
- Dim Clasificacion As String = Row("Clasificacion").ToString().Trim
- Dim Marca As String = Row("Marca").ToString().Trim
- Dim AplicaSerie As Boolean = If(Row("AplicaSerie").ToString().Trim.ToUpper.Contiene("1", "SI"), True, False)
- Dim Precio As Double = Row("Precio").ToString().ToDouble
- Dim IEPS As Decimal = Row("IEPS").ToString().ToDecimal
- Dim Tamaño As String = Row("Tamaño").ToString().Trim
- Dim SATClavePS As String = Row("Código SAT").ToString().Trim
+ Dim Codigo As String = Row("Codigo").ToString
+ Dim Descripcion As String = Row("Descripcion").ToString
+ Dim TipoPS As String = Row("Tipo").ToString.Trim.ToUpper
+ Dim CodigoBarras As String = Row("Código Barras").ToString
+ Dim UnidadMedida As String = Row("Unidad Medida").ToString.Trim
+ Dim Clasificacion As String = Row("Clasificacion").ToString.Trim
+ Dim Marca As String = Row("Marca").ToString.Trim
+ Dim AplicaSerie As Boolean = If(Row("AplicaSerie").ToString.Trim.ToUpper.Contiene("1", "SI"), True, False)
+ Dim Precio As Double = Row("Precio").ToString.ToDouble
+ Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
+ Dim Tamaño As String = Row("Tamaño").ToString.Trim
+ Dim SATClavePS As String = Row("Código SAT").ToString.Trim
- Dim Clasificacion2 As String = If(dt.Columns.Contains("Servicio"), Row("Servicio").ToString().Trim, "")
- Dim Litraje As Double = If(dt.Columns.Contains("Conversion Unidad"), Row("Conversion Unidad").ToString().ToDouble, 0)
- Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString().Trim, "")
- Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString().Trim, "")
- Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString().Trim, "")
- Dim Linea As String = If(Row.Table.Columns.Contains("Linea"), Row("Linea").ToString().Trim, "")
- Dim Modelo As String = If(Row.Table.Columns.Contains("Modelo"), Row("Modelo").ToString().Trim, "")
- Dim RetIVA As Decimal = If(Row.Table.Columns.Contains("RetIVA"), Row("RetIVA").ToString().Trim.ToDecimal, 0D)
+ Dim Clasificacion2 As String = If(dt.Columns.Contains("Servicio"), Row("Servicio").ToString.Trim, "")
+ Dim Litraje As Double = If(dt.Columns.Contains("Conversion Unidad"), Row("Conversion Unidad").ToString.ToDouble, 0)
+ Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "")
+ Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "")
+ Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "")
+ Dim Linea As String = If(Row.Table.Columns.Contains("Linea"), Row("Linea").ToString.Trim, "")
+ Dim Modelo As String = If(Row.Table.Columns.Contains("Modelo"), Row("Modelo").ToString.Trim, "")
+ Dim RetIVA As Decimal = If(Row.Table.Columns.Contains("RetIVA"), Row("RetIVA").ToString.Trim.ToDecimal, 0D)
- Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString().ToEntero()
+ Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
Dim CveTipoPS As Integer = If(TipoPS.ToUpper = "PRODUCTO", 2, 1)
- Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString().ToEntero()
- Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}' OR Abreviatura = '{UnidadMedida}'").ToString().ToEntero()
- Dim CveSATPS As Integer = ClsPaginas.GlobalDTPSATPS("-1", CodigoSAT:=SATClavePS).FiltroPrimeroValor("CveSATPS", "").ToEntero()
- Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}' AND CveEmpresa = {UsuarioActual.CveEmpresa}").ToString().ToEntero()
- Dim CveClasificacion2 As Integer = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString().ToEntero()
- Dim CveClasificacionDetalle As Integer = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveClasificacionDetalle", $"ClasificacionDetalle = '{Linea}'").ToString().ToEntero()
+ Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
+ Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}' OR Abreviatura = '{UnidadMedida}'").ToString.ToEntero
+ Dim CveSATPS As Integer = ClsPaginas.GlobalDTPSATPS("-1", CodigoSAT:=SATClavePS).FiltroPrimeroValor("CveSATPS", "").ToEntero
+ Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}' AND CveEmpresa = {UsuarioActual.CveEmpresa}").ToString.ToEntero
+ Dim CveClasificacion2 As Integer = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero
+ Dim CveClasificacionDetalle As Integer = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveClasificacionDetalle", $"ClasificacionDetalle = '{Linea}'").ToString.ToEntero
If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then
If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1",
- GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToString().ToEntero(), UsuarioActual.CveUsuario,
+ GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToString.ToEntero, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa) Then
GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
- CveClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString().ToEntero()
+ CveClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
NuevaClasificacion = True
End If
End If
If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then
- If ObjUM.AddUnidadMedida(UnidadMedida, UnidadMedida, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero() > 0 Then
+ If ObjUM.AddUnidadMedida(UnidadMedida, UnidadMedida, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then
If ObjUM.GetUnidadesMedida(UsuarioActual.CveEmpresa) Then GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing
- CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString().ToEntero()
+ CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
End If
End If
Dim CveMarca As Integer = -1
If Marca <> "" AndAlso DtMarcas IsNot Nothing Then
- CveMarca = DtMarcas.FiltroPrimeroValor("CveMarca", $"Marca = '{Marca}'").ToString().ToEntero()
+ CveMarca = DtMarcas.FiltroPrimeroValor("CveMarca", $"Marca = '{Marca}'").ToString.ToEntero
If Not CveMarca > 0 Then
If ObjPS.AddMarcas(Marca, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
DtMarcas = ObjPS.DtResultados.Copy
- CveMarca = DtMarcas.FiltroPrimeroValor("CveMarca", $"Marca = '{Marca}'").ToString().ToEntero()
+ CveMarca = DtMarcas.FiltroPrimeroValor("CveMarca", $"Marca = '{Marca}'").ToString.ToEntero
End If
End If
End If
@@ -767,12 +1026,12 @@ Partial Class General_SaldosIniciales
Dim CveMedida As Integer = -1
If Medida <> "" AndAlso DtMedidas IsNot Nothing Then
- CveMedida = DtMedidas.FiltroPrimeroValor("CveMedida", $"Medida = '{Medida}'").ToString().ToEntero()
+ CveMedida = DtMedidas.FiltroPrimeroValor("CveMedida", $"Medida = '{Medida}'").ToString.ToEntero
If Not CveMedida > 0 Then
If ObjGral.AddMedidas(CveClasificacion, "", Medida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjGral.GetMedidas(UsuarioActual.CveEmpresa) Then
DtMedidas = ObjGral.DtResultados.Copy
- CveMedida = DtMedidas.FiltroPrimeroValor("CveMedida", $"Medida = '{Medida}'").ToString().ToEntero()
+ CveMedida = DtMedidas.FiltroPrimeroValor("CveMedida", $"Medida = '{Medida}'").ToString.ToEntero
End If
End If
End If
@@ -780,12 +1039,12 @@ Partial Class General_SaldosIniciales
Dim CveRinTamaño As Integer = -1
If RinTamaño <> "" AndAlso DtRinTamaño IsNot Nothing Then
- CveRinTamaño = DtRinTamaño.FiltroPrimeroValor("CveRinTamaño", $"RinTamaño = '{RinTamaño}'").ToString().ToEntero()
+ CveRinTamaño = DtRinTamaño.FiltroPrimeroValor("CveRinTamaño", $"RinTamaño = '{RinTamaño}'").ToString.ToEntero
If Not CveRinTamaño > 0 Then
If ObjGral.AddRimTamanios(CveClasificacion, "", RinTamaño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DtRinTamaño = ObjGral.DtResultados.Copy
- CveRinTamaño = DtRinTamaño.FiltroPrimeroValor("CveRinTamaño", $"RinTamaño = '{RinTamaño}'").ToString().ToEntero()
+ CveRinTamaño = DtRinTamaño.FiltroPrimeroValor("CveRinTamaño", $"RinTamaño = '{RinTamaño}'").ToString.ToEntero
End If
End If
End If
@@ -793,12 +1052,12 @@ Partial Class General_SaldosIniciales
Dim CveModelo As Integer = -1
If Modelo <> "" AndAlso DtModelos IsNot Nothing Then
- CveModelo = DtModelos.FiltroPrimeroValor("CveModelo", $"Modelo = '{Modelo}'").ToString().ToEntero()
+ CveModelo = DtModelos.FiltroPrimeroValor("CveModelo", $"Modelo = '{Modelo}'").ToString.ToEntero
If Not CveModelo > 0 Then
If ObjGral.AddModelos(CveMarca, "", Modelo, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjGral.GetModelos(UsuarioActual.CveEmpresa) Then
DtModelos = ObjGral.DtResultados.Copy
- CveModelo = DtModelos.FiltroPrimeroValor("CveModelo", $"Modelo = '{Modelo}'").ToString().ToEntero()
+ CveModelo = DtModelos.FiltroPrimeroValor("CveModelo", $"Modelo = '{Modelo}'").ToString.ToEntero
End If
End If
End If
@@ -810,21 +1069,21 @@ Partial Class General_SaldosIniciales
If ObjGral.GetCategorias(UsuarioActual.CveEmpresa, 4) Then
- CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero()
+ CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero
End If
If Not CveCategoria > 0 Then
If ObjGral.AddCategorias(Clasificacion2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4) Then
If ObjGral.GetCategorias(UsuarioActual.CveEmpresa, 4) Then
- CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero()
+ CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero
End If
End If
End If
If ObjClas.GetClasificaciones(UsuarioActual.CveEmpresa) Then
- CveClasificacion2 = ObjClas.DtResultados.FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{ Clasificacion2.Trim }'").ToEntero()
+ CveClasificacion2 = ObjClas.DtResultados.FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{ Clasificacion2.Trim }'").ToEntero
End If
@@ -833,7 +1092,7 @@ Partial Class General_SaldosIniciales
If ObjClas.AddClasificaciones(Clasificacion2, "", -1, "-1", -1, "-1", -1, "-1", CveCategoria, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa) Then
If ObjClas.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClas.DtResultados
- CveClasificacion2 = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString().ToEntero()
+ CveClasificacion2 = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero
End If
End If
@@ -929,14 +1188,14 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
- Dim RazonSocial As String = Row("RazonSocial").ToString()
+ Dim RazonSocial As String = Row("RazonSocial").ToString
- Dim CuentaContable As String = Row("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "")
+ Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
- Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
+ Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
If CveCuentaContable > 0 Then
Row("CveCuentaContable") = CveCuentaContable
@@ -948,8 +1207,8 @@ Partial Class General_SaldosIniciales
Next
For Each Row As DataRow In dt.Rows
- Dim RazonSocial As String = Row("RazonSocial").ToString()
- If Not (Row("TipoProveedor").ToString().Trim.ToUpper).Contiene("PROVEEDOR", "ACREEDOR") Then
+ Dim RazonSocial As String = Row("RazonSocial").ToString
+ If Not (Row("TipoProveedor").ToString.Trim.ToUpper).Contiene("PROVEEDOR", "ACREEDOR") Then
sbErrores.AppendLine($"Proveedor {RazonSocial} TipoProveedor {Row("TipoProveedor")} invalido.
")
ErrorProv = True
End If
@@ -974,57 +1233,57 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
- Dim Codigo As String = Row("Codigo").ToString()
- Dim RazonSocial As String = Row("RazonSocial").ToString()
+ Dim Codigo As String = Row("Codigo").ToString
+ Dim RazonSocial As String = Row("RazonSocial").ToString
If RazonSocial.Trim.Length = 0 Then
Continue For
End If
- Dim RFC As String = Row("RFC").ToString().Trim
+ Dim RFC As String = Row("RFC").ToString.Trim
- Dim Dirrecion As String = $"{ Row("Población").ToString()}, { Row("Estado").ToString()} , Colonia { Row("Colonia").ToString()}, {Row("Calle").ToString()} #{Row("Número exterior").ToString()}"
+ Dim Dirrecion As String = $"{ Row("Población").ToString}, { Row("Estado").ToString} , Colonia { Row("Colonia").ToString}, {Row("Calle").ToString} #{Row("Número exterior").ToString}"
- 'Dim NumExt As String = Row("Número exterior").ToString()
+ 'Dim NumExt As String = Row("Número exterior").ToString
- ' Dim Colonia As String = Row("Colonia").ToString()
- Dim CodigoPostal As Integer = Row("Código Postal").ToString().ToEntero()
+ ' Dim Colonia As String = Row("Colonia").ToString
+ Dim CodigoPostal As Integer = Row("Código Postal").ToString.ToEntero
- ' Dim Poblacion As String = Row("Población").ToString()
+ ' Dim Poblacion As String = Row("Población").ToString
- 'Dim Estado As String = Row("Estado").ToString()
- Dim Telefono As String = Row("Teléfono").ToString()
- Dim ContactoMail As String = Row("Contacto").ToString()
- Dim CelularContacto As String = Row("Celular Contacto").ToString()
- Dim LimiteCredito As Double = Row("Limite Credito").ToString().ToDouble
- Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString().ToEntero()
+ 'Dim Estado As String = Row("Estado").ToString
+ Dim Telefono As String = Row("Teléfono").ToString
+ Dim ContactoMail As String = Row("Contacto").ToString
+ Dim CelularContacto As String = Row("Celular Contacto").ToString
+ Dim LimiteCredito As Double = Row("Limite Credito").ToString.ToDouble
+ Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero
- Dim Banco As String = Row("Banco").ToString()
- Dim NumeroCuenta As String = Row("N° CUENTA").ToString().Replace("-", "").Replace(" ", "")
- Dim ClabeInter As String = Row("Clabe Inter").ToString().Replace("-", "").Replace(" ", "")
+ Dim Banco As String = Row("Banco").ToString
+ Dim NumeroCuenta As String = Row("N° CUENTA").ToString.Replace("-", "").Replace(" ", "")
+ Dim ClabeInter As String = Row("Clabe Inter").ToString.Replace("-", "").Replace(" ", "")
- Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString().ToEntero()
- Dim CveProveedor2 As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RazonSocial = '{RazonSocial}'").ToString().ToEntero()
+ Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
+ Dim CveProveedor2 As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RazonSocial = '{RazonSocial}'").ToString.ToEntero
Dim CveProveedor3 As Integer = 0
- Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString().ToEntero()
- Dim TipoProveedor As Integer = If(Row("TipoProveedor").ToString().ToUpper = "PROVEEDOR", 1, 2)
+ Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
+ Dim TipoProveedor As Integer = If(Row("TipoProveedor").ToString.ToUpper = "PROVEEDOR", 1, 2)
Dim CveConceptoCuentaAsiganaciones As Integer = If(TipoProveedor = 1, 5, 305)
If Codigo.Trim.Length > 0 Then
- CveProveedor3 = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"Codigo = '{Codigo}'").ToString().ToEntero()
+ CveProveedor3 = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"Codigo = '{Codigo}'").ToString.ToEntero
End If
- Dim CodigoRegimenFiscal As String = Row("Regimen Fiscal").ToString()
- Dim ProveedorClasificacion As String = Row("Clasificación Proveedor").ToString()
- Dim Moneda As String = Row("Moneda Preferente").ToString()
- Dim DIOTTipoTercero As String = Row("Tipo Tercero").ToString().Trim.ToUpper
- Dim DIOTipoOperacion As String = Row("Tipo Operación").ToString()
+ Dim CodigoRegimenFiscal As String = Row("Regimen Fiscal").ToString
+ Dim ProveedorClasificacion As String = Row("Clasificación Proveedor").ToString
+ Dim Moneda As String = Row("Moneda Preferente").ToString
+ Dim DIOTTipoTercero As String = Row("Tipo Tercero").ToString.Trim.ToUpper
+ Dim DIOTipoOperacion As String = Row("Tipo Operación").ToString
Dim CveMoneda As Integer = -1
Dim CveProveedorClasificacion As Integer = -1
@@ -1104,7 +1363,7 @@ Partial Class General_SaldosIniciales
If ProveedorClasificacion.Trim.Length > 0 Then
- CveProveedorClasificacion = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedorClasificacion", $"ProveedorClasificacion = '{ProveedorClasificacion}'").ToString().ToEntero()
+ CveProveedorClasificacion = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedorClasificacion", $"ProveedorClasificacion = '{ProveedorClasificacion}'").ToString.ToEntero
If Not CveProveedorClasificacion > 0 Then
sbErrores.AppendLine($"Proveedor {RazonSocial} Proveedor Clasificacion {ProveedorClasificacion} invalida.
")
ErrorProv = True
@@ -1112,7 +1371,7 @@ Partial Class General_SaldosIniciales
End If
If CodigoRegimenFiscal.Trim.Length > 0 Then
- CveRegimenFiscal = GlobalDTRegimenesFiscales.FiltroPrimeroValor("CveRegimenFiscal", $"CodigoRegimenFiscal= '{CodigoRegimenFiscal}' ").ToEntero()
+ CveRegimenFiscal = GlobalDTRegimenesFiscales.FiltroPrimeroValor("CveRegimenFiscal", $"CodigoRegimenFiscal= '{CodigoRegimenFiscal}' ").ToEntero
If Not CveRegimenFiscal > 0 Then
sbErrores.AppendLine($"Proveedor {RazonSocial} Codigo RegimenFiscal {CodigoRegimenFiscal} invalido.
")
ErrorProv = True
@@ -1231,11 +1490,11 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
- Dim RazonSocial As String = Row("RazonSocial").ToString()
- Dim CuentaContable As String = Row("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "")
+ Dim RazonSocial As String = Row("RazonSocial").ToString
+ Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
- Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
+ Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
If CveCuentaContable > 0 Then
Row("CveCuentaContable") = CveCuentaContable
@@ -1264,40 +1523,40 @@ Partial Class General_SaldosIniciales
NumRow = NumRow + 1
- Dim Codigo As String = Row("Codigo").ToString()
- Dim RazonSocial As String = Row("RazonSocial").ToString()
- Dim RFC As String = Row("RFC").ToString().Trim
- Dim Calle As String = Row("Calle").ToString()
- Dim NumExt As Decimal = Row("Número exterior").ToString().ToDecimal
- Dim Colonia As String = Row("Colonia").ToString()
- Dim CodigoPostal As String = Row("Código Postal").ToString()
- Dim Poblacion As String = Row("Población").ToString()
- Dim Estado As String = Row("Estado").ToString().Trim
- Dim Pais As String = Row("Pais").ToString()
- Dim Telefono As String = Row("Teléfono").ToString().Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
- Dim Contacto As String = Row("Contacto").ToString()
+ Dim Codigo As String = Row("Codigo").ToString
+ Dim RazonSocial As String = Row("RazonSocial").ToString
+ Dim RFC As String = Row("RFC").ToString.Trim
+ Dim Calle As String = Row("Calle").ToString
+ Dim NumExt As Decimal = Row("Número exterior").ToString.ToDecimal
+ Dim Colonia As String = Row("Colonia").ToString
+ Dim CodigoPostal As String = Row("Código Postal").ToString
+ Dim Poblacion As String = Row("Población").ToString
+ Dim Estado As String = Row("Estado").ToString.Trim
+ Dim Pais As String = Row("Pais").ToString
+ Dim Telefono As String = Row("Teléfono").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
+ Dim Contacto As String = Row("Contacto").ToString
- Dim Vendedor As String = Row("Vendedor").ToString()
- Dim Clasificacion As String = Row("ClasificacionCliente").ToString()
- Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero()
+ Dim Vendedor As String = Row("Vendedor").ToString
+ Dim Clasificacion As String = Row("ClasificacionCliente").ToString
+ Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
- Dim CveVendedor As Integer = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString().ToEntero()
- Dim CveClasificación As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString().ToEntero()
- Dim EsDistribuidor As Boolean = If(dt.Columns.Contains("Es distribuidor"), If(Row("Es distribuidor").ToString().ToUpper = "SI", True, False), False)
- Dim CargoUsado As Boolean = If(dt.Columns.Contains("Cargo Usados"), If(Row("Cargo Usados").ToString().ToUpper = "SI", True, False), False)
- Dim BonificacionUsado As Boolean = If(dt.Columns.Contains("EmitirBon Usado"), If(Row("EmitirBon Usado").ToString().ToUpper = "SI", True, False), False)
+ Dim CveVendedor As Integer = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString.ToEntero
+ Dim CveClasificación As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
+ Dim EsDistribuidor As Boolean = If(dt.Columns.Contains("Es distribuidor"), If(Row("Es distribuidor").ToString.ToUpper = "SI", True, False), False)
+ Dim CargoUsado As Boolean = If(dt.Columns.Contains("Cargo Usados"), If(Row("Cargo Usados").ToString.ToUpper = "SI", True, False), False)
+ Dim BonificacionUsado As Boolean = If(dt.Columns.Contains("EmitirBon Usado"), If(Row("EmitirBon Usado").ToString.ToUpper = "SI", True, False), False)
- Dim LimiteCredito As Decimal = Row("Limite Credito").ToString().ToDecimal
- Dim CobranzaCorreo As String = Row("CorreoPagos").ToString()
- Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString().ToEntero()
+ Dim LimiteCredito As Decimal = Row("Limite Credito").ToString.ToDecimal
+ Dim CobranzaCorreo As String = Row("CorreoPagos").ToString
+ Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero
- Dim DìaVisita As String = If(dt.Columns.Contains("Dia Pago"), Row("Dia Pago").ToString(), "")
- Dim DiasPagoEspecifico As String = If(dt.Columns.Contains("Dìa Visita"), Row("Dìa Visita").ToString(), "")
- Dim CobranzaContacto As String = If(dt.Columns.Contains("Encargado Pagoa"), Row("Encargado Pago").ToString(), "")
- Dim CobranzaTelefono As String = Row("Celular Contacto").ToString().Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
- Dim CveUsoCFDI As Integer = If(Row("UsoCFDI").ToString() = "", -1, GlobalDTSATUsosCFDI().FiltroPrimeroValor("CveUsoCFDI", String.Format("UsoCFDI = '{0}'", Row("UsoCFDI").ToString())).ToEntero())
- Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString().ToEntero()
+ Dim DìaVisita As String = If(dt.Columns.Contains("Dia Pago"), Row("Dia Pago").ToString, "")
+ Dim DiasPagoEspecifico As String = If(dt.Columns.Contains("Dìa Visita"), Row("Dìa Visita").ToString, "")
+ Dim CobranzaContacto As String = If(dt.Columns.Contains("Encargado Pagoa"), Row("Encargado Pago").ToString, "")
+ Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
+ Dim CveUsoCFDI As Integer = If(Row("UsoCFDI").ToString = "", -1, GlobalDTSATUsosCFDI().FiltroPrimeroValor("CveUsoCFDI", String.Format("UsoCFDI = '{0}'", Row("UsoCFDI").ToString)).ToEntero)
+ Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "")
'Telefono
@@ -1311,7 +1570,7 @@ Partial Class General_SaldosIniciales
CobranzaTelefono = ""
End If
- Dim FormaPago As String = If(dt.Columns.Contains("Forma Pago"), Row("Forma Pago").ToString(), "")
+ Dim FormaPago As String = If(dt.Columns.Contains("Forma Pago"), Row("Forma Pago").ToString, "")
Dim CveFormaPago33 As Integer = 99
Select Case FormaPago
@@ -1389,7 +1648,7 @@ Partial Class General_SaldosIniciales
- 'Dim RazonSocial As String = Row("RazonSocial").ToString()
+ 'Dim RazonSocial As String = Row("RazonSocial").ToString
'Contacto
@@ -1404,9 +1663,9 @@ Partial Class General_SaldosIniciales
' Exit For
'End If
Else
- Dim CveSATEstado As Integer = GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveSATEstado", String.Format(" NombreEstado ='{0}'", Estado.ToUpper)).ToEntero()
+ Dim CveSATEstado As Integer = GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveSATEstado", String.Format(" NombreEstado ='{0}'", Estado.ToUpper)).ToEntero
- If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString(), "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
+ If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", Codigo, LimiteCredito, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI, CveSATEstado:=CveSATEstado, CveAdminTrayecto:=0) Then
@@ -1472,38 +1731,38 @@ Partial Class General_SaldosIniciales
DtProveedores = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
Dim RFC As String = ""
Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("")
- Dim CvePS As Integer = drr("CvePS").ToString().ToEntero()
- Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString().ToEntero()
- Dim CveClasificacion As Integer = drr("CveClasificacion").ToString().ToEntero()
+ Dim CvePS As Integer = drr("CvePS").ToString.ToEntero
+ Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString.ToEntero
+ Dim CveClasificacion As Integer = drr("CveClasificacion").ToString.ToEntero
Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
- Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'")
- RFC = Row("RFC").ToString().Trim
- RFC = Row("RFC").ToString().Trim
- Dim Serie As String = Row("Serie").ToString()
- Dim Folio As String = Row("Folio").ToString()
- Dim Fecha As Date = Row("Fecha").ToString().ToDate
- Dim SubTotal As Decimal = Row("SubTotal").ToString().ToDecimal
- Dim IVA As Decimal = Row("IVA").ToString().ToDecimal
- Dim Total As Decimal = Row("Total").ToString().ToDecimal
- Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal
- Dim TipoDocto As String = Row("Tipo Documento").ToString()
- Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString().ToEntero()
- GuardaLog(Sucursal + " - " + Row("Sucursal").ToString())
- Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal
- Dim RetISR As Decimal = Row("Ret ISR").ToString().ToDecimal
- Dim IEPS As Decimal = Row("IEPS").ToString().ToDecimal
- Dim Moneda As String = Row("Moneda").ToString()
- Dim TipoCambio As String = Row("Tipo Cambio").ToString()
- Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate
+ Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString}'")
+ RFC = Row("RFC").ToString.Trim
+ RFC = Row("RFC").ToString.Trim
+ Dim Serie As String = Row("Serie").ToString
+ Dim Folio As String = Row("Folio").ToString
+ Dim Fecha As Date = Row("Fecha").ToString.ToDate
+ Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal
+ Dim IVA As Decimal = Row("IVA").ToString.ToDecimal
+ Dim Total As Decimal = Row("Total").ToString.ToDecimal
+ Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal
+ Dim TipoDocto As String = Row("Tipo Documento").ToString
+ Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
+ GuardaLog(Sucursal + " - " + Row("Sucursal").ToString)
+ Dim RetIVA As Decimal = Row("Ret IVA").ToString.ToDecimal
+ Dim RetISR As Decimal = Row("Ret ISR").ToString.ToDecimal
+ Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
+ Dim Moneda As String = Row("Moneda").ToString
+ Dim TipoCambio As String = Row("Tipo Cambio").ToString
+ Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
Dim CveMoneda As Integer = 1
- Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString().ToEntero()
- Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString()
- Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString(), "0").ToDecimal
- Dim RetIVAPorcentaje As Decimal = Row("RetIVAPorcentaje").ToString().ToDecimal
- Dim RetISRPorcentaje As Decimal = Row("RetISRPorcentaje").ToString().ToDecimal
+ Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString.ToEntero
+ Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString
+ Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString, "0").ToDecimal
+ Dim RetIVAPorcentaje As Decimal = Row("RetIVAPorcentaje").ToString.ToDecimal
+ Dim RetISRPorcentaje As Decimal = Row("RetISRPorcentaje").ToString.ToDecimal
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True
@@ -1511,14 +1770,14 @@ Partial Class General_SaldosIniciales
If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For
If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1
- TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString()
+ TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString
'Temporalmente SE BORRARA
- Dim Transaccion As String = "" 'Row("Transaccion2").ToString()
- Dim Folio2 As String = "" 'Row("Folio2").ToString()
- Dim CodProvee As String = "" 'Row("CodProvee2").ToString()
+ Dim Transaccion As String = "" 'Row("Transaccion2").ToString
+ Dim Folio2 As String = "" 'Row("Folio2").ToString
+ Dim CodProvee As String = "" 'Row("CodProvee2").ToString
'Moneda
If Moneda.ToUpper.Contiene("PESOS", "PESO", "MXN", "MONEDA NACIONAL") Then
@@ -1542,7 +1801,7 @@ Partial Class General_SaldosIniciales
End If
'Compra
- If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero(), SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDouble, FechaVencimiento,
+ If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero, SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDouble, FechaVencimiento,
False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal,
NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total) Then
ErrorCompras = True
@@ -1551,7 +1810,7 @@ Partial Class General_SaldosIniciales
CveCompra = ObjCompras.CveCompra
'Compra Detalle
- If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero(), -1, 0, 1, SubTotal, 0.16D, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA.ToDecimal, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then
+ If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero, -1, 0, 1, SubTotal, 0.16D, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA.ToDecimal, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then
ErrorCompras = True
Exit For
End If
@@ -1559,20 +1818,20 @@ Partial Class General_SaldosIniciales
If TipoDocto = "NC" Then ConceptoContablePago = 60
'PrePólizaDetalle
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio, IIf(TipoDocto = "Fac", 5, 18).ToString().ToEntero(), String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio, 6, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=SubTotal, CveClasificacion:=CveClasificacion, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio, IIf(TipoDocto = "Fac", 5, 18).ToString.ToEntero, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio, 6, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=SubTotal, CveClasificacion:=CveClasificacion, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
If IVA > 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Folio, 14, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IVA, CveSubProyecto:=Sucursal.ToEntero(), CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Folio, 14, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IVA, CveSubProyecto:=Sucursal.ToEntero, CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For
End If
- If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, Folio, 25, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IEPS, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
+ If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, Folio, 25, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IEPS, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
- If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetIVA, Folio, 15, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetIVA, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
- If RetISR > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetISR, Folio, 16, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetISR, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
- If ImpuestosLocales > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImpuestosLocales, Folio, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=ImpuestosLocales, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
+ If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetIVA, Folio, 15, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetIVA, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
+ If RetISR > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetISR, Folio, 16, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetISR, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
+ If ImpuestosLocales > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImpuestosLocales, Folio, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=ImpuestosLocales, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
'Saldo
If Saldo < Total Then
@@ -1618,9 +1877,9 @@ Partial Class General_SaldosIniciales
Dim Encontrados As Integer = 0
Dim StrRFCNoencontrados As New StringBuilder
Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("AplicaParaVenta = 1")
- Dim CvePS As Integer = drr("CvePS").ToString().ToEntero()
- Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString().ToEntero()
- Dim CveClasificacion As Integer = drr("CveClasificacion").ToString().ToEntero()
+ Dim CvePS As Integer = drr("CvePS").ToString.ToEntero
+ Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString.ToEntero
+ Dim CveClasificacion As Integer = drr("CveClasificacion").ToString.ToEntero
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorVentas = True
@@ -1630,49 +1889,49 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
- Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'")
- Dim TipoDocto As String = Row("Tipo Documento").ToString().Trim
- Dim RFC As String = Row("RFC").ToString().Trim
- Dim Serie As String = Row("Serie").ToString()
- Dim Folio As Integer = Row("Folio").ToString().ToEntero()
- Dim Fecha As Date = Row("Fecha").ToString().ToDate
- Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate
- Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString().ToDecimal, 0D)
- Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString().ToDouble, 0.0)
- Dim SubTotal As Decimal = Row("SubTotal").ToString().ToDecimal
- Dim IVA As Decimal = Row("IVA").ToString().ToDecimal
- Dim Total As Decimal = Row("Total").ToString().ToDecimal
- Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal
- Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero()
- Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal
- Dim RetISR As Double = Row("Ret ISR").ToString().ToDouble
- Dim Moneda As String = Row("Moneda").ToString()
- Dim TipoCambio As String = Row("Tipo Cambio").ToString()
+ Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString}'")
+ Dim TipoDocto As String = Row("Tipo Documento").ToString.Trim
+ Dim RFC As String = Row("RFC").ToString.Trim
+ Dim Serie As String = Row("Serie").ToString
+ Dim Folio As Integer = Row("Folio").ToString.ToEntero
+ Dim Fecha As Date = Row("Fecha").ToString.ToDate
+ Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
+ Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0D)
+ Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString.ToDouble, 0.0)
+ Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal
+ Dim IVA As Decimal = Row("IVA").ToString.ToDecimal
+ Dim Total As Decimal = Row("Total").ToString.ToDecimal
+ Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal
+ Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
+ Dim RetIVA As Decimal = Row("Ret IVA").ToString.ToDecimal
+ Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble
+ Dim Moneda As String = Row("Moneda").ToString
+ Dim TipoCambio As String = Row("Tipo Cambio").ToString
Dim CveMoneda As Integer = 1
- Dim Vendedor As String = If(dt.Columns.Contains("Vendedor"), Row("Vendedor").ToString(), "")
+ Dim Vendedor As String = If(dt.Columns.Contains("Vendedor"), Row("Vendedor").ToString, "")
Dim CveVendedor As Integer = 0
- Dim IEPS As Decimal = 0 'Row("IEPS").ToString().ToDecimal
- Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString().ToEntero()
- Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString(), "")
- Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString().ToDecimal, 4), 0)
- Dim PorcentajeRetIVA As Decimal = If(dt.Columns.Contains("PorcentajeRetIVA"), Round(Row("PorcentajeRetIVA").ToString().ToDecimal, 4), 0)
+ Dim IEPS As Decimal = 0 'Row("IEPS").ToString.ToDecimal
+ Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString.ToEntero
+ Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString, "")
+ Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString.ToDecimal, 4), 0)
+ Dim PorcentajeRetIVA As Decimal = If(dt.Columns.Contains("PorcentajeRetIVA"), Round(Row("PorcentajeRetIVA").ToString.ToDecimal, 4), 0)
- Dim PedidoContrato As String = If(dt.Columns.Contains("Pedido"), Row("Pedido").ToString(), "")
+ Dim PedidoContrato As String = If(dt.Columns.Contains("Pedido"), Row("Pedido").ToString, "")
- GuardaLog(Sucursal + "-" + Row("Folio").ToString())
+ GuardaLog(Sucursal + "-" + Row("Folio").ToString)
'Temporalmente SE BORRARA
- Dim Transaccion As String = "" ' Row("Transaccion2").ToString()
- Dim Folio2 As String = "" ' Row("Folio2").ToString()
- Dim CodCliente As String = "" 'Row("CodCliente2").ToString()
+ Dim Transaccion As String = "" ' Row("Transaccion2").ToString
+ Dim Folio2 As String = "" ' Row("Folio2").ToString
+ Dim CodCliente As String = "" 'Row("CodCliente2").ToString
'If Not CveCliente > 0 Then Alert(String.Format("No se encontró el cliente con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorVentas = True : RFC.GuardaLog : Exit For
- TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESO", "INGRESOS", "ING"), "Ing", IIf(TipoDocto.ToUpper.Contiene("EGRESO", "EGRESOS", "EGS"), "Egs", "Rem")).ToString()
+ TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESO", "INGRESOS", "ING"), "Ing", IIf(TipoDocto.ToUpper.Contiene("EGRESO", "EGRESOS", "EGS"), "Egs", "Rem")).ToString
'PrePóliza
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Venta/SaldoInicial", 1, Total, Total, 1, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Vendedor <> "" Then
- CveVendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString().ToEntero()
+ CveVendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString.ToEntero
If Not CveVendedor > 0 Then CveVendedor = 0
Else
CveVendedor = 0
@@ -1702,17 +1961,17 @@ Partial Class General_SaldosIniciales
If TipoDocto.Contiene("Ing", "Egs", "Rem") Then
GuardaLog(Serie & "-" & Folio)
- If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero(), CveClienteSucursal, SubTotal, 0, Amortizacion, IVA, RetIVA, RetISR, Total, CveMoneda, TipoCambio.ToDouble,
+ If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero, CveClienteSucursal, SubTotal, 0, Amortizacion, IVA, RetIVA, RetISR, Total, CveMoneda, TipoCambio.ToDouble,
0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, 0, CvePrePoliza,
- UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero(), CveSubProyectoEjecucion:=Sucursal.ToEntero(),
- CveSubProyectoCobranza:=Sucursal.ToEntero(), IEPS:=IEPS,
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero,
+ CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS,
ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestoLocal, PedidoContrato:=PedidoContrato) Then
ErrorVentas = True
Exit For
End If
CveVenta = ObjVentas.CveVenta
- If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, IVA, SubTotal * PorcentajeIVA, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA) Then
+ If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, IVA, SubTotal * PorcentajeIVA, "Saldo Inicial", 0, 0, Sucursal.ToEntero, 0, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA) Then
ErrorVentas = True
Exit For
End If
@@ -1735,39 +1994,39 @@ Partial Class General_SaldosIniciales
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True
'PrePólizaDetalle
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString(), 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero(), PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString(), ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
If IVA > 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio.ToString(), 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IVA, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IVA, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
- 'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString(), 38, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For
+ 'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString, 38, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For
If RetIVA > 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio.ToString(), 8, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=RetIVA, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio.ToString, 8, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=RetIVA, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
If ImpuestoLocal > 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, Folio.ToString(), 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImpuestoLocal, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, Folio.ToString, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImpuestoLocal, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
If UsaComplementaria Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Folio.ToString(), 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal - Total, TipoCambio:=TipoCambio.ToDecimal, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Folio.ToString, 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal - Total, TipoCambio:=TipoCambio.ToDecimal, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
'Saldo
If Saldo < Total Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Folio.ToString(), ConceptoContablePago, Folio.ToString(), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total - Saldo, CveVentaAmortizacion:=CveVenta, Contabilizable:=False) Then ErrorVentas = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio.ToString(), 95, Folio.ToString(), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total - Saldo, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Folio.ToString, ConceptoContablePago, Folio.ToString, Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total - Saldo, CveVentaAmortizacion:=CveVenta, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio.ToString, 95, Folio.ToString, Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total - Saldo, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
Else
'ANTICIPOS
- Dim CveIE As Integer = ObjIE.AddBancos_IE(1, 1, Fecha, Folio.ToString(), "", Total, 1,
+ Dim CveIE As Integer = ObjIE.AddBancos_IE(1, 1, Fecha, Folio.ToString, "", Total, 1,
1, "Anticipo Cliente", "", False, False, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString(), 30, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio.ToString(), 66, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, 30, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio.ToString, 66, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
Encontrados = Encontrados + 1
@@ -1815,13 +2074,13 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
- Dim Codigo As String = Row("Código").ToString()
- Dim Descripcion As String = Row("Descripción").ToString()
+ Dim Codigo As String = Row("Código").ToString
+ Dim Descripcion As String = Row("Descripción").ToString
- Dim CuentaContable As String = Row("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "")
+ Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
- Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
+ Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
If CveCuentaContable > 0 Then
Row("CveCuentaContable") = CveCuentaContable
@@ -1848,30 +2107,30 @@ Partial Class General_SaldosIniciales
Dim NumRow As Integer = 0
For Each Row As DataRow In dt.FiltraParametros("Descripción <> ''").Rows
- Dim Codigo As String = Row("Código").ToString()
- Dim Descripcion As String = Row("Descripción").ToString()
- Dim TipoAF As String = Row("Tipo").ToString().Trim
- Dim SubTipo As String = Row("SubTipo").ToString().Trim
- Dim Valor As Decimal = Row("Valor de compra").ToString().ToDecimal
- Dim FechaAF As Date = Row("Fecha de compra").ToString().ToDate
- Dim NumeroSerie As String = Row("No. Serie").ToString()
- Dim Año As Integer = Row("Año").ToString().ToEntero()
- Dim CuentaContable As String = Row("Cuenta Contable").ToString()
- Dim Estado As String = Row("Estado").ToString()
- Dim Proyecto As String = Row("Proyecto").ToString()
- Dim SubProyecto As String = Row("SubProyecto").ToString()
- Dim Cliente As String = Row("Cliente").ToString()
- Dim Observaciones As String = Row("Observaciones").ToString()
- Dim CtaDepreciacion As Integer = Row("Cuenta Depreciación").ToString().ToEntero()
- Dim PorcentajeDepreciacion As Decimal = Row("% Depreciación").ToString().ToDecimal
+ Dim Codigo As String = Row("Código").ToString
+ Dim Descripcion As String = Row("Descripción").ToString
+ Dim TipoAF As String = Row("Tipo").ToString.Trim
+ Dim SubTipo As String = Row("SubTipo").ToString.Trim
+ Dim Valor As Decimal = Row("Valor de compra").ToString.ToDecimal
+ Dim FechaAF As Date = Row("Fecha de compra").ToString.ToDate
+ Dim NumeroSerie As String = Row("No. Serie").ToString
+ Dim Año As Integer = Row("Año").ToString.ToEntero
+ Dim CuentaContable As String = Row("Cuenta Contable").ToString
+ Dim Estado As String = Row("Estado").ToString
+ Dim Proyecto As String = Row("Proyecto").ToString
+ Dim SubProyecto As String = Row("SubProyecto").ToString
+ Dim Cliente As String = Row("Cliente").ToString
+ Dim Observaciones As String = Row("Observaciones").ToString
+ Dim CtaDepreciacion As Integer = Row("Cuenta Depreciación").ToString.ToEntero
+ Dim PorcentajeDepreciacion As Decimal = Row("% Depreciación").ToString.ToDecimal
'CLAVES
- Dim CveAF As Integer = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActivoFijo", $"Codigo = '{Codigo}'").ToString().ToEntero()
- Dim CveSubTipoAF As Integer = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubTipoActivoFijo", $"TipoActivoFijo = '{TipoAF}'").ToString().ToEntero()
- Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{SubProyecto}'").ToString().ToEntero()
- Dim CveEstadoActivoFijo As Integer = GlobalDTEstadoActivoFijo().FiltroPrimeroValor("CveEstadoActivoFijo", $"EstadoActivoFijo = '{Estado}'").ToString().ToEntero()
- Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"Nombre = '{Cliente}'").ToString().ToEntero()
- Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString().ToEntero()
+ Dim CveAF As Integer = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActivoFijo", $"Codigo = '{Codigo}'").ToString.ToEntero
+ Dim CveSubTipoAF As Integer = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubTipoActivoFijo", $"TipoActivoFijo = '{TipoAF}'").ToString.ToEntero
+ Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{SubProyecto}'").ToString.ToEntero
+ Dim CveEstadoActivoFijo As Integer = GlobalDTEstadoActivoFijo().FiltroPrimeroValor("CveEstadoActivoFijo", $"EstadoActivoFijo = '{Estado}'").ToString.ToEntero
+ Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"Nombre = '{Cliente}'").ToString.ToEntero
+ Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
'VALIDACIONES
@@ -1953,18 +2212,18 @@ Partial Class General_SaldosIniciales
Dim CuentaPadre As String = ""
For Each Row As DataRow In dt.Rows
- NombreCuenta = Row("NombreCuenta").ToString()
- CuentaPadre = Row("CuentaPadre").ToString()
- Dim Cuenta As String = Row("Cuenta").ToString()
- Dim TipoCuenta As String = Row("TipoCuenta").ToString()
- Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString()
+ NombreCuenta = Row("NombreCuenta").ToString
+ CuentaPadre = Row("CuentaPadre").ToString
+ Dim Cuenta As String = Row("Cuenta").ToString
+ Dim TipoCuenta As String = Row("TipoCuenta").ToString
+ Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString
Dim CveCuentaPadre As Integer = -1
If NombreCuenta <> "" Then
If ObjConta.GetCuentas(-1, CuentaPadre.Replace("-", ""), -1) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
- CveCuentaPadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero()
+ CveCuentaPadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
Else
TieneError = True
Exit For
@@ -1974,7 +2233,7 @@ Partial Class General_SaldosIniciales
Exit For
End If
- Dim IdNew = ObjConta.AddCuenta(Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 0, 1, 0, "", 0, CveCuentaPadre, AgrupadorSAT.ToEntero())
+ Dim IdNew = ObjConta.AddCuenta(Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 0, 1, 0, "", 0, CveCuentaPadre, AgrupadorSAT.ToEntero)
If IdNew > 0 Then
ContadorUpdate = ContadorUpdate + 1
Else
@@ -2012,30 +2271,45 @@ Partial Class General_SaldosIniciales
Dim NombreCuenta As String = ""
Dim CuentaPadre As String = ""
+ Dim SbMsgError As New StringBuilder
+
+ If Not ValidaCuentasSaldoInicial(ObjConta, NombreCuenta) Then
+ SbMsgError.AppendFormat("No se pudo validar las cuentas principales.")
+ TieneError = True
+ End If
+
Dim AgrupadoresSAT As DataTable = New DataTable
- If ObjConta.GetAgrupadoresSAT() Then
+ If Not TieneError AndAlso ObjConta.GetAgrupadoresSAT() Then
AgrupadoresSAT = ObjConta.DtResultados
End If
- If AgrupadoresSAT.Rows.Count > 0 Then
-
+ If AgrupadoresSAT.Rows.Count > 0 AndAlso Not TieneError Then
For Each Row As DataRow In dt.Rows
- Dim Cuenta As String = Row("Cuenta").ToString().Trim.Replace("-", "")
+ Dim Cuenta As String = Row("Cuenta").ToString.Trim.Replace("-", "")
If Cuenta <> "" Then
- NombreCuenta = Row("NombreCuenta").ToString().Trim
- CuentaPadre = Row("CuentaPadre").ToString().Trim.Replace("-", "")
+ NombreCuenta = Row("NombreCuenta").ToString.Trim
+ CuentaPadre = Row("CuentaPadre").ToString.Trim.Replace("-", "")
- Dim TipoCuenta As String = Row("TipoCuenta").ToString().Trim
- Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString().Trim
+ Dim TipoCuenta As String = Row("TipoCuenta").ToString.Trim
+ Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString.Trim
Dim CveCuentaPadre As Integer = -1
- Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero())
+ Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero)
+
+ If Not String.IsNullOrEmpty(Row("AgrupadorSAT").ToString()) AndAlso AgrupadorSAT.ToDecimal() > 0 Then
+ If CveAgrupadorSAT <= 0 Then
+ SbMsgError.AppendFormat("El agrupador SAT '{0}' no existe.", AgrupadorSAT)
+ TieneError = True
+ Exit For
+ End If
+ End If
If Not CuentaPadre = "" Then
If ObjConta.GetCuentas(-1, CuentaPadre.Replace("-", ""), -1, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
- CveCuentaPadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero()
+ CveCuentaPadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
Else
+ SbMsgError.AppendFormat("La cuenta padre '{0}' no existe.", CuentaPadre)
TieneError = True
Exit For
End If
@@ -2062,11 +2336,12 @@ Partial Class General_SaldosIniciales
Alert("No se tienen asociados Agrupadores para esta empresa")
TieneError = True
End If
+
If Not TieneError Then
ObjConta.Commit()
Alert($"Se agregaron {ContadorUpdate} Cuentas Correctamente y se omitieron: {ContadorError} cuentas.")
Else
- Alert($"No pudimos agregar la cuenta en ContaSIG: {NombreCuenta} - Cuenta Padre: {CuentaPadre}", TipoMensaje.MsgError)
+ Alert($"No pudimos agregar la cuenta en ContaSIG:
{NombreCuenta} - Cuenta Padre: {CuentaPadre}. {SbMsgError.ToString()}", TipoMensaje.MsgError)
ObjConta.RollBack()
End If
@@ -2095,10 +2370,10 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
- NombreCuenta = Row("NombreCuenta").ToString()
- Cuenta = Row("Cuenta").ToString()
- Dim TipoCuenta As String = Row("TipoCuenta").ToString()
- Dim Importe As Double = Row("Importe").ToString().ToDouble
+ NombreCuenta = Row("NombreCuenta").ToString
+ Cuenta = Row("Cuenta").ToString
+ Dim TipoCuenta As String = Row("TipoCuenta").ToString
+ Dim Importe As Double = Row("Importe").ToString.ToDouble
Dim IdCuenta As Integer = -1
Dim CargoAbono As Boolean = True
Dim YaExiste As Boolean = False
@@ -2106,7 +2381,7 @@ Partial Class General_SaldosIniciales
If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
- IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero()
+ IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo")
Else
Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe} ")
@@ -2142,7 +2417,7 @@ Partial Class General_SaldosIniciales
Alert($"Se agregó la póliza {IdPoliza}")
Else
- Alert($"No encontraron las siguientes cuentas: {Reporte.ToString()} ", TipoMensaje.MsgError)
+ Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError)
ObjConta.RollBack()
End If
@@ -2169,14 +2444,14 @@ Partial Class General_SaldosIniciales
CvePrePoliza = ObjConta.AddPrePolizas("SI", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Saldos Iniciales", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
For Each Row As DataRow In dt.FiltraParametros("Cuenta <> '' ").Rows
- NombreCuenta = Row("NombreCuenta").ToString()
- Cuenta = Row("Cuenta").ToString()
+ NombreCuenta = Row("NombreCuenta").ToString
+ Cuenta = Row("Cuenta").ToString
- Dim Importe As Decimal = If(Row("Cargo").ToString().ToDecimal <> 0, Row("Cargo").ToString().ToDecimal, Row("Abono").ToString().ToDecimal)
- Dim Concepto As String = Row("Concepto").ToString()
+ Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal)
+ Dim Concepto As String = Row("Concepto").ToString
Dim IdCuenta As Integer = -1
Dim CveSubProyecto As Integer = -1
- Dim TipoMovto As Boolean = If(Row("Cargo").ToString().ToDecimal <> 0, False, True)
+ Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True)
Dim YaExiste As Boolean = False
Dim DataTemp As DataTable
Dim Afectable As Boolean = False
@@ -2185,7 +2460,7 @@ Partial Class General_SaldosIniciales
Cuenta = Cuenta.Replace(" ", "")
If ObjConta.GetCuentas(-1, Cuenta.Replace("-", "").Trim, -1, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
- IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero()
+ IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero
Afectable = ObjConta.DtResultados().FiltroPrimeroValor("Afectable") = "True"
Else
Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe} ")
@@ -2197,10 +2472,10 @@ Partial Class General_SaldosIniciales
Exit For
End If
- Dim SubP As String = Row("SubProyecto").ToString().Trim
+ Dim SubP As String = Row("SubProyecto").ToString.Trim
If SubP <> "" AndAlso SubP <> "-" Then
DataTemp = SubProTemp.FiltraParametros(String.Format("SubProyecto = '{0}'", SubP))
- CveSubProyecto = DataTemp.FiltroPrimeroValor("CveSubProyecto", "").ToEntero()
+ CveSubProyecto = DataTemp.FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If CveSubProyecto <= 0 Then
Reporte.AppendLine($"'{SubP}' - no se encontró en los subproyectos ")
TieneError = True
@@ -2236,7 +2511,7 @@ Partial Class General_SaldosIniciales
Alert($"Se agregó la póliza {ObjConta.ContaFolio}")
Else
- Alert($"No encontraron las siguientes cuentas: {Reporte.ToString()} ", TipoMensaje.MsgError)
+ Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError)
ObjConta.RollBack()
End If
@@ -2259,11 +2534,11 @@ Partial Class General_SaldosIniciales
Dim Fecha As DateTime = (TxtFecha.Text).ToDate
Try
For Each almacenSinRepetir As DataRow In dt.FiltraParametros("Almacen <> ''", DistinctColumns:={"Almacen"}).Rows
- Dim almacenActual As String = almacenSinRepetir("Almacen").ToString().Trim
- Dim CveAlmacen As Integer = AlmacenRef.FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero()
+ Dim almacenActual As String = almacenSinRepetir("Almacen").ToString.Trim
+ Dim CveAlmacen As Integer = AlmacenRef.FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero
If CveAlmacen > 0 Then
- Dim movimientoCabecera As Integer = ObjMovimientos.AddMovimiento(CveAlmacen, DdlConceptoAlmacen.SelectedValue.ToEntero(), 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
+ Dim movimientoCabecera As Integer = ObjMovimientos.AddMovimiento(CveAlmacen, DdlConceptoAlmacen.SelectedValue.ToEntero, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
listadoMovimientos += $"movimiento con folio {ObjMovimientos.Folio}
"
If movimientoCabecera > 0 Then
@@ -2271,12 +2546,12 @@ Partial Class General_SaldosIniciales
contadorMovimientos += 1
Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' AND CveEmpresa = {UsuarioActual.CveEmpresa}")
If RowPS IsNot Nothing Then
- Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero()
- Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
+ Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero
+ Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero
If CveUM > 0 Then
- Dim Cantidad As Decimal = nuevaEntrada("Existencia").ToString().ToDecimal
- Dim Valor As Decimal = nuevaEntrada("Valor").ToString().ToDecimal
- Dim Serie As String = If(dt.Columns.Contains("Serie"), nuevaEntrada("Serie").ToString().Trim, "")
+ Dim Cantidad As Decimal = nuevaEntrada("Existencia").ToString.ToDecimal
+ Dim Valor As Decimal = nuevaEntrada("Valor").ToString.ToDecimal
+ Dim Serie As String = If(dt.Columns.Contains("Serie"), nuevaEntrada("Serie").ToString.Trim, "")
If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, (Valor / Cantidad), -1, -1, Serie:=Serie) Then
mensajeError = "No se logró generar el detalle del movimiento"
@@ -2365,26 +2640,26 @@ Partial Class General_SaldosIniciales
DTClasificaiones.CaseSensitive = False
- For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows
+ For Each dRow As DataRow In dt.Rows
- Dim Clasificacion As String = Regex.Replace(dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, ""), "[^\u0009\u000A\u000D\u0020-\u007E]", "")
- Dim Categoria As String = dRow("Categoria").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
- Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString().Trim.ToUpper.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
- Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString().Trim.Replace("-", "").Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
- Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString().Trim.Replace("-", "").Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
+ Dim Clasificacion As String = dRow("Clasificacion").ToString.Trim
+ Dim Categoria As String = dRow("Categoria").ToString.Trim
+ Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString.Trim.ToUpper
+ Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString.Trim.Replace("-", "")
+ Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString.Trim.Replace("-", "")
Dim CveClasificacion As Integer = -1
Dim CveUsoClasificacion As Integer = -1
Dim CveCategoria As Integer = -1
- CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", $" Categoria = '{Categoria}' ").ToEntero()
+ CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", $" Categoria = '{Categoria}' ").ToEntero
If Not CveCategoria > 0 Then
- CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToEntero()
+ CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToEntero
If Not CveCategoria > 0 Then
Alert($"Clasificación {Clasificacion} la categoria {Categoria} no es valida.", TipoMensaje.MsgAdvertencia)
ErrorProceso = True
@@ -2408,8 +2683,8 @@ Partial Class General_SaldosIniciales
Exit For
End If
- Dim CveCuentaContableIngreso As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableIngreso}'").ToEntero()
- Dim CveCuentaContableGasto As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableGasto}'").ToEntero()
+ Dim CveCuentaContableIngreso As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableIngreso}'").ToEntero
+ Dim CveCuentaContableGasto As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableGasto}'").ToEntero
If CuentaContableIngreso.Trim.Length > 0 AndAlso CveCuentaContableIngreso <= 0 Then
Alert($"Clasificación {Clasificacion} no se encontro la cuenta de ingreso {CuentaContableIngreso}.", TipoMensaje.MsgAdvertencia)
@@ -2422,7 +2697,7 @@ Partial Class General_SaldosIniciales
End If
- Dim CveClasificaionTemp = DTClasificaiones.FiltroPrimeroValor("CveClasificacion", $"Clasificacion='{Clasificacion}'").ToEntero()
+ Dim CveClasificaionTemp = DTClasificaiones.FiltroPrimeroValor("CveClasificacion", $"Clasificacion='{Clasificacion}'").ToEntero
If CveClasificaionTemp > 0 Then
CveClasificacion = CveClasificaionTemp
@@ -2441,19 +2716,13 @@ Partial Class General_SaldosIniciales
Else
ErrorProceso = True
End If
- Else
-
- If Not ObjClasificaciones.UpdateClasificacion(Clasificacion, "-1", -1, "-1", -1, "-1", -1, "-1", True, True, CveCategoria, UsuarioActual.CveUsuario, CveClasificacion, UsoClasificacion:=CveUsoClasificacion) Then
- ErrorProceso = True
- End If
-
End If
If Not ErrorProceso Then
If CveCuentaContableIngreso > 0 Then
- If Not AsignacionCuenta(ObjConta, 4, CveCuentaContableIngreso, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion, OpActualizarClasificacion:=True) Then
+ If Not AsignacionCuenta(ObjConta, 4, CveCuentaContableIngreso, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion) Then
ErrorProceso = True
Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia)
Exit For
@@ -2461,7 +2730,7 @@ Partial Class General_SaldosIniciales
End If
If CveCuentaContableGasto > 0 Then
- If Not AsignacionCuenta(ObjConta, 6, CveCuentaContableGasto, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion, OpActualizarClasificacion:=True) Then
+ If Not AsignacionCuenta(ObjConta, 6, CveCuentaContableGasto, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion) Then
ErrorProceso = True
Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia)
Exit For
@@ -2502,17 +2771,17 @@ Partial Class General_SaldosIniciales
Dim Contador As Integer = 0
For Each dRow As DataRow In DTBancos.Rows
- Dim Fecha As Date = dRow("Fecha").ToString().ToDate
- Dim Importe As Decimal = dRow("Importe").ToString().ToDecimal
- Dim Descripcion As String = dRow("Descripcion").ToString()
- Dim Banco As String = dRow("Banco").ToString()
- Dim NumCuenta As String = dRow("CuentaBancaria").ToString().Trim
+ Dim Fecha As Date = dRow("Fecha").ToString.ToDate
+ Dim Importe As Decimal = dRow("Importe").ToString.ToDecimal
+ Dim Descripcion As String = dRow("Descripcion").ToString
+ Dim Banco As String = dRow("Banco").ToString
+ Dim NumCuenta As String = dRow("CuentaBancaria").ToString.Trim
Dim ImporteMX As Decimal = 0
Dim ImporteME As Decimal = 0
- Dim Moneda As String = dRow("Moneda").ToString()
+ Dim Moneda As String = dRow("Moneda").ToString
Dim CveMoneda As Integer
- Dim TipoCambio As Decimal = dRow("TipoCambio").ToString().ToDecimal
+ Dim TipoCambio As Decimal = dRow("TipoCambio").ToString.ToDecimal
If Moneda.ToUpper.Contiene("PESOS", "PESO", "MXN") Then
CveMoneda = 1
@@ -2543,11 +2812,11 @@ Partial Class General_SaldosIniciales
Dim CveTipoTransaccion As Integer = 3 ' tipo transaccion, cheque recibido
- Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=-1).FiltroPrimeroValor("CveCuenta", $" NumCuenta = '{NumCuenta}'").ToEntero()
+ Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=-1).FiltroPrimeroValor("CveCuenta", $" NumCuenta = '{NumCuenta}'").ToEntero
If Not CveCuentaBancaria > 0 Then
' se registrará primero
- Dim CveBanco As Integer = GlobalDTBancos().FiltroPrimeroValor("CveBanco", String.Format("CveEmpresa = {0} AND Banco = '{1}'", UsuarioActual.CveEmpresa, Banco)).ToEntero()
+ Dim CveBanco As Integer = GlobalDTBancos().FiltroPrimeroValor("CveBanco", String.Format("CveEmpresa = {0} AND Banco = '{1}'", UsuarioActual.CveEmpresa, Banco)).ToEntero
If CveBanco > 0 Then
Dim CveTipoCuenta As Integer = 2 'tipo de cheques
@@ -2570,11 +2839,11 @@ Partial Class General_SaldosIniciales
FolioStr = CStr(ObjBancos.GetNextFolio(CveCuentaBancaria, CveTipoTransaccion))
Dim CveCuentaContable As Integer = 0
- Dim CuentaContable As String = dRow("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "")
+ Dim CuentaContable As String = dRow("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
- CveCuentaContable = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
+ CveCuentaContable = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
If CveCuentaContable > 0 Then
dRow("CveCuentaContable") = CveCuentaContable
@@ -2603,11 +2872,11 @@ Partial Class General_SaldosIniciales
ErrorProceso = True : Exit For
End If
- Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, CveTipoTransaccion, Fecha, FolioStr.ToString(), "", Importe, CveMoneda,
+ Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, CveTipoTransaccion, Fecha, FolioStr.ToString, "", Importe, CveMoneda,
TipoCambio, Descripcion, "", False, False, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, FolioStr.ToString(), 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, FolioStr.ToString(), 95, FolioStr, Fecha, -1, -1, CveIE:=CveIE, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, FolioStr.ToString, 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, FolioStr.ToString, 95, FolioStr, Fecha, -1, -1, CveIE:=CveIE, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
End If
@@ -2628,7 +2897,7 @@ Partial Class General_SaldosIniciales
Private Sub ProcesaAnticipoProveedor(DtAnticipoProveedor As DataTable, DTCuentasContables As DataTable)
Dim ErrorProceso As Boolean = False
- Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCuenta", "").ToEntero()
+ Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCuenta", "").ToEntero
If Not CveCuentaBancaria > 0 Then
Alert("No se detecto una cuenta Bancaria", TipoMensaje.MsgAdvertencia)
@@ -2647,15 +2916,15 @@ Partial Class General_SaldosIniciales
For Each dRow As DataRow In DtAnticipoProveedor.Rows
- Dim Fecha As Date = dRow("Fecha").ToString().ToDate
- Dim Importe As Decimal = dRow("Importe").ToString().ToDecimal
+ Dim Fecha As Date = dRow("Fecha").ToString.ToDate
+ Dim Importe As Decimal = dRow("Importe").ToString.ToDecimal
Dim ImporteMX As Decimal = 0
Dim ImporteME As Decimal = 0
- Dim Descripcion As String = dRow("Descripcion").ToString()
- Dim RFC As String = dRow("RFC").ToString()
- Dim Moneda As String = dRow("Moneda").ToString()
+ Dim Descripcion As String = dRow("Descripcion").ToString
+ Dim RFC As String = dRow("RFC").ToString
+ Dim Moneda As String = dRow("Moneda").ToString
Dim CveMoneda As Integer
- Dim TipoCambio As Decimal = dRow("TipoCambio").ToString().ToDecimal
+ Dim TipoCambio As Decimal = dRow("TipoCambio").ToString.ToDecimal
@@ -2691,7 +2960,7 @@ Partial Class General_SaldosIniciales
Dim FolioStr As String = ""
FolioStr = CStr(ObjBancos.GetNextFolio(CveCuentaBancaria, 1) + Contador)
- Dim CveProveedor As Integer = GlobalDTCompProveedores(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $" RFC = '{RFC}' ").ToEntero()
+ Dim CveProveedor As Integer = GlobalDTCompProveedores(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $" RFC = '{RFC}' ").ToEntero
If Not CveProveedor > 0 Then
@@ -2701,10 +2970,10 @@ Partial Class General_SaldosIniciales
End If
Dim CveCuentaContable As Integer = 0
- Dim CuentaContable As String = dRow("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "")
+ Dim CuentaContable As String = dRow("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
- CveCuentaContable = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
+ CveCuentaContable = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
If CveCuentaContable > 0 Then
@@ -2736,11 +3005,11 @@ Partial Class General_SaldosIniciales
End If
- Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, 1, Fecha, FolioStr.ToString(), "", Importe, CveMoneda,
+ Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, 1, Fecha, FolioStr.ToString, "", Importe, CveMoneda,
TipoCambio, Descripcion, "", False, False, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, FolioStr.ToString(), 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveProveedor:=CveProveedor, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, FolioStr.ToString(), 10, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveProveedor:=CveProveedor, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, FolioStr.ToString, 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveProveedor:=CveProveedor, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, FolioStr.ToString, 10, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveProveedor:=CveProveedor, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
Contador = Contador + 1
Next
@@ -2760,7 +3029,7 @@ Partial Class General_SaldosIniciales
Private Sub ProcesaAnticipoCliente(DTAnticipoCliente As DataTable, DTCuentasContables As DataTable)
Dim ErrorProceso As Boolean = False
- Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCuenta", "").ToEntero()
+ Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCuenta", "").ToEntero
If Not CveCuentaBancaria > 0 Then
Alert("No se detecto una cuenta Bancaria", TipoMensaje.MsgAdvertencia)
@@ -2779,15 +3048,15 @@ Partial Class General_SaldosIniciales
For Each dRow As DataRow In DTAnticipoCliente.Rows
- Dim Fecha As Date = dRow("Fecha").ToString().ToDate
- Dim Importe As Decimal = dRow("Importe").ToString().ToDecimal
+ Dim Fecha As Date = dRow("Fecha").ToString.ToDate
+ Dim Importe As Decimal = dRow("Importe").ToString.ToDecimal
Dim ImporteMX As Decimal = 0
Dim ImporteME As Decimal = 0
- Dim Descripcion As String = dRow("Descripcion").ToString()
- Dim RFC As String = dRow("RFC").ToString()
- Dim Moneda As String = dRow("Moneda").ToString()
+ Dim Descripcion As String = dRow("Descripcion").ToString
+ Dim RFC As String = dRow("RFC").ToString
+ Dim Moneda As String = dRow("Moneda").ToString
Dim CveMoneda As Integer
- Dim TipoCambio As Decimal = dRow("TipoCambio").ToString().ToDecimal
+ Dim TipoCambio As Decimal = dRow("TipoCambio").ToString.ToDecimal
If Moneda.ToUpper.Contiene("PESOS", "PESO", "MXN") Then
CveMoneda = 1
@@ -2820,7 +3089,7 @@ Partial Class General_SaldosIniciales
Dim FolioStr As String = ""
FolioStr = CStr(ObjBancos.GetNextFolio(CveCuentaBancaria, 3) + Contador)
- Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCliente", $" RFC = '{RFC}' ").ToEntero()
+ Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCliente", $" RFC = '{RFC}' ").ToEntero
If Not CveCliente > 0 Then
@@ -2830,12 +3099,12 @@ Partial Class General_SaldosIniciales
End If
- 'Dim RazonSocial As String = Row("RazonSocial").ToString()
+ 'Dim RazonSocial As String = Row("RazonSocial").ToString
Dim CveCuentaContable As Integer = 0
- Dim CuentaContable As String = dRow("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "")
+ Dim CuentaContable As String = dRow("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
- CveCuentaContable = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
+ CveCuentaContable = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
If CveCuentaContable > 0 Then
@@ -2867,11 +3136,11 @@ Partial Class General_SaldosIniciales
End If
- Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, 3, Fecha, FolioStr.ToString(), "", Importe, CveMoneda,
+ Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, 3, Fecha, FolioStr.ToString, "", Importe, CveMoneda,
TipoCambio, Descripcion, "", False, False, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, FolioStr.ToString(), 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, FolioStr.ToString(), 66, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, FolioStr.ToString, 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, FolioStr.ToString, 66, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CveCliente:=CveCliente, Contabilizable:=False, ImporteMX:=ImporteMX, ImporteME:=ImporteME, TipoCambio:=TipoCambio) Then ErrorProceso = True : Exit For
Contador = Contador + 1
Next
@@ -2896,7 +3165,7 @@ Partial Class General_SaldosIniciales
Private Function AsignacionCuenta(ObjContabilidad As ClsContabilidad, CveConceptoContable As Integer, CveCuentaContable As Integer, CveBancoCuenta As Integer, CveProveedor As Integer, CveCliente As Integer,
- CvePersonal As Integer, CveEmpresa As Integer, CveClasificacion As Integer, Optional OpActualizarClasificacion As Boolean = False) As Boolean
+ CvePersonal As Integer, CveEmpresa As Integer, CveClasificacion As Integer) As Boolean
Dim Respuesta As Boolean = False
@@ -2904,7 +3173,7 @@ Partial Class General_SaldosIniciales
If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, CveEmpresa, CveCuentaContable, -1,
CveProveedor, CveCliente, CvePersonal, CveClasificacion, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
- CveTipoGasto:=-1, RegeneraCuenta:=False, OpActualizarClasificacion:=OpActualizarClasificacion) Then
+ CveTipoGasto:=-1, RegeneraCuenta:=False) Then
Respuesta = True
End If
@@ -3187,15 +3456,15 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
- Dim ApellidoPaterno As String = Row("Apellido Paterno").ToString()
- Dim ApellidoMaterno As String = Row("Apellido Materno").ToString()
- Dim Nombre As String = Row("Nombre").ToString()
+ Dim ApellidoPaterno As String = Row("Apellido Paterno").ToString
+ Dim ApellidoMaterno As String = Row("Apellido Materno").ToString
+ Dim Nombre As String = Row("Nombre").ToString
- Dim CuentaContable As String = Row("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "")
+ Dim CuentaContable As String = Row("CuentaContable").ToString.Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
- Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
+ Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero
If CveCuentaContable > 0 Then
Row("CveCuentaContable") = CveCuentaContable
@@ -3222,10 +3491,7 @@ Partial Class General_SaldosIniciales
Dim dTDepartamentos As New DataTable
Dim dTTurno As New DataTable
Dim ObjRH As New ClsRH
- Dim dtTipoTrabajador As New DataTable
- If (ObjRH.TiposTrabajadorGet(-1, UsuarioActual.CveEmpresa)) Then
- dtTipoTrabajador = ObjRH.DtResultados
- End If
+
Dim dtpuestos = GlobalDTRHPuestos(UsuarioActual.CveEmpresa)
dtpuestos.CaseSensitive = False
If ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, -1) Then
@@ -3248,46 +3514,45 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
Dim myarraystr As String()
Dim RegistroPatronal As String = Row("Registro Patronal").ToString().ToUpper()
- Dim Codigo As String = Row("Código").ToString()
- Dim ApellidoPaterno As String = Row("Apellido Paterno").ToString()
- Dim ApellidoMaterno As String = Row("Apellido Materno").ToString()
- Dim Nombre As String = Row("Nombre").ToString()
- Dim CorreoElectronico As String = Row("Correo Electronico").ToString()
- Dim FechaIngreso As String = Row("Fecha Ingreso").ToString()
- Dim FechaBaja As String = Row("Fecha Baja").ToString()
- Dim NumeroSS As String = Row("Numero SS").ToString()
- Dim AltaIMSS As String = Row("Alta IMSS").ToString()
- Dim SalarioDiario As String = Row("Salario Diario").ToString()
- Dim Direccion As String = Row("Dirección").ToString()
- Dim FechaNacimiento As String = Row("Fecha Nacimiento").ToString()
- Dim LugarNacimiento As String = Row("Lugar Nacimiento").ToString()
- Dim Sexo As String = Row("Sexo").ToString()
- Dim CodigoPostal As String = Row("Código Postal").ToString()
- Dim Ciudad As String = Row("Ciudad").ToString()
- Dim EstadoCivil As String = Row("Estado Civil").ToString().ToUpper
- Dim Telefono As String = Row("Teléfono").ToString()
- Dim Celular As String = Row("Celular").ToString()
- Dim RFC As String = Row("RFC").ToString()
- Dim CURP As String = Row("CURP").ToString()
- Dim ClabeInterbancaria As String = Row("CLABE").ToString()
- Dim EstatusPersonal As String = Row("Estatus Personal").ToString().ToUpper
- Dim SubProyecto As String = Row("SubProyecto").ToString().ToUpper
+ Dim Codigo As String = Row("Código").ToString
+ Dim ApellidoPaterno As String = Row("Apellido Paterno").ToString
+ Dim ApellidoMaterno As String = Row("Apellido Materno").ToString
+ Dim Nombre As String = Row("Nombre").ToString
+ Dim CorreoElectronico As String = Row("Correo Electronico").ToString
+ Dim FechaIngreso As String = Row("Fecha Ingreso").ToString
+ Dim FechaBaja As String = Row("Fecha Baja").ToString
+ Dim NumeroSS As String = Row("Numero SS").ToString
+ Dim AltaIMSS As String = Row("Alta IMSS").ToString
+ Dim SalarioDiario As String = Row("Salario Diario").ToString
+ Dim Direccion As String = Row("Dirección").ToString
+ Dim FechaNacimiento As String = Row("Fecha Nacimiento").ToString
+ Dim LugarNacimiento As String = Row("Lugar Nacimiento").ToString
+ Dim Sexo As String = Row("Sexo").ToString
+ Dim CodigoPostal As String = Row("Código Postal").ToString
+ Dim Ciudad As String = Row("Ciudad").ToString
+ Dim EstadoCivil As String = Row("Estado Civil").ToString.ToUpper
+ Dim Telefono As String = Row("Teléfono").ToString
+ Dim Celular As String = Row("Celular").ToString
+ Dim RFC As String = Row("RFC").ToString
+ Dim CURP As String = Row("CURP").ToString
+ Dim ClabeInterbancaria As String = Row("CLABE").ToString
+ Dim EstatusPersonal As String = Row("Estatus Personal").ToString.ToUpper
+ Dim SubProyecto As String = Row("SubProyecto").ToString.ToUpper
'Nuevas
- Dim Estado As String = Row("Estado").ToString()
- Dim NombrePadre As String = Row("Nombre Padre").ToString()
- Dim NombreMadre As String = Row("Nombre Madre").ToString()
- Dim Puesto As String = Row("Puesto").ToString()
- Dim Turno As String = Row("Turno").ToString()
- Dim TipoContrato As String = Row("Tipo Contrato").ToString()
- Dim Departamento As String = Row("Departamento").ToString()
- Dim TipoPeriodo As String = Row("Tipo Periodo").ToString()
- Dim Escolaridad As String = Row("Escolaridad").ToString()
- Dim SDI As String = Row("SDI").ToString()
- Dim MetodoPago As String = Row("Metodo Pago").ToString()
- Dim Nominista As String = Row("Nominista").ToString()
- Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString().ToEntero()
- Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal
- Dim TipoTrabajador As String = Row("Tipo Trabajador").ToString()
+ Dim Estado As String = Row("Estado").ToString
+ Dim NombrePadre As String = Row("Nombre Padre").ToString
+ Dim NombreMadre As String = Row("Nombre Madre").ToString
+ Dim Puesto As String = Row("Puesto").ToString
+ Dim Turno As String = Row("Turno").ToString
+ Dim TipoContrato As String = Row("Tipo Contrato").ToString
+ Dim Departamento As String = Row("Departamento").ToString
+ Dim TipoPeriodo As String = Row("Tipo Periodo").ToString
+ Dim Escolaridad As String = Row("Escolaridad").ToString
+ Dim SDI As String = Row("SDI").ToString
+ Dim MetodoPago As String = Row("Metodo Pago").ToString
+ Dim Nominista As String = Row("Nominista").ToString
+ Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString.ToEntero
+ Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal
Dim NombreCompleto As String = $"{Nombre} {ApellidoPaterno} {ApellidoMaterno}"
@@ -3299,7 +3564,7 @@ Partial Class General_SaldosIniciales
Dim CveGenero As Integer = 0
Dim CveEstadoCivil As Integer = 0
Dim CveEstatusPersonal As Integer = 0
- ' Dim CveSucursal As Integer = GlobalDTSucursales(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSucursal").ToString().ToEntero()
+ ' Dim CveSucursal As Integer = GlobalDTSucursales(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSucursal").ToString.ToEntero
Dim CveRegistroPatronal As Integer
Dim CvePuesto As Integer
Dim CveTurno As Integer
@@ -3311,22 +3576,17 @@ Partial Class General_SaldosIniciales
Dim CveMetodoPago As Integer
Dim CveUsuarioNomina As Integer
Dim CveSubProyecto As Integer
- Dim CveTipoTrabajador As Integer
myarraystr = Puesto.Split(":"c)
If (myarraystr.Length > 1) Then
CvePuesto = myarraystr(0).ToEntero()
- CvePuesto = dtpuestos.FiltroPrimeroValor("CvePuesto", $"(CvePuesto) = ({CvePuesto})").ToString().ToEntero()
+ CvePuesto = dtpuestos.FiltroPrimeroValor("CvePuesto", $"(CvePuesto) = ({CvePuesto})").ToString.ToEntero
Else
- CvePuesto = dtpuestos.FiltroPrimeroValor("CvePuesto", $"(Puesto) = ('{Puesto}')").ToString().ToEntero()
+ CvePuesto = dtpuestos.FiltroPrimeroValor("CvePuesto", $"(Puesto) = ('{Puesto}')").ToString.ToEntero
End If
- CveTipoTrabajador = dtTipoTrabajador.FiltroPrimeroValor("CveTipoTrabajador", $"(TipoTrabajador) = ('{TipoTrabajador}')").ToString().ToEntero()
- If CveTipoTrabajador = 0 Then
- CveTipoTrabajador = -1
- End If
- CveRegistroPatronal = dtregistrospatronales.FiltroPrimeroValor("CveRegistroPatronal", $"(RegistroPatronal) = ('{RegistroPatronal}')").ToString().ToEntero()
+ CveRegistroPatronal = dtregistrospatronales.FiltroPrimeroValor("CveRegistroPatronal", $"(RegistroPatronal) = ('{RegistroPatronal}')").ToString.ToEntero
If CvePuesto = 0 Then
CvePuesto = -1
End If
@@ -3334,9 +3594,9 @@ Partial Class General_SaldosIniciales
myarraystr = Turno.Split(":"c)
If (myarraystr.Length > 1) Then
CveTurno = myarraystr(0).ToEntero()
- CveTurno = dTTurno.FiltroPrimeroValor("CveTurno", $"CveTurno = {CveTurno}").ToString().ToEntero()
+ CveTurno = dTTurno.FiltroPrimeroValor("CveTurno", $"CveTurno = {CveTurno}").ToString.ToEntero
Else
- CveTurno = dTTurno.FiltroPrimeroValor("CveTurno", $"Turno = '{Turno}'").ToString().ToEntero()
+ CveTurno = dTTurno.FiltroPrimeroValor("CveTurno", $"Turno = '{Turno}'").ToString.ToEntero
End If
If CveTurno = 0 Then
CveTurno = -1
@@ -3361,10 +3621,10 @@ Partial Class General_SaldosIniciales
myarraystr = Departamento.Split(":"c)
If (myarraystr.Length > 1) Then
CveDepartamento = myarraystr(0).ToEntero()
- CveDepartamento = dTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"CveDepartamento = {CveDepartamento}").ToString().ToEntero()
+ CveDepartamento = dTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"CveDepartamento = {CveDepartamento}").ToString.ToEntero
Else
- CveDepartamento = dTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"Departamento = '{Departamento}'").ToString().ToEntero()
+ CveDepartamento = dTDepartamentos.FiltroPrimeroValor("CveDepartamento", $"Departamento = '{Departamento}'").ToString.ToEntero
End If
If CveDepartamento <= 0 Then
CveDepartamento = -1
@@ -3373,9 +3633,9 @@ Partial Class General_SaldosIniciales
myarraystr = Estado.Split(":"c)
If (myarraystr.Length > 1) Then
CveEstado = myarraystr(0).ToEntero()
- CveEstado = GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"CveEstado = {CveEstado}").ToString().ToEntero()
+ CveEstado = GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"CveEstado = {CveEstado}").ToString.ToEntero
Else
- CveEstado = GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado}'").ToString().ToEntero()
+ CveEstado = GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado}'").ToString.ToEntero
End If
If CveEstado = 0 Then
CveEstado = -1
@@ -3384,9 +3644,9 @@ Partial Class General_SaldosIniciales
myarraystr = TipoContrato.Split(":"c)
If (myarraystr.Length > 1) Then
CveTipoContrato = myarraystr(0).ToEntero()
- CveTipoContrato = GlobalDTTiposContrato().FiltroPrimeroValor("CveTipoContrato", $"CveTipoContrato = {CveTipoContrato}").ToString().ToEntero()
+ CveTipoContrato = GlobalDTTiposContrato().FiltroPrimeroValor("CveTipoContrato", $"CveTipoContrato = {CveTipoContrato}").ToString.ToEntero
Else
- CveTipoContrato = GlobalDTTiposContrato().FiltroPrimeroValor("CveTipoContrato", $"TipoContrato = '{TipoContrato}'").ToString().ToEntero()
+ CveTipoContrato = GlobalDTTiposContrato().FiltroPrimeroValor("CveTipoContrato", $"TipoContrato = '{TipoContrato}'").ToString.ToEntero
End If
If CveTipoContrato = 0 Then
CveTipoContrato = -1
@@ -3404,9 +3664,9 @@ Partial Class General_SaldosIniciales
myarraystr = TipoPeriodo.Split(":"c)
If (myarraystr.Length > 1) Then
CveTipoPeriodo = myarraystr(0).ToEntero()
- CveTipoPeriodo = GlobalDTTipoPeriodo().FiltroPrimeroValor("CveTipoPeriodo", $"CveTipoPeriodo = {CveTipoPeriodo}").ToString().ToEntero()
+ CveTipoPeriodo = GlobalDTTipoPeriodo().FiltroPrimeroValor("CveTipoPeriodo", $"CveTipoPeriodo = {CveTipoPeriodo}").ToString.ToEntero
Else
- CveTipoPeriodo = GlobalDTTipoPeriodo().FiltroPrimeroValor("CveTipoPeriodo", $"TipoPeriodo = '{TipoPeriodo}'").ToString().ToEntero()
+ CveTipoPeriodo = GlobalDTTipoPeriodo().FiltroPrimeroValor("CveTipoPeriodo", $"TipoPeriodo = '{TipoPeriodo}'").ToString.ToEntero
End If
If CveTipoPeriodo = 0 Then
CveTipoPeriodo = -1
@@ -3415,9 +3675,9 @@ Partial Class General_SaldosIniciales
myarraystr = Escolaridad.Split(":"c)
If (myarraystr.Length > 1) Then
CveEscolaridad = myarraystr(0).ToEntero()
- CveEscolaridad = GlobalDTEscolaridad().FiltroPrimeroValor("CveEscolaridad", $"CveEscolaridad = {CveEscolaridad}").ToString().ToEntero()
+ CveEscolaridad = GlobalDTEscolaridad().FiltroPrimeroValor("CveEscolaridad", $"CveEscolaridad = {CveEscolaridad}").ToString.ToEntero
Else
- CveEscolaridad = GlobalDTEscolaridad().FiltroPrimeroValor("CveEscolaridad", $"Escolaridad = '{Escolaridad}'").ToString().ToEntero()
+ CveEscolaridad = GlobalDTEscolaridad().FiltroPrimeroValor("CveEscolaridad", $"Escolaridad = '{Escolaridad}'").ToString.ToEntero
End If
'If CveEscolaridad = 0 Then
' CveEscolaridad = -1
@@ -3431,9 +3691,9 @@ Partial Class General_SaldosIniciales
myarraystr = MetodoPago.Split(":"c)
If (myarraystr.Length > 1) Then
CveMetodoPago = myarraystr(0).ToEntero()
- CveMetodoPago = GlobalDTMetodosPago().FiltroPrimeroValor("CveMetodoPago", $"CveMetodoPago = {CveMetodoPago}").ToString().ToEntero()
+ CveMetodoPago = GlobalDTMetodosPago().FiltroPrimeroValor("CveMetodoPago", $"CveMetodoPago = {CveMetodoPago}").ToString.ToEntero
Else
- CveMetodoPago = GlobalDTMetodosPago().FiltroPrimeroValor("CveMetodoPago", $"ClaveSAT = '{MetodoPago}'").ToString().ToEntero()
+ CveMetodoPago = GlobalDTMetodosPago().FiltroPrimeroValor("CveMetodoPago", $"ClaveSAT = '{MetodoPago}'").ToString.ToEntero
End If
If CveMetodoPago = 0 Then
CveMetodoPago = -1
@@ -3442,9 +3702,9 @@ Partial Class General_SaldosIniciales
myarraystr = Nominista.Split(":"c)
If (myarraystr.Length > 1) Then
CveUsuarioNomina = myarraystr(0).ToEntero()
- CveUsuarioNomina = GlobalDTUsuarios(-1, -1).FiltroPrimeroValor("CveUsuario", $"CveUsuario = {CveUsuarioNomina}").ToString().ToEntero()
+ CveUsuarioNomina = GlobalDTUsuarios(-1, -1).FiltroPrimeroValor("CveUsuario", $"CveUsuario = {CveUsuarioNomina}").ToString.ToEntero
Else
- CveUsuarioNomina = GlobalDTUsuarios(-1, -1).FiltroPrimeroValor("CveUsuario", $"Nombre = '{Nominista}'").ToString().ToEntero()
+ CveUsuarioNomina = GlobalDTUsuarios(-1, -1).FiltroPrimeroValor("CveUsuario", $"Nombre = '{Nominista}'").ToString.ToEntero
End If
If CveUsuarioNomina = 0 Then
CveUsuarioNomina = -1
@@ -3477,10 +3737,10 @@ Partial Class General_SaldosIniciales
- Dim CvePersonal As Integer = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"NombreCompletoNombre = '{NombreCompleto}'").ToString().ToEntero()
+ Dim CvePersonal As Integer = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"NombreCompletoNombre = '{NombreCompleto}'").ToString.ToEntero()
If Not (CvePersonal > 0) Then
- CvePersonal = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"CURP = '{CURP}'").ToString().ToEntero()
+ CvePersonal = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"CURP = '{CURP}'").ToString.ToEntero()
End If
@@ -3538,9 +3798,9 @@ Partial Class General_SaldosIniciales
SDI = SalarioDiario
End If
If Not ObjRH.AddPersonal(Codigo, ApellidoPaterno, ApellidoMaterno, Nombre, CorreoElectronico, FechaIn, CveTipoPeriodo, NumeroSS, CBool(AltaIMSS), SalarioDiario.ToDouble, SalarioDiario.ToDouble, SDI.ToDouble, SDI.ToDouble,
- -1, -1, -1, CveMetodoPago, FechaIn, FechaFn.ToString(), CveTipoContrato, Direccion, CveTurno, CvePuesto, CveDepartamento, -1, CveEscolaridad, CveEstadoCivil, CveGenero, -1, FechaBaja, CveEstatusPersonal, FechaNac,
+ -1, -1, -1, CveMetodoPago, FechaIn, FechaFn.ToString, CveTipoContrato, Direccion, CveTurno, CvePuesto, CveDepartamento, -1, CveEscolaridad, CveEstadoCivil, CveGenero, -1, FechaBaja, CveEstatusPersonal, FechaNac,
LugarNacimiento, Direccion, "", "", "", CodigoPostal, Ciudad, CveEstado, Telefono, "", Celular, RFC, CURP, "", NombrePadre, NombreMadre, -1, CveSATRiesgoPuesto, CveSATRegimenContratacion, -1, CveSubProyecto, "", -1,
- ClabeInterbancaria, "", CveJornada, CveJornada, "", -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina, CveRegistroPatronal:=CveRegistroPatronal, CveTipoTrabajador:=CveTipoTrabajador) Then
+ ClabeInterbancaria, "", CveJornada, CveJornada, "", -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina, CveRegistroPatronal:=CveRegistroPatronal) Then
If (ObjRH.noguardoXcurpb) Then
Else
ErrorRH = True
@@ -3571,7 +3831,7 @@ Partial Class General_SaldosIniciales
Exit For
End If
- Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCuenta", "").ToEntero()
+ Dim CveCuentaBancaria As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CveCuenta", "").ToEntero
If Not CveCuentaBancaria > 0 Then
Alert("No se detecto una cuenta Bancaria", TipoMensaje.MsgAdvertencia)
@@ -3596,11 +3856,11 @@ Partial Class General_SaldosIniciales
Exit For
End If
- Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, 3, Fecha, FolioStr.ToString(), "", Saldo, 1,
+ Dim CveIE As Integer = ObjBancos.AddBancos_IE(CveCuentaBancaria, 3, Fecha, FolioStr.ToString, "", Saldo, 1,
1, "Saldo Inicial", "", False, False, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Saldo, FolioStr.ToString(), 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CvePersonal:=CvePersonal, Contabilizable:=False, ImporteMX:=Saldo) Then ErrorRH = True : Exit For
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, FolioStr.ToString(), 28, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CvePersonal:=CvePersonal, Contabilizable:=False, ImporteMX:=Saldo) Then ErrorRH = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Saldo, FolioStr.ToString, 30, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CvePersonal:=CvePersonal, Contabilizable:=False, ImporteMX:=Saldo) Then ErrorRH = True : Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, FolioStr.ToString, 28, FolioStr, Fecha, -1, -1, CveIE:=CveIE, CvePersonal:=CvePersonal, Contabilizable:=False, ImporteMX:=Saldo) Then ErrorRH = True : Exit For
End If
@@ -3927,8 +4187,7 @@ Partial Class General_SaldosIniciales
libro.Cell(crow, ccol).Value = "Registro Patronal" : ccol = ccol + 1
libro.Cell(crow, ccol).Value = "CuentaContable" : ccol = ccol + 1
libro.Cell(crow, ccol).Value = "Saldo" : ccol = ccol + 1
- libro.Cell(crow, ccol).Value = "Tipo Trabajador" : ccol = ccol + 1
- '
+
libro.Range(crow, 1, crow, ccol - 1).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189))
libro.Range(crow, 1, crow, ccol - 1).Style.Font.FontColor = ClosedXML.Excel.XLColor.White