Energía Eléctrica 2024-12-20
This commit is contained in:
@@ -1316,6 +1316,7 @@ Partial Class General_SaldosIniciales
|
||||
Dim ErrorClientes As Boolean = False
|
||||
Dim ExisteCliente As Boolean = False
|
||||
Dim Contador As Integer = 0
|
||||
Dim CountRFCGenerico As Integer = 0
|
||||
Dim NumRow As Integer = 0
|
||||
|
||||
|
||||
@@ -1376,7 +1377,17 @@ Partial Class General_SaldosIniciales
|
||||
|
||||
Dim Vendedor As String = If(dt.Columns.Contains("Vendedor"), Row("Vendedor").ToString(), "").Trim
|
||||
Dim Clasificacion As String = If(dt.Columns.Contains("ClasificacionCliente"), Row("ClasificacionCliente").ToString(), "").Trim
|
||||
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero()
|
||||
|
||||
Dim CveCliente As Integer = -1 'GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero()
|
||||
|
||||
Dim EsRFCGenerico As Boolean = If(RFC.ToUpper = "XAXX010101000" Or RFC.ToUpper = "XEXX010101000" Or RFC.ToUpper = "AAA010101AAA", True, False)
|
||||
|
||||
'If CveCliente <= 0 And Not EsRFCGenerico Then
|
||||
' If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=-1) Then
|
||||
' CveCliente = ObjClientes.DtResultados.Copy().FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero()
|
||||
' End If
|
||||
'End If
|
||||
|
||||
|
||||
Dim CveVendedor As Integer = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString().ToEntero()
|
||||
Dim CveClasificación As Integer = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClienteClasificacion", $"ClienteClasificacion = '{Clasificacion}'").ToEntero()
|
||||
@@ -1400,6 +1411,8 @@ Partial Class General_SaldosIniciales
|
||||
Dim CveRegimenFiscal As Integer = 0
|
||||
Dim TipoPersona As Boolean = If(RFC.Length = 12, True, False)
|
||||
|
||||
|
||||
|
||||
If CodigoRegimenFiscal.Trim.Length > 0 Then
|
||||
CveRegimenFiscal = GlobalDTRegimenesFiscales.FiltroPrimeroValor("CveRegimenFiscal", $"CodigoRegimenFiscal= '{CodigoRegimenFiscal}' ").ToEntero()
|
||||
If Not CveRegimenFiscal > 0 Then
|
||||
@@ -1500,10 +1513,57 @@ Partial Class General_SaldosIniciales
|
||||
'Contacto
|
||||
|
||||
If CveCliente > 0 Then
|
||||
|
||||
ExisteCliente = True
|
||||
Contador = Contador + 1
|
||||
|
||||
'PermiteCredito As Boolean, CveSubProyecto As Integer, CveClienteCorporativo As Integer,
|
||||
|
||||
Dim CveSATEstado As Integer = GlobalDTGralEstados("-1").FiltroPrimeroValor("CveSATEstado", String.Format(" NombreEstado ='{0}'", Estado.ToUpper)).ToEntero()
|
||||
CveSATEstado = If(CveSATEstado > 0, CveSATEstado, -1)
|
||||
Dim PermiteCredito As Boolean = If(LimiteCredito > 0, True, False)
|
||||
|
||||
|
||||
|
||||
If EsRFCGenerico Then
|
||||
CountRFCGenerico = CountRFCGenerico + 1
|
||||
End If
|
||||
|
||||
Codigo = If(Codigo.Trim.Length = 0, "-1", Codigo)
|
||||
|
||||
If Not EsRFCGenerico AndAlso Not ObjClientes.UpdateCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString(), NumInt, Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, Correo,
|
||||
"-1", "-1", Pagina, "-1", -1, False, -1, -1, False, True, "-1", CveVendedor, PlazoCobranza, -1,
|
||||
"-1", "-1", "-1", Codigo, LimiteCredito, False, "-1", "-1", "-1", False, "-1", "-1", "-1", "-1", "-1", False, "-1", UsuarioActual.CveUsuario, CveCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
"-1", "-1", PermiteCredito, -1, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
|
||||
BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI, CveSATEstado:=CveSATEstado, CveAdminTrayecto:=0,
|
||||
RegimenSociedad:=RegimenSociedad, CveRegimenFiscal:=CveRegimenFiscal, TipoPersona:=TipoPersona) Then
|
||||
|
||||
ErrorClientes = True
|
||||
RFC.GuardaLog
|
||||
Exit For
|
||||
Else
|
||||
If EsRFCGenerico Then
|
||||
CountRFCGenerico = CountRFCGenerico + 1
|
||||
Else
|
||||
Contador = Contador + 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If CveCuentaContable > 0 Then
|
||||
|
||||
Dim ObjConta As New ClsContabilidad(ObjClientes.IniciaTransacSQL)
|
||||
|
||||
If Not ObjConta.AddCuentasAsignaciones(1, UsuarioActual.CveEmpresa, CveCuentaContable,
|
||||
-1, ObjClientes.CveCliente, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
|
||||
CveTipoGasto:=-1, RegeneraCuenta:=False) Then
|
||||
ErrorClientes = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
Dim CveSATEstado As Integer = GlobalDTGralEstados("-1").FiltroPrimeroValor("CveSATEstado", String.Format(" NombreEstado ='{0}'", Estado.ToUpper)).ToEntero()
|
||||
CveSATEstado = If(CveSATEstado > 0, CveSATEstado, 26)
|
||||
|
||||
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString(), NumInt, Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, Correo, "", "", Pagina, "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
|
||||
"-1", "-1", "-1", Codigo, LimiteCredito, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
|
||||
@@ -1513,6 +1573,8 @@ Partial Class General_SaldosIniciales
|
||||
ErrorClientes = True
|
||||
RFC.GuardaLog
|
||||
Exit For
|
||||
Else
|
||||
GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
|
||||
End If
|
||||
|
||||
If CveCuentaContable > 0 Then
|
||||
@@ -1533,7 +1595,7 @@ Partial Class General_SaldosIniciales
|
||||
'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
|
||||
GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
|
||||
If Contador > 0 Then
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados. RFC Genericos Omitidos {2}", NumRows - Contador, Contador, CountRFCGenerico), TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente.", NumRows), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user