From b76f325c18ffa42a6f0559c167cd7c23cbff49df Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 31 Jul 2021 16:01:02 -0700 Subject: [PATCH 1/7] Contabilizacion desde api net core --- Ashx/SIGWeb.ashx | 105 +++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 68 deletions(-) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 11ec214c0..f191800c0 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -8,6 +8,12 @@ Imports Extensiones Imports System.IO Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState + 'TEMPORAL, DEBE SER REEMPLAZADO POR EL MODELO DE LA LIBRERIA + Public Class MResponseModel(Of T) + Public Property IsSuccess As Boolean + Public Property Message As String + Public Property Result As T + End Class Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest If context.Request("metodo") IsNot Nothing AndAlso context.Request("metodo").ToString() = "GetTokenAngular" Then @@ -51,13 +57,14 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 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)() + + Dim obj As New MResponseModel(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)() + Dim obj As New MResponseModel(Of Object)() obj.Result = DateTime.Now.ToString() Dim retorno = JsonConvert.SerializeObject(obj).ToString() context.Response.Write(retorno) @@ -92,8 +99,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState ActualizaPrePoliza(context) Case "getpersonal" getpersonal(context) - Case "getcuentascontables" - GetCuentasContables(context) Case "getcontratos" GetContratos(context) Case "GettingCURP" @@ -214,7 +219,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim CveEmpresa As Integer = context.Request("CveEmpresa").ToString.ToEntero Dim CveUsuario As Integer = context.Request("CveUsuario").ToString.ToEntero Dim Empresa As New Empresa - Dim ObjConta As New ClsContabilidad + Dim Retorno As Integer = 0 Dim ObjEmpresa As New ClsSisEmpresas() @@ -224,19 +229,22 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState ObjEmpresa.Dispose() Dim IdPoliza As Integer = -1 - ObjConta.GetPrePoliza(CvePrePoliza, CveEmpresa) - IdPoliza = ObjConta.DtResultados.FiltroPrimeroValor("IdPoliza", "").ToEntero + Dim ObjConta As New ClsContabilidad + Try + ObjConta.GetPrePoliza(CvePrePoliza, CveEmpresa) + IdPoliza = ObjConta.DtResultados.FiltroPrimeroValor("IdPoliza", "").ToEntero + If IdPoliza > 0 Then + ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) + End If - If IdPoliza > 0 Then - - ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, CveUsuario, Empresa, pIDPoliza:=IdPoliza) Then + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, CveUsuario, Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1)) Then Retorno = 200 End If - Else - Retorno = 200 - End If + Catch ex As Exception + GuardaLogAD(ex.ToString()) + End Try ObjConta.Dispose() + Empresa = Nothing 'context.Response.Write(CveUsuario.ToString()) context.Response.StatusCode = Retorno @@ -582,15 +590,6 @@ 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 @@ -626,6 +625,11 @@ 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)) @@ -651,7 +655,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Else context.Response.Write("[]") End If - + DtRetorno.Dispose() Return retorno End Function #End Region @@ -740,6 +744,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163, 166) Then UsaGlobal = False + 'If CveEmpresa.Contiene(140, 141) And Pagina.Contiene("ventas/ventas") Then + ' AplicaParaVenta = 1 + 'End If + Dim objInv As New ClsInventarios If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca) Then @@ -1185,6 +1193,11 @@ 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}%'") @@ -1192,7 +1205,6 @@ 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 @@ -1239,47 +1251,4 @@ 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 From a287c967413f85959be6324494abe73e98502711 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sun, 1 Aug 2021 00:37:11 -0700 Subject: [PATCH 2/7] Parametro de Concatenar Directorio en metodo FilesMove de la clase Archivo de DropZone --- AF/AF.aspx.vb | 10 +-- AF/ResguardoAF.aspx.vb | 6 +- App_Code/modExtensiones.vb | 16 +++-- Bancos/CreditosPagoMultiple.aspx.vb | 2 +- Bancos/IE.aspx.vb | 4 +- Bancos/PagoAcreedor.aspx.cs | 4 +- Bancos/PagoDeudor.aspx.cs | 4 +- Bancos/PolizaCheque.aspx.vb | 2 +- Bancos/PrestamoPersonal.aspx.cs | 92 ++++++++++++++-------------- Bancos/ProveedoresAbonar.aspx.vb | 2 +- Bancos/Transferencias.aspx.vb | 2 +- CRM/Acercamiento.aspx.cs | 2 +- CRM/EmpresaCRM.aspx.cs | 2 +- Compras/Compras.aspx.vb | 4 +- Compras/Proveedores.aspx.vb | 2 +- Compras/eFacturas.aspx.vb | 5 +- Contratos/Contrato.aspx.vb | 2 +- Contratos/Contrato.vb | 2 +- Contratos/ContratoAvance.aspx.vb | 8 +-- Contratos/ContratoObra.aspx.vb | 2 +- Inventarios/EntradasSalidas.aspx.vb | 4 +- Inventarios/RecepcionAlmacen.aspx.vb | 2 +- Inventarios/RecepcionUsados.aspx.vb | 4 +- OC/RepCotizacionesDetalle.aspx.vb | 4 +- OI/Normatividad.aspx.vb | 4 +- OS/OrdenesServicios.aspx.vb | 4 +- Prospectos/Prospectos.aspx.vb | 2 +- RH/Personal.aspx.vb | 4 +- RH/Prospectos.aspx.vb | 2 +- Ventas/Clientes.aspx.vb | 2 +- Ventas/ClientesAbonar.aspx.vb | 2 +- Ventas/Ventas.aspx.vb | 2 +- 32 files changed, 108 insertions(+), 101 deletions(-) diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 5c2f76690..a9d79c531 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -766,7 +766,7 @@ Partial Class AF_AF End If If Filename <> "" Then - Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("Empresas\{0}\AF\Placas", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("{0}AF\Placas", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If If HdnModalidad.Value = "A" Then @@ -883,7 +883,7 @@ Partial Class AF_AF End If If Filename <> "" Then - Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("Empresas\{0}\AF\Licencias", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("{0}AF\Licencias", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If If HdnModalidadLicencia.Value = "A" Then @@ -1036,7 +1036,7 @@ Partial Class AF_AF End If If Filename <> "" Then - Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("{0}AF\Polizas", UsuarioActual.Empresa.Ruta)) + Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("{0}AF\Polizas", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If If HdnModalidadPoliza.Value = "A" Then @@ -1929,7 +1929,7 @@ Partial Class AF_AF If EsURL2 Then If objAF.UpdateActivosFijosResguardosURL("-1", $"AFT{CveResguardoPadre}.{FileExtension}", CveResguardoPadre) Then If filemove <> "" Then - filemove.FilesMove(String.Format("AFT{0}", CveResguardoPadre), String.Format("Empresas\{0}\AF\Resguardos", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("AFT{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If Else HuboError = True @@ -1937,7 +1937,7 @@ Partial Class AF_AF Else If objAF.UpdateActivosFijosResguardosURL($"AFR{CveResguardoPadre}.{FileExtension}", "-1", CveResguardoPadre) Then If filemove <> "" Then - filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("Empresas\{0}\AF\Resguardos", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If Else HuboError = True diff --git a/AF/ResguardoAF.aspx.vb b/AF/ResguardoAF.aspx.vb index 86984d0f8..03ab0ce02 100644 --- a/AF/ResguardoAF.aspx.vb +++ b/AF/ResguardoAF.aspx.vb @@ -545,7 +545,7 @@ Partial Class AF_ResguardoAF If File.Exists(String.Format("{0}\AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) Then File.Delete(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) End If - If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta)) Then + If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then HuboError = False Else HuboError = True @@ -561,7 +561,7 @@ Partial Class AF_ResguardoAF If File.Exists(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) Then File.Delete(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) End If - If filemove.FilesMove(String.Format("AFT{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta)) Then + If filemove.FilesMove(String.Format("AFT{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then HuboError = False Else HuboError = True @@ -578,7 +578,7 @@ Partial Class AF_ResguardoAF If File.Exists(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) Then File.Delete(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) End If - If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta)) Then + If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then HuboError = False Else HuboError = True diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 95863dc34..3743692cd 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -519,7 +519,7 @@ Namespace Extensiones Return retorno End Function - Public Function FilesMove(oldName As String, newName As String, newDirectorio As String, Optional Sobreescribir As Boolean = False) As Boolean + Public Function FilesMove(oldName As String, newName As String, newDirectorio As String, Optional Sobreescribir As Boolean = False, Optional ConcatenarDirectorioBase As Boolean = True) As Boolean Dim retorno As Boolean = True Dim directorioOld As New StringBuilder Dim directorioNew As New StringBuilder @@ -531,11 +531,17 @@ Namespace Extensiones End If 'SI VA A LA CARPETA DE EMPRESAS TIENE QUE TOMAR LA RUTA DE EMPRESAS - If newDirectorio.Contains("Empresas") Then - directorioNew.AppendFormat("{0}{1}\", ModExtensiones.DirectorioBaseEmpresas, newDirectorio) + If ConcatenarDirectorioBase Then + If newDirectorio.Contains("Empresas") Then + directorioNew.AppendFormat("{0}{1}\", ModExtensiones.DirectorioBaseEmpresas, newDirectorio) + Else + directorioNew.AppendFormat("{0}{1}\", AppDomain.CurrentDomain.BaseDirectory, newDirectorio) + End If Else - directorioNew.AppendFormat("{0}{1}\", AppDomain.CurrentDomain.BaseDirectory, newDirectorio) - End If + 'SI YA TIENE EL DIRECTORIO COMPLETO NO CONCANTENA EL DIRECTORIO + directorioNew.AppendFormat("{0}\", newDirectorio) + End If + If Not Directory.Exists(directorioNew.ToString) Then Directory.CreateDirectory(directorioNew.ToString) diff --git a/Bancos/CreditosPagoMultiple.aspx.vb b/Bancos/CreditosPagoMultiple.aspx.vb index 3389cd8d3..55cf1b55f 100644 --- a/Bancos/CreditosPagoMultiple.aspx.vb +++ b/Bancos/CreditosPagoMultiple.aspx.vb @@ -302,7 +302,7 @@ Partial Class Bancos_CreditosPagoMultiple Alert("El Documento se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/CreditosPagoMultiple.aspx"";") If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If ObjIE.Commit() GeneraChequePDF(CveIE, UsuarioActual.Empresa) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index b2f5d6555..7bde7a0bc 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2737,7 +2737,7 @@ Partial Class Bancos_IE 'GUARDA COMPROBANTE If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If 'GUARDA PREPOLIZAS DETALLE [PRIMERO SON LOS CASOS ESPECIALES, AL FINAL (ELSE) LOS CASOS NORMALES] --REEMPLAZA IFs @@ -4880,7 +4880,7 @@ Partial Class Bancos_IE If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvEB.DataSource = ObjEventoBitacora.DtResultados diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 0220112e6..56fa5710f 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -321,7 +321,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:false); } decimal Importe; decimal ImporteMN; @@ -744,7 +744,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); } if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteMN, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 9176dded2..abd9ee76f 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -355,7 +355,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); } // SI ES DOLARES @@ -699,7 +699,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); } //GUARDA PREPOLIZAS DETALLE diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index ff500fbfe..4c7177d1f 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -1021,7 +1021,7 @@ Partial Class Bancos_PolizaCheque 'If Conta IsNot Nothing Then Conta.Commit() If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GeneraChequePDF(CveIE, UsuarioActual.Empresa, IDPoliza) diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs index 083e605c0..61470b145 100644 --- a/Bancos/PrestamoPersonal.aspx.cs +++ b/Bancos/PrestamoPersonal.aspx.cs @@ -10,8 +10,8 @@ using System.Web.UI.WebControls; using Extensiones; using static Extensiones.ModExtensiones; public partial class Bancos_PrestamoPersonal : ClsPaginas -{ - #region "PROPIEDADES" +{ + #region "PROPIEDADES" private int IDCtaContablePrestamo { get @@ -106,7 +106,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas txtFechaF.Text = DateTime.Now.ToShortDateString(); TxtImporte.Attributes.Add("disabled", "disabled"); - if(UsuarioActual.Empresa.Funcionalidad(281).ToEntero() == 1) + if (UsuarioActual.Empresa.Funcionalidad(281).ToEntero() == 1) { TxtFechaPrestamo.Enabled = false; ImgCalendarioPrestamo.Visible = false; @@ -187,8 +187,8 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas { divTCPago.Visible = false; TxtTCPago.Text = "1"; - } - + } + long Folio; ClsBancos bancos = new ClsBancos(); Folio = bancos.GetNextFolio(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransaccion.SelectedValue.ToEntero()); @@ -268,17 +268,17 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas if (CvePrePoliza > 0) { decimal ImporteBanco = TxtImporte.Text.ToDecimal(); - decimal ImporteMNBanco= ImporteBanco; + decimal ImporteMNBanco = ImporteBanco; decimal ImporteComplementaria = 0; decimal TC = TxtTCPago.Text.ToDecimal(); string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransaccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), DdlFuncionarioEmpleadoPago.SelectedItem.Text, ImporteBanco.ToString().ToDouble(), CveMoneda, - TC.ToString().ToDouble() , TxtObservaciones.Text.Trim(), "", ChkAbonoCuenta.Checked, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + TC.ToString().ToDouble(), TxtObservaciones.Text.Trim(), "", ChkAbonoCuenta.Checked, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); if (CveMoneda != 1) - { + { if (UsaComplementaria) { ImporteMNBanco = ImporteBanco; @@ -296,7 +296,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false); } decimal Importe; decimal ImporteMN; @@ -323,9 +323,9 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas ImporteMN = Importe * TC; ImporteComplementaria = 0; } - } - - + } + + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePago, Conc, DateTime.Now, IDCtaContablePrestamo, -1, CveIE, CvePersonal: DdlFuncionarioEmpleadoPago.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TC)) { MsgError = "No se pudo insertar concepto de pago acreedor"; @@ -352,7 +352,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, ImporteBanco, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosPrestamo, -1, CveIE, CvePersonal: DdlFuncionarioEmpleadoPago.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TC, TipoCambioPago: TC)) { MsgError = "No se pudo insertar concepto de bancos complementaria"; - } + } } } @@ -377,7 +377,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas } //CONTABILIZA - if (UsuarioActual.Empresa.Funcionalidad(200).Equals("1") && MsgError.Equals("") ) + if (UsuarioActual.Empresa.Funcionalidad(200).Equals("1") && MsgError.Equals("")) { if (IDCtaContablePrestamo > 0 && IDCtaContableBancos > 0) { @@ -471,11 +471,11 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas int tCveMoneda = 0; if (dr != null) { - tCveMoneda = dr["CveMoneda"].ToString().ToEntero(); - - IDCtaContableBancosPrestamo = dr["IdCtaContable"].ToString().ToEntero(); - IDCtaContableBancosPrestamoComplementario = dr["IdCtaContableComplementaria"].ToString().ToEntero(); - + tCveMoneda = dr["CveMoneda"].ToString().ToEntero(); + + IDCtaContableBancosPrestamo = dr["IdCtaContable"].ToString().ToEntero(); + IDCtaContableBancosPrestamoComplementario = dr["IdCtaContableComplementaria"].ToString().ToEntero(); + } if (tCveMoneda != 1) @@ -487,9 +487,9 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas { divTCPrestamo.Visible = false; TxtTCPrestamo.Text = "1"; - } - - + } + + long Folio; ClsBancos bancos = new ClsBancos(); Folio = bancos.GetNextFolio(DdlCuentaPrestamo.SelectedValue.ToEntero(), DdlTipoTransanccionPrestamo.SelectedValue.ToEntero()); @@ -500,7 +500,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas } - private void AsignaCuentaPersonal( int CvePersonal, int tCveMoneda) + private void AsignaCuentaPersonal(int CvePersonal, int tCveMoneda) { IDCtaContablePrestamo = 0; @@ -508,10 +508,10 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas if (CvePersonal > 0) { - if (ObjRH.GetPersonal(CvePersonal,UsuarioActual.CveEmpresa)) + if (ObjRH.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa)) { - IDCtaContablePrestamo = ObjRH.IdCtaContPrestamos; - + IDCtaContablePrestamo = ObjRH.IdCtaContPrestamos; + } } ObjRH.Dispose(); @@ -550,7 +550,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas AsignaCuentaPersonal(DdlFuncionarioEmpleadoPrestamo.SelectedValue.ToEntero(), CveMoneda); // DATOS PREPOLIZA - if (DdlTipoTransanccionPrestamo.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119 ) FolioFijo = TxtFolioPrestamo.Text.ToEntero(); + if (DdlTipoTransanccionPrestamo.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolioPrestamo.Text.ToEntero(); CvePrePoliza = ObjMov.AddPrePolizas("Bancos/PRESTAMO PERSONAL", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMoneda, TxtFechaPrestamo.Text.ToDate(), DdlFuncionarioEmpleadoPrestamo.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa)); @@ -564,11 +564,11 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas string Ref = TxtObservacionesPrestamo.Text == "" ? TxtFolioPrestamo.Text : TxtObservacionesPrestamo.Text; CveIE = ObjIE.AddBancos_IE(DdlCuentaPrestamo.SelectedValue.ToEntero(), DdlTipoTransanccionPrestamo.SelectedValue.ToEntero(), TxtFechaPrestamo.Text.Trim().ToDate(), TxtFolioPrestamo.Text.Trim(), DdlFuncionarioEmpleadoPrestamo.SelectedItem.Text, Importe.ToString().ToDouble(), CveMoneda, - TC.ToString().ToDouble(), TxtObservacionesPrestamo.Text.Trim(), "", false, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); - + TC.ToString().ToDouble(), TxtObservacionesPrestamo.Text.Trim(), "", false, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + if (CveMoneda != 1) { - if (UsuarioActual.CveEmpresa.Contiene (1, 119)) { UsaComplementaria = true; } + if (UsuarioActual.CveEmpresa.Contiene(1, 119)) { UsaComplementaria = true; } if (UsaComplementaria) { @@ -579,21 +579,21 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas { ImporteMN = Importe * TC; ImporteComplementaria = 0; - } - - } - - - + } + + } + + + if (CveIE > 0) { //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:false); } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancosPrestamo, -1, CveIE, CvePersonal: DdlFuncionarioEmpleadoPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteMN, TipoCambio: TC, TipoCambioPago:TC)) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancosPrestamo, -1, CveIE, CvePersonal: DdlFuncionarioEmpleadoPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteMN, TipoCambio: TC, TipoCambioPago: TC)) { MsgError = "No se pudo insertar concepto de bancos"; } @@ -603,7 +603,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas } if (CveMoneda != 1 && UsaComplementaria) - { + { if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosPrestamo, -1, CveIE, CvePersonal: DdlFuncionarioEmpleadoPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC)) { MsgError = "No se pudo insertar concepto de bancos complementaria"; @@ -612,9 +612,9 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas { MsgError = "No se pudo insertar concepto de acreedor complementaria"; } - } - - + } + + } else { @@ -637,7 +637,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas } //CONTABILIZA - if (UsuarioActual.Empresa.Funcionalidad(200).Equals("1") && MsgError.Equals("") ) + if (UsuarioActual.Empresa.Funcionalidad(200).Equals("1") && MsgError.Equals("")) { if (IDCtaContablePrestamo > 0 && IDCtaContableBancosPrestamo > 0) { @@ -732,10 +732,10 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas if (DdlFuncionarioEmpleado.SelectedValue.ToEntero() > 0) CvePersonal = DdlFuncionarioEmpleado.SelectedValue.ToEntero(); ClsBancos bancos = new ClsBancos(); - if(bancos.GetPersonalPrestamoAuxiliar(CvePersonal, FechaI, FechaF, UsuarioActual.CveEmpresa)) + if (bancos.GetPersonalPrestamoAuxiliar(CvePersonal, FechaI, FechaF, UsuarioActual.CveEmpresa)) { - GvAuxiliar.DataSource = bancos.DtResultados; - + GvAuxiliar.DataSource = bancos.DtResultados; + } bancos.Dispose(); GvAuxiliar.DataBind(); diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 55b03dca0..0d3286ab6 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -888,7 +888,7 @@ Partial Class Bancos_ProveedoresAbonar 'guardo el archivo If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("{0}\IE", UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If Anexo.Text = "" diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index 097a21b4f..1cdd89b8e 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -296,7 +296,7 @@ Partial Class Bancos_Transferencias If (CveIE > 0 AndAlso CveIEDestino > 0) Then If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If 'inserto los movimientos de la conta para abonar al saldo diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 03abe16fb..bd33d2fb3 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -1059,7 +1059,7 @@ public partial class CRM_Acercamiento : ClsPaginas if (ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim(), string.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveEtapaProcesoCRM: CveEtapa)) { if (filemove != "") - filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"Empresas\{0}\OI", UsuarioActual.CveEmpresa)); + filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:false); TxtEventoDescripcion.Text = ""; diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index b0dc49fe5..14b65061a 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -1068,7 +1068,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim(), string.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { if (filemove != "") - filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"Empresas\{0}\OI", UsuarioActual.CveEmpresa)); + filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:false); TxtEventoDescripcion.Text = ""; diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 9cf041aca..26d8de58e 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1630,7 +1630,7 @@ Partial Class Compras_Compras Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador Dim XMLDoc As New XmlDocument - Dim Archivo As String = String.Format("{0}Compras\{2}\{3}", UsuarioActual.Empresa.Ruta, dr("RFCDe"), dr("XML")) + Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, dr("RFCDe"), dr("XML")) If IO.File.Exists(Archivo) Then Dim Validada As Boolean = True @@ -13585,7 +13585,7 @@ Partial Class Compras_Compras If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvEB.DataSource = ObjEventoBitacora.DtResultados diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 3d6f80da9..0d721b704 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -2699,7 +2699,7 @@ Partial Class Compras_Proveedores If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) Then If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvEB.DataSource = ObjEventoBitacora.DtResultados diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index aa2e004dd..9b4d611c9 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1428,7 +1428,8 @@ Partial Class Compras_eFacturas If filemove <> "" Then 'filemove.FilesMove("", String.Format("{0}\Temp\Facturas", UsuarioActual.Empresa.Ruta)) - filemove.FilesMove("", String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta)) + 'filemove.FilesMove("", String.Format("Empresas\{0}\Temp\Facturas", UsuarioActual.CveEmpresa)) + filemove.FilesMove("", String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) 'AGREGA XML A LA LISTA If FileExtension.ToUpper = "XML" Or FileExtension.ToUpper = "PDF" Then ListXML.Add(String.Format("{0}Temp\Facturas\{1}", UsuarioActual.Empresa.Ruta, filemove)) @@ -1454,7 +1455,7 @@ Partial Class Compras_eFacturas ListaComprimidos.Add(filePath) 'CREO DIRECTORIO ALEATORIO Dim Aleatorio As New Random - Dim TempDirectorio As String = String.Format("{0}\{1}\{2}{3}", UsuarioActual.Empresa.Ruta, "Temp\Facturas", Date.Now.Ticks, Aleatorio.Next(100, 999)) + Dim TempDirectorio As String = String.Format("{0}{1}\{2}{3}", UsuarioActual.Empresa.Ruta, "Temp\Facturas", Date.Now.Ticks, Aleatorio.Next(100, 999)) Directory.CreateDirectory(TempDirectorio) ListaDirectoriosTemporales.Add(TempDirectorio) 'AGREGA DIRECTORIO A LA LISTA diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 35ab2b146..02127071e 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -3248,7 +3248,7 @@ Partial Class Contratos_Default If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If cargarBitacora() diff --git a/Contratos/Contrato.vb b/Contratos/Contrato.vb index 7318bac15..385377c09 100644 --- a/Contratos/Contrato.vb +++ b/Contratos/Contrato.vb @@ -1462,7 +1462,7 @@ Partial Class Contratos_Default If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If cargarBitacora() diff --git a/Contratos/ContratoAvance.aspx.vb b/Contratos/ContratoAvance.aspx.vb index c462ab589..d26ba7cc4 100644 --- a/Contratos/ContratoAvance.aspx.vb +++ b/Contratos/ContratoAvance.aspx.vb @@ -361,10 +361,10 @@ Partial Class Contratos_ContratoAvance Alert("No se logro guardar el Presupuesto favor de intentarlo mas tarde o comuniquese con soporte", TipoMensaje.MsgAdvertencia) Else - Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato) + Dim urlsave As String = String.Format("{0}Contrato\{1}\Anexos", UsuarioActual.Empresa.Ruta, CveContrato) For Each fileItem As Archivo In guardarArchivos - fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extension}", ""), urlsave) + fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extension}", ""), urlsave, ConcatenarDirectorioBase:=False) Next @@ -426,9 +426,9 @@ Partial Class Contratos_ContratoAvance Alert("No se logro guardar el Presupuesto favor de intentarlo mas tarde o comuniquese con soporte", TipoMensaje.MsgAdvertencia) Else - Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato) + Dim urlsave As String = String.Format("{0}Contrato\{1}\Anexos", UsuarioActual.Empresa.Ruta, CveContrato) For Each fileItem As Archivo In guardarArchivos - fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extension}", ""), urlsave) + fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extension}", ""), urlsave, ConcatenarDirectorioBase:=False) Next ObjContratos.Commit() diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 49ad90808..c8a3abb3b 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -3203,7 +3203,7 @@ Partial Class Contratos_ContratoObra If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If cargarBitacora() diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 8b5dd2eca..9a71020a2 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -3000,7 +3000,7 @@ Partial Class Inventarios_EntradasSalidas End If If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, Now.ToString("HH-mm")), String.Format("Empresas\{0}\OI\Temp", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, Now.ToString("HH-mm")), String.Format("{0}OI\Temp", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If @@ -3083,7 +3083,7 @@ Partial Class Inventarios_EntradasSalidas If ObjEventoBitacora.AddEventoBitacora(descripcion, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvBitacora.DataSource = ObjEventoBitacora.DtResultados diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index a2750203c..3c2820087 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -4284,7 +4284,7 @@ Partial Class Inventarios_RecepcionAlmacen End If If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, Now.ToString("HH-mm")), String.Format("Empresas\{0}\OI\Temp", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, Now.ToString("HH-mm")), String.Format("{0}OI\Temp", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index ba9e4319b..7d4de7d44 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -1707,7 +1707,7 @@ Partial Class Inventarios_RecepcionUsados End If If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, Now.ToString("HH-mm")), String.Format("Empresas\{0}\OI\Temp", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, Now.ToString("HH-mm")), String.Format("{0}OI\Temp", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If @@ -1790,7 +1790,7 @@ Partial Class Inventarios_RecepcionUsados If ObjEventoBitacora.AddEventoBitacora(descripcion, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvBitacora.DataSource = ObjEventoBitacora.DtResultados diff --git a/OC/RepCotizacionesDetalle.aspx.vb b/OC/RepCotizacionesDetalle.aspx.vb index 31fdadb22..787112c96 100644 --- a/OC/RepCotizacionesDetalle.aspx.vb +++ b/OC/RepCotizacionesDetalle.aspx.vb @@ -204,7 +204,7 @@ Partial Class PopOCCotizacionesDetalle End If If Filename <> "" Then - Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("{0}Cotizaciones", UsuarioActual.Empresa.Ruta)) + Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("{0}Cotizaciones", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If For Each dr As GridViewRow In GvDC.Rows @@ -225,7 +225,7 @@ Partial Class PopOCCotizacionesDetalle End If If Filename <> "" Then - Filename.FilesMove(CveCotizacion.ToString(), String.Format("{0}Cotizaciones", UsuarioActual.Empresa.Ruta)) + Filename.FilesMove(CveCotizacion.ToString(), String.Format("{0}Cotizaciones", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If For Each dr As GridViewRow In GvDC.Rows diff --git a/OI/Normatividad.aspx.vb b/OI/Normatividad.aspx.vb index d3499d810..812dfa77f 100644 --- a/OI/Normatividad.aspx.vb +++ b/OI/Normatividad.aspx.vb @@ -152,7 +152,7 @@ Partial Class OI_Normatividad If File.Exists(ruta) Then File.Delete(ruta) End If - filemove.FilesMove(String.Format("OI{0}", IDSelected.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", IDSelected.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If Dim customerRow As Data.DataRow @@ -205,7 +205,7 @@ Partial Class OI_Normatividad Idnew = row("CveEvento").ToString().ToEntero If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", Idnew.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", Idnew.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If ArbolCuentas.DataSource = DtDatos diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 647fd13a9..4f8681043 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -1329,7 +1329,7 @@ Partial Class OS_OrdenesServicios End If If Filename <> "" Then - Filename.FilesMove(String.Format("OS{0}-{1}", UsuarioActual.CveUsuario, Consecutivo), String.Format("Empresas\{0}\OS\Temp", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OS{0}-{1}", UsuarioActual.CveUsuario, Consecutivo), String.Format("{0}OS\Temp", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If AddPS(Consecutivo, -1, DdlPSDetalle.SelectedValue.ToEntero, DdlPSDetalle.SelectedItem.Text, TxtCantidad.Text.ToEntero, TxtObservacionesServicioDetalle.Text, HdnEspecificaciones.Value.ToString, LtlPSEspecificaciones.Text, "", @@ -1476,7 +1476,7 @@ Partial Class OS_OrdenesServicios If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveOS, -1, -1, -1, -1) Then If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvEB.DataSource = ObjEventoBitacora.DtResultados diff --git a/Prospectos/Prospectos.aspx.vb b/Prospectos/Prospectos.aspx.vb index 4934ab8ef..49ace671c 100644 --- a/Prospectos/Prospectos.aspx.vb +++ b/Prospectos/Prospectos.aspx.vb @@ -289,7 +289,7 @@ Partial Class Prospectos_Prospectos If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), -1, -1, CveProspecto, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 84a2daf1d..bc495a4c1 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -2817,7 +2817,7 @@ Partial Class RH_Personal If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvEB.DataSource = ObjEventoBitacora.DtResultados @@ -5361,7 +5361,7 @@ Partial Class RH_Personal End If If filemove <> "" Then - filemove.FilesMove(CvePersonal.ToString(), String.Format("Empresas\{0}\RH\Personal\", UsuarioActual.CveEmpresa)) + filemove.FilesMove(CvePersonal.ToString(), String.Format("{0}RH\Personal\", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If ViewState("Archivo") = String.Format("{0}.{1}", CvePersonal.ToString(), FileExtension) Next diff --git a/RH/Prospectos.aspx.vb b/RH/Prospectos.aspx.vb index 4934ab8ef..49ace671c 100644 --- a/RH/Prospectos.aspx.vb +++ b/RH/Prospectos.aspx.vb @@ -289,7 +289,7 @@ Partial Class Prospectos_Prospectos If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), -1, -1, CveProspecto, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index a45fdff33..83de68f2e 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -3678,7 +3678,7 @@ Partial Class Clientes If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then If filemove <> "" Then - filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If GvEB.DataSource = ObjEventoBitacora.DtResultados diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index c6374fedd..95fe80359 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -776,7 +776,7 @@ Partial Class Ventas_ClientesAbonar 'Guardar archivo If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 3680a6f79..e34a4dfbe 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -19771,7 +19771,7 @@ Partial Class Ventas Dim ObjEventos As New ClsOIEventos() If ObjEventos.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then If Filename <> "" Then - Filename.FilesMove(String.Format("OI{0}", ObjEventos.CveEvento.ToString()), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("OI{0}", ObjEventos.CveEvento.ToString()), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If End If ObjEventos.Dispose() From 0d29366c879eda02c2598b6ef9863eb830ac6db3 Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 1 Aug 2021 13:20:05 -0700 Subject: [PATCH 3/7] mejoras --- Bancos/PopIECompras.aspx.vb | 68 ++++++++++++++++---------------- Bancos/ProveedoresAbonar.aspx.vb | 58 +++++++++++++-------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 67e647931..f487fadc2 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -186,11 +186,11 @@ Partial Class Bancos_PopIECompras ViewState("TipoTransaccion") = value End Set End Property - Private Property SaldoVenta As Double + Private Property SaldoVenta As Decimal Get - Return ViewState("SaldoVenta").ToString.ToDouble + Return ViewState("SaldoVenta").ToString.ToDecimal End Get - Set(value As Double) + Set(value As Decimal) ViewState("SaldoVenta") = value End Set End Property @@ -277,7 +277,7 @@ Partial Class Bancos_PopIECompras Public Class Anticipos Public Property CveIE As Integer - Public Property Importe As Double + Public Property Importe As Decimal Public Property CvePersonal As Integer End Class @@ -677,10 +677,10 @@ Partial Class Bancos_PopIECompras RVImporte.Enabled = True RVImporte.Enabled = True - RVImporte.MaximumValue = dr("Saldo").ToString.ToDouble.ToString.FormatoNumero - TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero + RVImporte.MaximumValue = dr("Saldo").ToString.ToDecimal.ToString.FormatoNumero + TxtImporte.Text = dr("Saldo").ToString.ToDecimal.FormatoNumero - SaldoVenta = dr("Saldo").ToString.ToDouble + SaldoVenta = dr("Saldo").ToString.ToDecimal EsImportacion = CBool(dr("EsImportacion")) End If End If @@ -915,10 +915,10 @@ Partial Class Bancos_PopIECompras dr = DtAcreedores.FiltroPrimero(String.Format("CveProveedor = {0}", DdlAcreedor.SelectedValue)) If dr IsNot Nothing Then - Dim tSaldo As Double = dr("Saldo").ToString.ToDouble + Dim tSaldo As Decimal = dr("Saldo").ToString.ToDecimal 'si el saldo es mayor de la compra poner el valor de la compra sino el valor del saldo - TxtImporte.Text = If(tSaldo > TxtTotal.Text.ToDouble, TxtTotal.Text, tSaldo.ToString).FormatoNumero + TxtImporte.Text = If(tSaldo > TxtTotal.Text.ToDecimal, TxtTotal.Text, tSaldo.ToString).FormatoNumero Dim ObjMov As New ClsMovimientos @@ -1086,7 +1086,7 @@ Partial Class Bancos_PopIECompras End If Next 'actualizo el monto maximo a pagar en el movimiento bancario - Dim tSaldo As Double = DdlFuncionarioEmpleado.SelectedItem.Text.Split(CChar("-"))(1).ToDouble + Dim tSaldo As Decimal = DdlFuncionarioEmpleado.SelectedItem.Text.Split(CChar("-"))(1).ToDecimal If tSaldo < MovimientoPagar.Saldo Then TxtImporte.Text = tSaldo.FormatoNumero() End If @@ -1149,7 +1149,7 @@ Partial Class Bancos_PopIECompras GvDeudores.Columns(6).Visible = False RVImporte.Enabled = True - RVImporte.MaximumValue = LtlSaldo.Text.ToDouble.ToString + RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString CVImporteDolares.Enabled = False CVImportePesos.Enabled = False @@ -1160,7 +1160,7 @@ Partial Class Bancos_PopIECompras End Sub Protected Sub CVImporteDolares_ServerValidate(source As Object, args As ServerValidateEventArgs) - If args.Value.ToString.Substring(0, args.Value.Length - 3).ToDouble <= LtlSaldo.Text.Substring(0, LtlSaldo.Text.Length - 3).ToDouble Then + If args.Value.ToString.Substring(0, args.Value.Length - 3).ToDecimal <= LtlSaldo.Text.Substring(0, LtlSaldo.Text.Length - 3).ToDecimal Then args.IsValid = True Else args.IsValid = False @@ -1208,7 +1208,7 @@ Partial Class Bancos_PopIECompras GvDeudores.Columns(6).Visible = False RVImporte.Enabled = True - RVImporte.MaximumValue = LtlSaldo.Text.ToDouble.ToString + RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString CVImporteDolares.Enabled = False CVImportePesos.Enabled = False @@ -1219,7 +1219,7 @@ Partial Class Bancos_PopIECompras End Sub Protected Sub CVImportePesos_ServerValidate(source As Object, args As ServerValidateEventArgs) - If args.Value.ToString.Substring(0, args.Value.Length - 3).ToDouble <= LtlSaldo.Text.Substring(0, LtlSaldo.Text.Length - 3).ToDouble Then + If args.Value.ToString.Substring(0, args.Value.Length - 3).ToDecimal <= LtlSaldo.Text.Substring(0, LtlSaldo.Text.Length - 3).ToDecimal Then args.IsValid = True Else args.IsValid = False @@ -1251,10 +1251,10 @@ Partial Class Bancos_PopIECompras #Region "GV ROW DATA BOUND" Private Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvIngresos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim total As Double - Dim saldo As Double + Dim total As Decimal + Dim saldo As Decimal - saldo = e.Row.DataKey("Saldo").ToDouble + saldo = e.Row.DataKey("Saldo").ToDecimal total = SaldoVenta e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ClickDeudorChk(this, ""{0}"", ""{1}"", ""{2}"")", e.Row.FCTextBox("TxtSaldoDeudor").ClientID, total, saldo)) @@ -1268,10 +1268,10 @@ Partial Class Bancos_PopIECompras Private Sub GvDeudores_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDeudores.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim total As Double - Dim saldo As Double + Dim total As Decimal + Dim saldo As Decimal - saldo = e.Row.DataKey("Saldo").ToDouble + saldo = e.Row.DataKey("Saldo").ToDecimal total = SaldoVenta e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ClickDeudorChk(this, ""{0}"", ""{1}"", ""{2}"")", e.Row.FCTextBox("TxtSaldoDeudor").ClientID, total, saldo)) @@ -1284,10 +1284,10 @@ Partial Class Bancos_PopIECompras Private Sub GvAcreedores_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAcreedores.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim total As Double - Dim saldo As Double + Dim total As Decimal + Dim saldo As Decimal - saldo = e.Row.DataKey("Saldo").ToDouble + saldo = e.Row.DataKey("Saldo").ToDecimal total = SaldoVenta e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ClickDeudorChk(this, ""{0}"", ""{1}"", ""{2}"")", e.Row.FCTextBox("TxtSaldoDeudor").ClientID, total, saldo)) @@ -1300,10 +1300,10 @@ Partial Class Bancos_PopIECompras Private Sub GvVentas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvVentas.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim total As Double - Dim saldo As Double + Dim total As Decimal + Dim saldo As Decimal - saldo = e.Row.DataKey("Saldo").ToDouble + saldo = e.Row.DataKey("Saldo").ToDecimal total = SaldoVenta e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ClickDeudorChk(this, ""{0}"", ""{1}"", ""{2}"")", e.Row.FCTextBox("TxtSaldoDeudor").ClientID, total, saldo)) @@ -1506,7 +1506,7 @@ Partial Class Bancos_PopIECompras CveIE = -1 End Select - If DdlOtrosPagos.SelectedValue = "2" AndAlso TxtComision.Text.ToDouble > 0 Then + If DdlOtrosPagos.SelectedValue = "2" AndAlso TxtComision.Text.ToDecimal > 0 Then 'Agrego el movimiento a Comisiones If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtComision.Text.ToDecimal, TxtObservaciones.Text, 78, TxtObservaciones.Text, Fecha, 0, -1, CveIE, CveCompra, -1, -1, If(ViewState("CveCliente") IsNot Nothing, ViewState("CveCliente").ToString.ToEntero, -1)) Then MsgError = "Detalle" @@ -2430,7 +2430,7 @@ Partial Class Bancos_PopIECompras ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible) ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2) + ImporteMovimientoNoDeducible = ImporteMovimientoNoDeducible.RoundSQL ImporteMXNoDeducible = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) @@ -2454,8 +2454,8 @@ Partial Class Bancos_PopIECompras ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago) ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2) - ImporteMXNoDeducible = Math.Round(ImporteMXNoDeducible, 2) + ImporteMovimientoNoDeducible = ImporteMovimientoNoDeducible.RoundSQL + ImporteMXNoDeducible = ImporteMXNoDeducible.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}" @@ -2656,7 +2656,7 @@ Partial Class Bancos_PopIECompras ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible) ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2) + ImporteMovimientoNoDeducible = ImporteMovimientoNoDeducible.RoundSQL ImporteMXNoDeducible = ImporteMX.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) @@ -2680,8 +2680,8 @@ Partial Class Bancos_PopIECompras ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago) ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) End If - ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2) - ImporteMXNoDeducible = Math.Round(ImporteMXNoDeducible, 2) + ImporteMovimientoNoDeducible = ImporteMovimientoNoDeducible.RoundSQL + ImporteMXNoDeducible = ImporteMXNoDeducible.RoundSQL TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}" @@ -3067,7 +3067,7 @@ Partial Class Bancos_PopIECompras IdCtaContable = IdCtaContComplementariaCliente If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then ImporteMX = ImporteMovimiento - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, 207, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, rw.DataKey("CveVenta").ToString.ToEntero, CveCompra, CveCliente:=rw.DataKey("CveCliente").ToString.ToEntero, ImporteMX:=Math.Round(ImporteMovimiento * tipoCambioPago - ImporteMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioPago) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, 207, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, rw.DataKey("CveVenta").ToString.ToEntero, CveCompra, CveCliente:=rw.DataKey("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioPago - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioPago) Then MsgError = "No se pudo insertar la póliza" End If End If diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 056bb2fd1..b67a756a2 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1013,8 +1013,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal importeMX = ImporteMovimiento * tipoCambioCompraValuacion End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = tipoCambioCompraValuacion ConceptoMovimiento = $"{HplProveedor.Text} F:{gvr.DataKey("SerieFolio")}" 'cuando son dolares, y tienen complementaria, se hace el registro @@ -1056,8 +1056,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = tipoCambioCompra @@ -1094,8 +1094,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1130,8 +1130,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = tipoCambioCompra If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1167,8 +1167,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1203,8 +1203,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = tipoCambioCompra If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1240,8 +1240,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1276,8 +1276,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = tipoCambioCompra If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1312,8 +1312,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1348,8 +1348,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - importeMX = Math.Round(importeMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1383,8 +1383,8 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2) - importeMX = Math.Round(importeMX, 2) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1588,8 +1588,8 @@ Partial Class Bancos_ProveedoresAbonar tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal importeMX = ImporteMovimiento * tipoCambioCompra End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" End If @@ -1643,7 +1643,7 @@ Partial Class Bancos_ProveedoresAbonar importeMX = 0 End If Else - ImporteMovimiento = gvr.DataKey("IVAPorPagarDeducible").ToDecimal * PorcentajePago + ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMX = ImporteMovimiento @@ -1657,8 +1657,8 @@ Partial Class Bancos_ProveedoresAbonar importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" End If @@ -1681,9 +1681,9 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) 'se registra el iva no acreditable - If gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal > 0 Then + If gvr.DataKey("IVANoDeducible").ToDecimal > 0 Then - Dim ImporteNOIVA As Decimal = gvr.DataKey("IVAPorPagarNoDeducible").ToDecimal * PorcentajePago + Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteNOIVA, Referencia, 280, ConceptoMovimiento, FechaMovimiento, IdCtaContableNoIVA, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=ImporteNOIVA, ImporteME:=If(TipoCambioPago = 1, 0, ImporteMovimiento), TipoCambio:=TipoCambioGeneral, CveSubProyecto:=CveSubProyecto, PorcentajeImpuesto:=PorcentajeImpuesto) Then MsgError = "No se pudo insertar la póliza" From 1995f2b9d60757e76d1a8ab6b2eceae966d3adb7 Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 1 Aug 2021 13:20:12 -0700 Subject: [PATCH 4/7] liga --- Contabilidad/RegPrePolizaS.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 222b9f505..277f6358a 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -532,8 +532,8 @@ Partial Class ContabilidadC_RegPrePolizaS Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero - If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) - If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) + If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63, 4, 291, 292) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) + If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) From bf2689cb30708b677f12fe5244cc9e4ba332adc2 Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 1 Aug 2021 13:21:49 -0700 Subject: [PATCH 5/7] alinear columnad e clasif/ps --- Compras/Compras.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 626eaac84..ecfa7bf4b 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -753,7 +753,7 @@ <%-- 3 --%> - +
From ffe57750a3a2d613cb373fc4b32d0deab7c47fcc Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Sun, 1 Aug 2021 17:08:42 -0700 Subject: [PATCH 6/7] --- Nomina/CatPeriodos.aspx | 32 ++++++++++++++++---------------- Nomina/Finiquito.aspx.cs | 2 +- Nomina/Nomina.aspx | 12 +++++++++++- Nomina/Nomina.aspx.cs | 4 +++- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Nomina/CatPeriodos.aspx b/Nomina/CatPeriodos.aspx index 32c32afea..909ba13a9 100644 --- a/Nomina/CatPeriodos.aspx +++ b/Nomina/CatPeriodos.aspx @@ -40,92 +40,92 @@ - - - - - - - - - - - - - - - <%----%> - <%-- --%> + <%----%> + <%-- --%> diff --git a/Nomina/Finiquito.aspx.cs b/Nomina/Finiquito.aspx.cs index 39df74d49..034559fb4 100644 --- a/Nomina/Finiquito.aspx.cs +++ b/Nomina/Finiquito.aspx.cs @@ -1220,7 +1220,7 @@ public partial class Nomina_Finiquito : ClsPaginas if (continuar) { - dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal)); + dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND (Importe<>0 OR Valor <>0)", CvePersonal)); foreach (DataRow rcon in dtconp.Rows) { diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 1f1a1c0d9..bbedacc2e 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -2257,7 +2257,17 @@ Tipo Periodo: - + +
+
Salario Diario
+
+ +
+
+
+ +
+
<%--
+ Tipo + Ej. + Mes + No. + Fecha Ini + Fecha Fin + Ini. Mes + Fin Mes + Ini. SS + Fin SS + Ini. Año + Fin Año + Calculado + Estatus Comandos
--%> diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index fc195f656..410b85081 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -4803,7 +4803,7 @@ public partial class Nomina_Nomina2 : ClsPaginas if (continuar) { - dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal)); + dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND (Importe<>0 OR Valor <>0)", CvePersonal)); foreach (DataRow rcon in dtconp.Rows) { @@ -5001,6 +5001,7 @@ public partial class Nomina_Nomina2 : ClsPaginas protected void LnkSimulador_Click(object sender, EventArgs e) { GvConceptossimulador.DataSource = new DataTable(); + LblSalarioDiarioSimula.Text = ""; GvConceptossimulador.DataBind(); DdlTipoPeriodoSim.SelectedValue = "1"; RegistraScript("$('#DSimulador').modal()"); @@ -5215,6 +5216,7 @@ public partial class Nomina_Nomina2 : ClsPaginas lconc.Add(SubTotales); //lconc.Add(Totales); + LblSalarioDiarioSimula.Text = string.Format("${0:N4}", dtempleados.SUM("SalarioDiario", string.Format("CvePersonal = {0}", 1))); GvConceptossimulador.DataSource = lconc; GvConceptossimulador.DataBind(); } From 89be4d7606d98ca7f9df02800b49e82e8a45f05f Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 2 Aug 2021 16:08:54 -0700 Subject: [PATCH 7/7] Compras, mostrar ocultar columna IEPS, columna IPS con porcentaje. Efacturas error en ruta de xml --- Compras/Compras.aspx | 10 ++++----- Compras/Compras.aspx.vb | 46 ++++++++++++++++++++++++++++++++++----- Compras/eFacturas.aspx.vb | 2 +- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 626eaac84..cb2793e61 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -682,7 +682,7 @@ P.U.  IVA  - % IEPS  + IEPS  Total 
¿No Deducible?  @@ -783,15 +783,15 @@ <%-- 8 --%> -
+
<%-- 9 --%> - + - - <%----%> +
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index cc37d055e..b45976131 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1548,8 +1548,8 @@ Partial Class Compras_Compras End If - 'SE OCUPAN AFUERA DEL POSTBACK ?? - cargaddlVinculacionServcios() + 'SE OCUPAN AFUERA DEL POSTBACK ?? + cargaddlVinculacionServcios() If UsuarioActual.TienePermisoProceso(117) Then HplAddClasificacion.Visible = False @@ -1574,9 +1574,30 @@ Partial Class Compras_Compras End If + + + MostrarOcultarColumnaIEPS() + + End Sub #Region "C A R G A S" + + Private Sub MostrarOcultarColumnaIEPS() + + + If TxtIEPS.Text.ToDecimal <> 0 And TmpDT.SUM("IEPSPS") <> 0 Then + GvPS.Columns(9).Visible = True + TD_Gvps_IEPS.Visible = True + Else + GvPS.Columns(9).Visible = False + TD_Gvps_IEPS.Visible = False + End If + UpPS.Update() + + End Sub + + Private Sub CargaOrdenCorte() Dim ObjCGame As New ClsCGame() If ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa) Then @@ -4361,8 +4382,6 @@ Partial Class Compras_Compras Exit Sub End If - - '------------------TERMINA VALIDACIONES------------------ 'si hay necesidad de actualizar el globaldtps @@ -8640,6 +8659,16 @@ Partial Class Compras_Compras End If + For Each dRow As DataRow In TmpDT.Rows + + If dRow("IEPSPSPorcentaje").ToString.ToDecimal > 0 AndAlso dRow("IEPSPS").ToString.ToDecimal = 0 Then + dRow("IEPSPSPorcentaje") = 0 + End If + + Next + + TmpDT.AcceptChanges() + End If @@ -18267,7 +18296,11 @@ Partial Class Compras_Compras End If UpPS.Update() - CargaGvPersonal() + CargaGvPersonal() + + MostrarOcultarColumnaIEPS() + + End Sub ''' ''' Regresa el INDEX del row que acaba de agregar en el TMPDT @@ -19772,6 +19805,9 @@ Partial Class Compras_Compras Alert("Debe seleccionar al menos un impuesto", TipoMensaje.MsgAdvertencia) End If + + MostrarOcultarColumnaIEPS() + End Sub #End Region diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 02c085bfd..f8f3c9304 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -2787,7 +2787,7 @@ Partial Class Compras_eFacturas XMLNodosPagosModalCount = 0 Dim XMLDoc As New XmlDocument - Dim Archivo As String = String.Format("{0}Compras\{2}\{3}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML")) + Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML")) If IO.File.Exists(Archivo) Then