diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 42d03da4b..6d25100b9 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -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 diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 0b868c51a..2701f6574 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5400,7 +5400,8 @@ Public Class ClsPaginas #End Region #Region "Sistema" 'Cargo las páginas que deben tener restricción - PaginaDict.Add("/Sistemas/CatEmpresas.aspx".ToUpper(), 2) + 'PaginaDict.Add("/Sistemas/CatEmpresas.aspx".ToUpper(), 2) + PaginaDict.Add("/Sistemas/CatEmpresas.aspx".ToUpper(), 24) PaginaDict.Add("/Sistemas/Empresa.aspx".ToUpper(), 2) PaginaDict.Add("/Sistemas/CatUsuarios.aspx".ToUpper(), 20) PaginaDict.Add("/Sistemas/Usuarios.aspx".ToUpper(), 20) @@ -9631,7 +9632,7 @@ Public Class ClsPaginas 'movimiento de pago proveedor Complementaria If Not ErrorMovtos AndAlso CompraActual.CveMoneda > 1 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (ImporteME * TCValuacion - ImporteME).RoundSQL, CveConceptoContableComplementaria, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacion, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (ImporteME * TCValuacion - ImporteME).RoundSQL, CveConceptoContableComplementaria, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProvComplementaria, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacion, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True End If @@ -10113,7 +10114,7 @@ Public Class ClsPaginas If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 207, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True Else 'Agregamos Nacional - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 11, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoExtranjera, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 11, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoExtranjera, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago) Then ErrorMovtos = True End If @@ -10129,7 +10130,7 @@ Public Class ClsPaginas If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 207, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True Else 'Agregamos Nacional - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 91, Pago.Referencia, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 91, Pago.Referencia, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True End If diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index 852ef415a..179c07d60 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -312,7 +312,7 @@ Public Class ClsSisEmpresas End Try Return Retorno End Function - Public Function GetEmpresas(CveEmpresa As Integer, Empresa As String, RFC As String, Telefono As String, Contacto As String) As Boolean + Public Function GetEmpresas(CveEmpresa As Integer, Empresa As String, RFC As String, Telefono As String, Contacto As String, Optional CveUsuarioEmpresas As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Sis_EmpresasGet") @@ -323,6 +323,7 @@ Public Class ClsSisEmpresas .Add("@RFC", SqlDbType.VarChar).Value = RFC .Add("@Telefono", SqlDbType.VarChar).Value = Telefono .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + .Add("@CveUsuarioEmpresas", SqlDbType.Int).Value = CveUsuarioEmpresas End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 916f8d655..ebcea89aa 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5576,7 +5576,7 @@ Public Class ClsVentas Public Function GetLineasAdicionales(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, CveMoneda As Integer, - FechaI As Date, FechaF As Date, CveEstatus As Integer, CveEmpresa As Integer) As Boolean + FechaI As Date, FechaF As Date, CveLineaAdicionalEstatus As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_LineasAdicionalesGet") @@ -5589,7 +5589,7 @@ Public Class ClsVentas .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveLineaAdicionalEstatus", SqlDbType.Int).Value = CveLineaAdicionalEstatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -5649,7 +5649,8 @@ Public Class ClsVentas End Function Public Function AddLineasAdicionales(LineaAdicional As String, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, Importe As Decimal, - CveMoneda As Integer, FechaVencimiento As Date, CveUsuario As Integer, CveClasificacionPS As Integer, CveEstatus As Integer) As Boolean + CveMoneda As Integer, FechaVencimiento As Date, CveUsuario As Integer, CveCategoria As Integer, + Optional DiasVencimiento As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_LineasAdicionalesAdd") @@ -5664,8 +5665,8 @@ Public Class ClsVentas .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveClasificacionPS", SqlDbType.Int).Value = CveClasificacionPS - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria + .Add("@DiasVencimiento", SqlDbType.VarChar).Value = DiasVencimiento End With @@ -5682,7 +5683,8 @@ Public Class ClsVentas Public Function UpdateLineasAdicionales(CveLineaAdicional As Integer, LineaAdicional As String, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, Importe As Decimal, - CveMoneda As Integer, FechaVencimiento As Date, CveUsuario As Integer, CveClasificacionPS As Integer, CveEstatus As Integer, CveEmpresa As Integer, Optional Comprobante As String = "-1") As Boolean + CveMoneda As Integer, FechaVencimiento As Date, CveUsuario As Integer, CveCategoria As Integer, CveEmpresa As Integer, + Optional Comprobante As String = "-1", Optional DiasVencimiento As Integer = -1, Optional CveVenta As Integer = -1, Optional CveLineaAdicionalEstatus As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_LineasAdicionalesUpdate") @@ -5697,10 +5699,12 @@ Public Class ClsVentas .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveClasificacionPS", SqlDbType.Int).Value = CveClasificacionPS - .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Comprobante", SqlDbType.VarChar).Value = Comprobante + .Add("@DiasVencimiento", SqlDbType.VarChar).Value = DiasVencimiento + .Add("@CveVenta", SqlDbType.VarChar).Value = CveVenta + .Add("@CveLineaAdicionalEstatus", SqlDbType.Int).Value = CveLineaAdicionalEstatus End With diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx index 7c71c6558..2c8963058 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx +++ b/Contabilidad2/CatCuentasAsignaciones.aspx @@ -102,9 +102,10 @@ DataKeyNames="CveEmpresa,CveCuenta,CveConceptoContable,CveCuentaAsignacion,CveConceptoNomina, CveProveedor,CveClasificacion,CveAlmacen, IdCuenta, PorcentajeIVA, CveBancoCuenta, CveCliente, CvePersonal" AutoGenerateColumns="False" Style=" width:100%" GridLines="None" Caption="Globales"> - - - + + + + @@ -231,20 +232,28 @@ - -
- - -
-
- +
+ + +
+
+
+
-
-
+ + +
+
+
+ + +
+
+
@@ -44,6 +44,7 @@ + <%----%> @@ -53,7 +54,7 @@ - +
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 6a39c6780..ccd7582a3 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -628,6 +628,32 @@ 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 +2240,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 +2454,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 +2587,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 +2718,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 +2761,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 +2810,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/Sistemas/CatEmpresas.aspx.vb b/Sistemas/CatEmpresas.aspx.vb index 62b3d0dca..d60e791ed 100644 --- a/Sistemas/CatEmpresas.aspx.vb +++ b/Sistemas/CatEmpresas.aspx.vb @@ -45,7 +45,7 @@ Partial Class Sistemas_CatEmpresas #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then - If UsuarioActual.CveRol <> 1 Then Response.Redirect("/Inicio.aspx") + 'If UsuarioActual.CveRol <> 1 Then Response.Redirect("/Inicio.aspx") ViewState("Orden") = "CveEmpresa ASC" ViewState("CveRol") = -1 @@ -117,16 +117,20 @@ Partial Class Sistemas_CatEmpresas End Sub Private Sub CargaGrid(Orden As String) - If Orden <> String.Empty Then - Dim DV As New DataView(GlobalDTEmpresas, "", Orden, DataViewRowState.CurrentRows) - GvDatos.DataSource = DV.ToTable() - DV.Dispose() - Else - GvDatos.DataSource = GlobalDTEmpresas - End If + + Using ObjEmpresas As New ClsSisEmpresas() + + If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1", UsuarioActual.CveUsuario) Then + GvDatos.DataSource = ObjEmpresas.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + End Using GvDatos.DataBind() UpDatos.Update() + End Sub #End Region End Class diff --git a/Sistemas/Empresa.aspx b/Sistemas/Empresa.aspx index c0bf14666..73c79e8ff 100644 --- a/Sistemas/Empresa.aspx +++ b/Sistemas/Empresa.aspx @@ -948,6 +948,7 @@
+ @@ -1048,7 +1049,8 @@ - + + <%-- @@ -1146,8 +1148,13 @@
-
+
--%> + + +
+ +
diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb index 51c58ba61..b095f668a 100644 --- a/Sistemas/Empresa.aspx.vb +++ b/Sistemas/Empresa.aspx.vb @@ -6,6 +6,7 @@ Imports Extensiones Imports System.Runtime.InteropServices Imports System.IO Imports Microsoft.Reporting.WebForms +Imports Microsoft.Owin.Security.Provider Partial Class Sistemas_Empresa Inherits ClsPaginas @@ -152,6 +153,18 @@ Partial Class Sistemas_Empresa Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + + If UsuarioActual.CveRol <> 1 AndAlso (Request("CveEmpresa") IsNot Nothing AndAlso Request("CveEmpresa").ToEntero > 0) Then + + If Not ValidaCveEmpresaUsaurio(UsuarioActual.CveUsuario, Request("CveEmpresa").ToEntero) Then + 'Response.Redirect("../Inicio.aspx") + Alert("No tiene acceso a esta empresa.", TipoMensaje.MsgAdvertencia, "document.location.href = ""../Inicio.aspx""") + Exit Sub + End If + + + End If + CargaDdlPac() CargaRegimenFiscal() CargaGridIndicadores() @@ -159,6 +172,7 @@ Partial Class Sistemas_Empresa DtFuncionalidades = Nothing DtCuentas = Nothing CveClasificacionPorcentaje = 0 + If (Request("CveEmpresa") IsNot Nothing AndAlso IsNumeric(Request("CveEmpresa")) AndAlso Request("CveEmpresa").ToEntero > 0 AndAlso UsuarioActual.CveRol = 1) OrElse UsuarioActual.CveRol <> 1 Then ViewState("CveEmpresa") = If(UsuarioActual.CveRol <> 1, UsuarioActual.Empresa.CveEmpresa.ToString, Request("CveEmpresa")) ' Request("CveEmpresa") ' Session("FileUpload") = CveEmpresa @@ -207,6 +221,22 @@ Partial Class Sistemas_Empresa End If End Sub + Private Function ValidaCveEmpresaUsaurio(CveUsuario As Integer, CveEmpresaValidar As Integer) As Boolean + + Dim Respuesta As Boolean = False + Using ObjEmpresas As New ClsSisEmpresas() + If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1", UsuarioActual.CveUsuario) Then + If ObjEmpresas.DtResultados.FiltraParametros($"CveEmpresa = {CveEmpresaValidar}").Rows.Count = 1 Then + Respuesta = True + End If + End If + End Using + Return Respuesta + + End Function + + + Private Sub CargaDatos() Dim ObjEmpresas As New ClsSisEmpresas() @@ -426,30 +456,30 @@ Partial Class Sistemas_Empresa CargaFuncionalidad(221, DdlActivoFijo) - CargaFuncionalidad(232, DdlProveedoresSIG) - CargaFuncionalidad(233, DdlClientesSIG) - CargaFuncionalidad(234, DdlDeudoresSIG) - CargaFuncionalidad(235, DdlAcreedoresSIG) - CargaFuncionalidad(236, DdlDocxPagarSIG) - CargaFuncionalidad(237, DdlAnticipoClienteSIG) - CargaFuncionalidad(238, DdlAnticipoProveedoresSIG) - CargaFuncionalidad(239, DdlInventarioSIG) - CargaFuncionalidad(240, DdlGastoSIG) - CargaFuncionalidad(241, DdlBancosSIG) - CargaFuncionalidad(242, DdlCajaSIG) - CargaFuncionalidad(243, DdlFyESIG) - CargaFuncionalidad(244, DdlActivoFijoSIG) + 'CargaFuncionalidad(232, DdlProveedoresSIG) + 'CargaFuncionalidad(233, DdlClientesSIG) + 'CargaFuncionalidad(234, DdlDeudoresSIG) + 'CargaFuncionalidad(235, DdlAcreedoresSIG) + 'CargaFuncionalidad(236, DdlDocxPagarSIG) + 'CargaFuncionalidad(237, DdlAnticipoClienteSIG) + 'CargaFuncionalidad(238, DdlAnticipoProveedoresSIG) + 'CargaFuncionalidad(239, DdlInventarioSIG) + 'CargaFuncionalidad(240, DdlGastoSIG) + 'CargaFuncionalidad(241, DdlBancosSIG) + 'CargaFuncionalidad(242, DdlCajaSIG) + 'CargaFuncionalidad(243, DdlFyESIG) + 'CargaFuncionalidad(244, DdlActivoFijoSIG) LbBannerDescarga.OnClientClick = "javascript:AbrirVentana('/Banners/" & .Banner & "', 500, 500, 'N', 'Banner Empresa');" Session("FileUpload") = .Banner - 'LbArchivoKeyDescarga.OnClientClick = "javascript:AbrirVentana('/Key/" & .ArchivoKey & "', 500, 500, 'N', 'ArchivoKey Empresa');" + Session("FileUpload") = .ArchivoKey LbBannerDescarga.OnClientClick = "javascript:AbrirVentana('/Cer/" & .ArchivoCer & "', 500, 500, 'N', 'ArchivoCer Empresa');" Session("FileUpload") = .ArchivoCer - 'LbArchivoPfxDescarga.OnClientClick = "javascript:AbrirVentana('/Pfx/" & .ArchivoPfx & "', 500, 500, 'N', 'ArchivoPfx Empresa');" + Session("FileUpload") = .ArchivoPfx End With @@ -665,20 +695,20 @@ Partial Class Sistemas_Empresa If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 246, DdlClientes) If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoCliente) - 'AGREGAR FUNCIONALIDADES - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 232, DdlProveedoresSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 233, DdlClientesSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 239, DdlInventarioSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 240, DdlGastoSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 241, DdlBancosSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 234, DdlDeudoresSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 235, DdlAcreedoresSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 236, DdlDocxPagarSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoClienteSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 238, DdlAnticipoProveedoresSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 242, DdlCajaSIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 243, DdlFyESIG) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 244, DdlActivoFijoSIG) + ''AGREGAR FUNCIONALIDADES + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 232, DdlProveedoresSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 233, DdlClientesSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 239, DdlInventarioSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 240, DdlGastoSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 241, DdlBancosSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 234, DdlDeudoresSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 235, DdlAcreedoresSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 236, DdlDocxPagarSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoClienteSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 238, DdlAnticipoProveedoresSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 242, DdlCajaSIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 243, DdlFyESIG) + 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 244, DdlActivoFijoSIG) 'TRIGGER @@ -1057,85 +1087,86 @@ Partial Class Sistemas_Empresa DdlCuentaOtrosIngresos.AutoPostBack = False : DdlCuentaOtrosIngresos.Attributes.Remove("onclick") : DdlCuentaOtrosIngresos.CssClass &= " select2me" - 'PADRES SIG - Case "42" - If DdlProveedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlProveedoresSIG.SelectedValue - DdlProveedoresSIG.Items.Clear() : DdlProveedoresSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlProveedoresSIG.DataSource = DtCuentasContablesSIG : DdlProveedoresSIG.DataBind() : DdlProveedoresSIG.SelectedValue = Seleccionado - DdlProveedoresSIG.AutoPostBack = False : DdlProveedoresSIG.Attributes.Remove("onclick") : DdlProveedoresSIG.CssClass &= " select2me" - Case "43" - If DdlClientesSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlClientesSIG.SelectedValue - DdlClientesSIG.Items.Clear() : DdlClientesSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlClientesSIG.DataSource = DtCuentasContablesSIG : DdlClientesSIG.DataBind() : DdlClientesSIG.SelectedValue = Seleccionado - DdlClientesSIG.AutoPostBack = False : DdlClientesSIG.Attributes.Remove("onclick") : DdlClientesSIG.CssClass &= " select2me" - Case "44" - If DdlInventarioSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlInventarioSIG.SelectedValue - DdlInventarioSIG.Items.Clear() : DdlInventarioSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlInventarioSIG.DataSource = DtCuentasContablesSIG : DdlInventarioSIG.DataBind() : DdlInventarioSIG.SelectedValue = Seleccionado - DdlInventarioSIG.AutoPostBack = False : DdlInventarioSIG.Attributes.Remove("onclick") : DdlInventarioSIG.CssClass &= " select2me" - Case "45" - If DdlGastoSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlGasto.SelectedValue - DdlGastoSIG.Items.Clear() : DdlGastoSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlGastoSIG.DataSource = DtCuentasContablesSIG : DdlGastoSIG.DataBind() : DdlGastoSIG.SelectedValue = Seleccionado - DdlGastoSIG.AutoPostBack = False : DdlGastoSIG.Attributes.Remove("onclick") : DdlGastoSIG.CssClass &= " select2me" - Case "46" - If DdlBancosSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlBancosSIG.SelectedValue - DdlBancosSIG.Items.Clear() : DdlBancosSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlBancosSIG.DataSource = DtCuentasContablesSIG : DdlBancosSIG.DataBind() : DdlBancosSIG.SelectedValue = Seleccionado - DdlBancosSIG.AutoPostBack = False : DdlBancosSIG.Attributes.Remove("onclick") : DdlBancosSIG.CssClass &= " select2me" - Case "47" - If DdlDeudoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlDeudoresSIG.SelectedValue - DdlDeudoresSIG.Items.Clear() : DdlDeudoresSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlDeudoresSIG.DataSource = DtCuentasContablesSIG : DdlDeudoresSIG.DataBind() : DdlDeudoresSIG.SelectedValue = Seleccionado - DdlDeudoresSIG.AutoPostBack = False : DdlDeudoresSIG.Attributes.Remove("onclick") : DdlDeudoresSIG.CssClass &= " select2me" - Case "48" - If DdlAcreedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlAcreedoresSIG.SelectedValue - DdlAcreedoresSIG.Items.Clear() : DdlAcreedoresSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlAcreedoresSIG.DataSource = DtCuentasContablesSIG : DdlAcreedoresSIG.DataBind() : DdlAcreedoresSIG.SelectedValue = Seleccionado - DdlAcreedoresSIG.AutoPostBack = False : DdlAcreedoresSIG.Attributes.Remove("onclick") : DdlAcreedoresSIG.CssClass &= " select2me" - Case "49" - If DdlDocxPagarSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlDocxPagarSIG.SelectedValue - DdlDocxPagarSIG.Items.Clear() : DdlDocxPagarSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlDocxPagarSIG.DataSource = DtCuentasContablesSIG : DdlDocxPagarSIG.DataBind() : DdlDocxPagarSIG.SelectedValue = Seleccionado - DdlDocxPagarSIG.AutoPostBack = False : DdlDocxPagarSIG.Attributes.Remove("onclick") : DdlDocxPagarSIG.CssClass &= " select2me" - Case "50" - If DdlAnticipoClienteSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlAnticipoClienteSIG.SelectedValue - DdlAnticipoClienteSIG.Items.Clear() : DdlAnticipoClienteSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlAnticipoClienteSIG.DataSource = DtCuentasContablesSIG : DdlAnticipoClienteSIG.DataBind() : DdlAnticipoClienteSIG.SelectedValue = Seleccionado - DdlAnticipoClienteSIG.AutoPostBack = False : DdlAnticipoClienteSIG.Attributes.Remove("onclick") : DdlAnticipoClienteSIG.CssClass &= " select2me" - Case "51" - If DdlAnticipoProveedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlAnticipoProveedoresSIG.SelectedValue - DdlAnticipoProveedoresSIG.Items.Clear() : DdlAnticipoProveedoresSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlAnticipoProveedoresSIG.DataSource = DtCuentasContablesSIG : DdlAnticipoProveedoresSIG.DataBind() : DdlAnticipoProveedoresSIG.SelectedValue = Seleccionado - DdlAnticipoProveedoresSIG.AutoPostBack = False : DdlAnticipoProveedoresSIG.Attributes.Remove("onclick") : DdlAnticipoProveedoresSIG.CssClass &= " select2me" - Case "52" - If DdlCajaSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlCajaSIG.SelectedValue - DdlCajaSIG.Items.Clear() : DdlCajaSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlCajaSIG.DataSource = DtCuentasContablesSIG : DdlCajaSIG.DataBind() : DdlCajaSIG.SelectedValue = Seleccionado - DdlCajaSIG.AutoPostBack = False : DdlCajaSIG.Attributes.Remove("onclick") : DdlCajaSIG.CssClass &= " select2me" - Case "53" - If DdlFyESIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlFyESIG.SelectedValue - DdlFyESIG.Items.Clear() : DdlFyESIG.Items.Add(New ListItem("Seleccione", "0")) - DdlFyESIG.DataSource = DtCuentasContablesSIG : DdlFyESIG.DataBind() : DdlFyESIG.SelectedValue = Seleccionado - DdlFyESIG.AutoPostBack = False : DdlFyESIG.Attributes.Remove("onclick") : DdlFyESIG.CssClass &= " select2me" - Case "54" - If DdlActivoFijoSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - Seleccionado = DdlActivoFijoSIG.SelectedValue - DdlActivoFijoSIG.Items.Clear() : DdlActivoFijoSIG.Items.Add(New ListItem("Seleccione", "0")) - DdlActivoFijoSIG.DataSource = DtCuentasContablesSIG : DdlActivoFijoSIG.DataBind() : DdlActivoFijoSIG.SelectedValue = Seleccionado - DdlActivoFijoSIG.AutoPostBack = False : DdlActivoFijoSIG.Attributes.Remove("onclick") : DdlActivoFijoSIG.CssClass &= " select2me" + ' 'PADRES SIG + 'Case "42" + ' If DdlProveedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlProveedoresSIG.SelectedValue + ' DdlProveedoresSIG.Items.Clear() : DdlProveedoresSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlProveedoresSIG.DataSource = DtCuentasContablesSIG : DdlProveedoresSIG.DataBind() : DdlProveedoresSIG.SelectedValue = Seleccionado + ' DdlProveedoresSIG.AutoPostBack = False : DdlProveedoresSIG.Attributes.Remove("onclick") : DdlProveedoresSIG.CssClass &= " select2me" + 'Case "43" + ' If DdlClientesSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlClientesSIG.SelectedValue + ' DdlClientesSIG.Items.Clear() : DdlClientesSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlClientesSIG.DataSource = DtCuentasContablesSIG : DdlClientesSIG.DataBind() : DdlClientesSIG.SelectedValue = Seleccionado + ' DdlClientesSIG.AutoPostBack = False : DdlClientesSIG.Attributes.Remove("onclick") : DdlClientesSIG.CssClass &= " select2me" + 'Case "44" + ' If DdlInventarioSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlInventarioSIG.SelectedValue + ' DdlInventarioSIG.Items.Clear() : DdlInventarioSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlInventarioSIG.DataSource = DtCuentasContablesSIG : DdlInventarioSIG.DataBind() : DdlInventarioSIG.SelectedValue = Seleccionado + ' DdlInventarioSIG.AutoPostBack = False : DdlInventarioSIG.Attributes.Remove("onclick") : DdlInventarioSIG.CssClass &= " select2me" + 'Case "45" + ' If DdlGastoSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlGasto.SelectedValue + ' DdlGastoSIG.Items.Clear() : DdlGastoSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlGastoSIG.DataSource = DtCuentasContablesSIG : DdlGastoSIG.DataBind() : DdlGastoSIG.SelectedValue = Seleccionado + ' DdlGastoSIG.AutoPostBack = False : DdlGastoSIG.Attributes.Remove("onclick") : DdlGastoSIG.CssClass &= " select2me" + 'Case "46" + ' If DdlBancosSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlBancosSIG.SelectedValue + ' DdlBancosSIG.Items.Clear() : DdlBancosSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlBancosSIG.DataSource = DtCuentasContablesSIG : DdlBancosSIG.DataBind() : DdlBancosSIG.SelectedValue = Seleccionado + ' DdlBancosSIG.AutoPostBack = False : DdlBancosSIG.Attributes.Remove("onclick") : DdlBancosSIG.CssClass &= " select2me" + 'Case "47" + ' If DdlDeudoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlDeudoresSIG.SelectedValue + ' DdlDeudoresSIG.Items.Clear() : DdlDeudoresSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlDeudoresSIG.DataSource = DtCuentasContablesSIG : DdlDeudoresSIG.DataBind() : DdlDeudoresSIG.SelectedValue = Seleccionado + ' DdlDeudoresSIG.AutoPostBack = False : DdlDeudoresSIG.Attributes.Remove("onclick") : DdlDeudoresSIG.CssClass &= " select2me" + 'Case "48" + ' If DdlAcreedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlAcreedoresSIG.SelectedValue + ' DdlAcreedoresSIG.Items.Clear() : DdlAcreedoresSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlAcreedoresSIG.DataSource = DtCuentasContablesSIG : DdlAcreedoresSIG.DataBind() : DdlAcreedoresSIG.SelectedValue = Seleccionado + ' DdlAcreedoresSIG.AutoPostBack = False : DdlAcreedoresSIG.Attributes.Remove("onclick") : DdlAcreedoresSIG.CssClass &= " select2me" + 'Case "49" + ' If DdlDocxPagarSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlDocxPagarSIG.SelectedValue + ' DdlDocxPagarSIG.Items.Clear() : DdlDocxPagarSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlDocxPagarSIG.DataSource = DtCuentasContablesSIG : DdlDocxPagarSIG.DataBind() : DdlDocxPagarSIG.SelectedValue = Seleccionado + ' DdlDocxPagarSIG.AutoPostBack = False : DdlDocxPagarSIG.Attributes.Remove("onclick") : DdlDocxPagarSIG.CssClass &= " select2me" + 'Case "50" + ' If DdlAnticipoClienteSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlAnticipoClienteSIG.SelectedValue + ' DdlAnticipoClienteSIG.Items.Clear() : DdlAnticipoClienteSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlAnticipoClienteSIG.DataSource = DtCuentasContablesSIG : DdlAnticipoClienteSIG.DataBind() : DdlAnticipoClienteSIG.SelectedValue = Seleccionado + ' DdlAnticipoClienteSIG.AutoPostBack = False : DdlAnticipoClienteSIG.Attributes.Remove("onclick") : DdlAnticipoClienteSIG.CssClass &= " select2me" + 'Case "51" + ' If DdlAnticipoProveedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlAnticipoProveedoresSIG.SelectedValue + ' DdlAnticipoProveedoresSIG.Items.Clear() : DdlAnticipoProveedoresSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlAnticipoProveedoresSIG.DataSource = DtCuentasContablesSIG : DdlAnticipoProveedoresSIG.DataBind() : DdlAnticipoProveedoresSIG.SelectedValue = Seleccionado + ' DdlAnticipoProveedoresSIG.AutoPostBack = False : DdlAnticipoProveedoresSIG.Attributes.Remove("onclick") : DdlAnticipoProveedoresSIG.CssClass &= " select2me" + 'Case "52" + ' If DdlCajaSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlCajaSIG.SelectedValue + ' DdlCajaSIG.Items.Clear() : DdlCajaSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlCajaSIG.DataSource = DtCuentasContablesSIG : DdlCajaSIG.DataBind() : DdlCajaSIG.SelectedValue = Seleccionado + ' DdlCajaSIG.AutoPostBack = False : DdlCajaSIG.Attributes.Remove("onclick") : DdlCajaSIG.CssClass &= " select2me" + 'Case "53" + ' If DdlFyESIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlFyESIG.SelectedValue + ' DdlFyESIG.Items.Clear() : DdlFyESIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlFyESIG.DataSource = DtCuentasContablesSIG : DdlFyESIG.DataBind() : DdlFyESIG.SelectedValue = Seleccionado + ' DdlFyESIG.AutoPostBack = False : DdlFyESIG.Attributes.Remove("onclick") : DdlFyESIG.CssClass &= " select2me" + 'Case "54" + ' If DdlActivoFijoSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() + ' Seleccionado = DdlActivoFijoSIG.SelectedValue + ' DdlActivoFijoSIG.Items.Clear() : DdlActivoFijoSIG.Items.Add(New ListItem("Seleccione", "0")) + ' DdlActivoFijoSIG.DataSource = DtCuentasContablesSIG : DdlActivoFijoSIG.DataBind() : DdlActivoFijoSIG.SelectedValue = Seleccionado + ' DdlActivoFijoSIG.AutoPostBack = False : DdlActivoFijoSIG.Attributes.Remove("onclick") : DdlActivoFijoSIG.CssClass &= " select2me" + End Select @@ -1171,20 +1202,20 @@ Partial Class Sistemas_Empresa DdlCuentaDescuentoVenta.AutoPostBack = True DdlCuentaOtrosIngresos.AutoPostBack = True - 'CUENTAS PADRES SIG - DdlProveedoresSIG.AutoPostBack = True - DdlClientesSIG.AutoPostBack = True - DdlInventarioSIG.AutoPostBack = True - DdlGastoSIG.AutoPostBack = True - DdlBancosSIG.AutoPostBack = True - DdlDeudoresSIG.AutoPostBack = True - DdlAcreedoresSIG.AutoPostBack = True - DdlDocxPagarSIG.AutoPostBack = True - DdlAnticipoClienteSIG.AutoPostBack = True - DdlAnticipoProveedoresSIG.AutoPostBack = True - DdlCajaSIG.AutoPostBack = True - DdlFyESIG.AutoPostBack = True - DdlActivoFijoSIG.AutoPostBack = True + ''CUENTAS PADRES SIG + 'DdlProveedoresSIG.AutoPostBack = True + 'DdlClientesSIG.AutoPostBack = True + 'DdlInventarioSIG.AutoPostBack = True + 'DdlGastoSIG.AutoPostBack = True + 'DdlBancosSIG.AutoPostBack = True + 'DdlDeudoresSIG.AutoPostBack = True + 'DdlAcreedoresSIG.AutoPostBack = True + 'DdlDocxPagarSIG.AutoPostBack = True + 'DdlAnticipoClienteSIG.AutoPostBack = True + 'DdlAnticipoProveedoresSIG.AutoPostBack = True + 'DdlCajaSIG.AutoPostBack = True + 'DdlFyESIG.AutoPostBack = True + 'DdlActivoFijoSIG.AutoPostBack = True DdlIVAxAcreditar.Attributes.Add("onclick", "CargaCuentas(1);") @@ -1217,20 +1248,20 @@ Partial Class Sistemas_Empresa DdlCuentaDescuentoVenta.Attributes.Add("onclick", "CargaCuentas(40);") DdlCuentaOtrosIngresos.Attributes.Add("onclick", "CargaCuentas(41);") - 'CUENTAS PADRES - DdlProveedoresSIG.Attributes.Add("onclick", "CargaCuentas(42);") - DdlClientesSIG.Attributes.Add("onclick", "CargaCuentas(43);") - DdlInventarioSIG.Attributes.Add("onclick", "CargaCuentas(44);") - DdlGastoSIG.Attributes.Add("onclick", "CargaCuentas(45);") - DdlBancosSIG.Attributes.Add("onclick", "CargaCuentas(46);") - DdlDeudoresSIG.Attributes.Add("onclick", "CargaCuentas(47);") - DdlAcreedoresSIG.Attributes.Add("onclick", "CargaCuentas(48);") - DdlDocxPagarSIG.Attributes.Add("onclick", "CargaCuentas(49);") - DdlAnticipoClienteSIG.Attributes.Add("onclick", "CargaCuentas(50);") - DdlAnticipoProveedoresSIG.Attributes.Add("onclick", "CargaCuentas(51);") - DdlCajaSIG.Attributes.Add("onclick", "CargaCuentas(52);") - DdlFyESIG.Attributes.Add("onclick", "CargaCuentas(53);") - DdlActivoFijoSIG.Attributes.Add("onclick", "CargaCuentas(54);") + ''CUENTAS PADRES + 'DdlProveedoresSIG.Attributes.Add("onclick", "CargaCuentas(42);") + 'DdlClientesSIG.Attributes.Add("onclick", "CargaCuentas(43);") + 'DdlInventarioSIG.Attributes.Add("onclick", "CargaCuentas(44);") + 'DdlGastoSIG.Attributes.Add("onclick", "CargaCuentas(45);") + 'DdlBancosSIG.Attributes.Add("onclick", "CargaCuentas(46);") + 'DdlDeudoresSIG.Attributes.Add("onclick", "CargaCuentas(47);") + 'DdlAcreedoresSIG.Attributes.Add("onclick", "CargaCuentas(48);") + 'DdlDocxPagarSIG.Attributes.Add("onclick", "CargaCuentas(49);") + 'DdlAnticipoClienteSIG.Attributes.Add("onclick", "CargaCuentas(50);") + 'DdlAnticipoProveedoresSIG.Attributes.Add("onclick", "CargaCuentas(51);") + 'DdlCajaSIG.Attributes.Add("onclick", "CargaCuentas(52);") + 'DdlFyESIG.Attributes.Add("onclick", "CargaCuentas(53);") + 'DdlActivoFijoSIG.Attributes.Add("onclick", "CargaCuentas(54);") UpDatos.Update() diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index c70a0433f..13c08b48b 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -4574,14 +4574,14 @@ - + @@ -6724,16 +6724,17 @@
- - + +
- + - + -
+
+
+
+
+ + + + + +
@@ -6807,9 +6818,9 @@
- + - +
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index d2093a1c2..23c792e33 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -10359,9 +10359,9 @@ Partial Class Clientes - DdlClasificacionLienaAdicionalModal.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) - DdlClasificacionLienaAdicionalModal.DataBind() - DdlClasificacionLienaAdicionalModal.Items.Insert(0, New ListItem("-", "-1")) + DdlCategoriaLineaAdicionalModal.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) + DdlCategoriaLineaAdicionalModal.DataBind() + DdlCategoriaLineaAdicionalModal.Items.Insert(0, New ListItem("-", "-1")) @@ -10397,9 +10397,11 @@ Partial Class Clientes DdlProveedorLineaAdicionalModal.txtValue.Value = "" DdlTipoLineaAdicionalModal.SelectedValueExist(-1) TxtFechaVencimientoLineaAdicionalModal.Text = "" - DdlClasificacionLienaAdicionalModal.SelectedValueExist(-1) + DdlCategoriaLineaAdicionalModal.SelectedValueExist(-1) TxtImporteLineaAdicionalModal.Text = "" DdlMonedaLineAdicionalModal.SelectedValueExist(-1) + TxtDiasVencimientoLineaAdicionalModal.Text = "" + DdlTipoLineaAdicionalModal_SelectedIndexChanged(Nothing, Nothing) UpLineaAdicionalmodal.Update() @@ -10419,14 +10421,16 @@ Partial Class Clientes If CveLineaAdicional > 0 Then If Not ObjVentas.UpdateLineasAdicionales(CveLineaAdicional, TxtLineaAdicionalModal.Text, CveCliente, DdlProveedorLineaAdicionalModal.SelectedValue.ToEntero, DdlTipoLineaAdicionalModal.SelectedValue.ToEntero, TxtImporteLineaAdicionalModal.Text.ToDecimal, - DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlClasificacionLienaAdicionalModal.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then + DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlCategoriaLineaAdicionalModal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, + DiasVencimiento:=TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero) Then ErrorAgregar = True Else Alert("Linea Adicional Actualizada Correctamente") End If Else If Not ObjVentas.AddLineasAdicionales(TxtLineaAdicionalModal.Text, CveCliente, DdlProveedorLineaAdicionalModal.SelectedValue.ToEntero, DdlTipoLineaAdicionalModal.SelectedValue.ToEntero, TxtImporteLineaAdicionalModal.Text.ToDecimal, - DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlClasificacionLienaAdicionalModal.SelectedValue.ToEntero, 0) Then + DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlCategoriaLineaAdicionalModal.SelectedValue.ToEntero, + DiasVencimiento:=TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero) Then ErrorAgregar = True Else Alert("Linea Adicional Agregada Correctamente") @@ -10455,10 +10459,11 @@ Partial Class Clientes DdlProveedorLineaAdicionalModal.txtValue.Value = GvRow.DataKey("CveProveedor") DdlTipoLineaAdicionalModal.SelectedValueExist(GvRow.DataKey("TipoLinea").ToEntero) TxtFechaVencimientoLineaAdicionalModal.Text = GvRow.DataKey("FechaVencimiento").ToDate.ToString("dd/MM/yyyy") - DdlClasificacionLienaAdicionalModal.SelectedValueExist(GvRow.DataKey("CveClasificacionPS").ToEntero) + DdlCategoriaLineaAdicionalModal.SelectedValueExist(GvRow.DataKey("CveCategoria").ToEntero) TxtImporteLineaAdicionalModal.Text = GvRow.DataKey("Importe").ToDecimal.ToString("###,###,###.00") DdlMonedaLineAdicionalModal.SelectedValueExist(GvRow.DataKey("CveMoneda").ToEntero) - + TxtDiasVencimientoLineaAdicionalModal.Text = GvRow.DataKey("DiasVencimiento").ToEntero.ToString + DdlTipoLineaAdicionalModal_SelectedIndexChanged(Nothing, Nothing) RegistraScript("$('#DVLineasAdicionales').modal('show')") UpLineaAdicionalmodal.Update() @@ -10490,8 +10495,11 @@ Partial Class Clientes + Protected Sub DdlTipoLineaAdicionalModal_SelectedIndexChanged(sender As Object, e As EventArgs) + DvLineaAdicionalDiasVenciemientoModal.Visible = If(DdlTipoLineaAdicionalModal.SelectedValue.ToEntero = 2, True, False) + UpLineaAdicionalmodal.Update() - + End Sub End Class diff --git a/Ventas/RepLineasAdicionales.aspx b/Ventas/RepLineasAdicionales.aspx index 7927edb15..4a65fdc2b 100644 --- a/Ventas/RepLineasAdicionales.aspx +++ b/Ventas/RepLineasAdicionales.aspx @@ -129,7 +129,7 @@ - + - - + <%----%> + + + + @@ -156,7 +159,7 @@
-
diff --git a/Ventas/RepLineasAdicionales.aspx.cs b/Ventas/RepLineasAdicionales.aspx.cs index 9595fcc64..f6266c005 100644 --- a/Ventas/RepLineasAdicionales.aspx.cs +++ b/Ventas/RepLineasAdicionales.aspx.cs @@ -65,7 +65,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas { DVProveedor1.Visible = true; DVProveedor2.Visible = true; - GvLineasAdicionales.Columns[8].Visible = true; + GvLineasAdicionales.Columns[10].Visible = true; TipoLinea = 2; LtlEncabezado.Text = "Reporte PO"; } @@ -221,7 +221,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas if (!errorCargaComprobante) { ClsVentas objVentas = new ClsVentas(); - if (!objVentas.UpdateLineasAdicionales(CveLineaAdicional, "-1", -1, -1, -1, -1, -1, MinFecha, 100, -1, -1, UsuarioActual.CveEmpresa, Comprobante: $@"{CveLineaAdicional}{fiNuevo.Extension}")) + if (!objVentas.UpdateLineasAdicionales(CveLineaAdicional, "-1", -1, -1, -1, -1, -1, MinFecha, 100, -1, UsuarioActual.CveEmpresa, Comprobante: $@"{CveLineaAdicional}{fiNuevo.Extension}")) { errorCargaComprobante = true; } @@ -248,11 +248,13 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas { GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; int CveLineaAdicionalActualzarEstatus = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero(); + int CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero(); + bool errorCambioEstatus = false; ClsVentas objVentas = new ClsVentas(); - if (!objVentas.UpdateLineasAdicionales(CveLineaAdicionalActualzarEstatus, "-1", -1, -1, -1, -1, -1, MinFecha, 100, -1, 3, UsuarioActual.CveEmpresa)) + if (!objVentas.UpdateLineasAdicionales(CveLineaAdicionalActualzarEstatus, "-1", -1, -1, -1, -1, -1, MinFecha, 100, -1, UsuarioActual.CveEmpresa,CveVenta:CveVenta,CveLineaAdicionalEstatus:2)) { errorCambioEstatus = true; } @@ -278,12 +280,12 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas { if(e.Row.RowType == DataControlRowType.DataRow) { - if(e.Row.DataKey("CveEstatus").ToEntero().Contiene(2)) + if(e.Row.DataKey("CveLineaAdicionalEstatus").ToEntero().Contiene(1) && e.Row.DataKey("CveVenta").ToEntero() > 0) { e.Row.FCLinkButton("LnkCambiarEstatus").Visible = true; } - if (e.Row.DataKey("CveEstatus").ToEntero() == 3) + if (e.Row.DataKey("CveLineaAdicionalEstatus").ToEntero() == 2) { e.Row.FCLinkButton("LnkCargarComprobante").Visible = false; } diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7df6471b7..237250041 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -15818,23 +15818,14 @@ Partial Class Ventas If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - importeMN = importeMovimiento - TC = gvr.DataKey("TipoCambio").ToString().ToDecimal ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - importeMN = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal - TC = gvr.DataKey("TipoCambio").ToString().ToDecimal ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal - importeMN = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal - TC = TipoCambioFluctuacion ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal - importeMN = importeMovimiento - TC = gvr.DataKey("TipoCambio").ToString().ToDecimal End If importeMovimiento = importeMovimiento.RoundSQL - importeMN = importeMN.RoundSQL If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(12, CveCliente) Then If ObjConta.DtResultados.Rows.Count > 0 Then