-- mejora
This commit is contained in:
@@ -294,21 +294,6 @@ Partial Class General_SaldosIniciales
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not dt.Columns(15).ColumnName = "IEPS" Then
|
|
||||||
Alert("El nombre de la decimosexta columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not dt.Columns(16).ColumnName = "RetIVAPorcentaje" Then
|
|
||||||
Alert("El nombre de la decimoséptima columna debe ser 'RetIVAPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not dt.Columns(17).ColumnName = "RetISRPorcentaje" Then
|
|
||||||
Alert("El nombre de la decimoctava columna debe ser 'RetISRPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
'If RblFormato.SelectedValue = "4" Then
|
'If RblFormato.SelectedValue = "4" Then
|
||||||
' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
|
' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
|
||||||
' Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError)
|
' Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
@@ -716,7 +701,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
Dim NuevaClasificacion As Boolean = False
|
Dim NuevaClasificacion As Boolean = False
|
||||||
|
|
||||||
For Each Row As DataRow In dt.Rows
|
For Each Row As DataRow In dt.FiltraParametros("Descripcion <> ''").Rows
|
||||||
Dim Codigo As String = Row("Codigo").ToString()
|
Dim Codigo As String = Row("Codigo").ToString()
|
||||||
Dim Descripcion As String = Row("Descripcion").ToString()
|
Dim Descripcion As String = Row("Descripcion").ToString()
|
||||||
Dim TipoPS As String = Row("Tipo").ToString().Trim.ToUpper
|
Dim TipoPS As String = Row("Tipo").ToString().Trim.ToUpper
|
||||||
@@ -1445,7 +1430,9 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
#Region "P R O V E E D O R E S - F A C T U R A S"
|
#Region "P R O V E E D O R E S - F A C T U R A S"
|
||||||
|
|
||||||
|
Dim ObjCompras As New ClsCompras
|
||||||
Dim ErrorCompras As Boolean = False
|
Dim ErrorCompras As Boolean = False
|
||||||
|
Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL())
|
||||||
Dim CveCompra As Integer
|
Dim CveCompra As Integer
|
||||||
Dim Contador As Integer = 0
|
Dim Contador As Integer = 0
|
||||||
Dim ExisteCompra As Boolean = False
|
Dim ExisteCompra As Boolean = False
|
||||||
@@ -1495,8 +1482,6 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
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
|
'Temporalmente SE BORRARA
|
||||||
Dim Transaccion As String = "" 'Row("Transaccion2").ToString()
|
Dim Transaccion As String = "" 'Row("Transaccion2").ToString()
|
||||||
Dim Folio2 As String = "" 'Row("Folio2").ToString()
|
Dim Folio2 As String = "" 'Row("Folio2").ToString()
|
||||||
@@ -1522,6 +1507,8 @@ Partial Class General_SaldosIniciales
|
|||||||
If FechaVencimiento = "".ToDate Or FechaVencimiento < "1900/01/01".ToDate Then
|
If FechaVencimiento = "".ToDate Or FechaVencimiento < "1900/01/01".ToDate Then
|
||||||
FechaVencimiento = Fecha
|
FechaVencimiento = Fecha
|
||||||
End If
|
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.ToDecimal, FechaVencimiento,
|
If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero(), SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDecimal, FechaVencimiento,
|
||||||
False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal,
|
False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal,
|
||||||
NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total, CveSubProyecto:=CveSubProyecto) Then
|
NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total, CveSubProyecto:=CveSubProyecto) Then
|
||||||
@@ -1546,8 +1533,6 @@ Partial Class General_SaldosIniciales
|
|||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, IVA, 14, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero(), CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, IVA, 14, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero(), CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, IEPS, 25, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
|
If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, IEPS, 25, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
|
||||||
|
|
||||||
If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetIVA, RetIVA, 15, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
|
If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetIVA, RetIVA, 15, Folio, String.Format("{0}-{1}", Serie, Folio), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveSubProyecto:=Sucursal.ToEntero()) Then ErrorCompras = True : Exit For
|
||||||
@@ -1556,18 +1541,12 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
'Saldo
|
'Saldo
|
||||||
If Saldo < Total Then
|
If Saldo < Total Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Total - Saldo, 17, $"{Folio} SALDO INICIAL", Folio, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Total - Saldo, 95, $"{Folio} SALDO INICIAL", Folio, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
|
||||||
End If
|
End If
|
||||||
Encontrados = Encontrados + 1
|
Encontrados = Encontrados + 1
|
||||||
|
|
||||||
Next
|
Next
|
||||||
If Not ErrorCompras Then
|
|
||||||
Next
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError("Ocurrió un error al cargar los datos", ex)
|
|
||||||
ErrorCompras = True
|
|
||||||
End Try
|
|
||||||
|
|
||||||
If Not ErrorCompras Then
|
If Not ErrorCompras Then
|
||||||
If Contador > 0 Then
|
If Contador > 0 Then
|
||||||
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.<br>Se Omitieron: <b>{1}</b> Compras ya que ya se encuentran registradas.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.<br>Se Omitieron: <b>{1}</b> Compras ya que ya se encuentran registradas.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
||||||
@@ -1578,7 +1557,9 @@ Partial Class General_SaldosIniciales
|
|||||||
ObjCompras.Commit()
|
ObjCompras.Commit()
|
||||||
TxtExcel.Text = ""
|
TxtExcel.Text = ""
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
'C L I E N T E S - F A C T U R A S
|
Else
|
||||||
|
Alert(String.Format("NO Se agregaron: <b>{0}</b> Compras.", NumRows), TipoMensaje.MsgError)
|
||||||
|
ObjCompras.RollBack()
|
||||||
End If
|
End If
|
||||||
ObjCompras.Dispose()
|
ObjCompras.Dispose()
|
||||||
|
|
||||||
@@ -2383,8 +2364,6 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
|
|
||||||
Dim ErrorProceso As Boolean = False
|
Dim ErrorProceso As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
Dim SBMensajesCuentasNoEncontradas As New StringBuilder
|
Dim SBMensajesCuentasNoEncontradas As New StringBuilder
|
||||||
|
|
||||||
For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows
|
For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows
|
||||||
@@ -2419,26 +2398,21 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim ObjConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL)
|
Dim ObjConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL)
|
||||||
|
|
||||||
Dim Contador As Integer = 0
|
Dim Contador As Integer = 0
|
||||||
|
|
||||||
|
|
||||||
Dim DTClasificaiones As New DataTable
|
Dim DTClasificaiones As New DataTable
|
||||||
|
|
||||||
If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
|
'If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
|
||||||
DTClasificaiones = ObjClasificaciones.DtResultados
|
' DTClasificaiones = ObjClasificaciones.DtResultados
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If Not DTClasificaiones.Rows.Count > 0 Then
|
|
||||||
ObjConta.Dispose()
|
|
||||||
Alert("Error a conusltar clasificaciones.", TipoMensaje.MsgAdvertencia)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
|
'If Not DTClasificaiones.Rows.Count > 0 Then
|
||||||
|
' ObjConta.Dispose()
|
||||||
|
' Alert("Error a consultar clasificaciones.", TipoMensaje.MsgAdvertencia)
|
||||||
|
' Exit Sub
|
||||||
|
'End If
|
||||||
DTClasificaiones.CaseSensitive = False
|
DTClasificaiones.CaseSensitive = False
|
||||||
|
|
||||||
For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows
|
For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows
|
||||||
|
|
||||||
|
|
||||||
Dim Clasificacion As String = dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
|
Dim Clasificacion As String = dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
|
||||||
Dim Categoria As String = dRow("Categoria").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
|
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 UsoClasificacion As String = dRow("UsoClasificacion").ToString().Trim.ToUpper.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
|
||||||
@@ -2448,12 +2422,8 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim CveClasificacion As Integer = -1
|
Dim CveClasificacion As Integer = -1
|
||||||
Dim CveUsoClasificacion As Integer = -1
|
Dim CveUsoClasificacion As Integer = -1
|
||||||
Dim CveCategoria 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
|
If Not CveCategoria > 0 Then
|
||||||
CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToEntero()
|
CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToEntero()
|
||||||
If Not CveCategoria > 0 Then
|
If Not CveCategoria > 0 Then
|
||||||
@@ -2461,7 +2431,6 @@ Partial Class General_SaldosIniciales
|
|||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -2503,34 +2472,24 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
If ObjClasificaciones.AddClasificaciones(Clasificacion, "", CveCategoria, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=0, UsoClasificacion:=CveUsoClasificacion,
|
If ObjClasificaciones.AddClasificaciones(Clasificacion, "", 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
|
CveSATPS:=-1, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False, EsAcumulador:=False, TopVentas:=False, TopCompras:=False, PrecioBaseCosto:=-1) Then
|
||||||
|
|
||||||
CveClasificacion = ObjClasificaciones.CveClasificacion
|
CveClasificacion = ObjClasificaciones.CveClasificacion
|
||||||
|
|
||||||
If CveClasificacion > 0 Then
|
If CveClasificacion > 0 Then
|
||||||
If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
|
If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
|
||||||
DTClasificaiones = ObjClasificaciones.DtResultados
|
DTClasificaiones = ObjClasificaciones.DtResultados
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|
||||||
If Not ObjClasificaciones.UpdateClasificacion(Clasificacion, "-1", True, True, CveCategoria, UsuarioActual.CveUsuario, CveClasificacion, UsoClasificacion:=CveUsoClasificacion) Then
|
If Not ObjClasificaciones.UpdateClasificacion(Clasificacion, "-1", True, True, CveCategoria, UsuarioActual.CveUsuario, CveClasificacion, UsoClasificacion:=CveUsoClasificacion) Then
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorProceso Then
|
If Not ErrorProceso Then
|
||||||
|
|
||||||
If CveCuentaContableIngreso > 0 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, OpActualizarClasificacion:=True) Then
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
@@ -2546,22 +2505,16 @@ Partial Class General_SaldosIniciales
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Contador = Contador + 1
|
Contador = Contador + 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorProceso Then
|
If Not ErrorProceso Then
|
||||||
ObjClasificaciones.Commit()
|
ObjClasificaciones.Commit()
|
||||||
Alert($"Se agregaron {Contador} Clasificaciones.")
|
Alert($"Se agregaron {Contador} Clasificaciones.")
|
||||||
Else
|
Else
|
||||||
ObjClasificaciones.RollBack()
|
ObjClasificaciones.RollBack()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
ObjClasificaciones.Dispose()
|
ObjClasificaciones.Dispose()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user