Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -802,6 +802,8 @@ Partial Class General_SaldosIniciales
|
|||||||
ObjClientes.IniciaTransacSQL()
|
ObjClientes.IniciaTransacSQL()
|
||||||
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
||||||
NumRow = NumRow + 1
|
NumRow = NumRow + 1
|
||||||
|
|
||||||
|
|
||||||
Dim Codigo As String = Row("Codigo").ToString
|
Dim Codigo As String = Row("Codigo").ToString
|
||||||
Dim RazonSocial As String = Row("RazonSocial").ToString
|
Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||||
Dim RFC As String = Row("RFC").ToString.Trim
|
Dim RFC As String = Row("RFC").ToString.Trim
|
||||||
@@ -812,22 +814,129 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim Poblacion As String = Row("Población").ToString
|
Dim Poblacion As String = Row("Población").ToString
|
||||||
Dim Estado As String = Row("Estado").ToString
|
Dim Estado As String = Row("Estado").ToString
|
||||||
Dim Pais As String = Row("Pais").ToString
|
Dim Pais As String = Row("Pais").ToString
|
||||||
Dim Telefono As String = Row("Teléfono").ToString
|
Dim Telefono As String = Row("Teléfono").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
|
||||||
Dim Contacto As String = Row("Contacto").ToString
|
Dim Contacto As String = Row("Contacto").ToString
|
||||||
Dim CelularContacto As String = Row("Celular Contacto").ToString
|
|
||||||
|
|
||||||
Dim Vendedor As String = Row("Vendedor").ToString
|
Dim Vendedor As String = Row("Vendedor").ToString
|
||||||
Dim Clasificacion As String = Row("Clasificación").ToString
|
Dim Clasificacion As String = Row("Clasificación").ToString
|
||||||
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
|
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 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 CveClasificación As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
|
||||||
Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString = "si", True, False)
|
Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString.ToUpper = "SI", True, False)
|
||||||
Dim CargoUsado As Boolean = If(Row("CargoUsado").ToString = "si", True, False)
|
Dim CargoUsado As Boolean = If(Row("Cargo Usados").ToString.ToUpper = "SI", True, False)
|
||||||
Dim BonificacionUsado As Boolean = If(Row("BonificacionUsado").ToString = "si", True, False)
|
Dim BonificacionUsado As Boolean = If(Row("EmitirBon Usado").ToString.ToUpper = "SI", True, False)
|
||||||
|
|
||||||
|
Dim LimiteCredito As Decimal = Row("Limite Credito").ToString.ToDecimal
|
||||||
|
Dim CobranzaCorreo As String = Row("CorreoPago").ToString
|
||||||
|
Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim DìaVisita As String = Row("Dia Pago").ToString
|
||||||
|
Dim DiasPagoEspecifico As String = Row("Dìa Visita").ToString
|
||||||
|
Dim CobranzaContacto As String = Row("Encargado Pago").ToString
|
||||||
|
Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
|
||||||
|
|
||||||
|
|
||||||
|
' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "")
|
||||||
|
|
||||||
|
'Telefono
|
||||||
|
|
||||||
|
If Telefono.Trim.Length > 10 Then
|
||||||
|
Telefono = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CobranzaTelefono.Trim.Length > 10 Then
|
||||||
|
|
||||||
|
CobranzaTelefono = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim FormaPago As String = Row("Forma Pago").ToString
|
||||||
|
Dim CveFormaPago33 As Integer = 99
|
||||||
|
|
||||||
|
Select Case FormaPago
|
||||||
|
|
||||||
|
Case "01"
|
||||||
|
CveFormaPago33 = 1
|
||||||
|
Exit Select
|
||||||
|
Case "02"
|
||||||
|
CveFormaPago33 = 2
|
||||||
|
Exit Select
|
||||||
|
Case "03"
|
||||||
|
CveFormaPago33 = 3
|
||||||
|
Exit Select
|
||||||
|
Case "04"
|
||||||
|
CveFormaPago33 = 4
|
||||||
|
Exit Select
|
||||||
|
Case "05"
|
||||||
|
CveFormaPago33 = 5
|
||||||
|
Exit Select
|
||||||
|
Case "06"
|
||||||
|
CveFormaPago33 = 6
|
||||||
|
Exit Select
|
||||||
|
Case "08"
|
||||||
|
CveFormaPago33 = 7
|
||||||
|
Exit Select
|
||||||
|
Case "12"
|
||||||
|
CveFormaPago33 = 8
|
||||||
|
Exit Select
|
||||||
|
Case "13"
|
||||||
|
CveFormaPago33 = 9
|
||||||
|
Exit Select
|
||||||
|
Case "14"
|
||||||
|
CveFormaPago33 = 10
|
||||||
|
Exit Select
|
||||||
|
Case "15"
|
||||||
|
CveFormaPago33 = 11
|
||||||
|
Exit Select
|
||||||
|
Case "17"
|
||||||
|
CveFormaPago33 = 12
|
||||||
|
Exit Select
|
||||||
|
Case "23"
|
||||||
|
CveFormaPago33 = 13
|
||||||
|
Exit Select
|
||||||
|
Case "24"
|
||||||
|
CveFormaPago33 = 14
|
||||||
|
Exit Select
|
||||||
|
Case "25"
|
||||||
|
CveFormaPago33 = 15
|
||||||
|
Exit Select
|
||||||
|
Case "26"
|
||||||
|
CveFormaPago33 = 16
|
||||||
|
Exit Select
|
||||||
|
Case "27"
|
||||||
|
CveFormaPago33 = 17
|
||||||
|
Exit Select
|
||||||
|
Case "28"
|
||||||
|
CveFormaPago33 = 18
|
||||||
|
Exit Select
|
||||||
|
Case "29"
|
||||||
|
CveFormaPago33 = 19
|
||||||
|
Exit Select
|
||||||
|
Case "99"
|
||||||
|
CveFormaPago33 = 20
|
||||||
|
Exit Select
|
||||||
|
Case "30"
|
||||||
|
CveFormaPago33 = 21
|
||||||
|
Exit Select
|
||||||
|
Case "31"
|
||||||
|
CveFormaPago33 = 22
|
||||||
|
Exit Select
|
||||||
|
Case Else
|
||||||
|
CveFormaPago33 = 99
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||||
|
|
||||||
|
'Contacto
|
||||||
|
|
||||||
If CveCliente > 0 Then
|
If CveCliente > 0 Then
|
||||||
ExisteCliente = True
|
ExisteCliente = True
|
||||||
Contador = Contador + 1
|
Contador = Contador + 1
|
||||||
|
|
||||||
'If Not ObjClientes.UpdateCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1,
|
'If Not ObjClientes.UpdateCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1,
|
||||||
' "-1", -1, -1, -1, -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", False, -1) Then
|
' "-1", -1, -1, -1, -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", False, -1) Then
|
||||||
' ErrorClientes = True
|
' ErrorClientes = True
|
||||||
@@ -835,13 +944,18 @@ Partial Class General_SaldosIniciales
|
|||||||
' Exit For
|
' Exit For
|
||||||
'End If
|
'End If
|
||||||
Else
|
Else
|
||||||
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, Pais, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, -1, -1,
|
|
||||||
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado, BonificacionUsado:=BonificacionUsado) Then
|
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, "", 1, 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) Then
|
||||||
|
|
||||||
ErrorClientes = True
|
ErrorClientes = True
|
||||||
RFC.GuardaLog
|
RFC.GuardaLog
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
@@ -1713,7 +1827,7 @@ Partial Class General_SaldosIniciales
|
|||||||
If firstRowHasHeaders Then
|
If firstRowHasHeaders Then
|
||||||
|
|
||||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim)
|
||||||
Else
|
Else
|
||||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||||
End If
|
End If
|
||||||
@@ -1722,9 +1836,11 @@ Partial Class General_SaldosIniciales
|
|||||||
Else
|
Else
|
||||||
dataTable.Columns.Add("Column " & (cols + 1))
|
dataTable.Columns.Add("Column " & (cols + 1))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
While curRow < worksheet.Rows.Count
|
While curRow < worksheet.Rows.Count
|
||||||
|
|
||||||
columns = New String(cols - 1) {}
|
columns = New String(cols - 1) {}
|
||||||
|
|
||||||
For curCol = 0 To cols - 1
|
For curCol = 0 To cols - 1
|
||||||
@@ -1734,13 +1850,16 @@ Partial Class General_SaldosIniciales
|
|||||||
Else
|
Else
|
||||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
dataTable.Rows.Add(columns)
|
dataTable.Rows.Add(columns)
|
||||||
curRow += 1
|
curRow += 1
|
||||||
|
|
||||||
End While
|
End While
|
||||||
|
|
||||||
Return dataTable
|
Return dataTable
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user