Clientes reacomodo, limpieza modulos, rep compras af
This commit is contained in:
@@ -28,47 +28,13 @@ Partial Class General_SaldosIniciales
|
||||
End Sub
|
||||
|
||||
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||
|
||||
Dim dt As New DataTable
|
||||
' Conexion As Odbc.OdbcConnection = Nothing
|
||||
Dim ErrorArchivo = False
|
||||
Dim ErrorExcel = False
|
||||
|
||||
dt = ReadExcelFile(Ruta + FileName, True)
|
||||
'Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1;"""
|
||||
'Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
|
||||
'Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
|
||||
'Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
|
||||
'objDbConnection.ConnectionString = strConnString
|
||||
'objDbConnection.Open()
|
||||
'Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
|
||||
'Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
|
||||
'Try
|
||||
' Select Case Tipo
|
||||
' Case "CSV"
|
||||
' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
|
||||
' Conexion.Open()
|
||||
' Dim cmd = Conexion.CreateCommand()
|
||||
' cmd.CommandType = CommandType.Text
|
||||
' cmd.CommandText = $"SELECT * FROM [{FileName}]"
|
||||
' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
' DataAdapter.Fill(dt)
|
||||
' Case "EXCEL"
|
||||
' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
' Conexion.Open()
|
||||
' Dim cmd = Conexion.CreateCommand()
|
||||
' cmd.CommandType = CommandType.Text
|
||||
' cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
|
||||
' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
' DataAdapter.Fill(dt)
|
||||
' Case Else
|
||||
' Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End Select
|
||||
'Catch ex As Exception
|
||||
' ErrorArchivo = True
|
||||
' OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||
'End Try
|
||||
'Conexion.Close()
|
||||
|
||||
If Not ErrorArchivo Then
|
||||
|
||||
If RblFormato.SelectedValue = "1" Then
|
||||
@@ -130,12 +96,6 @@ Partial Class General_SaldosIniciales
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'If Not dt.Columns(14).ColumnName = "Pais" Then
|
||||
' Alert("El nombre de la quinceava columna debe ser 'Plazo Cobranza'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
If Not dt.Columns(14).ColumnName.ToUpper = "BANCO" Then
|
||||
Alert("El nombre de la quinceava columna debe ser 'Banco'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
@@ -2257,6 +2217,21 @@ Partial Class General_SaldosIniciales
|
||||
Dim Contador As Integer = 0
|
||||
|
||||
|
||||
Dim DTClasificaiones As New DataTable
|
||||
|
||||
If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
|
||||
DTClasificaiones = ObjClasificaciones.DtResultados
|
||||
End If
|
||||
|
||||
If Not DTClasificaiones.Rows.Count > 0 Then
|
||||
ObjConta.Dispose()
|
||||
Alert("Error a conusltar clasificaciones.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
DTClasificaiones.CaseSensitive = False
|
||||
|
||||
For Each dRow As DataRow In dt.Rows
|
||||
|
||||
|
||||
@@ -2273,6 +2248,8 @@ Partial Class General_SaldosIniciales
|
||||
|
||||
CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", $" Categoria = '{Categoria}' ").ToEntero
|
||||
|
||||
|
||||
|
||||
If Not CveCategoria > 0 Then
|
||||
CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToEntero
|
||||
If Not CveCategoria > 0 Then
|
||||
@@ -2312,19 +2289,26 @@ Partial Class General_SaldosIniciales
|
||||
End If
|
||||
|
||||
|
||||
Dim CveClasificaionTemp = DTClasificaiones.FiltroPrimeroValor("CveClasificacion", $"Clasificacion='{Clasificacion}'").ToEntero
|
||||
|
||||
If ObjClasificaciones.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1", CveCategoria, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=0, UsoClasificacion:=CveUsoClasificacion,
|
||||
CveSATPS:=-1, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False, EsAcumulador:=False, TopVentas:=False, TopCompras:=False, PrecioBaseCosto:=-1) Then
|
||||
|
||||
CveClasificacion = ObjClasificaciones.CveClasificacion
|
||||
|
||||
If Not CveClasificacion > 0 Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
Else
|
||||
ErrorProceso = True
|
||||
If CveClasificaionTemp > 0 Then
|
||||
CveClasificacion = CveClasificaionTemp
|
||||
End If
|
||||
|
||||
If Not CveClasificacion > 0 Then
|
||||
|
||||
If ObjClasificaciones.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1", CveCategoria, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=0, UsoClasificacion:=CveUsoClasificacion,
|
||||
CveSATPS:=-1, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False, EsAcumulador:=False, TopVentas:=False, TopCompras:=False, PrecioBaseCosto:=-1) Then
|
||||
|
||||
CveClasificacion = ObjClasificaciones.CveClasificacion
|
||||
|
||||
If Not CveClasificacion > 0 Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ErrorProceso Then
|
||||
|
||||
Reference in New Issue
Block a user