+
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index 6a39c6780..71ad7a0f1 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -628,6 +628,36 @@ Partial Class General_SaldosIniciales
Exit Sub
End If
+ ElseIf RblFormato.SelectedValue = "16" Then 'CLASIFICACIONES
+
+ If Not dt.Columns(0).ColumnName = "Clasificacion" Then
+ Alert("El nombre de la primera columna debe ser 'Clasificacion'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+ If Not dt.Columns(1).ColumnName = "Categoria" Then
+ Alert("El nombre de la segunda columna debe ser 'Categoria'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+ If Not dt.Columns(2).ColumnName = "UsoClasificacion" Then
+ Alert("El nombre de la segunda columna debe ser 'UsoClasificacion'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+ If Not dt.Columns(3).ColumnName = "CuentaContableIngreso" Then
+ Alert("El nombre de la segunda columna debe ser 'CuentaContableIngreso'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+ If Not dt.Columns(4).ColumnName = "CuentaContableGasto" Then
+ Alert("El nombre de la cuarta columna debe ser 'CuentaContableGasto'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+
+
+
End If
@@ -2214,14 +2244,130 @@ Partial Class General_SaldosIniciales
ProcesaAnticipoCliente(dt, DTCuentasContables)
ElseIf RblFormato.SelectedValue = "15" Then
ProcesaBancos(dt, DTCuentasContables)
+ ElseIf RblFormato.SelectedValue = "16" Then
+ ProcesaClasificaciones(dt, DTCuentasContables)
End If
End If
End Sub
+ Private Sub ProcesaClasificaciones(dt As DataTable, dTCuentasContables As DataTable)
+ Dim ObjClasificaciones As New ClsClasificaciones
+ Dim ObjConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL)
+ Dim ErrorProceso As Boolean = False
+ Dim Contador As Integer = 0
+
+
+ For Each dRow As DataRow In dt.Rows
+
+
+ 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
+ Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString.Trim
+
+ Dim CveClasificacion As Integer = -1
+ Dim CveUsoClasificacion As Integer = -1
+ Dim CveCategoria As Integer = -1
+
+
+ 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
+ Alert($"Clasificación {Clasificacion} la categoria {Categoria} no es valida.", TipoMensaje.MsgAdvertencia)
+ ErrorProceso = True
+ Exit For
+ End If
+
+ End If
+
+
+ If UsoClasificacion = "INGRESOS" Then
+ CveUsoClasificacion = 1
+ ElseIf UsoClasificacion = "GASTO" Then
+ CveUsoClasificacion = 2
+ ElseIf UsoClasificacion = "INGRESOS/GASTO" Then
+ CveUsoClasificacion = 3
+ End If
+
+ If Not CveUsoClasificacion > 0 Then
+ Alert($"Clasificación {Clasificacion} el uso {UsoClasificacion} no es valido.", TipoMensaje.MsgAdvertencia)
+ ErrorProceso = True
+ Exit For
+ End If
+
+ 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)
+ ErrorProceso = True
+ End If
+
+ If CuentaContableGasto.Trim.Length > 0 AndAlso CveCuentaContableGasto <= 0 Then
+ Alert($"Clasificación {Clasificacion} no se encontro la cuenta de gasto {CuentaContableGasto}.", TipoMensaje.MsgAdvertencia)
+ ErrorProceso = True
+ End If
+
+
+
+ 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
+
+
+
+ If Not ErrorProceso Then
+
+ If CveCuentaContableIngreso > 0 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
+ End If
+ End If
+
+ If CveCuentaContableGasto > 0 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
+ End If
+ End If
+
+ End If
+
+
+ Contador = Contador + 1
+ Next
+
+
+ If Not ErrorProceso Then
+ ObjClasificaciones.Commit()
+ Alert($"Se agregaron {Contador} Clasificaciones.")
+ Else
+ ObjClasificaciones.RollBack()
+ End If
+
+
+ ObjClasificaciones.Dispose()
+
+ End Sub
+
Private Sub ProcesaBancos(DTBancos As DataTable, DTCuentasContables As DataTable)
Dim ErrorProceso As Boolean = False
@@ -2312,7 +2458,7 @@ Partial Class General_SaldosIniciales
End If
- If Not AsignacionCuenta(ObjConta, 30, CveCuentaContable, CveCuentaBancaria, -1, -1, -1, UsuarioActual.CveEmpresa) Then
+ If Not AsignacionCuenta(ObjConta, 30, CveCuentaContable, CveCuentaBancaria, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then
ErrorProceso = True
Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia)
Exit For
@@ -2445,7 +2591,7 @@ Partial Class General_SaldosIniciales
End If
- If Not AsignacionCuenta(ObjConta, 10, CveCuentaContable, -1, CveProveedor, -1, -1, UsuarioActual.CveEmpresa) Then
+ If Not AsignacionCuenta(ObjConta, 10, CveCuentaContable, -1, CveProveedor, -1, -1, UsuarioActual.CveEmpresa, -1) Then
ErrorProceso = True
Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia)
Exit For
@@ -2576,7 +2722,7 @@ Partial Class General_SaldosIniciales
End If
- If Not AsignacionCuenta(ObjConta, 66, CveCuentaContable, -1, -1, CveCliente, -1, UsuarioActual.CveEmpresa) Then
+ If Not AsignacionCuenta(ObjConta, 66, CveCuentaContable, -1, -1, CveCliente, -1, UsuarioActual.CveEmpresa, -1) Then
ErrorProceso = True
Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia)
Exit For
@@ -2619,19 +2765,14 @@ 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) As Boolean
+ CvePersonal As Integer, CveEmpresa As Integer, CveClasificacion As Integer) As Boolean
Dim Respuesta As Boolean = False
- 'If Not ObjConta.AddCuentasAsignaciones(28, UsuarioActual.CveEmpresa, CveCuentaContable, -1,
- ' -1, -1, ObjRH.CvePersonal, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
- ' CveTipoGasto:=-1, RegeneraCuenta:=False) Then
- ' ErrorRH = True
- ' Exit For
- 'End If
+
If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, CveEmpresa, CveCuentaContable, -1,
- CveProveedor, CveCliente, CvePersonal, -1, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
+ CveProveedor, CveCliente, CvePersonal, CveClasificacion, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
CveTipoGasto:=-1, RegeneraCuenta:=False) Then
Respuesta = True
End If
@@ -2673,6 +2814,8 @@ Partial Class General_SaldosIniciales
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoAnticipoCliente.xlsx"
ElseIf RblFormato.SelectedValue = "15" Then
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoBancos.xlsx"
+ ElseIf RblFormato.SelectedValue = "16" Then
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClasificaciones.xlsx"
End If
If Not (Directorio = "") Then
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index 8e1a53863..94dcafa7c 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -2037,7 +2037,13 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Private Sub CambiaCliente(Optional CargaSucursales As Boolean = True, Optional CargaFacturas As Boolean = True)
If DdlClientes.SelectedValue.ToEntero > 0 Then
- Me.EsDistribuidor = CBool(GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=DdlClientes.SelectedValue.ToEntero(), Estatus:=-1).FiltroPrimeroValor("EsDistribuidor", ""))
+ Dim strDistribuidor = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=DdlClientes.SelectedValue.ToEntero(), Estatus:=-1).FiltroPrimeroValor("EsDistribuidor", "")
+ If String.IsNullOrEmpty(strDistribuidor) Then
+ strDistribuidor = "False"
+ End If
+
+ Me.EsDistribuidor = CBool(strDistribuidor)
+
If CargaSucursales Then
DivClienteSucursal.Visible = False
DdlClientesSucursales.Items.Clear()
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index 9765f9698..ef79851d5 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -1818,6 +1818,29 @@ Partial Class PV
imgCalendario.Enabled = True
End Sub
Private Sub BtnPermisoEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnPermisoEditarRemision.Click
+ Dim TieneInventario As Boolean = False
+ Dim TieneErrorInv As Boolean = False
+
+ Using ObjInv As New ClsInventarios
+ If ObjInv.GetInv_Mov(Me.CveVenta, UsuarioActual.CveEmpresa) Then
+ If ObjInv.DtResultados.Rows.Count > 0 Then
+ TieneInventario = True
+ End If
+ Else
+ TieneErrorInv = True
+ End If
+ End Using
+
+ If TieneInventario Then
+ Alert("La remisión no se puede editar porque ya tiene un movimiento de almacen.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If TieneErrorInv Then
+ Alert("No se pudo comprobar el inventario de la remisión", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
HabilitarEdicion()
BtnPermisoEditarRemision.Visible = False
BtnEditarRemision.Visible = True
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 55fd94f2b..31832ce40 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -18062,7 +18062,7 @@ Partial Class Ventas
End Sub
Private Sub CalculaLineasAdicionales()
- If DdlTipoComprobante.SelectedValue = "Ing" AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
+ If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
DdlLineaAdicional.DataSource = Nothing
Using ObjVentas As New ClsVentas