diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 018752561..8163a318d 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -87,7 +87,7 @@ Public Class ClsClientes Public Property Codigo As String Public Property LimiteCredito As Double 'Public Property NumCtaPago As String - 'Public Property CveMetodoPago As Integer + Public Property CveMetodoPago As Integer Public Property AplicaFEMSA As Boolean Public Property FEMSA_NumSociedad As String Public Property FEMSA_NumProveedor As String diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e70cc360a..8222c3ea9 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -3225,7 +3225,7 @@ Public Class ClsContabilidad #Region " CUENTAS " - Public Function GetCuentas(CveCuenta As Integer, Codigo As String, Afectable As Integer, CveEmpresa As Integer, Optional RowNum As Integer = 100000, Optional CvePadre As Integer = -1) As Boolean ', Codigo As String, Nombre As String, CveClasificacionCuenta As Integer, TipoCuenta As Integer, Afectable As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean + Public Function GetCuentas(CveCuenta As Integer, Codigo As String, Afectable As Integer, CveEmpresa As Integer, Optional RowNum As Integer = 100000, Optional CvePadre As Integer = -1, Optional Nombre As String = "-1") As Boolean ', Codigo As String, Nombre As String, CveClasificacionCuenta As Integer, TipoCuenta As Integer, Afectable As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasGet") @@ -3234,6 +3234,7 @@ Public Class ClsContabilidad .Add("@Codigo", SqlDbType.VarChar).Value = Codigo .Add("@Afectable", SqlDbType.VarChar).Value = Afectable .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa + .Add("@Nombre", SqlDbType.VarChar).Value = Nombre .Add("@RowNum", SqlDbType.VarChar).Value = RowNum .Add("@CvePadre", SqlDbType.Int).Value = CvePadre End With diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 353146e49..f9f915c25 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -2619,13 +2619,13 @@ Public Class ClsGenerales #End Region #Region "SAT PRODUCTOS SERVICIOS Y UNIDAD DE MEDIDA" - Public Function GetSATProductosServicios() As Boolean + Public Function GetSATProductosServicios(Optional SATClaveProductoServicio As String = "-1", Optional CveSATPS As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_SAT_ProductosServiciosGet") With SqlAdapter.SelectCommand.Parameters - - + .Add("@SATClaveProductoServicio", SqlDbType.VarChar).Value = SATClaveProductoServicio + .Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS End With 'SqlTypes.SqlDateTime.Null Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 4039d1299..593e54e06 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -130,7 +130,8 @@ Public Class ClsNominas .CommandText = pStrSQL .CommandType = TipoComando End With - Data = New DataTable + Data = New DataTable() + DTSet = New DataSet() If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc End Sub #Region "Conexiones" @@ -171,6 +172,47 @@ Public Class ClsNominas #End Region #Region "ClsNominas_Nominas" + + Public Function NominaUpMetododepago(cveEmpresa As Integer, CvePersonal As Integer, CvePeriodo As Integer, MetodoPagoFijo As Boolean, + CveMetodoPago As Integer, CveSATBanco As Integer, BancoNumCuenta As String, CLABE As String) As Boolean + Dim retorno As Boolean = False + DTSet = New DataSet() + DataAdapter("PA_Nom_NominaUpMetododepago", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@MetodoPagoFijo", SqlDbType.Bit).Value = MetodoPagoFijo + .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco + .Add("@BancoNumCuenta", SqlDbType.VarChar).Value = BancoNumCuenta + .Add("@CLABE", SqlDbType.VarChar).Value = CLABE + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + End With + Try + SqlAdapter.Fill(DTSetResultados) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar forma de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function PersonalISRAnual(CvePersonal As Integer, cveEmpresa As Integer, Ejercicio As Integer) As Boolean + Dim retorno As Boolean = False + DTSet = New DataSet() + DataAdapter("PA_Nom_PersonalISRAnual", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + End With + Try + SqlAdapter.Fill(DTSet) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Function RemoveFiniquito(CvePersonal As Integer, cveEmpresa As Integer, CvePersonalAltas As Integer) As Boolean Dim retorno As Boolean = False DTSet = New DataSet() @@ -270,7 +312,7 @@ Public Class ClsNominas End Function Public Function GetCalculoAguinaldo(ejercicio As Int32, cveEmpresa As Int32, importe As Double, CveTipoPeriodo As Integer, CvePeriodo As Integer) As Boolean Dim retorno As Boolean = False - DataAdapter("PA_NomCalcularAguinaldo", CommandType.StoredProcedure) + DataAdapter("PA_Nom_CalcularAguinaldo", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa .Add("@Ejercicio", SqlDbType.Int).Value = ejercicio @@ -286,24 +328,28 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function Autorizaperiodoconta(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean + Public Function RegistraProvision(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean Dim retorno As Boolean = False - DataAdapter("PA_Nom_Autorizaperiodoconta", CommandType.StoredProcedure) + DataAdapter("PA_Nom_RegistraProvision", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try - SqlAdapter.Fill(Data) + SqlAdapter.Fill(DTSet) + Data = New DataTable + If DTSet.Tables.Count > 0 Then + Data = DTSet.Tables(0) + End If retorno = True Catch ex As Exception - OnError("Ocurrió un error al autorizar periodo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al registrar la provisión de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function - Public Function GetDispersiondenomina(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean + Public Function GetDispersionnomina(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean Dim retorno As Boolean = False - DataAdapter("PA_PA_NomDispersiondenomina", CommandType.StoredProcedure) + DataAdapter("PA_Nom_Dispersionnomina", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -318,7 +364,7 @@ Public Class ClsNominas End Function Public Function GetCalculoUtilidades(ejercicio As Int32, cveEmpresa As Int32, importe As Double, importeA As Double) As Boolean Dim retorno As Boolean = False - DataAdapter("PA_NomCalcularUtilidades", CommandType.StoredProcedure) + DataAdapter("PA_Nom_CalcularUtilidades", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa .Add("@Ejercicio", SqlDbType.Int).Value = ejercicio @@ -542,8 +588,13 @@ Public Class ClsNominas Try SqlAdapter.Fill(Data) Retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al Guardar el Movimiento de Nomina.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' + Catch sqlex As SqlException + If sqlex.Message.Contains("x5010") Then + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina(Timbrada).", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If End Try Return Retorno @@ -786,6 +837,14 @@ Public Class ClsNominas Try SqlAdapter.Fill(Data) Retorno = True + + Catch sqlex As SqlException + If sqlex.Message.Contains("Número: 50001x") Then + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina(Timbrada).", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + End If Catch ex As Exception Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try @@ -1930,12 +1989,13 @@ Public Class ClsNominas End Function #End Region - Public Function GetFiniquitosPersonal(CvePersonal As Integer, CveEmpresa As Integer, Optional Limpiar As Integer = 0) As Boolean + Public Function GetFiniquitosPersonal(CvePersonal As Integer, CveEmpresa As Integer, Optional Limpiar As Integer = 0, Optional diasindemnizacion As Integer = 90) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_FiniquitosGET") With SqlAdapter.SelectCommand.Parameters .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@diasindemnizacion", SqlDbType.Int).Value = diasindemnizacion '.Add("@Limpiar", SqlDbType.Int).Value = Limpiar End With Try @@ -2494,7 +2554,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean) As Boolean + Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure) @@ -2508,20 +2568,21 @@ Public Class ClsNominas .Add("@montoLimite", SqlDbType.Decimal).Value = (montoLimite) .Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion) .Add("@estatus", SqlDbType.Bit).Value = (estatus) + .Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta) End With Try SqlAdapter.Fill(Data) retorno = True Catch sqEx As SqlException retorno = False - OnError("Ocurrió un error al agregar los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al agregar los movimientos permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception retorno = False - OnError("Ocurrió un error al agregar los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al agregar los movimientos permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function - Public Function UpMovtoPermanente(cveMovtoPermanente As Int32, cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean) As Boolean + Public Function UpMovtoPermanente(cveMovtoPermanente As Int32, cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_UpMovtoPermanente", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -2535,16 +2596,21 @@ Public Class ClsNominas .Add("@montoLimite", SqlDbType.Decimal).Value = (montoLimite) .Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion) .Add("@estatus", SqlDbType.Bit).Value = (estatus) + .Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta) End With Try SqlAdapter.Fill(Data) retorno = True Catch sqEx As SqlException retorno = False - OnError("Ocurrió un error al agregar los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + If (sqEx.Message.Contains("FK_Conta_CuentasAsignaciones_Conta_ConceptosContables")) Then + OnError("Es necesario asignar el concepto contable al concepto de nomina para poder realizar la vinculacion de la cuenta.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + OnError("Ocurrió un error al actualizar los movimientos permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If Catch ex As Exception retorno = False - OnError("Ocurrió un error al agregar los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al actualizar los movimientos permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 2f67b4eff..2e98da7cf 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -293,7 +293,7 @@ Public Class ClsPaginas Application("Directorio") = value End Set End Property - Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String) As DataTable + Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String, Optional CveSATPS As Integer = -1) As DataTable Get 'If Application("GlobalDTPSATPS") Is Nothing Then ' Dim ObjGrales As New ClsGenerales @@ -304,13 +304,13 @@ Public Class ClsPaginas 'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio) Then + If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio, CveSATPS) Then GlobalDTPSATPS = ObjGrales.DtResultados Else GlobalDTPSATPS = Nothing End If - ObjGrales.Dispose() + 'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable End Get 'Set(value As DataTable) ' Application("GlobalDTPSATPS") = value @@ -647,7 +647,7 @@ Public Class ClsPaginas End Property - Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1, Optional Estatus As Integer = 1) As DataTable + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) 'sino existe, recarga los datos @@ -662,7 +662,6 @@ Public Class ClsPaginas If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) - If Estatus <> -1 Then Str.AppendFormat(" AND Estatus = '{0}'", If(Estatus = 1, "Activo", "Inactivo")) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTClasificaciones = Dv.ToTable Dv.Dispose() @@ -1759,7 +1758,7 @@ Public Class ClsPaginas ObjProveedores.Dispose() End If - If CveEmpresa <> -1 Then + If CveEmpresa <> -1 AndAlso Application(AppNombre) IsNot Nothing Then Dim StrSQL As New StringBuilder StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) If CveProveedor >= 0 Then StrSQL.AppendFormat(" AND CveProveedor = {0} ", CveProveedor) @@ -3076,6 +3075,8 @@ Public Class ClsPaginas End Set End Property + + Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable Get If CvePlantillaPoliza <> -1 Then @@ -3848,6 +3849,7 @@ Public Class ClsPaginas If Application("GlobalSIGAppPaginas") Is Nothing Then PaginaDict = New System.Collections.Hashtable + PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915) PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) @@ -4617,7 +4619,6 @@ Public Class ClsPaginas PaginaDict.Add("/GPS/RepGastos.aspx".ToUpper(), 685) PaginaDict.Add("/GPS/RecursoConfiableTracking.aspx".ToUpper(), 692) PaginaDict.Add("/GPS/KimberlyClarkTracking.aspx".ToUpper(), -1) - PaginaDict.Add("/GPS/RepUnidades.aspx".ToUpper(), 780) #End Region 'INVENTARIOS #Region "Inventarios" @@ -5951,19 +5952,6 @@ Public Class ClsPaginas Dim TipoDocumentoRef As String = "" Dim AplicaPagare As String = "1" - Dim RFCReceptor As String = "" - - If String.IsNullOrEmpty(Vta.RFCReceptor) Then - RFCReceptor = Vta.Cliente.RFC - If Vta.FacturarSucursal Then - If Vta.ClienteSucursal IsNot Nothing Then - RFCReceptor = Vta.ClienteSucursal.RFC - End If - End If - Else - RFCReceptor = Vta.RFCReceptor - End If - Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio) Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) Dim ImgCBB As String '= String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) @@ -6093,7 +6081,7 @@ Public Class ClsPaginas 'Si no tiene CBB, SE GENERA If Not ImagenCBB.Exists Then Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) End If ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) @@ -6108,7 +6096,7 @@ Public Class ClsPaginas 'CLIENTE params.Add(New CrystalParametro("ClienteCodigo", Vta.Cliente.Codigo)) - params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso RFCReceptor = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre)))) + params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre)))) params.Add(New CrystalParametro("ClienteDireccion", ClienteDireccion)) params.Add(New CrystalParametro("ClienteLugar", ClienteLugar)) @@ -6140,7 +6128,7 @@ Public Class ClsPaginas params.Add(New CrystalParametro("SelloSAT", Vta.SelloSAT)) params.Add(New CrystalParametro("QR", ImgCBB)) - params.Add(New CrystalParametro("ClienteRFC", RFCReceptor)) + params.Add(New CrystalParametro("ClienteRFC", Vta.Cliente.RFC)) params.Add(New CrystalParametro("FormaPago", Vta.FormaPagoText)) params.Add(New CrystalParametro("Moneda", Vta.Moneda)) params.Add(New CrystalParametro("TipoCambio", Vta.TipoCambio.ToString)) @@ -6475,18 +6463,7 @@ Public Class ClsPaginas Dim NombreArchivoDescarga As String = "" Dim TipoDocumento As String = "" Dim TipoDocumentoRef As String = "" - Dim RFCReceptor As String = "" - If String.IsNullOrEmpty(Vta.RFCReceptor) Then - RFCReceptor = Vta.Cliente.RFC - If Vta.FacturarSucursal Then - If Vta.ClienteSucursal IsNot Nothing Then - RFCReceptor = Vta.ClienteSucursal.RFC - End If - End If - Else - RFCReceptor = Vta.RFCReceptor - End If Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio) Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) @@ -6641,7 +6618,7 @@ Public Class ClsPaginas 'Si no tiene CBB, SE GENERA If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) End If ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) @@ -6662,14 +6639,14 @@ Public Class ClsPaginas params.Add(New ReportParameter("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre)))) params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion)) params.Add(New ReportParameter("ClienteLugar", ClienteLugar)) - params.Add(New ReportParameter("ClienteRFC", RFCReceptor)) + params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC)) End If If Vta.CveEmpresaCRM.ToEntero > 0 Then params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo)) params.Add(New ReportParameter("ClienteNombre", Vta.Cliente.Nombre)) params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion)) params.Add(New ReportParameter("ClienteLugar", ClienteLugar)) - params.Add(New ReportParameter("ClienteRFC", RFCReceptor)) + params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC)) End If 'TOTALES diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 196f5f3bf..80494b780 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -5654,7 +5654,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Return Retorno End Function - Public Function SolicitudVacacionesAdd(CvePersonal As Integer, Fecha As Date, FechaFin As Date, Estatus As Integer, CveUsuario As Integer, CveAutoriza As Integer, Folio As Integer, Optional Motivo As String = "", Optional FechaPago As String = "", Optional diasinabiles As Integer = 0, Optional PorcentajePrimaVac As Decimal = -1) As Boolean + Public Function SolicitudVacacionesAdd(CvePersonal As Integer, Fecha As Date, FechaFin As Date, Estatus As Integer, CveUsuario As Integer, CveAutoriza As Integer, Folio As Integer, Optional Motivo As String = "", Optional FechaPago As String = "", Optional diasinabiles As Integer = 0, Optional PorcentajePrimaVac As Decimal = -1, Optional CveTipoPago As Integer = 0, Optional diasExtras As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_SolicitudVacacionesAdd") @@ -5670,6 +5670,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@diasinabiles", SqlDbType.Int).Value = diasinabiles .Add("@PorcentajePrimaVac", SqlDbType.Money).Value = PorcentajePrimaVac .Add("@FechaPago", SqlDbType.VarChar).Value = FechaPago + .Add("@CveTipoPago", SqlDbType.Int).Value = CveTipoPago + .Add("@diasExtras", SqlDbType.Int).Value = diasExtras '.Add("@Motivo", SqlDbType.VarChar).Value = MotivoFechaPago As String = "", Optional diasinabiles End With diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f4504bbb3..63f73011e 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4388,6 +4388,134 @@ Public Class ClsVentas End Function #End Region + +#Region " AUTORIZACION LIMITES " + + Public Function AutorizacionLimitesGet(CveCliente As Integer, CveCveVendedor As Integer, CveEstatus As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_AutorizacionLimitesGet", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveCveVendedor", SqlDbType.Int).Value = CveCveVendedor + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + + OnError("Ocurrió un error al obtener las Autorizaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + + Return Retorno + End Function + + Public Function AutorizacionLimitesRemove(CveAutorizacion As Integer, CveCliente As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_AutorizacionLimitesRemove", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + + OnError("Ocurrió un error al eliminar la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + + Return Retorno + End Function + + Public Function AutorizacionLimitesAdd(CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveUsuario As Integer, CveEstatus As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_AutorizacionLimitesAdd", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@Importe", SqlDbType.Money).Value = Importe + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + + OnError("Ocurrió un error al agregar la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + + Return Retorno + End Function + + Public Function AutorizacionLimitesEstatusUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_AutorizacionlimitesEstatusUpdate", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + + OnError("Ocurrió un error al actualizar la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + + Return Retorno + End Function + + Public Function AutorizacionLimitesUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_AutorizacionLimitesUpdate", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@Importe", SqlDbType.Money).Value = Importe + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + + OnError("Ocurrió un error al actualizar el Estatus de la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + + Return Retorno + End Function +#End Region + #Region "CANCELACION REMISION" Public Function UpdateCancelaRemision(CveVenta As Integer, SeCancelaRemision As Boolean) As Boolean diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 6ac889921..7e9d8cc88 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -137,6 +137,7 @@ Public Class LogicNominas Dim SDI As Double = 0 Dim SalarioDiarioSS As Double = 0 Dim ClaveEstado As String = "" + Dim MetodoPagoFijo As Boolean Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades) 'Conexiones a la Base de Datos @@ -152,6 +153,12 @@ Public Class LogicNominas cfdi.Nomina.UltimoSueldoOrdinario = drow("UltimoSueldoOrdinario").ToString().ToDecimal() Serie = objNomina.Serie Folio = objNomina.Folio.ToString() + + MetodoPagoFijo = drow("MetodoPagoFijo").ToString().ToUpper().Contiene("1", "TRUE") + + ClaveBanco = drow("ClaveBanco").ToString() + BancoNumCuenta = drow("BancoNumCuenta").ToString() + If TimbreIndemnizacion Then cfdi.Timbrado = drow("SeTimbroFiniquitoVal").ToString().ToEntero() = 1 cfdi.IStimbreFiniquito = True @@ -180,8 +187,11 @@ Public Class LogicNominas Puesto = objPersonal.Puesto CveSATRiesgoPuesto = objPersonal.CveSATRiesgoPuesto.ToString() TipoPeriodoPago = objPersonal.TipoPeriodoPago - ClaveBanco = objPersonal.ClaveBanco - BancoNumCuenta = objPersonal.BancoNumCuenta + If Not MetodoPagoFijo Then + ClaveBanco = objPersonal.ClaveBanco + BancoNumCuenta = objPersonal.BancoNumCuenta + + End If SDI = objPersonal.SDI SalarioDiarioSS = objPersonal.SalarioDiarioSS ClaveEstado = objPersonal.ClaveEstado @@ -332,7 +342,7 @@ Public Class LogicNominas 'subsidio al empleo If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo - .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal, .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()}) + .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal, .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()}) End If Next End If @@ -362,7 +372,7 @@ Public Class LogicNominas 'subsidio al empleo If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo - .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal(), .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()}) + .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal(), .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()}) End If Next End If @@ -376,7 +386,7 @@ Public Class LogicNominas If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For Dim otrp = New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), - .Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()} + .Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()} If Row("SATCveConcepto").ToString().ToEntero() = 4 Then otrp.ejercicio = DateTime.Now.Year - 1 otrp.SaldoAFavor = Row("ImporteValor").ToString().ToDecimal().Abs() diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index 4d52b8b02..e2ba8339d 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -406,6 +406,8 @@ Public Class E141 : Implements IHttpHandler Else retorno = "False" End If + Case "ActualizarPreciosJson" + retorno = ActualizarPreciosJson(If(FiltrarTodos = "1", True, False)) Case "ActualizarExistencias" respuesta = ActualizarExistencias() If respuesta Then @@ -413,6 +415,8 @@ Public Class E141 : Implements IHttpHandler Else retorno = "False" End If + Case "ActualizarExistenciasJson" + retorno = ActualizarExistenciasJson(If(FiltrarTodos = "1", True, False)) Case "ActualizarVendedores" respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False)) If respuesta Then @@ -2118,6 +2122,26 @@ Public Class E141 : Implements IHttpHandler Return Retorno End Function + Private Function ActualizarPreciosJson(Todos As Boolean) As String + Dim payload = New JObject() + + Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0 + + Dim DtPS As DataTable = Nothing + Using ObjPS As New ClsProductosServicios + 'OBTERNER PRECIOS DE PUBLICO GENERAL + If ObjPS.GetPreciosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then + DtPS = ObjPS.DtResultados.Copy() + End If + End Using + + If DtPS IsNot Nothing Then + payload.Add(New JProperty("products", GenerarPayloadPrecios(DtPS))) + End If + + Return payload.ToString() + End Function + Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray Dim ArrayPS As New JArray For Each RowPS As DataRow In DtPS.Rows @@ -2215,6 +2239,25 @@ Public Class E141 : Implements IHttpHandler Return Retorno End Function + Private Function ActualizarExistenciasJson(Todos As Boolean) As String + Dim payload = New JObject() + + Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0 + + Dim DtPS As DataTable = Nothing + Using ObjPS As New ClsProductosServicios + If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then + DtPS = ObjPS.DtResultados.Copy() + End If + End Using + + If DtPS IsNot Nothing Then + payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS))) + End If + + Return payload.ToString() + End Function + Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray Dim ArrayPS As New JArray For Each RowPS As DataRow In DtPS.Rows @@ -2233,7 +2276,7 @@ Public Class E141 : Implements IHttpHandler #End Region -#Region "A C T U A L I Z A R - E X I S T E N C I A S" +#Region "A C T U A L I Z A R - V E N D E D O R E S" Private Function ActualizarVendedores(Todos As Boolean) As Boolean Dim Retorno As Boolean = False diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 43e27b789..50ad3494f 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -35,11 +35,33 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState context.Response.Close() context.Response.End() Else - context.Response.ContentType = "text/plain" + If context.Request("metodo").Contiene("Contabilizapoliza", "RevisaConexion") Then + context.Response.ContentType = "text/json" + Else + context.Response.ContentType = "text/plain" + + End If End If Try Select Case context.Request("metodo") + Case "Contabilizapoliza" + Dim CvePrePoliza As Integer = context.Request("CvePrePoliza").ToString().ToEntero() + Dim CveUsuario As Integer = context.Request("CveUsuario").ToString().ToEntero() + Dim CveEmpresa As Integer = context.Request("CveEmpresa").ToString().ToEntero() + GuardaLog(String.Format("?metodo=Contabilizapoliza&CvePrePoliza={0}&CveUsuario={1}&CveEmpresa ={2}", CvePrePoliza, CveUsuario, CveEmpresa)) + ActualizaPrePoliza(context) + Dim obj As New ADSNetLibrary.SIGAPI.Models.ResponseModel(Of Object)() + obj.Result = DateTime.Now.ToString() + Dim retorno = JsonConvert.SerializeObject(obj).ToString() + context.Response.Write(retorno) + context.Response.StatusCode = 200 + Case "RevisaConexion" + Dim obj As New ADSNetLibrary.SIGAPI.Models.ResponseModel(Of Object)() + obj.Result = DateTime.Now.ToString() + Dim retorno = JsonConvert.SerializeObject(obj).ToString() + context.Response.Write(retorno) + context.Response.StatusCode = 200 Case "getps" GETPS(context) Case "getps2" @@ -70,6 +92,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState ActualizaPrePoliza(context) Case "getpersonal" getpersonal(context) + Case "getcuentascontables" + GetCuentasContables(context) Case "getcontratos" GetContratos(context) Case "GettingCURP" @@ -558,6 +582,15 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End If If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then + 'Dim i As Integer = 0 'limpieza de columnas + 'While i < DtRetorno.Columns.Count + ' If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then + ' DtRetorno.Columns.RemoveAt(i) + ' Else + ' i = i + 1 + ' End If + 'End While + DtRetorno.Columns("CveCliente").ColumnName = "id" DtRetorno.Columns(ColumnaNombre).ColumnName = "text" retorno = JsonConvert.SerializeObject(DtRetorno).ToString @@ -593,11 +626,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState ObjProveedores.Dispose() End If - 'Dim ObjProveedores As New ClsCompProveedores - 'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then - ' DtRetorno = ObjProveedores.DtResultados - 'End If - 'ObjProveedores.Dispose() Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name)) @@ -606,14 +634,24 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End If If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then + Dim i As Integer = 0 'limpieza de columnas + While i < DtRetorno.Columns.Count + If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then + DtRetorno.Columns.RemoveAt(i) + Else + i = i + 1 + End If + End While + DtRetorno.Columns("CveProveedor").ColumnName = "id" DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text" retorno = JsonConvert.SerializeObject(DtRetorno).ToString context.Response.Write(retorno) + DtRetorno.Dispose() Else context.Response.Write("[]") End If - DtRetorno.Dispose() + Return retorno End Function #End Region @@ -1147,11 +1185,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState ObjPersonal.Dispose() End If - 'Dim ObjProveedores As New ClsCompProveedores - 'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then - ' DtRetorno = ObjProveedores.DtResultados - 'End If - 'ObjProveedores.Dispose() Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}") If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'") @@ -1159,6 +1192,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End If If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then + DtRetorno.Columns("CvePersonal").ColumnName = "id" DtRetorno.Columns("NombreCompleto").ColumnName = "text" retorno = JsonConvert.SerializeObject(DtRetorno).ToString @@ -1205,4 +1239,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Return retorno End Function #End Region + +#Region "Get Cuentas" + Private Function GetCuentasContables(ByVal context As HttpContext) As String + Dim retorno As String = "" + Dim DtRetorno As DataTable = Nothing + + Dim usuario As Usuario = UsuarioActual(context) + Dim CveEmpresa As String + If IsNothing(usuario) Then + context.Response.Write("") + Else + CveEmpresa = usuario.CveEmpresa + + Dim Name = IfNull(context.Request("Name"), "-1").ToString + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(-1, "-1", 1, CveEmpresa, Nombre:=Name) Then + DtRetorno = ObjConta.DtResultados + End If + ObjConta.Dispose() + + End If + + If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then + Dim i As Integer = 0 'limpieza de columnas + While i < DtRetorno.Columns.Count + If Not DtRetorno.Columns(i).ColumnName.Contiene("CveCuenta", "CtaCodigo") Then + DtRetorno.Columns.RemoveAt(i) + Else + i = i + 1 + End If + End While + DtRetorno.Columns("CveCuenta").ColumnName = "id" + DtRetorno.Columns("CtaCodigo").ColumnName = "text" + retorno = JsonConvert.SerializeObject(DtRetorno).ToString + context.Response.Write(retorno) + Else + context.Response.Write("[]") + End If + + DtRetorno.Dispose() + Return retorno + End Function +#End Region End Class \ No newline at end of file diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index c59201a8f..e96343893 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -715,7 +715,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas TCDoc = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal(); } - Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal(); + Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal().RoundSQL(); ImporteMN = Importe; ImporteComplementaria = 0; @@ -756,8 +756,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas } } - ImporteMN = Math.Round(ImporteMN, 2, MidpointRounding.AwayFromZero); - ImporteComplementaria = Math.Round(ImporteComplementaria, 2, MidpointRounding.AwayFromZero); + ImporteMN = ImporteMN.RoundSQL(); + ImporteComplementaria = ImporteComplementaria.RoundSQL(); if (tCveMoneda != 1) { @@ -825,7 +825,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas } else { - ImporteMNBanco = ImporteBanco * TC; + ImporteMNBanco = (ImporteBanco * TC).RoundSQL(); ImporteComplementaria = 0; } } diff --git a/Bin/ClosedXML.dll b/Bin/ClosedXML.dll index 4065a321f..0bdfccd36 100644 Binary files a/Bin/ClosedXML.dll and b/Bin/ClosedXML.dll differ diff --git a/Bin/DocumentFormat.OpenXml.dll b/Bin/DocumentFormat.OpenXml.dll index 1698758e5..7978b0462 100644 Binary files a/Bin/DocumentFormat.OpenXml.dll and b/Bin/DocumentFormat.OpenXml.dll differ diff --git a/Bin/Microsoft.Owin.Security.OAuth.dll b/Bin/Microsoft.Owin.Security.OAuth.dll index 8f95e3053..650eb379b 100644 Binary files a/Bin/Microsoft.Owin.Security.OAuth.dll and b/Bin/Microsoft.Owin.Security.OAuth.dll differ diff --git a/Bin/Microsoft.Owin.Security.dll b/Bin/Microsoft.Owin.Security.dll index e162f2d25..3bf4f0a88 100644 Binary files a/Bin/Microsoft.Owin.Security.dll and b/Bin/Microsoft.Owin.Security.dll differ diff --git a/Bin/Microsoft.Owin.dll b/Bin/Microsoft.Owin.dll index 3b7a0ffe8..0e19530d5 100644 Binary files a/Bin/Microsoft.Owin.dll and b/Bin/Microsoft.Owin.dll differ diff --git a/Bin/WebGrease.dll b/Bin/WebGrease.dll index 1d308f8ed..a6a80d37f 100644 Binary files a/Bin/WebGrease.dll and b/Bin/WebGrease.dll differ diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 1d606c9e3..6015bbbd6 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -4422,7 +4422,7 @@
-
+
8% diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 509fa9327..ce5eb995c 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4621,6 +4621,13 @@ Partial Class Compras_Compras 'End If End If + + 'Compra + Dim CveFactura As Integer = -1 + If Request("CveFactura") IsNot Nothing Then + CveFactura = Request("CveFactura").ToString.ToEntero + End If + 'si el registro es manual, toma el mismo dato If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal @@ -4637,14 +4644,13 @@ Partial Class Compras_Compras - 'Compra If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble, LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble, TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen, - CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, EsImportacion:=EsImportacion) Then + CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, EsImportacion:=EsImportacion, CveFactura:=CveFactura) Then ViewState("CveCompra") = ObjCompras.CveCompra If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString @@ -8424,16 +8430,20 @@ Partial Class Compras_Compras Msg.Append("¿Desea realizar una evaluacion al proveedor?") Msg.AppendFormat($"
Evaluar Proveedor.") End If + + BtnGuardar.Enabled = False + UpFacturar.Update() + + Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar) + + Else ObjCompras.RollBack() If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError) End If - BtnGuardar.Enabled = False - UpFacturar.Update() - Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar) End If @@ -18225,12 +18235,12 @@ Partial Class Compras_Compras If Version = "3.3" And CveSATPS > 0 Then Dim DrPSSAT As DataRow = Nothing If CargaXml Then - DrPSSAT = GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS)) + DrPSSAT = GlobalDTPSATPS("-1", CveSATPS).FiltroPrimero("") 'If GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows.Count > 0 Then ' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows(0) 'End If Else - DrPSSAT = GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS)) + DrPSSAT = GlobalDTPSATPS("-1", CveSATPS).FiltroPrimero("") '= GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS)) 'If GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows.Count > 0 Then ' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows(0) 'End If diff --git a/Contabilidad/RegPrePoliza1.aspx.vb b/Contabilidad/RegPrePoliza1.aspx.vb index 24a9d6da5..2dbc8e945 100644 --- a/Contabilidad/RegPrePoliza1.aspx.vb +++ b/Contabilidad/RegPrePoliza1.aspx.vb @@ -857,9 +857,9 @@ Partial Class ContabilidadC_RegPrePoliza Next If CvePeriodo > 0 Then - If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then - MsgError = "No se pudo actualizar el periodo de la nómina" - End If + 'If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then + ' MsgError = "No se pudo actualizar el periodo de la nómina" + 'End If End If If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2b9d9ec0a..136e3c504 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -453,8 +453,6 @@ Partial Class ContabilidadC_RegPrePolizaS End If End If - - divDatosPrincipales.Visible = False divObservaciones.Visible = False UPMovs.Visible = False @@ -1958,7 +1956,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If ObjConta2.Dispose() - If CveCuenta <= 0 Then + If CveCuenta <= 0 AndAlso CveConceptoContable <> 30 Then ' concepto 30-Bancos, tomará la cuetna de las especificaciones que se hagan enel modal Alert(String.Format("La cuenta {0} no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString)) DtMovimientos.Clear() Exit For diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 886765323..3202ecc39 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -165,13 +165,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If LbAgregar.Text = "Agregar" Then If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then ErrorString = "Error al agregar" End If ElseIf LbAgregar.Text = "Actualizar" Then If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then ErrorString = "Error al actualizar" End If End If diff --git a/Contabilidad2/RepEstadoActividades.aspx.vb b/Contabilidad2/RepEstadoActividades.aspx.vb index 0141383de..c9d8051e6 100644 --- a/Contabilidad2/RepEstadoActividades.aspx.vb +++ b/Contabilidad2/RepEstadoActividades.aspx.vb @@ -248,7 +248,7 @@ Partial Class AC_RepEstadoActividades 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray 'e.Row.ControlStyle.ForeColor = Drawing.Color.White e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then + ElseIf e.Row.DBCampo("CtaMayor").ToString.Contiene("3", "4") Then 'e.Row.CssClass = "SubTotales3" e.Row.ControlStyle.Font.Bold = True End If @@ -277,7 +277,7 @@ Partial Class AC_RepEstadoActividades 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray 'e.Row.ControlStyle.ForeColor = Drawing.Color.White e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then + ElseIf e.Row.DBCampo("CtaMayor").ToString.Contiene("3", "4") Then 'e.Row.CssClass = "SubTotales" e.Row.ControlStyle.Font.Bold = True End If diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index c6cce12bd..3470619bb 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1233,14 +1233,14 @@ Partial Class General_SaldosIniciales Dim Folio As Integer = Row("Folio").ToString.ToEntero Dim Fecha As Date = Row("Fecha").ToString.ToDate Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate - Dim ImpuestoLocal As Double = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDouble, 0.0) + Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0D) Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString.ToDouble, 0.0) Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal Dim IVA As Decimal = Row("IVA").ToString.ToDecimal Dim Total As Decimal = Row("Total").ToString.ToDecimal Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero - Dim RetIVA As Double = Row("Ret IVA").ToString.ToDouble + Dim RetIVA As Decimal = Row("Ret IVA").ToString.ToDecimal Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble Dim Moneda As String = Row("Moneda").ToString Dim TipoCambio As String = Row("Tipo Cambio").ToString @@ -1249,7 +1249,6 @@ Partial Class General_SaldosIniciales Dim CveVendedor As Integer = 0 Dim IEPS As Decimal = 0 'Row("IEPS").ToString.ToDecimal Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString.ToEntero - Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0) Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString, "") Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString.ToDecimal, 4), 0) @@ -1300,7 +1299,7 @@ Partial Class General_SaldosIniciales 0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero, CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS, - ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestosLocales) Then + ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestoLocal) Then ErrorVentas = True Exit For End If @@ -1329,14 +1328,22 @@ Partial Class General_SaldosIniciales If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True 'PrePólizaDetalle - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero) Then ErrorVentas = True : Exit For - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then ErrorVentas = True : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For If IVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For End If 'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString, 38, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For + If RetIVA > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio.ToString, 8, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=RetIVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For + End If + If ImpuestoLocal > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, Folio.ToString, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImpuestoLocal, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For + End If + + If UsaComplementaria Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Folio.ToString, 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal - Total, TipoCambio:=TipoCambio.ToDecimal) Then ErrorVentas = True : Exit For End If diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 11ada3319..2a458ea07 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1331,7 +1331,7 @@ Partial Class Inventarios_EntradasSalidas tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero End If - If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.Contiene(10276) Then + If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then FechaCaducidadVal = MinFecha FechaCaducidad = MinFecha Lote = "" @@ -3845,16 +3845,16 @@ Partial Class Inventarios_EntradasSalidas Dim ObjInventario As New ClsInventarios Dim CveUM As Integer Dim Mensaje As String = "" - Dim FechaCaducidad As Date - Dim lote As String + 'Dim FechaCaducidad As Date + 'Dim lote As String If ObjProductosServicios.GetPS(DdlPSSalida.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then If ObjProductosServicios.DtResultados.Rows.Count > 0 Then CveUM = ObjProductosServicios.CveUnidadMedida.ToString.ToEntero End If End If - FechaCaducidad = If(ObjProductosServicios.AplicaCaducidad, TxtCaducidadSalida.Text.ToDate, MinFecha) - lote = If(ObjProductosServicios.AplicaLote, TxtLoteSalida.Text.ToString, "-1") + Dim Lote As String = If(TxtLoteSalida.Text = "", "", TxtLoteSalida.Text) + Dim FechaCaducidad As Date = If(TxtCaducidadSalida.Text = "", MinFecha.ToShortDateString, TxtCaducidadSalida.Text).ToDate If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then If Not DdlPSSalida.SelectedValue.ToEntero > 0 Then diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 0c0018eb9..f0df0fce3 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -973,8 +973,8 @@ Partial Class Inventarios_EntregaAlmacen If CBool(e.Row.DBCampo("AplicaCaducidad")) Then e.Row.FCTextBox("TxtCaducidad").Visible = True e.Row.FCLinkButton("LnkCaducidad").Visible = True - e.Row.FCTextBox("TxtCaducidad").ReadOnly = True - CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False + e.Row.FCTextBox("TxtCaducidad").readonly = True + CType(e.row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False 'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then @@ -2275,6 +2275,7 @@ Partial Class Inventarios_EntregaAlmacen If ErrorMovInv Then Exit For + Else ErrorMovInv = True End If @@ -2601,27 +2602,24 @@ Partial Class Inventarios_EntregaAlmacen Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero()) Dim CveSeccionAlmacen As Integer = 0 Dim ValorTraspaso As Decimal = 0 - - 'SI TIENE APARTADOS DEBE GENERAR LOS TRASPASOS - If DtTempApartados.Rows.Count > 0 Then - + If DtTempApartados IsNot Nothing AndAlso DtTempApartados.Rows.Count > 0 Then For Each Dr As DataRow In DtTempApartados.Rows If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then - CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, - Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, - CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9") - FolioSalida = ObjInventario.Folio - CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero() + CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, + Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, + CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9") + FolioSalida = ObjInventario.Folio + CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero() + + Dim DrMovto = DtTraspasos.NewRow + DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero() + DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero() + DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado + DrMovto("FolioSalida") = FolioSalida + DtTraspasos.Rows.Add(DrMovto) + End If - Dim DrMovto = DtTraspasos.NewRow - DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero() - DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero() - DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado - DrMovto("FolioSalida") = FolioSalida - DtTraspasos.Rows.Add(DrMovto) - End If - If Not CveMovimientoSalidaApartado > 0 Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") @@ -2636,85 +2634,82 @@ Partial Class Inventarios_EntregaAlmacen CveSeccionAlmacen = -3 If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then - ErrorMovInv = True - TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") - Exit For - End If - Next - - If Not ErrorMovInv Then - - Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CvePrePolizaTraspaso > 0 Then - - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then ErrorMovInv = True + TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") + Exit For End If + Next - For Each Dr1 As DataRow In DtTraspasos.Rows - CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero() + If Not ErrorMovInv Then + + Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CvePrePolizaTraspaso > 0 Then + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then + ErrorMovInv = True + End If + + For Each Dr1 As DataRow In DtTraspasos.Rows + CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero() CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(), - If Not CveMovimientoEntradaApartado > 0 Then + CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, + CveCliente:=CveCliente, Modulo:="RE/G10") + FolioEntrada = ObjInventario.Folio + + If Not CveMovimientoEntradaApartado > 0 Then ErrorMovInv = True - TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.") - Exit For - End If + TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.") + Exit For + End If - Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado - Dr1("FolioEntrada") = FolioEntrada + Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado + Dr1("FolioEntrada") = FolioEntrada - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL - For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL + For Each Dr As DataRow In ObjInventario.DtResultados.Rows - CveSeccionAlmacen = -3 + CveSeccionAlmacen = -3 - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then - ErrorMovInv = True - TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") - Exit For - End If - Next - End If + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then + ErrorMovInv = True + TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") + Exit For + End If + Next + End If - If ErrorMovInv Then Exit For + If ErrorMovInv Then Exit For - If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then - ErrorMovInv = True - End If - Next + If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then + ErrorMovInv = True + End If + Next - Else - ErrorMovInv = True + Else + ErrorMovInv = True + End If End If - End If - + End If End If End If - End If - End If - - End If - - End If End If - End If - - 'QUEMAR REMISIONES - - 'CARGA REMISIONES DE LA VENTA DEVUELTA - - 'CARGA REMISIONES DE LA VENTA DEVUELTA - If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then - DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0") - Else - ErrorMovInv = True - End If - - If Not ErrorMovInv Then + + 'QUEMAR REMISIONES + If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then + Dim DtDevRem As New DataTable + + 'CARGA REMISIONES DE LA VENTA DEVUELTA + If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then + DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0") + Else + ErrorMovInv = True + End If + + If Not ErrorMovInv Then If DtDevRem.Rows.Count > 0 Then For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem"}).Rows If Not ObjInventario.ActualizarEsDevolucionVenta(DrMovtos("CveRem").ToString().ToEntero(), 2) Then @@ -3280,10 +3275,10 @@ Partial Class Inventarios_EntregaAlmacen 'sino es transitorio, los transitorios, ya no se hace otro movimiento ConceptoMovimiento = If(ChkTransitorio.Checked, 2, 27) - Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino) - CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, - Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino, - Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP) + Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino) + CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, + Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino, + Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP) FolioEntrada = ObjInventario.Folio If CveMovimientoEntrada > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 7e8f78fbe..720f688d5 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -605,14 +605,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("") Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero - Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) - If AplicaSeccion Then - CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - End If + 'Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) + 'If AplicaSeccion Then + ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + 'End If If AplicaSerie Then For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows 'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.DataKey("Serie").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Gvr.DataKey("Serie").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida" Exit For diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 0585cb4a3..48675aa7f 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -3009,10 +3009,8 @@ Partial Class Inventarios_RecepcionAlmacen Row("CveUM") = GvRow.DataKey("CveUM").ToEntero() DtPSVirtual.Rows.Add(Row) End If - End If Next - End If Next @@ -3065,36 +3063,32 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero()).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero() + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD") + If CveMovimientoVirtual > 0 Then + FolioVirtual = ObjInventario.Folio - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD") + For Each RowUsado As DataRow In DtPSVirtual.Rows + Dim CvePS = RowUsado("CvePS").ToString().ToEntero() + Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal() + Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() + Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() - If CveMovimientoVirtual > 0 Then - FolioVirtual = ObjInventario.Folio - - For Each RowUsado As DataRow In DtPSVirtual.Rows - Dim CvePS = RowUsado("CvePS").ToString().ToEntero() - Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal() - Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() - Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() - - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - ErrorMovInv = True - Exit For - End If - Next - - If SumarImporteUsados Then - If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then - ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal") - End If + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorMovInv = True + Exit For End If + Next - Else - ErrorMovInv = True + If SumarImporteUsados Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then + ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal") + End If End If - End If + Else + ErrorMovInv = True + End If Else ErrorMovInv = True End If diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index ff91f38ce..a50ab4f25 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -2761,7 +2761,7 @@ Partial Class Inventarios_RecepcionUsados CveClasificacion = drPS("CveClasificacion").ToString.ToEntero Dim Arr = PS.Split("-"c) - If Arr.Count > 0 Then + If Arr.Count > 1 Then If (DdlBCIAjuste.Items.FindByText(Arr(1).ToString) IsNot Nothing) Then DdlBCIAjuste.SelectedValueExist(DdlBCIAjuste.Items.FindByText(Arr(1).ToString).Value) End If diff --git a/Inventarios/ReconstruirCostos.aspx.vb b/Inventarios/ReconstruirCostos.aspx.vb index 1f082cf1d..6b714f911 100644 --- a/Inventarios/ReconstruirCostos.aspx.vb +++ b/Inventarios/ReconstruirCostos.aspx.vb @@ -37,10 +37,9 @@ Partial Class Inventario_ReconstruirCostos If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then DdlMarca.DataSource = ObjPS.DtResultados - DdlMarca.DataBind() - End If ObjPS.Dispose() + DdlMarca.DataBind() End Sub Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click CargaDatos() diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 647d737bd..320609c34 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -331,7 +331,7 @@
- Ver Compra + VerCompra
@@ -454,7 +454,7 @@
- + diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 303283d94..4187a209a 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -344,7 +344,7 @@ Partial Class Inventarios_TraspasoAlmacen 'End If If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, Serie, CveClasificacion, EstatusExistencia") + DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, Serie, CveSeccionAlmacen, CveClasificacion, EstatusExistencia") CargaGvDatos() End If diff --git a/Nomina/ConceptoNomina.aspx b/Nomina/ConceptoNomina.aspx index f691d8511..5e4827a94 100644 --- a/Nomina/ConceptoNomina.aspx +++ b/Nomina/ConceptoNomina.aspx @@ -203,7 +203,7 @@
- +
diff --git a/Nomina/ConceptoNomina.aspx.cs b/Nomina/ConceptoNomina.aspx.cs index 2c9f70bee..b798fb34e 100644 --- a/Nomina/ConceptoNomina.aspx.cs +++ b/Nomina/ConceptoNomina.aspx.cs @@ -271,6 +271,21 @@ public partial class Nomina_CatConcepto : ClsPaginas DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlCtaContable.SelectedValueExist("-1"); } + else + { + + using (ClsContabilidad ObjConta = new ClsContabilidad()) + { + if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa)) + { + + DdlCtaContable.DataSource = ObjConta.DtResultados; + DdlCtaContable.DataBind(); + } + } + DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlCtaContable.SelectedValueExist("-1"); + } } @@ -453,7 +468,14 @@ public partial class Nomina_CatConcepto : ClsPaginas DdlClasificacion.SelectedValueExist(drow["CveClasificacion"]); DdlTipoGasto.SelectedValueExist(drow["CveTipoGasto"]); - DdlCtaContable.SelectedValueExist(drow["IdCtaContable"]); + DdlCtaContable.SelectedValueExist(drow["CveCuenta"]); + //if (UsuarioActual.Empresa.TipoContabilidad == 1) + //{ + //} + //else + //{ + // DdlCtaContable.SelectedValueExist(drow["IdCtaContable"]); + //} DdlConceptoSAT.SelectedValueExist(drow["CveSATConcepto"]); } ObjNomina.Dispose(); diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx index 8aff005bd..0d915c274 100644 --- a/Nomina/Finiquito.aspx +++ b/Nomina/Finiquito.aspx @@ -242,6 +242,13 @@ Indemnización
+
+
+ + +
+
+
Separación unica diff --git a/Nomina/Finiquito.aspx.cs b/Nomina/Finiquito.aspx.cs index 3596e07ff..5b28459b6 100644 --- a/Nomina/Finiquito.aspx.cs +++ b/Nomina/Finiquito.aspx.cs @@ -1062,16 +1062,15 @@ public partial class Nomina_Finiquito : ClsPaginas using (ClsRH ObjPersonal = new ClsRH()) using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL())) { - if (ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked,chkIndemnizacion.Checked ,chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) + if (continuar =ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked,chkIndemnizacion.Checked ,chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) { DataRow da = ObjPersonal.DtResultados.Rows[0]; CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero(); - CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero(); - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); + CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero(); } if (continuar) { - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); + continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa,diasindemnizacion:Txtdiasindemnizacion.Text.ToEntero()); } if (continuar) { @@ -1311,16 +1310,15 @@ public partial class Nomina_Finiquito : ClsPaginas using (ClsRH ObjPersonal = new ClsRH()) using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL())) { - if (ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) + if (continuar =ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0) { DataRow da = ObjPersonal.DtResultados.Rows[0]; CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero(); CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero(); - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); } if (continuar) { - continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa); + continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa, diasindemnizacion: Txtdiasindemnizacion.Text.ToEntero()); } if (continuar) { loadsobrerecibo(onom); } diff --git a/Nomina/ISRCalculoAnual.aspx b/Nomina/ISRCalculoAnual.aspx new file mode 100644 index 000000000..6de631038 --- /dev/null +++ b/Nomina/ISRCalculoAnual.aspx @@ -0,0 +1,128 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ISRCalculoAnual.aspx.cs" Inherits="Nomina_ISCalculoAnual" %> + + + + + + + Calculo anual de ISR + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+ + +
+ +
+
+
+ <%----%> +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/Nomina/ISRCalculoAnual.aspx.cs b/Nomina/ISRCalculoAnual.aspx.cs new file mode 100644 index 000000000..f6528e3b0 --- /dev/null +++ b/Nomina/ISRCalculoAnual.aspx.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Nomina_ISCalculoAnual : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + + DataTable dtejercicio = new DataTable(); + using (ClsNominas objnom = new ClsNominas()) + { + if (objnom.GetEjercicios(UsuarioActual.CveEmpresa)) + { + dtejercicio = objnom.DtResultados; + } + } + DdlEjercicios.DataSource = dtejercicio; + DdlEjercicios.DataBind(); + } + + protected void LnkConsultar_Click(object sender, EventArgs e) + { + CargaPersonalISRAnual(); + } + + protected void CargaPersonalISRAnual() + { + DataTable dtdatos = new DataTable(); + int ejercicio = DdlEjercicios.SelectedValue.ToEntero(); + using (ClsNominas objnom = new ClsNominas()) + { + if (objnom.PersonalISRAnual(-1, UsuarioActual.CveEmpresa, ejercicio)) + { + dtdatos = objnom.DTSetResultados.Tables[0]; + } + } + GVPersonalISRAnual.DataSource = dtdatos; + GVPersonalISRAnual.DataBind(); + upDatosPers.Update(); + } +} \ No newline at end of file diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index bb73f7840..72004b2fa 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -1,103 +1,309 @@ -<%@ Page Title="Nómina - Nómina" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Nomina.aspx.vb" Inherits="Nomina_Nomina" %> +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Nomina.aspx.cs" Inherits="Nomina_Nomina2" %> - - + - - <%-- Nómina --%> + + Nominas + + + + + +
  • + Autorizar +
  • +
  • + Registrar provisión +
  • +
  • + Layout banco +
  • +
  • + Ver provisión +
  • +
  • + Ver provisión Asimilados +
  • +
  • + Timbrar todos +
  • +
  • + Incidencias asistencia +
  • +
  • + Reporte percepciones y deducciones +
  • +
  • + Reporte acumulados +
  • +
  • + Empleado concepto +
  • +
  • + Carga masiva de asistencia +
  • +
  • + Lista de raya +
  • +
  • + Cargar masiva de conceptos +
  • +
  • + Tablas de cálculo +
  • +
  • + Cálculo ISR +
  • +
  • + Ir a asistencia +
  • +
  • + Nómina tabular +
  • +
  • + Simulador +
  • +
  • + Procesar archivo SUA +
  • +
  • + Descargar archivos SUA +
  • +
  • + Recibos timbrados +
  • +
    + + + + + + +
    +
    - + + + - + +
    - -
    - -
    - - -
    - - - -
    - - -
    - - - -
    - +
    - - - + +
    + + +
    + +
    + + +
    + + + +
    +
    + + <%----%> + <%----%> + + + + + Recibos +
    +
    + +
    -
    +
    + +
    +
    +
    + Forma de pago
    + + + + + +
    +
    +
    +
    + + Días extras +
    +
    +
    diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index c5bac7099..c76ba4672 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -4514,7 +4514,7 @@ Partial Class RH_Personal VacFolioActual = VacFolioActual + 1 Dim objRH As New ClsRH 'Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones) - Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil) + Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil, CveTipoPago:=DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras:=TxtVacDiasExtra.Text.ToEntero()) If objRH.DtResultados.Rows.Count > 0 Then Dim ShowError As String = objRH.DtResultados.Rows(0)("ShowError").ToString() If ShowError.Length > 0 Then @@ -4768,11 +4768,6 @@ Partial Class RH_Personal Protected Sub BtnEditarDiaVacacionModal_Click(sender As Object, e As EventArgs) Handles BtnEditarDiaVacacionModal.Click - Dim objRH As New ClsRH() - - - - Dim FileExtension As String = "-1" Dim Filesgral As List(Of Archivo) = TxtFileFormatoVacaciones.getfiles().Archivos Dim Filename As String = "" @@ -4784,36 +4779,27 @@ Partial Class RH_Personal Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}" Dim tempArray() As String tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) - Dim rutaDestino As String = $"{UsuarioActual.Empresa.Ruta}Personal\{CvePersonal}\Vacaciones\{Documento}" - If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\") Then System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\") End If - - If System.IO.File.Exists(rutaDestino) Then System.IO.File.Delete(rutaDestino) End If - System.IO.File.Move(fileItem.FileUrl, rutaDestino) - TxtFileFormatoVacaciones.Text = "" - Catch ex As Exception OnError("Error al cargar Formato vacaciones", ex) End Try Next If Documento.Length > 0 Then - + Dim objRH As New ClsRH() If objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, CvePersonal, UsuarioActual.CveUsuario, Documento) Then Alert("La fecha se actualizo correctamente") End If UpModalEditarDiaVacacion.Update() - objRH.Dispose() - CargaVacaciones() CargaVacacionesResumenPeriodoActual() RegistraScript("$('#divEditarDiaVacacion').modal('hide');") @@ -5304,38 +5290,14 @@ Partial Class RH_Personal Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble() Dim Serie As String = TxtLiberarSerie.Text.Trim - Dim MsgError As String = "" Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme) - If CveResultadoSalida > 0 Then - If CveSeccionAlmacenUniforme = 0 Then CveSeccionAlmacenUniforme = -3 'que lo tome por default - Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme) - Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero - If ResultadoDetalleSalida Then + Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme) + Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero + Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) + Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie) - Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) - If CveResultadoEntrada > 0 Then - Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie) - If ResultadoDetalleSalida And ResultadoDetalleEntrada Then - MsgError = "" - Else - Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError) - MsgError = "Error1" - End If - Else - MsgError = "Error1" - End If - - Else - MsgError = "Error1" - End If - Else - MsgError = "Error" - - End If - - - If MsgError = "" Then + If ResultadoDetalleSalida And ResultadoDetalleEntrada Then ObjInventario.Commit() Alert("El resguardo se liberó correctamente") RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalUniforme")) @@ -5344,7 +5306,6 @@ Partial Class RH_Personal Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError) ObjInventario.RollBack() End If - ObjInventario.Dispose() End Sub diff --git a/Sistemas/PopUpCambiaUsuario.aspx.vb b/Sistemas/PopUpCambiaUsuario.aspx.vb index acda2dfa4..2c3b04d80 100644 --- a/Sistemas/PopUpCambiaUsuario.aspx.vb +++ b/Sistemas/PopUpCambiaUsuario.aspx.vb @@ -53,29 +53,30 @@ Partial Class Sistemas_PopUpCambiaUsuario End If If splitedtext.Length > 0 Then - Select Case splitedtext(0).ToUpper() - Case "VSH" : CveEmpresa = "7" - Case "JAM" : CveEmpresa = "119" - Case "COMPUPROVEEDORES" : CveEmpresa = "72" - Case "DNDIFUSA" : CveEmpresa = "80" - Case "SOGO" : CveEmpresa = "8" - Case "BDH" : CveEmpresa = "140" - Case "ECONOLLANTAS" : CveEmpresa = "141" - End Select - End If - DdlEmpresa.DataBind() - DdlEmpresa.SelectedValue = CveEmpresa - - 'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero) - 'DdlRol.DataBind() - 'DdlRol.Items.Insert(0, New ListItem("Todos", "-1")) - - TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID) - - CargaUsuarios() - 'LblUsuario.Text = usuarioactual. - + Select Case splitedtext(0).ToUpper() + Case "VSH" : CveEmpresa = "7" + Case "JAM" : CveEmpresa = "119" + Case "COMPUPROVEEDORES" : CveEmpresa = "72" + Case "DNDIFUSA" : CveEmpresa = "80" + Case "SOGO" : CveEmpresa = "8" + Case "BDH" : CveEmpresa = "140" + Case "ECONOLLANTAS" : CveEmpresa = "141" + Case "SERVEC" : CveEmpresa = "153" + End Select End If + DdlEmpresa.DataBind() + DdlEmpresa.SelectedValue = CveEmpresa + + 'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero) + 'DdlRol.DataBind() + 'DdlRol.Items.Insert(0, New ListItem("Todos", "-1")) + + TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID) + + CargaUsuarios() + 'LblUsuario.Text = usuarioactual. + + End If End Sub diff --git a/Site.master.vb b/Site.master.vb index 899461f8d..d187dbef2 100644 --- a/Site.master.vb +++ b/Site.master.vb @@ -320,7 +320,7 @@ Partial Class Site Dim ClassActive As String CveModuloPadreSeleccionado = 0 : CveModuloHijoSeleccionado = 0 : CveModuloNietoSeleccionado = 0 - Dim strdomain = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, "") + Dim strdomain = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, "").Replace("https://", "http://") If Request.Url.Port <> 80 Then strdomain = strdomain.Replace(String.Format(":{0}", Request.Url.Port), "") End If diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index eb1ea5c8c..eab05b55b 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -118,7 +118,7 @@ Partial Class CatClasificaciones 'End If 'Cuenta.Dispose() Else - If UsuarioActual.Empresa.TipoContabilizacion = 2 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 Then DivCuentaIngresos.Visible = False DivCuentaCostos.Visible = False DivCuentaGasto.Visible = False @@ -224,17 +224,26 @@ Partial Class CatClasificaciones Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1) - Dim ObjEmpresa As New ClsSisEmpresas - Dim Empresa As Empresa = Nothing - If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then - Empresa = ObjEmpresa.Empresa - Dim ObjContabilidad As New ClsContPAQi(Empresa) - If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then - DtCuentasContables = ObjContabilidad.DtResultados + + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + + Dim ObjEmpresa As New ClsSisEmpresas + Dim Empresa As Empresa = Nothing + If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then + Empresa = ObjEmpresa.Empresa + Dim ObjContabilidad As New ClsContPAQi(Empresa) + If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then + DtCuentasContables = ObjContabilidad.DtResultados + End If + ObjContabilidad.Dispose() End If - ObjContabilidad.Dispose() + ObjEmpresa.Dispose() + ElseIf UsuarioActual.Empresa.TipoContabilizacion = 2 Then + DdlCuentaGasto.DataValueField = "CveCuenta" + DdlCuentaGasto.DataTextField = "Cuenta" End If - ObjEmpresa.Dispose() + + End Sub Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click diff --git a/Ventas/RepPS.aspx b/Ventas/RepPS.aspx index 7c3aeed05..48d0adee4 100644 --- a/Ventas/RepPS.aspx +++ b/Ventas/RepPS.aspx @@ -68,7 +68,7 @@ Excel
  • - Reporte Diario + Reporte Diario
  • @@ -222,6 +222,53 @@ + + + + + + + + diff --git a/Ventas/RepPS.aspx.vb b/Ventas/RepPS.aspx.vb index 55f38afb9..cf7a1a120 100644 --- a/Ventas/RepPS.aspx.vb +++ b/Ventas/RepPS.aspx.vb @@ -37,7 +37,7 @@ Partial Class Ventas_RepPS End If If UsuarioActual.TienePermisoProceso(320) OrElse UsuarioActual.CveRol = 1 Then - LnkRepDiario.Visible = True + HLReporteDiario.Visible = True End If @@ -49,6 +49,8 @@ Partial Class Ventas_RepPS Private Sub CargaDatosIniciales() txtFechaI.Text = $"01/{Now.Month}/{Now.Year}" txtFechaF.Text = Now.ToString("dd/MM/yyyy") + + TxtFechaConsulta.Text = Now.ToString("dd/MM/yyyy") End Sub Private Sub CargaCombos() @@ -237,12 +239,12 @@ Partial Class Ventas_RepPS #End Region - Protected Sub LnkRepDiario_Click(sender As Object, e As EventArgs) + Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click Dim CveMoneda As Integer = -1 Dim TC As Integer = 1 Dim TCEspecifico As Decimal = -1 - Dim FechaConsulta As DateTime = Now + Dim FechaConsulta As DateTime = TxtFechaConsulta.Text.ToDateTime() Dim DataSet As DataSet = New DataSet Dim ObjVentas As New ClsVentas() @@ -276,6 +278,8 @@ Partial Class Ventas_RepPS CellRangeTitulo.Style.HorizontalAlignment = HorizontalAlignmentStyle.Center #Region "V E N T A S - L L A N T A S, R I N E S, A L I N E A C I O N E S" + Dim CeldaTotalVentaAcumulada As ExcelCell = Nothing + worksheet.Cells(2, 0).Value = "Sucursal" 'TITULO DE LLANTAS worksheet.Cells.GetSubrangeAbsolute(1, 1, 1, 3).Merged = True @@ -322,7 +326,9 @@ Partial Class Ventas_RepPS 'INICIA DESDE LA CUARTA FILA Dim IdxSucursalesLlantasAlin As Integer = 3 + Dim idxTabla As Integer = 0 For Each Row As DataRow In DtSucursalesLLantasAlin.Rows + idxTabla += 1 worksheet.Cells(IdxSucursalesLlantasAlin, 0).Value = Row("SubProyecto") worksheet.Cells(IdxSucursalesLlantasAlin, 1).Value = Row("LlantasCantidadAnterior") @@ -345,6 +351,10 @@ Partial Class Ventas_RepPS 'worksheet.Cells(IdxSucursalesLlantasAlin, 12).Value = Row("VentaAcumulada") worksheet.Cells(IdxSucursalesLlantasAlin, 12).Formula = $"=SUM({worksheet.Cells(IdxSucursalesLlantasAlin, 10).Name}:{worksheet.Cells(IdxSucursalesLlantasAlin, 11).Name})" + If idxTabla = DtSucursalesLLantasAlin.Rows.Count Then + CeldaTotalVentaAcumulada = worksheet.Cells(IdxSucursalesLlantasAlin, 12) + End If + Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin, 0, IdxSucursalesLlantasAlin, 12).Style StyleData.Font.Weight = ExcelFont.BoldWeight StyleData.Font.Name = "Calibri" @@ -368,11 +378,336 @@ Partial Class Ventas_RepPS 'LA FILA DE LOS TOTALES DEBE ESTAR EN NEGITAS worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin - 1, 0, IdxSucursalesLlantasAlin - 1, 12).Style.Font.Weight = ExcelFont.BoldWeight + +#End Region + +#Region "L L A N T A S M E S A Ñ O A N T E R I O R R E S U M E N" + Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxSucursalesLlantasAlin + 1 + + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes" + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS" + worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %" + + Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style + StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight + StyleTitleTable6.Font.Name = "Calibri" + StyleTitleTable6.Font.Size = 8 * 20 + StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center + + + Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5) + 'INICIA DESDE LA CUARTA FILA + Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1 + + For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() + " - LLANTAS" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior") + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas") + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})" + + Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style + StyleData.Font.Weight = ExcelFont.NormalWeight + StyleData.Font.Name = "Calibri" + StyleData.Font.Size = 8 * 20 + StyleData.VerticalAlignment = VerticalAlignmentStyle.Center + StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + IdxMesAnioAnteriorLlantasResumen += 1 + Next + + IdxMesAnioAnteriorLlantasResumen += 1 + + 'RESUMEN DE METAS + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = "Mes" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = "Meta" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year - 1)) + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Value = "DIF %" + + Dim StyleTitleTableMeta = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style + StyleTitleTableMeta.Font.Weight = ExcelFont.BoldWeight + StyleTitleTableMeta.Font.Name = "Calibri" + StyleTitleTableMeta.Font.Size = 8 * 20 + StyleTitleTableMeta.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTableMeta.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTableMeta.HorizontalAlignment = HorizontalAlignmentStyle.Center + + IdxMesAnioAnteriorLlantasResumen += 1 + + For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() + " - LLANTAS" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = 0 + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantasAnioAnterior") + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})" + worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})" + + Dim StyleDataMeta = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style + StyleDataMeta.Font.Weight = ExcelFont.NormalWeight + StyleDataMeta.Font.Name = "Calibri" + StyleDataMeta.Font.Size = 8 * 20 + StyleDataMeta.VerticalAlignment = VerticalAlignmentStyle.Center + StyleDataMeta.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleDataMeta.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleDataMeta.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + IdxMesAnioAnteriorLlantasResumen += 1 + Next + + DtMesAnioAnteriorLLantasResumen.Dispose() +#End Region + +#Region "F R A N Q U I C I A S R E S U M E N" + + Dim TotalFranquicias As Decimal = DtSucursalesLLantasAlin.FiltroPrimeroValor("LlantasCantidadAcumulada", "CveSubProyecto=11842").ToDecimal() + DtSucursalesLLantasAlin.Dispose() + + Dim IdxRefFranquiciasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + + Dim columnRefFranquiciasResumen As Integer = 6 + + 'PRM 19 + worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen).Value = $"PRM {Now.Year - 1}" + worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 1).Value = "ALM PS" + worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 2).Value = "" + worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Value = TotalFranquicias + + 'TOMA EL VALOR DE DIF LLANTAS + worksheet.Cells(IdxRefFranquiciasResumen + 1, columnRefFranquiciasResumen).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen - 4, 3).Name})" + + worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 1).Value = $"FRANQ {Now.Year}" + worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Value = 4988 + + worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen).Value = $"PRM {Now.Year}" + worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 1).Value = "" + worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2).Formula = $"=({worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Name} - {worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Name})" + worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 3).Formula = $"+({worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2)})" + + 'TOMA EL VALOR DE DIF LLANTAS METAS + worksheet.Cells(IdxRefFranquiciasResumen + 4, columnRefFranquiciasResumen).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen - 1, 3).Name})" + + + Dim StyleTitleTableFR = worksheet.Cells.GetSubrangeAbsolute(IdxRefFranquiciasResumen, columnRefFranquiciasResumen, IdxRefFranquiciasResumen + 4, columnRefFranquiciasResumen + 3).Style + StyleTitleTableFR.Font.Weight = ExcelFont.BoldWeight + StyleTitleTableFR.Font.Name = "Calibri" + StyleTitleTableFR.Font.Size = 8 * 20 + StyleTitleTableFR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTableFR.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTableFR.HorizontalAlignment = HorizontalAlignmentStyle.Center + + 'Dim StyleDataFranquicias = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style + 'StyleData.Font.Weight = ExcelFont.NormalWeight + 'StyleData.Font.Name = "Calibri" + 'StyleData.Font.Size = 8 * 20 + 'StyleData.VerticalAlignment = VerticalAlignmentStyle.Center + 'StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center + 'StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + 'StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + IdxRefFranquiciasResumen += 1 + + +#End Region + +#Region "A Ñ O R E S U M E N" + Dim IdxRefAnioResumen As Integer = IdxRefFranquiciasResumen - 1 + + Dim columnRefAnioResumen As Integer = columnRefFranquiciasResumen + 5 + + 'AÑO ANTERIOR + worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen).Value = Now.Year - 1 + Dim CellAnioAnterior = worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1) + CellAnioAnterior.Value = 0 + + 'AÑO ACTUAL + worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen).Value = Now.Year + Dim CellAnioActual = worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen + 1) + CellAnioActual.Value = 0 + + worksheet.Cells(IdxRefAnioResumen + 2, columnRefAnioResumen + 1).Formula = $"=({CeldaTotalVentaAcumulada.Name} - {worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1).Name})" + + worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen).Value = $"X DIA {Now.Year - 1}" + worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen).Value = $"X DIA {Now.Year}" + + Dim DiasFinMes As Integer = 0 + + Dim Day As Integer = Now.Day + Dim DaysMonth As Integer = DateTime.DaysInMonth(Now.Year, Now.Month) + Dim Month As Integer = Now.Month + Dim Year As Integer = Now.Year + + For i = Day To DaysMonth + Dim DayRef As DateTime = New DateTime(Year, Month, i) + If DayRef.DayOfWeek <> DayOfWeek.Sunday Then + DiasFinMes += 1 + End If + Next + + worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen + 1).Formula = $"=({CellAnioAnterior.Name} - {CeldaTotalVentaAcumulada.Name})/{If(DiasFinMes > 0, DiasFinMes, 1)}" + worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen + 2).Formula = $"=({CeldaTotalVentaAcumulada.Name}/{CellAnioAnterior.Name})" + + worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen + 1).Formula = $"=({CellAnioActual.Name} - {CeldaTotalVentaAcumulada.Name})/{If(DiasFinMes > 0, DiasFinMes, 1)}" + worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Formula = $"=({CeldaTotalVentaAcumulada.Name}/{CellAnioActual.Name})" + + Dim StyleTitleTableAR = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioResumen, columnRefAnioResumen, IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Style + StyleTitleTableAR.Font.Weight = ExcelFont.BoldWeight + StyleTitleTableAR.Font.Name = "Calibri" + StyleTitleTableAR.Font.Size = 8 * 20 + StyleTitleTableAR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTableAR.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTableAR.HorizontalAlignment = HorizontalAlignmentStyle.Center + + Dim StyleDataAR = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioResumen, columnRefAnioResumen + 1, IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Style + StyleDataAR.Font.Weight = ExcelFont.NormalWeight + StyleDataAR.Font.Name = "Calibri" + StyleDataAR.Font.Size = 8 * 20 + StyleDataAR.VerticalAlignment = VerticalAlignmentStyle.Center + StyleDataAR.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleDataAR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleDataAR.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + IdxRefAnioResumen += 1 + + +#End Region + +#Region "L L A N T A S M E S A Ñ O A N T E R I O R" + Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxSucursalesLlantasAlin + 8 + + worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True + worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True + worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS" + worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%" + + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal" + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %" + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year)) + worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %" + + Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style + StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight + StyleTitleTable5.Font.Name = "Calibri" + StyleTitleTable5.Font.Size = 8 * 20 + StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center + + Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style + StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight + StyleSubTitleTable5.Font.Name = "Calibri" + StyleSubTitleTable5.Font.Size = 8 * 20 + StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center + StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center + + Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4) + 'INICIA DESDE LA CUARTA FILA + Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1 + + For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows + worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal") + worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior") + worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas") + worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})" + worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12" + worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12" + worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1" + + Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style + StyleData.Font.Weight = ExcelFont.NormalWeight + StyleData.Font.Name = "Calibri" + StyleData.Font.Size = 8 * 20 + StyleData.VerticalAlignment = VerticalAlignmentStyle.Center + StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + IdxMesAnioAnteriorLlantas += 1 + Next + + DtMesAnioAnteriorLLantas.Dispose() +#End Region + +#Region "A Ñ O A N T E R I O R" + Dim IdxRefAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + + Dim columnRefAnioAnterior As Integer = 9 + + worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior).Value = "Sucursal" + worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = (FechaConsulta.Year - 1).ToString() + worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = FechaConsulta.Year.ToString() + worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 3).Value = "Dif" + + Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior, IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style + StyleTitleTable4.Font.Weight = ExcelFont.BoldWeight + StyleTitleTable4.Font.Name = "Calibri" + StyleTitleTable4.Font.Size = 8 * 20 + StyleTitleTable4.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleTitleTable4.VerticalAlignment = VerticalAlignmentStyle.Center + StyleTitleTable4.HorizontalAlignment = HorizontalAlignmentStyle.Center + + Dim DtAnioAnteriorLLantas As DataTable = DataSet.Tables(3) + 'INICIA DESDE LA CUARTA FILA + Dim IdxAnioAnteriorLlantas As Integer = IdxRefAnioAnteriorLlantas + 1 + + For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila > 1").Rows + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior).Value = Row("Grupo") + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = Row("LLantasAnioAnterior") + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = Row("LLantas") + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Formula = $"=({worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Name})" + + + Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, columnRefAnioAnterior, IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style + StyleData.Font.Weight = ExcelFont.NormalWeight + StyleData.Font.Name = "Calibri" + StyleData.Font.Size = 8 * 20 + StyleData.VerticalAlignment = VerticalAlignmentStyle.Center + StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + + If Row("TipoFila").ToString() = "2" Then + StyleData.Font.Weight = ExcelFont.BoldWeight + StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255)) + End If + + IdxAnioAnteriorLlantas += 1 + Next + + For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila = 1").Rows + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior).Value = Row("Grupo") + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = Row("LLantasAnioAnterior") + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = Row("LLantas") + worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Formula = $"=(+{worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Name})" + + + Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, columnRefAnioAnterior, IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style + StyleData.Font.Weight = ExcelFont.BoldWeight + StyleData.Font.Name = "Calibri" + StyleData.Font.Size = 8 * 20 + StyleData.VerticalAlignment = VerticalAlignmentStyle.Center + StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center + StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) + StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" + StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255)) + + IdxAnioAnteriorLlantas += 1 + Next + DtAnioAnteriorLLantas.Dispose() #End Region #Region "V E N T A S - S E R V I C I O S D E I N S T A L A C I O N, A M O R T I G U A D O R E S, P O L I Z A S" - Dim IdxRefSucursalesServiciosAmortPolizas As Integer = IdxSucursalesLlantasAlin + 3 + Dim IdxRefSucursalesServiciosAmortPolizas As Integer = IdxMesAnioAnteriorLlantas + 3 worksheet.Cells(IdxRefSucursalesServiciosAmortPolizas, 0).Value = "Sucursal" 'TITULO SERVICIOS DE INSTALACION @@ -550,176 +885,6 @@ Partial Class Ventas_RepPS DtPorcentajes.Dispose() #End Region -#Region "A Ñ O A N T E R I O R" - Dim IdxRefAnioAnteriorLlantas As Integer = IdxPorcentajes + 3 - - worksheet.Cells(IdxRefAnioAnteriorLlantas, 0).Value = "Sucursal" - worksheet.Cells(IdxRefAnioAnteriorLlantas, 1).Value = (FechaConsulta.Year - 1).ToString() - worksheet.Cells(IdxRefAnioAnteriorLlantas, 2).Value = FechaConsulta.Year.ToString() - worksheet.Cells(IdxRefAnioAnteriorLlantas, 3).Value = "Dif" - - Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, 0, IdxRefAnioAnteriorLlantas, 3).Style - StyleTitleTable4.Font.Weight = ExcelFont.BoldWeight - StyleTitleTable4.Font.Name = "Calibri" - StyleTitleTable4.Font.Size = 8 * 20 - StyleTitleTable4.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleTitleTable4.VerticalAlignment = VerticalAlignmentStyle.Center - StyleTitleTable4.HorizontalAlignment = HorizontalAlignmentStyle.Center - - Dim DtAnioAnteriorLLantas As DataTable = DataSet.Tables(3) - 'INICIA DESDE LA CUARTA FILA - Dim IdxAnioAnteriorLlantas As Integer = IdxRefAnioAnteriorLlantas + 1 - - For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila > 1").Rows - worksheet.Cells(IdxAnioAnteriorLlantas, 0).Value = Row("Grupo") - worksheet.Cells(IdxAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior") - worksheet.Cells(IdxAnioAnteriorLlantas, 2).Value = Row("LLantas") - worksheet.Cells(IdxAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxAnioAnteriorLlantas, 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, 2).Name})" - - - Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, 0, IdxAnioAnteriorLlantas, 3).Style - StyleData.Font.Weight = ExcelFont.NormalWeight - StyleData.Font.Name = "Calibri" - StyleData.Font.Size = 8 * 20 - StyleData.VerticalAlignment = VerticalAlignmentStyle.Center - StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center - StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" - - If Row("TipoFila").ToString() = "2" Then - StyleData.Font.Weight = ExcelFont.BoldWeight - StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255)) - End If - - IdxAnioAnteriorLlantas += 1 - Next - - For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila = 1").Rows - worksheet.Cells(IdxAnioAnteriorLlantas, 0).Value = Row("Grupo") - worksheet.Cells(IdxAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior") - worksheet.Cells(IdxAnioAnteriorLlantas, 2).Value = Row("LLantas") - worksheet.Cells(IdxAnioAnteriorLlantas, 3).Formula = $"=(+{worksheet.Cells(IdxAnioAnteriorLlantas, 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, 2).Name})" - - - Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, 0, IdxAnioAnteriorLlantas, 3).Style - StyleData.Font.Weight = ExcelFont.BoldWeight - StyleData.Font.Name = "Calibri" - StyleData.Font.Size = 8 * 20 - StyleData.VerticalAlignment = VerticalAlignmentStyle.Center - StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center - StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" - StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255)) - - IdxAnioAnteriorLlantas += 1 - Next - DtAnioAnteriorLLantas.Dispose() -#End Region - -#Region "L L A N T A S M E S A Ñ O A N T E R I O R" - Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxAnioAnteriorLlantas + 3 - - worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True - worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True - worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS" - worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%" - - worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal" - worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1)) - worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year)) - worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %" - worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1)) - worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year)) - worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %" - - Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style - StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight - StyleTitleTable5.Font.Name = "Calibri" - StyleTitleTable5.Font.Size = 8 * 20 - StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center - StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center - - Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style - StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight - StyleSubTitleTable5.Font.Name = "Calibri" - StyleSubTitleTable5.Font.Size = 8 * 20 - StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center - StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center - - Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4) - 'INICIA DESDE LA CUARTA FILA - Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1 - - For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows - worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal") - worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior") - worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas") - worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})" - worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12" - worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12" - worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1" - - Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style - StyleData.Font.Weight = ExcelFont.NormalWeight - StyleData.Font.Name = "Calibri" - StyleData.Font.Size = 8 * 20 - StyleData.VerticalAlignment = VerticalAlignmentStyle.Center - StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center - StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" - - IdxMesAnioAnteriorLlantas += 1 - Next - - DtMesAnioAnteriorLLantas.Dispose() -#End Region - -#Region "L L A N T A S M E S A Ñ O A N T E R I O R" - Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxMesAnioAnteriorLlantas + 2 - - worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes" - worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1)) - worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year)) - worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS" - worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %" - - Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style - StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight - StyleTitleTable6.Font.Name = "Calibri" - StyleTitleTable6.Font.Size = 8 * 20 - StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center - StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center - - - Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5) - 'INICIA DESDE LA CUARTA FILA - Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1 - - For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows - worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() - worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior") - worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas") - worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})" - worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})" - - Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style - StyleData.Font.Weight = ExcelFont.NormalWeight - StyleData.Font.Name = "Calibri" - StyleData.Font.Size = 8 * 20 - StyleData.VerticalAlignment = VerticalAlignmentStyle.Center - StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center - StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin) - StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-" - - IdxMesAnioAnteriorLlantasResumen += 1 - Next - - DtMesAnioAnteriorLLantasResumen.Dispose() -#End Region - Dim columnCount = worksheet.CalculateMaxUsedColumns() For i = 0 To columnCount diff --git a/WEB.zip b/WEB.zip deleted file mode 100644 index 8f6967992..000000000 Binary files a/WEB.zip and /dev/null differ diff --git a/asmx/WSSIGApp.asmx b/asmx/WSSIGApp.asmx index 71ad666ea..9aaca8891 100644 --- a/asmx/WSSIGApp.asmx +++ b/asmx/WSSIGApp.asmx @@ -1867,7 +1867,7 @@ Public Class WSSIGApp 'VALIDA PROMOCIONES Y EXISTENCIAS Dim ObjVentas As New ClsVentas - If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, UsuarioActual.CveEmpresa) Then + If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then ObjFactura.DtPromociones = ObjVentas.DtResultados End If ObjVentas.Dispose() @@ -1951,13 +1951,13 @@ Public Class WSSIGApp ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}") ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}") - ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago - If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows.Count > 0 Then - ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows(0)("MetodoPago").ToString - Else - ObjFactura.CveMetodoPago = 1 - ObjFactura.MetodoPago = "Efectivo" - End If + 'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago + 'If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows.Count > 0 Then + ' ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows(0)("MetodoPago").ToString + 'Else + ' ObjFactura.CveMetodoPago = 1 + ' ObjFactura.MetodoPago = "Efectivo" + 'End If ObjFactura.CveClienteSucursal = -1 End If diff --git a/vwd.webinfo b/vwd.webinfo index 4f2b5ea5a..5fb864961 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -250,6 +250,10 @@ + + + +