Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -32,6 +32,8 @@ Public Class ClsClasificaciones
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property CveClasificacion As Integer = -1
|
||||
|
||||
#End Region
|
||||
|
||||
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
||||
@@ -272,7 +274,8 @@ Public Class ClsClasificaciones
|
||||
|
||||
Public Function AddClasificaciones(Clasificacion As String, Codigo As String, IdCuentaGasto As Integer, CuentaGasto As String, IdCuentaCostos As Integer, CuentaCostos As String, IdCuentaIngreso As Integer, CuentaIngreso As String, CveCategoria As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional RequiereSerieLote As Integer = 0, Optional UsoClasificacion As Integer = -1, Optional CveSATPS As Integer = -1, Optional RequiereAFCompra As Boolean = False, Optional RequiereAFInsumo As Boolean = False, Optional RequierePersonal As Boolean = False,
|
||||
Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False, Optional PrecioBaseCosto As Decimal = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Retorno As Boolean = False
|
||||
Me.CveClasificacion = -1
|
||||
|
||||
DataAdapter("PA_ClasificacionesAdd")
|
||||
|
||||
@@ -306,13 +309,15 @@ Public Class ClsClasificaciones
|
||||
.Add("@EsAcumulador", SqlDbType.Bit).Value = EsAcumulador
|
||||
.Add("@TopCompras", SqlDbType.Bit).Value = TopCompras
|
||||
.Add("@TopVentas", SqlDbType.Bit).Value = TopVentas
|
||||
.Add("@PrecioBaseCosto", SqlDbType.Money).Value = PrecioBaseCosto
|
||||
|
||||
.Add("@PrecioBaseCosto", SqlDbType.Money).Value = PrecioBaseCosto
|
||||
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Me.CveClasificacion = SqlAdapter.SelectCommand.Parameters("@CveClasificacion").Value.ToString.ToEntero
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 2627;") Then
|
||||
|
||||
@@ -8591,19 +8591,18 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'VALIDA IMPORTES
|
||||
If CveFactura > 0 Then 'SI NO VIENE DE FACTURA/XML NO VALIDA TOTALES
|
||||
|
||||
|
||||
|
||||
|
||||
If Not ValidaTotalesGuardar() Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlRembolsoCajaChica.SelectedValue.ToEntero() > 0 AndAlso DdlRembolsoPersonal.SelectedValue.ToEntero() > 0 Then
|
||||
Alert("No se puede tener seleccionada una 'Caja Chica' y 'Personal/Empleado' a la vez", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
If Row("CveSubProyecto").ToString.ToEntero <= 0 Then
|
||||
Alert("No se ha completado la asignacion de proyectos en la compra. ", TipoMensaje.MsgAdvertencia)
|
||||
@@ -11968,13 +11967,15 @@ Partial Class Compras_Compras
|
||||
Protected Sub RblRembolso_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
TrRembolsoCajaChica.Visible = False
|
||||
TrRembolsoPersonal.Visible = False
|
||||
DdlRembolsoCajaChica.SelectedValueExist("-1")
|
||||
DdlRembolsoPersonal.SelectedValueExist("-1")
|
||||
DdlRembolsoCajaChica.SelectedValueExistInsert("-1", "Seleccione")
|
||||
DdlRembolsoPersonal.SelectedValueExistInsert("-1", "Seleccione")
|
||||
If RblRembolso.SelectedValue.ToEntero = 1 Then
|
||||
TrRembolsoPersonal.Visible = True
|
||||
ElseIf RblRembolso.SelectedValue.ToEntero = 2 Then
|
||||
TrRembolsoCajaChica.Visible = True
|
||||
End If
|
||||
|
||||
UPCondicionesPago.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -358,8 +358,8 @@
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTieneLineaAdicional" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
<asp:ListItem Text="Solo lineas adicionales" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Sin lineas adicionales" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
@@ -44,6 +44,7 @@
|
||||
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>
|
||||
<asp:ListItem Value="14" Text="Anticipo Clientes"></asp:ListItem>
|
||||
<asp:ListItem Value="5" Text="Productos y Sevicios" ></asp:ListItem>
|
||||
<asp:ListItem Value="16" Text="Clasificaciones" Enabled="True"></asp:ListItem>
|
||||
<asp:ListItem Value="6" Text="RH - Personal"></asp:ListItem>
|
||||
<%--<asp:ListItem Value="7" Text="AF - Activos Fijos" Enabled="false"></asp:ListItem>--%>
|
||||
<asp:ListItem Value="7" Text="AF - Activos Fijos" ></asp:ListItem>
|
||||
@@ -53,7 +54,7 @@
|
||||
<asp:ListItem Value="11" Text="ContaSIG - Saldos Iniciales Cuentas" Enabled="True"></asp:ListItem>
|
||||
<asp:ListItem Value="12" Text="Almacen" Enabled="True"></asp:ListItem>
|
||||
<asp:ListItem Value="15" Text="Bancos" Enabled="True"></asp:ListItem>
|
||||
<asp:ListItem Value="16" Text="Clasificaciones" Enabled="True"></asp:ListItem>
|
||||
|
||||
</asp:RadioButtonList>
|
||||
<div runat="server" id="divAlmacen">
|
||||
<div class="row">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user