From ea384a13c855b2dde596c528d535e71d7b5dce79 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 10 Jul 2020 11:32:42 -0700 Subject: [PATCH 01/56] validacion sat, incluir en clase y considerar la que usamos al cancelar --- App_Code/ClsValidaCFDi.vb | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsValidaCFDi.vb b/App_Code/ClsValidaCFDi.vb index 59aebfc3a..02031dff8 100644 --- a/App_Code/ClsValidaCFDi.vb +++ b/App_Code/ClsValidaCFDi.vb @@ -102,8 +102,35 @@ Public Class ClsValidaCFDi EsValida = 2 End If - Catch ex As Exception + 'SI NO PUEDE ENCONTRAR EL ESTATUS UTILIZA EL SERVICIO PARA ESTATUS DE CANCELACION + If EsValida = 0 Then + + Dim Vigencia = Timbrado.VerificarVigenciaSAT(LFolioFiscal.ToUpper, LRFCEmisor, LRFCReceptor, Importe, True) + + If Vigencia IsNot Nothing Then + If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then + EsValida = 1 + End If + If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then + EsValida = 2 + ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then + If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then + EsValida = 1 + ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then + EsValida = 1 + ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then + EsValida = 1 + End If + Else + EsValida = 0 + End If + Else + EsValida = 0 + End If + End If + Catch ex As Exception + OnError("Ocurrió un error al consultar la vigencia ante el SAT", ex) End Try End Sub From 0fc5d89d203eb76b501ff42c7e2f3856c678acdb Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 10 Jul 2020 11:33:37 -0700 Subject: [PATCH 02/56] Correciones en importar desde excel al hacer ajustes en seccion de almacen --- Inventarios/AjustesSeccionAlmacen.aspx.vb | 55 ++++++++++++++++------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index e00c268dd..478c321f9 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -13,10 +13,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen End Sub Private Sub CargaCombos() - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + DdlAlmacen.DataSource = DtAlmacenes DdlAlmacen.DataBind() - DdlAlmacenExcel.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacenExcel.DataSource = DtAlmacenes DdlAlmacenExcel.DataBind() DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) @@ -216,7 +218,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "") If Tipo = "EXCEL" Then Dim CveAlmacen As Integer = DdlAlmacenExcel.SelectedValue.ToEntero() - Dim CveSubProyecto As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}") + Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}") CargarArchivo(Directorio, file.filename, CveAlmacen, CveSubProyecto) Else @@ -267,7 +269,10 @@ Partial Class Inventarios_AjustesSeccionAlmacen If Not ErrorArchivo Then Dim ErrorMovInv As Boolean = False - Dim RowNoEncontrados As New StringBuilder() + Dim CodigosNoEncontrados As New StringBuilder() + Dim SeccionesNoEncontradas As New StringBuilder() + Dim ExistenciasNoEncontradas As New StringBuilder() + Dim NumAgregados As Integer = 0 Dim ObjInventario As New ClsInventarios() @@ -275,7 +280,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Try Dim DtExistenciasSecciones As DataTable = Nothing - If ObjInventario.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacenExcel.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then DtExistenciasSecciones = ObjInventario.DtResultados.Copy() End If @@ -293,9 +298,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen For Each RowExcel As DataRow In DtExcel.Rows Dim Codigo As String = RowExcel("Código").ToString.Trim() - Dim PS As String = RowExcel("Producto/Servicio").ToString().Trim() + 'Dim PS As String = RowExcel("Producto/Servicio").ToString().Trim() - Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Codigo).FiltroPrimero($"PS='{PS}'") + Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo='{Codigo}'") If DrPS IsNot Nothing Then If Not ErrorMovInv Then @@ -303,7 +308,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim CantidadEntrada As Decimal = RowExcel("Cantidad").ToString().ToDecimal() Dim CvePS As Integer = DrPS("CvePS").ToString().ToEntero() - Dim CveUM As Integer = DrPS("CveUM").ToString().ToEntero() + Dim CveUM As Integer = DrPS("CveUnidadMedida").ToString().ToEntero() Dim SeccionAlmacen As String = RowExcel("SeccionAlmacen").ToString.Trim Dim CveSeccionAlmacen As Integer = -1 @@ -319,7 +324,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}") - If RowExistencia IsNot Nothing Then + If RowExistencia IsNot Nothing AndAlso CveSeccionAlmacen > 0 Then Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero() Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal() Dim SerieSalida As String = RowExistencia("Serie").ToString() @@ -362,13 +367,22 @@ Partial Class Inventarios_AjustesSeccionAlmacen End If Else ErrorMovInv = True - RowNoEncontrados.AppendFormat("{0},", Codigo) + End If + + If RowExistencia Is Nothing Then + ExistenciasNoEncontradas.AppendFormat("{0},", SeccionAlmacen) + ErrorMovInv = True + End If + + If CveSeccionAlmacen <= 0 Then + SeccionesNoEncontradas.AppendFormat("{0},", SeccionAlmacen) + ErrorMovInv = True End If End If Else ErrorMovInv = True - RowNoEncontrados.AppendFormat("{0},", Codigo) + CodigosNoEncontrados.AppendFormat("{0},", Codigo) End If Next @@ -383,10 +397,21 @@ Partial Class Inventarios_AjustesSeccionAlmacen ObjInventario.RollBack() Dim SbError As New StringBuilder() - SbError.Append("Ocurrió un error al guardar") - If RowNoEncontrados.Length > 0 Then - SbError.Append("Los siguientes códigos no fueron encontrados en el sistema.
") - SbError.Append(RowNoEncontrados.ToString()) + SbError.Append("Ocurrió un error al guardar.
") + + If CodigosNoEncontrados.Length > 0 Then + SbError.Append("
Los siguientes códigos no fueron encontrados en el sistema.
") + SbError.Append(CodigosNoEncontrados.ToString()) + End If + + If ExistenciasNoEncontradas.Length > 0 Then + SbError.Append($"
Los siguientes códigos no se encontraron existencias en el almacen: '{DdlAlmacenExcel.SelectedItem.Text}'.
") + SbError.Append(ExistenciasNoEncontradas.ToString()) + End If + + If SeccionesNoEncontradas.Length > 0 Then + SbError.Append("
Las siguientes secciones de almacen no fueron encontradas en el sistema.
") + SbError.Append(SeccionesNoEncontradas.ToString()) End If Alert(SbError.ToString(), TipoMensaje.MsgError) From 2f80f2603c845312a1f0c66f9b97e9c501e51a76 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Sat, 11 Jul 2020 10:59:28 -0700 Subject: [PATCH 03/56] Correcion en UsurioDetalle , getAlamcen() se agrego parametro CveCompra --- Sistemas/UsuarioDetalle.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 3c769756c..1465720ec 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -1323,7 +1323,7 @@ Partial Class Sistemas_UsuarioDetalle 'RECARGA GLOBAL ALMACEN - If ObjUsuarios.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing + If ObjUsuarios.GetAlmacen(-1, UsuarioActual.CveEmpresa) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing 'RECARGA GLOBAL EMPRESAS USUARIOS @@ -2068,7 +2068,7 @@ Partial Class Sistemas_UsuarioDetalle Private Sub CargaDtAlmacen() Dim ClsUsuarios As New ClsSisUsuarios - If ClsUsuarios.GetAlmacen(CveUsuario) Then + If ClsUsuarios.GetAlmacen(CveUsuario, UsuarioActual.CveEmpresa) Then DtAlmacenes = ClsUsuarios.DtResultados.FiltraParametros(String.Format("CveUsuario = {0}", CveUsuario)) Else DtAlmacenes = Nothing From 72afa5097e9f1cc67921f0bbaca859f14c3d5602 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 11 Jul 2020 12:41:01 -0700 Subject: [PATCH 04/56] -globaldtusuarioalmacen --- Inventarios/CatAlmacenes.aspx.vb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Inventarios/CatAlmacenes.aspx.vb b/Inventarios/CatAlmacenes.aspx.vb index c600d6351..b1fc5a922 100644 --- a/Inventarios/CatAlmacenes.aspx.vb +++ b/Inventarios/CatAlmacenes.aspx.vb @@ -205,11 +205,8 @@ Partial Class Inventarios_CatAlmacenes End Sub Private Sub RecargaGlobalAlmacenesUsuarios() - Dim ObjUsuarios As New ClsSisUsuarios - If ObjUsuarios.GetAlmacen(-1) Then - Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados - End If - ObjUsuarios.Dispose() + GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing + End Sub 'Private Sub CargaSucursal() ' DtSubProyectos = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto =" & DdlSubProyecto.SelectedValue.ToEntero) From 47fac3d34de1103c1e2eff1f7ece7d8962cf9576 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 11 Jul 2020 15:50:17 -0700 Subject: [PATCH 05/56] API en Clientes.aspx --- Ventas/Clientes.aspx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index d537bc6bb..71897ac72 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -7028,8 +7028,6 @@ } - + From e5e25a32e6fbd96c32976533b91eadb7aec67309 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 13 Jul 2020 09:37:47 -0700 Subject: [PATCH 06/56] Tarea119 adjuntar archivos a correo --- TareasProgramadas/Tareas119.ashx | 65 +++++++++++++++++++++++++------- vwd.webinfo | 2 + 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index 1f560654a..afd3762fe 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -10,6 +10,7 @@ using System.Web.Services.Protocols; using GemBox.Spreadsheet; using System.Data; using System.Text; +using System.Collections.Generic; public class TareasJam : IHttpHandler { @@ -57,9 +58,21 @@ public class TareasJam : IHttpHandler DataTable DTClientes = new DataTable(); DataTable DTAlmacenes = new DataTable(); - string FTPServer = "ftp://127.0.0.1/"; - string TFPUsr = "Toor"; - string FTPPass = "agj-3500"; + string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + + + //"ftp://us2.hostedftp.com/", "agrojam", "A12345678"; + //string FTPServer = "ftp://127.0.0.1/"; + //string TFPUsr = "Toor"; + //string FTPPass = "agj-3500"; + + + string FTPServer = "ftp://us2.hostedftp.com"; + string TFPUsr = "agrojam"; + string FTPPass = "A12345678"; bool ErrorProceso = false; @@ -179,8 +192,8 @@ public class TareasJam : IHttpHandler string tmpString = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd"); dRow[3] = tmpString; } - DTAlmacenes.AcceptChanges(); - + DTAlmacenes.AcceptChanges(); + } @@ -197,10 +210,7 @@ public class TareasJam : IHttpHandler if (!ErrorProceso) { - string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; - string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; - string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; - string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + SpreadsheetInfo.SetLicense(Extensiones.ModExtensiones.SerialGemBoxSpreadsheet()); @@ -344,24 +354,53 @@ public class TareasJam : IHttpHandler string Cuerpo = Respuesta ? $"Correcto
Tarea de carga de archios Corteva realizada correctamente
{SBLog.ToString()}" : $"Error
Error tarea de carga de archios Corteva
{SBLog.ToString()}" ; - MandaCorreo(Cuerpo, Respuesta); + + + + MandaCorreo(Cuerpo, Respuesta, RutaProductos, RutaVentas, RutaClientes, RutaAlmacenes); return Respuesta; } - private void MandaCorreo(string Cuerpo, bool ErrorProceso) + private void MandaCorreo(string Cuerpo, bool ErrorProceso, string RutaProductos, string RutaVentas, string RutaClientes, string RutaAlmacenes) { try { + + List ListaArchivos = new List(); + + ClsSisMail.ArchivoMail Productos = new ClsSisMail.ArchivoMail(); + ClsSisMail.ArchivoMail Ventas = new ClsSisMail.ArchivoMail(); + ClsSisMail.ArchivoMail Clientes = new ClsSisMail.ArchivoMail(); + ClsSisMail.ArchivoMail Almacenes = new ClsSisMail.ArchivoMail(); + + Productos.Ruta = RutaProductos; + Ventas.Ruta = RutaVentas; + Clientes.Ruta = RutaClientes; + Almacenes.Ruta = RutaAlmacenes; + + //FileInfo FIp = new FileInfo(RutaProductos); + //FileInfo FIv = new FileInfo(RutaVentas); + //FileInfo FIc = new FileInfo(RutaClientes); + //FileInfo FIa = new FileInfo(RutaAlmacenes); + + + + ListaArchivos.Add(Productos); + ListaArchivos.Add(Ventas); + ListaArchivos.Add(Clientes); + ListaArchivos.Add(Almacenes); + + ClsSisMail Correo = new ClsSisMail(); string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx"; - // string Para = "oscar.irigoyen@adssistemas.mx"; + // string Para = "oscar.irigoyen@adssistemas.mx"; string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}"; - Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo); + Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos); }catch(Exception ex) { diff --git a/vwd.webinfo b/vwd.webinfo index 65b4102ee..6a84ef014 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -80,6 +80,8 @@ + + From 1bb39f45db6163869c91dbbcdae3f7538dcb0c18 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 14 Jul 2020 09:43:08 -0700 Subject: [PATCH 07/56] se consideran los nuevos campos serie,lote y fecha caducidad en el inventario fisico --- Inventarios/InventarioFisicoDetalle.aspx | 6 +++--- Inventarios/InventarioFisicoDetalle.aspx.vb | 18 +++++++++++------- Inventarios/RepAnomalias.aspx | 8 ++++++-- Inventarios/RepAnomalias.aspx.vb | 11 ++++++++++- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/Inventarios/InventarioFisicoDetalle.aspx b/Inventarios/InventarioFisicoDetalle.aspx index a1c069487..c702804ee 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx +++ b/Inventarios/InventarioFisicoDetalle.aspx @@ -92,7 +92,7 @@
  • - +
  • @@ -232,7 +232,7 @@ -
    +
    @@ -323,7 +323,7 @@ - + diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index d478c9d76..208728062 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -103,7 +103,7 @@ Partial Class Inventarios_InventarioFisicoDetalle lbEstatus.Text = ObjInventario.Estatus lbFechaF.Text = ObjInventario.FechaF - btnFin.Text = "Iniciar" + btnFin.Text = "Iniciar" BtnGuardar.Enabled = False btnFin.ToolTip = "Inicia el Inventario Físico" Case "3" 'FINALIZADO @@ -128,7 +128,7 @@ Partial Class Inventarios_InventarioFisicoDetalle lbFechaI.Text = ObjInventario.FechaI lbFechaF.Text = ObjInventario.FechaF BtnGuardar.Enabled = True - btnFin.Text = "Finalizar" + btnFin.Text = "Finalizar" LBAvance.Visible = UsuarioActual.TienePermisoProceso(178) ' si tiene permiso de ver el avance, se activa End Select GvIFD.Visible = False @@ -293,16 +293,18 @@ Partial Class Inventarios_InventarioFisicoDetalle Exit Sub End If - Dim Consulto As Boolean = False Using Inventarios As New ClsInventarios If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(CveMetodoInv = 5, 1, Cantidad), SerieLote, UsuarioActual.CveUsuario, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then + + GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0 + GvIFDUltimoRegistrado.Columns(5).Visible = SerieLote <> "-1" + GvIFDUltimoRegistrado.Columns(6).Visible = Lote <> "-1" + GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad <> "01/01/1900" + If GvIFDUltimoRegistrado.Rows.Count > 0 Then - GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0 - GvIFDUltimoRegistrado.Columns(6).Visible = Lote <> "-1" - GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad <> "01/01/1900" GvIFDUltimoRegistrado.Rows(0).Cells(0).Text = Now GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString @@ -390,7 +392,7 @@ Partial Class Inventarios_InventarioFisicoDetalle #Region " FINALIZAR " Protected Sub btnFin_Click(sender As Object, e As EventArgs) Handles btnFin.Click - If btnFin.Text = "Iniciar" Then + If btnFin.Text.Contains("Iniciar") Then Dim Inventarios As New ClsInventarios Inventarios.UpdateInventarioFisicoEstatus(CveInventarioFisico, 1, UsuarioActual.CveEmpresa) @@ -526,10 +528,12 @@ Partial Class Inventarios_InventarioFisicoDetalle Dim AplicaSeccion As Boolean = Producto("AplicaSeccion") = "1" Dim AplicaCaducidad As Boolean = Producto("AplicaCaducidad") = "1" Dim AplicaLote As Boolean = Producto("AplicaLote") = "1" + Dim AplicaSerie As Boolean = Producto("AplicaSerie") = "1" divSeccionAlmacen.Visible = AplicaSeccion divLote.Visible = AplicaLote divFechaCaducidad.Visible = AplicaCaducidad + divSerie.Visible = AplicaSerie UPAgregarPro.Update() End Sub End Class diff --git a/Inventarios/RepAnomalias.aspx b/Inventarios/RepAnomalias.aspx index 284ea3c83..8d3185711 100644 --- a/Inventarios/RepAnomalias.aspx +++ b/Inventarios/RepAnomalias.aspx @@ -198,7 +198,9 @@ - + + + @@ -230,7 +232,9 @@ - + + + diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index 73046d131..a239ccbab 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -136,9 +136,14 @@ Partial Class Inventarios_RepAnomalias Inventario.Dispose() GvS.DataSource = dt.FiltraParametros("Diferencia < 0") + Dim DtS As DataTable = dt.FiltraParametros("Diferencia < 0") GvS.DataBind() + BanderaSerieLoteCad(GvS, DtS) + GvF.DataSource = dt.FiltraParametros("Diferencia > 0") + Dim DtF As DataTable = dt.FiltraParametros("Diferencia > 0") GvF.DataBind() + BanderaSerieLoteCad(GvF, DtF) Dim Script = "" If (GvF.Rows.Count > 0) Then @@ -267,6 +272,10 @@ Partial Class Inventarios_RepAnomalias End Sub #End Region - + Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable) + Gv.Columns(4).Visible = resultado.MAX("Serie") <> "" + Gv.Columns(5).Visible = resultado.MAX("Lote") <> "" + Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad") <> "" + End Sub End Class From 18d4924998675d7848a70ad8aba9d9828e0f7a18 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 14 Jul 2020 10:14:16 -0700 Subject: [PATCH 08/56] --Globalalmacenusuarios --- Sistemas/CatSesiones.aspx.vb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 0b2111830..8e3985724 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -153,9 +153,10 @@ Partial Class Sistemas_CatSesiones Private Sub CargaAlmacenUsuarios() - Dim Obj As New ClsSisUsuarios - If Obj.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = Obj.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing - Obj.Dispose() + GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing + 'Dim Obj As New ClsSisUsuarios + 'If Obj.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = Obj.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing + 'Obj.Dispose() End Sub Private Sub CargaClientes() @@ -267,8 +268,9 @@ Partial Class Sistemas_CatSesiones Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados Else Application("GlobalDTUsuarios") = Nothing - End If - If ObjUsuarios.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing + End If + GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing + 'If ObjUsuarios.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing ObjUsuarios.Dispose() 'Fin Carga Usuarios End Sub From bb0b7c11514d6cd59affea7d0e59a74e3b6f2d1c Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 14 Jul 2020 11:21:40 -0700 Subject: [PATCH 09/56] =?UTF-8?q?avance=20del=20nuevo=20cat=C3=A1logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 1 + Compras/CatTipoGasto.aspx | 75 ++++++++++++++++++++++++++++++++++++ Compras/CatTipoGasto.aspx.cs | 53 +++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 Compras/CatTipoGasto.aspx create mode 100644 Compras/CatTipoGasto.aspx.cs diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 531cadc14..9a4c0c915 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4100,6 +4100,7 @@ Public Class ClsPaginas PaginaDict.Add("/OI/Circular.aspx".ToUpper(), 756) PaginaDict.Add("/OI/CircularDetalle.aspx".ToUpper(), 757) PaginaDict.Add("/OI/CircularDetalleB.aspx".ToUpper(), 757) + PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759) #End Region diff --git a/Compras/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx new file mode 100644 index 000000000..0857adb09 --- /dev/null +++ b/Compras/CatTipoGasto.aspx @@ -0,0 +1,75 @@ +<%@ Page Title="Compras - Catálogo de Tipos de Gasto" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTipoGasto.aspx.cs" Inherits="Compras_CatTipoGasto" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Motivos de Rechazo de Paquetes + + + + +
  • + +
  • + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs new file mode 100644 index 000000000..e10e6156f --- /dev/null +++ b/Compras/CatTipoGasto.aspx.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class Compras_CatTipoGasto : ClsPaginas +{ + private int CveTipoGasto + { + get + { + return ViewState["CveTipoGasto"].ToString().ToEntero(); + } + + set + { + ViewState["CveTipoGasto"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAC ObjAC = new ClsAC(); + if (ObjAC.GetTipoGasto()) + { + GvDatos.DataSource = ObjAC.DtResultados; + GvDatos.DataBind(); + } + ObjAC.Dispose(); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarTiposDModal.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero(); + DescripcionTxt.Text = GvRow.DataKey("Descripcion"); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } +} \ No newline at end of file From 809c549f7a8d794c0df5c4a1c36c8450270943e3 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 14 Jul 2020 13:31:12 -0700 Subject: [PATCH 10/56] quitando nombre de empresa a los correos en html --- General/PopUpPaqueteriasGuias.aspx.cs | 4 +- General/RepPaqueteriasGuias.aspx.cs | 57 ++++++++++++++----------- Inventarios/EntregaAlmacen.aspx.vb | 4 +- Inventarios/EntregasPorRealizar.aspx.cs | 4 +- 4 files changed, 37 insertions(+), 32 deletions(-) diff --git a/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs index 97e830f06..3c8e94472 100644 --- a/General/PopUpPaqueteriasGuias.aspx.cs +++ b/General/PopUpPaqueteriasGuias.aspx.cs @@ -787,11 +787,11 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas strBody.Append("
    "); strBody.Append("

    "); strBody.Append(" Gracias por realizar pedido
    "); - strBody.Append(" Compuproveedores"); + //strBody.Append(" Compuproveedores"); strBody.Append("

    "); strBody.Append("

    "); strBody.Append(" Sigue disfrutando de nuestros productos y servicios
    "); - strBody.Append(" www.compuproveedores.com"); + //strBody.Append(" www.compuproveedores.com"); strBody.Append(""); strBody.Append("

    "); strBody.Append(" "); diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index 2633ccd25..af2e3a827 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -202,7 +202,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas } CargaDatos(); - + } } @@ -231,7 +231,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas DdlPaqueterias.DataBind(); DdlPaqueterias.Items.Insert(0, new ListItem("Todos ", "-1")); } - + DdlPaqueteriaEditar.DataSource = get_GlobalDTPaqueterias(UsuarioActual.CveEmpresa); DdlPaqueteriaEditar.DataBind(); @@ -254,7 +254,8 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas if (UsuarioActual.CveRol == 1339) { DdlEstatus.Items.Insert(0, new ListItem("En Proceso ", "2")); - }else + } + else { DdlEstatus.Items.Insert(0, new ListItem("Todos ", "-1")); DdlEstatus.Items.Insert(1, new ListItem("Pendiente ", "1")); @@ -272,7 +273,8 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas DdlEstatusEditar.Items.Insert(4, new ListItem("Confirmado por Cliente", "4")); DdlEstatusEditar.SelectedValue = "-1"; - if(UsuarioActual.Empresa.Funcionalidad(280) == "1"){ + if (UsuarioActual.Empresa.Funcionalidad(280) == "1") + { DivEstatusEntrega.Visible = true; } @@ -282,7 +284,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { if (UsuarioActual.CveRol == 1339) { - DdlUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveRol = {0}",UsuarioActual.CveRol)); + DdlUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveRol = {0}", UsuarioActual.CveRol)); DdlUsuarios.DataBind(); } else @@ -336,7 +338,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas String FechaIngInicio = TxtFechaInicialIngreso.Text == "" ? "-1" : TxtFechaInicialIngreso.Text; String FechaIngFin = TxtFechaFinalIngreso.Text == "" ? "-1" : TxtFechaFinalIngreso.Text; - if (ObjGeneral.GetPaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CvePaqueteria, CveEstatus, CveSubProyecto, CveEmpresa, Guia, FechaInicio, FechaFin, + if (ObjGeneral.GetPaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CvePaqueteria, CveEstatus, CveSubProyecto, CveEmpresa, Guia, FechaInicio, FechaFin, FechaIngInicio, FechaIngFin, Filtro: Filtro, CveUsuarioEntrega: CveUsuarioEntrega, EsEntregaInterna: ChkLote.Checked)) { DTDatos = ObjGeneral.DtResultados; @@ -356,7 +358,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas int CvePaqueteriaGuiaTipo = DdlTipoEditar.SelectedValue.ToEntero(); int CveEstatus = DdlEstatusEditar.SelectedValue.ToEntero(); int CveSubProyecto = DdlSucursalesEditar.SelectedValue.ToEntero(); - + String Guia = (TxtGuia.Text != "") ? TxtGuia.Text : "-1"; String Rastreo = TxtRastreo.Text; String Fecha = TxtFecha.Text; @@ -372,7 +374,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas if (ObjGeneral.UpdatePaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CveSubProyecto, CvePaqueteria, CveEstatus, Fecha, Rastreo, Guia, NumCajas, Peso, Dimensiones, FechaEstimada, Observaciones, ImplicaCosto)) { - + if (Guia == "-1") { Alert(String.Format("La Guía se ha actualizado correctamente."), ModExtensiones.TipoMensaje.MsgInformacion); @@ -486,7 +488,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas TxtPeso.Text = String.Format("{0:N3}", GvRow.DataKey("Peso").ToDouble()); TxtDimensiones.Text = GvRow.DataKey("Dimensiones"); TxtObservaciones.Text = GvRow.DataKey("Observaciones"); - + ChkImplicaCosto.Checked = Boolean.Parse(GvRow.DataKey("ImplicaCosto")); Boolean mostrarDescarga = CrearArchivo(false); @@ -494,7 +496,8 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas if (mostrarDescarga) { DivDownloadGuia.Visible = true; - } else + } + else { DivDownloadGuia.Visible = false; } @@ -533,9 +536,9 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { BtnEliminarGuia.Visible = false; } - + UPEditarGuia.Update(); - + this.RegistraScript("$('#DivEditarGuia').modal('show');"); } @@ -716,7 +719,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas int EstatusEntregado = 3; //Mandamos a actualizar solo el estatus - if (!ObjGral.UpdatePaqueteriasGuias(CvePaqueteriaGuia,-1, -1, -1, EstatusEntregado, "-1", "", "", -1, -1, "-1", "-1", "")) + if (!ObjGral.UpdatePaqueteriasGuias(CvePaqueteriaGuia, -1, -1, -1, EstatusEntregado, "-1", "", "", -1, -1, "-1", "-1", "")) { TieneError = true; } @@ -732,7 +735,8 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas if (MensajeEnviado) { Alert(String.Format("El Archivo ha sido guardado y el estatus de la Guía ha sido actualizado correctamente.

    Correo enviado exitosamente a {0}.", Destinatario)); - }else + } + else { Alert(String.Format("El Archivo ha sido guardado y el estatus de la Guía ha sido actualizado correctamente.

    Error al Notificar al Cliente a su correo: {0}.", Destinatario)); } @@ -777,7 +781,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { String path = Path.Combine(UsuarioActual.Empresa.Ruta, "Documentos", "Guias", CvePaqueteriaGuia.ToString() + ".pdf"); System.IO.FileInfo file = new System.IO.FileInfo(path); - + string[] fileEntries = Directory.GetFiles(Path.Combine(UsuarioActual.Empresa.Ruta, "Documentos", "Guias")); foreach (string fileName in fileEntries) @@ -793,7 +797,8 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas if (descargar) { DescargarArchivo(file); - }else + } + else { if (!file.Exists) { @@ -813,11 +818,11 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { Response.Clear(); - Response.AddHeader("Content-Disposition", "attachment; filename="+ String.Format("Guia {0} - {1}{2}",Paqueteria, Guia,File.Extension)); + Response.AddHeader("Content-Disposition", "attachment; filename=" + String.Format("Guia {0} - {1}{2}", Paqueteria, Guia, File.Extension)); Response.AddHeader("Content-Length", File.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.WriteFile(File.FullName); - + Response.End(); } catch (Exception e) @@ -1006,7 +1011,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas SerieFolio = String.Format("{0}-{1}", DbRowVenta["Serie"].ToString(), DbRowVenta["Folio"].ToString().ToEntero()); NombreCliente = DbRowVenta["ClienteNombre"].ToString(); - + //Si se subio Archivo if (!SubirArchivo) { @@ -1037,7 +1042,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas private string getCorreoNotificacion(int CveCliente, int CveVendedor) { - DataRow DatosCliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveCliente = {0}",CveCliente)); + DataRow DatosCliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveCliente = {0}", CveCliente)); DataRow DatosVendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveVendedor = {0}", CveVendedor)); if (DatosCliente != null && DatosVendedor != null) { @@ -1060,11 +1065,11 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas CveVenta = GvRow.DataKey("CveAgrupador").ToString().ToEntero(); Folio = GvRow.DataKey("Folio").ToString(); } - + protected void BtnReasignar_Click(object sender, EventArgs e) { ClsGenerales ObjGeneral = new ClsGenerales(); - if (ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriaGuiaReasignar, -1, CveMotivoRechazoPaqueteria:DdlMotivoRechazoGuia.SelectedValue.ToEntero())) + if (ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriaGuiaReasignar, -1, CveMotivoRechazoPaqueteria: DdlMotivoRechazoGuia.SelectedValue.ToEntero())) { Alert("La guía está lista para volver a ser asignada, disponible en el reporte Entregas Por Realizar"); } @@ -1072,7 +1077,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas CargaDatos(); UPDatos.Update(); CvePaqueteriaGuiaReasignar = -1; - EnviarCorreoNotificacionEntrega(3, Folio, "","","","","",-1,null); + EnviarCorreoNotificacionEntrega(3, Folio, "", "", "", "", "", -1, null); this.RegistraScript("$('#ModalMotivoReasignacion').modal('hide')", "hidemodal3"); } @@ -1080,7 +1085,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { ClsVentas ObjVentas = new ClsVentas(); - if (ObjVentas.GetVenta(CveVenta,UsuarioActual.CveEmpresa)) + if (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) { DataRow row = ObjVentas.DtResultados.Rows[0]; string ClienteNombre = row["ClienteNombre"].ToString(); @@ -1122,11 +1127,11 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas strBody.Append("
    "); strBody.Append("

    "); strBody.Append(" Agradecemos su preferencia.
    "); - strBody.Append(" Compuproveedores"); + //strBody.Append(" Compuproveedores"); strBody.Append("

    "); strBody.Append("

    "); strBody.Append(" Sigue disfrutando de nuestros productos y servicios
    "); - strBody.Append(" www.compuproveedores.com"); + //strBody.Append(" www.compuproveedores.com"); strBody.Append(""); strBody.Append("

    "); strBody.Append(" "); diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index d2acbfd5f..8dff1f8c8 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -3256,11 +3256,11 @@ Partial Class Inventarios_EntregaAlmacen strBody.Append("
    ") strBody.Append("

    ") strBody.Append(" Gracias por su compra
    ") - strBody.Append(" Compuproveedores") + 'strBody.Append(" Compuproveedores") strBody.Append("

    ") strBody.Append("

    ") strBody.Append(" Sigue disfrutando de nuestros productos y servicios
    ") - strBody.Append(" www.compuproveedores.com") + 'strBody.Append(" www.compuproveedores.com") strBody.Append("") strBody.Append("

    ") strBody.Append(" ") diff --git a/Inventarios/EntregasPorRealizar.aspx.cs b/Inventarios/EntregasPorRealizar.aspx.cs index 4a24c6f5a..689c7d368 100644 --- a/Inventarios/EntregasPorRealizar.aspx.cs +++ b/Inventarios/EntregasPorRealizar.aspx.cs @@ -178,11 +178,11 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas strBody.Append("
    "); strBody.Append("

    "); strBody.Append(" Gracias por realizar su pedido
    "); - strBody.Append(" Compuproveedores"); + //strBody.Append(" Compuproveedores"); strBody.Append("

    "); strBody.Append("

    "); strBody.Append(" Sigue disfrutando de nuestros productos y servicios
    "); - strBody.Append(" www.compuproveedores.com"); + //strBody.Append(" www.compuproveedores.com"); strBody.Append(""); strBody.Append("

    "); strBody.Append(" "); From af85c5c3fe088d3e6e1c373702f17bea451bbb17 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 14 Jul 2020 19:07:31 -0700 Subject: [PATCH 11/56] Error al enviar correo en facturacion masiva --- Compras/PopUpVerFactura.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 3b343b278..adabb7677 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -105,7 +105,7 @@ Partial Class PopUpVerFactura Dim UsuarioToken = ValidaUsuarioSistema(CveEmpresaToken, CveUsuario) - If UsuarioToken IsNot Nothing AndAlso UsuarioActual Is Nothing Then + If UsuarioToken IsNot Nothing AndAlso Context.Session("UsuarioSIG") Is Nothing Then Context.Session("UsuarioSIG") = UsuarioToken End If End If From 2c19a40bbf31536cdac30d307e7e1d19a0b73b82 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 14 Jul 2020 19:10:48 -0700 Subject: [PATCH 12/56] Pedidos 2 desde portal cliente --- App_Code/ClsClientes.vb | 5 +- App_Code/Modelos.vb | 8 + PortalCliente/PortalCliente.aspx | 3116 +++++++++++++++------------ PortalCliente/PortalCliente.aspx.vb | 702 +++++- 4 files changed, 2290 insertions(+), 1541 deletions(-) diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 7a14674f8..9435c83d1 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -525,7 +525,7 @@ Public Class ClsClientes 'SqlAdapter.Dispose() Return Retorno End Function - Public Function GetHistorialVentas(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional TipoDocto As String = "-1") As Boolean + Public Function GetHistorialVentas(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional TipoDocto As String = "-1", Optional CveEstatusFactura As Integer = -1, Optional FechaI As DateTime = ModExtensiones.MinFecha, Optional FechaF As DateTime = ModExtensiones.MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClienteHistorialVentas") @@ -533,6 +533,9 @@ Public Class ClsClientes SqlAdapter.SelectCommand.Parameters.Add("@SelectTop", SqlDbType.Int).Value = SelectTop SqlAdapter.SelectCommand.Parameters.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal SqlAdapter.SelectCommand.Parameters.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto + SqlAdapter.SelectCommand.Parameters.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura + SqlAdapter.SelectCommand.Parameters.Add("@FechaI", SqlDbType.DateTime).Value = FechaI + SqlAdapter.SelectCommand.Parameters.Add("@FechaF", SqlDbType.DateTime).Value = FechaF Try SqlAdapter.Fill(Data) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 5d28a3a5a..2157dedef 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4265,6 +4265,14 @@ Namespace Modelos Return Retorno End If + 'VALIDACION DE PEDIDOS: SI ESTA ENTEGADO NO SE PUEDA CANCELAR + If ObjFactura.TipoDocto = "Pd2" AndAlso TieneAlmacen AndAlso ObjFactura.SaldoAlmacen <> 0 Then + Retorno.Mensaje = "El pedido no se puede cancelar debido ha que ya fue entregado." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion) diff --git a/PortalCliente/PortalCliente.aspx b/PortalCliente/PortalCliente.aspx index bd846d0b1..cf82c513a 100644 --- a/PortalCliente/PortalCliente.aspx +++ b/PortalCliente/PortalCliente.aspx @@ -1,600 +1,657 @@ -<%@ Page Title="Portal Cliente" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PortalCliente.aspx.vb" Inherits="Ventas_PortalCliente" %> - -<%@ Register Assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24d65337282035f2" Namespace="eWorld.UI" TagPrefix="ew" %> - - - - - - -
  • - Descargar todos los PDF -
  • -
  • - Descargar todos los XML -
  • - - -
  • - Agregar Concepto -
  • -
    -
    -
    - -   - - - - - - - - - + +
    - - - - - - - - - - - - - - - - - - -
    -
    -
    - Resumen - - - - - - - - - - - - - - - - - - - - - -
    Cantidad de Compras:  -
    Total Comprado:  -
    Compra Mínima:  -
    Promedio de Compras:  -
    Compra Máxima:  -
    -
    -
    -
    -
    -
    - - - - - - - - -
    -
    -
    - -
    -
    - Historial de Compras - - - - - - - - - - -
    - - - - - - - - - - - Tipo - - - - - - - - - Factura - - - - - - - - Fecha - - - - - - - Sub Total - - - - - - - Descuento - - - - - - - Amortización - - - - - - - Total - - - - - - - - Moneda - - - - - - - Estatus - - - - - - - Se Timbró - - - - - - - Envío Mail - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    -
    -
    -
    - - - - - - + +
    -
    -
    - Cuentas por Pagar Activas - - - - - - - - - + + + + +
    - - - - - - - - - - Factura - - - - - - Fecha Compra - - - - - - Fecha Vencimiento - - - - - - - Días Vencidos - +<%@ Page Title="Portal Cliente" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PortalCliente.aspx.vb" EnableEventValidation="false" Inherits="Ventas_PortalCliente" %> + +<%@ Register Assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24d65337282035f2" Namespace="eWorld.UI" TagPrefix="ew" %> + + + + + + +
  • + Descargar todos los PDF +
  • +
  • + Descargar todos los XML +
  • +
    + +   + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    +
    +
    + Resumen + + + + + + + + + + + + + + + + + + + + + +
    Cantidad de Compras:  +
    Total Comprado:  +
    Compra Mínima:  +
    Promedio de Compras:  +
    Compra Máxima:  +
    +
    +
    +
    +
    +
    + + + + + + + + +
    +
    +
    + +
    +
    + Historial de Compras + + + + + + + + + + +
    + + + + + + + + + + + Tipo + + + + + + + + + Factura + + + + + + + + Fecha + + + + + + + Sub Total + + + + + + + Descuento + + + + + + + Amortización + + + + + + + Total + + + + + + + + Moneda + + + + + + + Estatus + + + + + + + Se Timbró + + + + + + + Envío Mail + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    +
    + + + + + + - - - - - - + + + + + + - -
    +
    +
    + Cuentas por Pagar Activas + + + + + + + + + - + + + + + Pagar + + + <%----%> + + + + Bitácora + + + + + + + + + + <%-- - --%> -
    + + + + + + + + + + Factura + + + + + + Fecha Compra + + + + + + Fecha Vencimiento + + + + + + + Días Vencidos +   - - - - Monto Compra (Saldo Orig) - + + + + + Monto Compra (Saldo Orig) +   - - - - $ Abonado - + + + + + $ Abonado +   - - - - % Abonado - + + + + + % Abonado +   - - - - Saldo - + + + + + Saldo +   - - - - % A Pagar - + + + + + % A Pagar + %  - - - - Pagar - - - <%----%> - - - - Bitácora - - - - - - - - -
    -
    -
    -
     
    -
    -
    - Historial de Cuentas por Pagar - - - - - - --%> +
    - - - - - - - - - - Factura - - - - - - Fecha Compra - - - - - - Fecha Vencimiento - - - - - - Días Vencidos - +
    +
    +
    +
     
    +
    +
    + Historial de Cuentas por Pagar + + + + + + - + + + + + + + + + + + + <%-- - --%> -
    + + + + + + + + + + Factura + + + + + + Fecha Compra + + + + + + Fecha Vencimiento + + + + + + Días Vencidos +   - - - - Monto Compra (Saldo Orig) - + + + + + Monto Compra (Saldo Orig) +   - - - - $ Abonado - + + + + + $ Abonado +   - - - - % Abonado - + + + + + % Abonado +   - - - - Saldo - + + + + + Saldo +   - - - - % A Pagar - + + + + + % A Pagar +   - - - - - - - - - -
    -
    -
    -
    -
    -
    - - - - - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - -
    -
    -
    - - Anticipo del Cliente -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - -
    -
    -
    - - Anticipo del Cliente Historial -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    - - - - -
    -
    - Datos del Orden de Servicio - - - - - - - - - - - - - --%> +
    Persona que Solicitó: - -
    Descripción: - -
    Fecha Cita: +
    +
    +
    +
    +
    + + + + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + +
    +
    +
    + + Anticipo del Cliente +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + +
    +
    +
    + + Anticipo del Cliente Historial +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + + + + +
    +
    + Datos del Orden de Servicio + + + + + + + + + + + + + - - - - -
    Persona que Solicitó: + +
    Descripción: + +
    Fecha Cita:   - - - - - - + + + + + + +   - + +   Hora:  - - - - - - -
    - Agregar
    -
    -
    - + + + + + + + +
    + Agregar
    +
    +
    + <%-- -
    @@ -850,880 +907,1089 @@
    --%> - - - - - - - - - -
    - - - + +
    -
    -
    - Datos del Reporte - - +
    --%> + + + + + + + + - -
    + + + - + - -
    +
    +
    + Datos del Reporte + + - - - + + + + - - - + + + + - + + + - - -
    Tipo de Buzón: - - - - - - - -
    + + + + + + +
    Sucursal: - - - - - - -
    + + + + + +
    Fecha : - - - - + - - - + + + + + + + + + +
    + + + + - -
      - - - - - - + + + + + + +   - + +   Hora:  - - - - - - -
    -
    +
    Descripción: - - -
    -
    -
    -
    -
    - Reportó - - + + + +
    + +
    +
    +
    +
    +
    + Reportó + + - - - + + + + - - - + + + + - - - + + + + - - -
    Nombre: - - -
    + +
    Teléfono: - - -
    + +
    Mail: - - -
    + +
    Observaciones: - - -
    -
    -
    -
    - -
    -
    -
    -
    - Personal - - - - - + +
    -   - + + + +
    +
    +
    +
    + +
    +
    +
    +
    + Personal + + + + + - - - -
    +   + Nombre - -
    - - - - - - <%----%> - - - - - - - - - - - -
    - <%----%> - <%----%> - -
    - -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    - - <%-- - - - --%> - - - - - - - - + +
    -
    -
    - Usuarios - - - + + + + + + +
    + + + + + + <%----%> + + + + + + + + + + + +
    + <%----%> + <%----%> + +
    + +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + +
    +
    +
    + Usuarios + + + <%-- --%> - --%> + - + - - - - - - - - - - - + + + + + + + + + + + - + - + - - - - - + + + + + + + + <%-- --%> - - - - - - - - - - - - - - - - - -
    Usuario - - + + Nombre - - - + + + + Correo/Usuario - - - Compras - CxP - Anticip - R.H. - O.S. - Cotiza--- - Sist - + + + + Compras + CxP + Anticip + R.H. + O.S. + Cotiza--- + Sist + Est - - - + + + + Fecha - - - + + + + Usuario - - Comandos
    Comandos
    - - - - - - - - - - - - - - - - - - -     -
    - - +
    + + + + + + + + + + + + + + + + + +     +
    + + <%-- - --%> - - - - - - - - - - - - - - - - - - <%----%> - - - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + --%> + + + + + + + + + + + + + + + + + + <%----%> + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      -
    -
    - - -   -   - -
    -
    - - -
    - - -
    -
    - - -
    - - - - - -
    -
    -
    -
    -
    - - Cambio Contraseña -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - - -
    - -
    -
    -
    -
    - -
    - - -
    - -
    -
    -
    -
    - -
    - - -
    - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - -
    - -
    - -
    -
    -
    -
    -
    - - - <%--0--%> - - <%--1--%> - - <%--2--%> - - <%--3--%> - - - - - -
    - -
    -
    - <%--4--%> - - <%--5--%> - <%-- + + + + +   +   + + +
    + + +
    + +
    +
    +
    +
    + + + + + + + + + + + +
    +
    +
    + + +
    +
    +
    + +
    + + + +
    +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + Historial de Pedidos +   Agregar Pedido  +   Descarga Excel  + + + + + + + + +
    + + + + Pedido + + + + + + Fecha + + + + + + Sub Total + + + + + + Descuento + + + + + + Amortización + + + + + + Total + + + + + + Moneda + + + + + + Estatus + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +
    + + Cambio Contraseña +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + + +
    + +
    +
    +
    +
    + +
    + + +
    + +
    +
    +
    +
    + +
    + + +
    + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    + + + + + + + + + + <%-- IxC --%> + + +
    + + - + + diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb index cf9b3414e..5a2946392 100644 --- a/PortalCliente/PortalCliente.aspx.vb +++ b/PortalCliente/PortalCliente.aspx.vb @@ -8,13 +8,14 @@ Imports System.Xml Imports System.IO.Compression Imports System.Net Imports Microsoft.Reporting.WebForms - +Imports System.Net.Http + Partial Class Ventas_PortalCliente Inherits ClsPaginas - Const TopRegistros = 20 - - + Const TopRegistros = 20 + + #Region " PROPIEDADES " Private Property CveCliente As Integer Get @@ -177,10 +178,10 @@ Partial Class Ventas_PortalCliente Set(value As Modelos.Factura) ViewState("ObjFactura") = value End Set - End Property - + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then Destino = String.Format("{0}\Compras\", UsuarioActual.Empresa.Ruta) @@ -223,7 +224,10 @@ Partial Class Ventas_PortalCliente CargarClienteSucursal() End If - '??ESTE TAB VA DESAPARECER - PARA QUE SOLO LA EMPRESA GESTIONE A LOS USUARIOS POR CLIENTE?? + CargaPedidos() + CargaCuentasDepositos() + + '??ESTE TAB VA DESAPARECER - PARA QUE SOLO LA EMPRESA GESTIONE A LOS USUARIOS POR CLIENTE?? If UsuarioActual.TienePermisoProceso(234) Then ' CARGA TAB SISTEMA TabSistema.Visible = False 'CargaUsuariosPortal() @@ -245,8 +249,8 @@ Partial Class Ventas_PortalCliente InicializaTabPedido() End If - End Sub - + End Sub + #Region "DATOS DEL CLIENTE" Private Sub CargaDatosCliente() LtlTitulo.Text = "Portal del Cliente:" @@ -261,11 +265,11 @@ Partial Class Ventas_PortalCliente End If End If ObjClientes.Dispose() - End Sub + End Sub #End Region - + #Region "TAB HISTORIAL DE VENTAS" - + Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) Dim ObjClientes As New ClsClientes() If ObjClientes.GetHistorialVentas(CveCliente, SelectTop, CveClienteSucursal:=CveClienteSucursal) Then @@ -400,9 +404,9 @@ Partial Class Ventas_PortalCliente ObjVentas.UpdateVentaMail(3, HdnCveVenta.Value.ToEntero) ObjVentas.Dispose() End Try - End Sub + End Sub #End Region - + #Region "TAB CUENTAS X PAGAR" Private Sub CargaCxP(Optional VerMas As Integer = -1) If TabCxP.Visible = True Then @@ -539,8 +543,8 @@ Partial Class Ventas_PortalCliente End If ObjEventoBitacora.Dispose() UPAddEventoBitacora.Update() - End Sub - + End Sub + #Region " PAGO PROSEPAGO " Private Sub InicializaProsepago() If Not UsuarioActual.CveEmpresa.Contiene(1, 4, 7, 11, 12, 145) Then @@ -1231,12 +1235,12 @@ Partial Class Ventas_PortalCliente Dim Mail As New ClsSisMail() Mail.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, Asunto, Body) - End Sub + End Sub #End Region - - + + #End Region - + #Region "TAB ANTICIPOS" Private Sub CargaAnticipos(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) Dim ObjMovtos As New ClsMovimientos() @@ -1290,9 +1294,9 @@ Partial Class Ventas_PortalCliente CargaAnticipos(21) BtnVerMasAnticipos.Text = "Ver Más" End If - End Sub + End Sub #End Region - + #Region "TAB BUZON DE CALIDAD" Private Sub CargarTipoBuzon() If TabBuzonCalidad.Visible = True Then @@ -1378,9 +1382,9 @@ Partial Class Ventas_PortalCliente End If Next ObjQueja.Dispose() - End Sub + End Sub #End Region - + #Region "TAB SISTEMA" Private Sub CargaUsuariosPortal() Dim ObjUsuario As New ClsSisUsuarios() @@ -1424,11 +1428,11 @@ Partial Class Ventas_PortalCliente End If ObjUsuario.Dispose() GvUsuariosPortal.DataBind() - End Sub - - + End Sub + + #Region "GESTION DE USUARIOS DEL PORTAL" - + Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) Dim ObjUsuario As New ClsSisUsuarios @@ -1673,13 +1677,13 @@ Partial Class Ventas_PortalCliente a.GuardaLog() Dim Mail As New ClsSisMail() Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body) - End Sub + End Sub #End Region - + #End Region - + #Region "TAB CONTRASENIA" - + Protected Sub BtnGuardarContraseña_Click(sender As Object, e As EventArgs) Handles BtnGuardarContraseña.Click If Decripta(UsuarioActual.Contraseña) = TxtContraseniaActual.Text Then @@ -1702,9 +1706,459 @@ Partial Class Ventas_PortalCliente Alert("La Contraseña Actual es incorrecta.", TipoMensaje.MsgAdvertencia) End If - End Sub + End Sub #End Region + +#Region "TAB PEDIDOS" + + Private Sub CargaCuentasDepositos() + + 'CargaEstatus + DdlEstatus.DataSource = GlobalDTEstatusFactura.FiltraParametros(" CveEstatusFactura IN (2, 5, 21) ") + DdlEstatus.DataBind() + + DdlCuenta.Items.Clear() + + 'Dim ObjGral As New ClsGenerales + 'If ObjGral.GetCuentasDepositos(CveProveedor:=-1, CveCliente:=CveCliente, CvePersonal:=-1) Then + ' DdlCuentaDeposito.DataSource = ObjGral.DtResultados.FiltraParametros("Estatus ='True'") + ' If ObjGral.DtResultados.Rows.Count > 0 Then + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + 'End If + 'ObjGral.Dispose() + + 'DdlCuentaDeposito.DataBind() + + + Dim dt As DataTable + If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then + dt = GlobalDTBancosCuentas(-1) + Else + dt = GlobalDTBancosCuentas(-1).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + End If + + + DdlCuenta.DataSource = dt + DdlCuenta.DataBind() + + UpIxC.Update() + End Sub + Private Sub CargaPedidos(Optional TopPedidos As Integer = 21) + Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim.ToDate, MinFecha) + Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha) + Dim ObjClientes As New ClsClientes + If ObjClientes.GetHistorialVentas(CveCliente, TopPedidos, CveClienteSucursal:=-1, TipoDocto:="Pd2", CveEstatusFactura:=DdlEstatus.SelectedValue.ToEntero(), FechaI:=FechaI, FechaF:=FechaF) Then + GvPedidos.DataSource = ObjClientes.DtResultados + If ObjClientes.DtResultados.Rows.Count < 21 Then + LnkVerMasPedidos.Visible = False + End If + End If + ObjClientes.Dispose() + GvPedidos.DataBind() + + UpTabPedidos.Update() + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaPedidos() + End Sub + + Protected Sub BtnVerMasPedidos_Click(sender As Object, e As EventArgs) + If BtnVerMasVentas.Text = "Ver Más" Then + CargaPedidos(-1) + BtnVerMasVentas.Text = "Ver Menos" + Else + CargaPedidos(21) + BtnVerMasVentas.Text = "Ver Más" + End If + End Sub + + Protected Sub GvPedidos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CveVenta") <> "" Then + 'e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/PopIEVentas.aspx?CveVenta={0}&TB_iframe=true&height=550&width=700", e.Row.DBCampo("CveVenta")) + If e.Row.DBCampo("CveEstatusFactura").ToEntero().Contiene(4, 5) Then + e.Row.FCLinkButton("ImgAbonar").Visible = False + e.Row.FCLinkButton("ImgCancelar").Visible = False + End If + Else + e.Row.FCLinkButton("ImgAbonar").Visible = False + e.Row.FCLinkButton("ImgCancelar").Visible = False + e.Row.CssClass = "Totales" + End If + End If + End Sub + + Protected Sub ImgCancelar_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = (DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)) + If GvRow.DataKey("CveVenta").ToEntero() > 0 Then + Dim ObjFactura As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + If ObjFactura IsNot Nothing Then + Dim Resp = ObjFactura.CancelarFactura(RealizarDevolucionAlmacen:=False, ListaRemisionesCancelar:=New List(Of Integer)) + Alert(Resp.Mensaje, If(Resp.HuboError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion)) + End If + Else + Alert("No se encontro pedido para cancelar", TipoMensaje.MsgAdvertencia) + End If + End Sub + + Protected Sub ImgAbonar_Click(sender As Object, e As EventArgs) + + TxtTotalPedido.Text = "" + TxtFolio.Text = "" + + Me.CveVenta = -1 + Dim GvRow As GridViewRow = (DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)) + If GvRow.DataKey("CveVenta").ToEntero() > 0 Then + + LblPedido.Text = GvRow.DataKey("SerieFolio") + TxtTotalPedido.Text = GvRow.DataKey("Total").ToDecimal().FormatoNumero(2) + RVPedido.MaximumValue = GvRow.DataKey("Total").ToDecimal().FormatoNumero(2) + Me.CveVenta = GvRow.DataKey("CveVenta").ToEntero() + + RegistraScript("$('#DivIxC').modal({backdrop: 'static',keyboard: false});") + End If + UpIxC.Update() + End Sub + + Protected Sub BtnPagarPedido_Click(sender As Object, e As EventArgs) + GuargarIxC(CveCliente, TxtTotalPedido.Text.ToDecimal(), New Modelos.Factura(UsuarioActual, Me.CveVenta, UsuarioActual.CveEmpresa)) + End Sub + + Private Sub GuargarIxC(CveCliente As Integer, ImportePagado As Decimal, ObjFactura As Modelos.Factura) + + Dim MsgError As String = "" + Dim CveConceptoContable As Integer = 30 + Dim CveConceptoCompra As Integer = 10 + Dim CveCreditoDetalle As Integer = -1 + Dim CIF As Decimal = 0 + Dim CvePlantillaPoliza As Integer = 3 + Dim CvePrePoliza As Integer = 0 + Dim ComprobanteIE As String = "" + Dim CveIE As Integer = -1 + Dim CveTipoTransaccion As Integer = 11 + Dim FechaDoc As DateTime = Now + + Dim ConceptoContable As Integer + Dim TipoMovimiento As Boolean + Dim importeMovimiento As Decimal + Dim FechaMovimiento As Date = Now + Dim Concepto As String = "" + + Dim Importe As Decimal = ImportePagado + + Dim Msg As New StringBuilder + + Dim ObjIE As New ClsBancos() + Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) + Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) + + Try + Dim CveCuentaDeposito As Integer = 0 + 'If DdlCuentaDeposito.Items.Count > 0 Then + ' CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero + 'End If + + '*****-_- INICIA: CONFIGURACION REGISTRO -_-***** + Dim AgregaPolizaSaldoInicial As Boolean = False + + 'INGPC + CvePlantillaPoliza = 6 + If CveCliente > 0 Then + CveConceptoCompra = 66 'Anticipo doc por pagar + CveConceptoContable = 30 'Bancos + End If + + Dim FolioFijo As Integer = 0 + Dim tCveMoneda As Integer = ObjFactura.CveMoneda + Dim tImporteMonedaExtranjera As Decimal = 0 + If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(Now).ToString.ToDecimal + Dim PagueseA = ObjFactura.Cliente.Nombre + + If MsgError = "" Then + + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, CveTipoTransaccion, FechaDoc, TxtFolio.Text.Trim, PagueseA, Importe, ObjFactura.CveMoneda, + TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, ComprobanteIE, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=1, Referencia:="-1", CveCuentaTarjeta:=-1, ConceptoCIE:="-1") + + If CveIE > 0 Then + + If CveTipoTransaccion = 1 AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = ObjIE.Folio.ToEntero 'cheque + CvePrePoliza = ObjMov.AddPrePolizas("PortalCliente/IE " + "INGPC", CvePlantillaPoliza, Importe, Importe, tCveMoneda, FechaDoc, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(CveTipoTransaccion.ToString(), Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(CveTipoTransaccion.ToString(), "-1", UsuarioActual.CveEmpresa)) + + 'valida prepoliza + If CvePrePoliza > 0 Then + + If Not ObjIE.UpdateIEPrePoliza(MinFecha, "", -1, CvePrePoliza, CveIE, -1) Then + MsgError = "Ocurrio un error al agregar la prepoliza al IE." + End If + + Dim Conc As String = ObjIE.Folio + Dim Ref As String = ObjIE.Folio + + ComprobanteIE = $"{CveIE}" + + 'GUARDA PREPOLIZAS DETALLE [PRIMERO SON LOS CASOS ESPECIALES, AL FINAL (ELSE) LOS CASOS NORMALES] --REEMPLAZA IFs + + Dim importeMX As Decimal + Dim Multiplicador As Integer + + If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then + + For Each Row As DataRow In ObjMov.DtResultados.Rows + + ConceptoContable = Row("CveConcepto").ToString.ToEntero + TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) + importeMovimiento = 0 + Multiplicador = (Row("Multiplicador").ToString.ToEntero) + Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) + + Select Case ConceptoContable + Case 66 + importeMovimiento = Importe '- TxtIvaIxC.Text.ToDecimal + importeMX = importeMovimiento + Case 30 + importeMovimiento = Importe + importeMX = importeMovimiento + End Select + + If importeMovimiento <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, ObjFactura.Cliente.IdCtaContClientes, ObjFactura.Cliente.IdCtaContAnticipos), -1, CveIE:=CveIE, CveCompra:=-1, CveProveedor:=-1, CvePersonal:=-1, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, ObjFactura.Cliente.CveCuentaClientes, ObjFactura.Cliente.CveCuentaAnticipos)) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + + Next + End If + + If MsgError = "" Then + If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjMov.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Bancos/IE | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + MsgError = "No se pudo validar la prepoliza de cuadre." + End If + End If + + 'El movimiento 1 es el de Venta + + 'Conta ContPAQ + 'If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + ' If IDCtaBeneficiario > 0 And IDCtaContable > 0 Then + ' If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + ' IDPoliza = ObjMov.ContaIdPoliza + ' 'Alert(alertaContabilizacion & ObjMov.AlertaMensaje, ModExtensiones.TipoMensaje.MsgInformacion) + ' Else + ' Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + ' End If + ' Else + ' If IDCtaContable < 1 Then + ' Alert("No se puede contabilizar la Prepoliza debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) + ' End If + ' If IDCtaBeneficiario < 1 Then + ' Alert("No se puede contabilizar la Prepoliza debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) + ' End If + ' End If + 'End If + + 'If UsuarioActual.Empresa.UsaAC Then + ' Dim ConceptoRenglon, Referencia As String + ' Dim FolioPoliza As Integer + ' Dim Fecha As Date = FechaDoc + ' Dim TipoChq As String = "" + ' Dim Total As Double = TxtImporte.Text.ToDouble + + ' Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) + ' Conta.IniciaTransacSQL() + + ' If CveTipoTransaccion = 1 Then TipoChq = "CHQ" + ' ConceptoRenglon = String.Format("Anticipo {0}", PagueseA) + + ' Dim IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq) + + ' If IDPoliza > 0 Then + ' FolioPoliza = Conta.Folio + ' Referencia = ObjIE.Folio + ' ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text) + + ' Total = TxtImporte.Text.ToDouble + + ' If Not Conta.AddMovimiento(IDPoliza, IDCtaContable, True, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" + + ' If Not Conta.AddMovimiento(IDPoliza, IDCtaBeneficiario, False, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" + + ' Else + ' MsgError = "No se insertó el encabezado" + ' End If + + ' If MsgError = "" Then + ' Conta.Commit() + + ' Conta.AjustaPoliza(IDPoliza) + ' 'actualizar la conta del IE + ' ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0) + ' Else + ' Conta.RollBack() + ' IDPoliza = 0 + ' End If + + ' Conta.Dispose() + 'End If + + 'Notificación de Pago + 'If TxtNotificarA.Text.Trim <> "" And MsgError = "" Then + ' 'NotificacionPago(CveIE, TxtNotificarA.Text.Trim) + ' EnviarCorreoNotificacion(CveIE, TxtNotificarA.Text.Trim, "", UsuarioActual, False) + 'End If + Else + MsgError = "No se pudo insertar la póliza" + End If + + Else + MsgError = "No se insertó el encabezado" + End If + + End If + + Catch ex As Exception + MsgError = ex.ToString() + End Try + + If MsgError = "" Then + 'IMPRIME CHEQUE + 'GeneraChequePDF(CveIE, UsuarioActual.Empresa, IDPoliza) + If Msg.ToString = "" Then + ObjIE.Commit() + Msg.Append("El Documento se guardo correctamente: Folio:" + ObjIE.Folio) + Alert(Msg.ToString(), TipoMensaje.MsgInformacion) + End If + 'Dim Archivo As System.IO.FileInfo = Nothing + ''VERIFICA SI EXISTE EL FORMATO + ''If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(2, 8, 9) Then + '' Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/Transferencia.rdlc", UsuarioActual.Empresa.Ruta)) + ''ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1) Then + '' Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) + '' If Not Archivo.Exists Then + '' Archivo = New System.IO.FileInfo(String.Format("{0}\Empresas\Grales\Formatos\CHQ.rdlc", ModExtensiones.DirectorioBaseEmpresas)) + '' End If + ''ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(6) And UsuarioActual.CveEmpresa = 72 Then + '' Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) + ''End If + + 'If Archivo IsNot Nothing Then + ' If Archivo.Exists Then + ' Msg.AppendFormat("

    {1} ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), "Imprimir Ingre") + ' End If + 'End If + + Else + ObjIE.RollBack() + Alert(MsgError, TipoMensaje.MsgAdvertencia) + End If + + ObjIE.Dispose() + ObjMov.Dispose() + ObjComp.Dispose() + + End Sub + + Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte() + Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) + Dim File As Byte() = Nothing + Try + Using httpClient = New HttpClient() + httpClient.Timeout = New TimeSpan(0, 15, 0) + Using request = New HttpRequestMessage(HttpMethod.Get, Url) + request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks))) + Dim response = httpClient.SendAsync(request).Result + If response.StatusCode = Net.HttpStatusCode.OK Then + File = response.Content.ReadAsByteArrayAsync().Result + End If + End Using + End Using + Catch ex As Exception + File = Nothing + OnError("Ocurrió un error al descargar la factura", ex) + End Try + + Return File + End Function + + Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, EnviarFactura As Boolean, ObjFactura As Modelos.Factura) + + Dim ObjMail As New ClsSisMail() + Dim ObjVentas As New ClsVentas + + Dim ArchivoPDF As String = "" + Dim ArchivoPDFBytes As Byte() = Nothing + Dim ExistePDF As Boolean = False + + Try + + Dim Asunto As String = String.Empty + Dim Cuerpo As String = String.Empty + Dim ResultadoMail As Integer = 0 + + Dim TipoComprobante = "Pedido" + + If UsuarioActual.Empresa.PlantillaMailVenta.Trim.Length > 0 Then + Cuerpo = UsuarioActual.Empresa.PlantillaMailVenta + Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa) + Cuerpo = Cuerpo.Replace("{""NombreCliente""}", ObjFactura.Cliente.Nombre) + Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante) + Cuerpo = Cuerpo.Replace("{""Fecha""}", ObjFactura.Fecha.ToString("dd/MM/yyyy")) + Cuerpo = Cuerpo.Replace("{""Total""}", ObjFactura.Total.FormatoNumero(2)) + Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", ObjFactura.FechaVencimiento.ToString("dd/MM/yyyy")) + Cuerpo = Cuerpo.Replace("{""SerieFolio""}", ObjFactura.SerieFolio) + End If + + If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then + Asunto = UsuarioActual.Empresa.AsuntoPlantillaMailVenta + Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante) + Asunto = Asunto.Replace("{""Sucursal""}", ObjFactura.SubProyecto.SubProyecto) + Asunto = Asunto.Replace("{""SerieFolio""}", ObjFactura.SerieFolio) + End If + + If Not EnviarFactura Then + ObjVentas.UpdateVentaMail(0, CveVenta) + End If + + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + + ArchivoPDF = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) + + If Not File.Exists(ArchivoPDF) Then + ArchivoPDFBytes = DescargarFactura(ObjFactura.CveVenta, ObjFactura.CveEmpresa) + Else + ExistePDF = True + End If + + If ExistePDF Then + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoPDF}) + Else + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = ArchivoPDFBytes, .NombreArchivo = String.Format("{0}.pdf", ObjFactura.SerieFolio)}) + End If + + If ObjMail.SendMail(UsuarioActual.Empresa, ObjFactura.Cliente.Mail, Asunto, Cuerpo, "japmx95@gmail.com", LSRutasMail, Displayname:="") Then + ResultadoMail = 1 + Else + ResultadoMail = 3 + End If + ObjVentas.UpdateVentaMail(ResultadoMail, CveVenta) + + Catch ex As Exception + OnError("Ocurrió error al mandar el Mail", ex) + ObjVentas.UpdateVentaMail(3, CveVenta) + Finally + ObjVentas.Dispose() + End Try + + End Sub +#End Region + #Region "O R D E N A M I E N T O" Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) Dim Orden As String = "" @@ -1739,12 +2193,12 @@ Partial Class Ventas_PortalCliente ElseIf gvi = 1 Then CargaGridUsuarios(Orden) End If - End Sub + End Sub #End Region - + #Region "DESCARGA Todos los Archivos" - - + + Private Sub BtnDescargarPDF_Click(sender As Object, e As EventArgs) Handles BtnDescargarPDF.Click If Not Directory.Exists(AppDomain.CurrentDomain.BaseDirectory & "Temp") Then Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory & "Temp") @@ -1827,14 +2281,14 @@ Partial Class Ventas_PortalCliente 'Elimine el .zip que se genero If File.Exists(RutaArchivo) Then File.Delete(RutaArchivo) - End Sub - + End Sub + #End Region - - + + #Region "IMPRIMIR GVHistorial" - - + + Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = Nothing Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) @@ -1870,6 +2324,10 @@ Partial Class Ventas_PortalCliente End Sub + Protected Sub BtnExcelHistorialPedidos_Click(sender As Object, e As EventArgs) + GvPedidos.ExportToExcel("Pedidos") + End Sub + Protected Sub BtnPDFHistorial_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteHistorial() @@ -1913,12 +2371,12 @@ Partial Class Ventas_PortalCliente ObjClientes.Dispose() Return retorno - End Function - - + End Function + + #End Region - - + + #Region "IMPRIMIR CxC Activas" Protected Sub LbExcelCxCActivas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = Nothing @@ -1984,13 +2442,13 @@ Partial Class Ventas_PortalCliente End If ObjMovtos.Dispose() Return retorno - End Function - + End Function + #End Region - - + + #Region "IMPRIMIR CxCHistorial" - + Protected Sub LbExcelCxCHistorial_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = Nothing Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) @@ -2055,34 +2513,34 @@ Partial Class Ventas_PortalCliente End If ObjMovtos.Dispose() Return retorno - End Function - + End Function + #End Region - - 'Protected Sub BtnCxPActivas_Click(sender As Object, e As EventArgs) - ' If BtnCxPActivas.Text = "Ver Más " Then - ' BtnCxPActivas.Text = "Ver Menos " - ' CargaCxP() - ' Else - ' BtnCxPActivas.Text = "Ver Más " - ' CargaCxP(1) - ' End If - 'End Sub - - 'Protected Sub BtnHistorialCxP_Click(sender As Object, e As EventArgs) - ' If BtnHistorialCxP.Text = "Ver Más " Then - ' BtnHistorialCxP.Text = "Ver Menos " - ' CargaCxP(2) - ' Else - ' BtnHistorialCxP.Text = "Ver Más " - ' CargaCxP(2) - ' End If - 'End Sub - + + 'Protected Sub BtnCxPActivas_Click(sender As Object, e As EventArgs) + ' If BtnCxPActivas.Text = "Ver Más " Then + ' BtnCxPActivas.Text = "Ver Menos " + ' CargaCxP() + ' Else + ' BtnCxPActivas.Text = "Ver Más " + ' CargaCxP(1) + ' End If + 'End Sub + + 'Protected Sub BtnHistorialCxP_Click(sender As Object, e As EventArgs) + ' If BtnHistorialCxP.Text = "Ver Más " Then + ' BtnHistorialCxP.Text = "Ver Menos " + ' CargaCxP(2) + ' Else + ' BtnHistorialCxP.Text = "Ver Más " + ' CargaCxP(2) + ' End If + 'End Sub + #Region "TAB PEDIDO" - + #Region "CARGAS" - + Private Sub CargaFolios() If CveSubProyecto <= 0 Then @@ -2280,11 +2738,11 @@ Partial Class Ventas_PortalCliente TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String)) TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String)) - End Sub - - + End Sub + + #End Region - + #Region "SELECTED INDEX CHANGE" Protected Sub DdlMoneda_SelectedIndexChanged(sender As Object, e As EventArgs) TrConversionTipoCambio.Visible = False @@ -2364,13 +2822,15 @@ Partial Class Ventas_PortalCliente Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) CargaPS(DdlClasificacion.SelectedValue.ToEntero, DdlPS) UpClasificacion.Update() - End Sub - + End Sub + #End Region - + #Region "AGREGAR/EDITAR/ELIMINAR" - Protected Sub LnkAddVenta_Click(sender As Object, e As EventArgs) - + Protected Sub LnkAddPedido_Click(sender As Object, e As EventArgs) + RegistraScript("$('#DivVenta').modal({backdrop: 'static',keyboard: false});") + End Sub + Protected Sub LnkAddPSVenta_Click(sender As Object, e As EventArgs) Modalidad = "A" LnkAgregar.Text = "Agregar" TxtCantidad.Text = "" @@ -2386,9 +2846,9 @@ Partial Class Ventas_PortalCliente DdlClasificacion.SelectedIndex = -1 DdlUM.Items.Clear() ChkAgregar.Checked = True - UpVenta.Update() - RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddVenta")) + UpAddPedido.Update() + RegistraScript("$('#DivAddVenta').modal({backdrop: 'static',keyboard: false});") End Sub Protected Sub LnkEditar_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) @@ -2411,17 +2871,22 @@ Partial Class Ventas_PortalCliente TxtPrecio.Text = GvRow.DataKey("PU") LblTotal.Text = GvRow.DataKey("Total") ChkAgregar.Checked = False - UpVenta.Update() - RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddVenta"), "EdicionVenta") + UpAddPedido.Update() + + RegistraScript("$('#DivAddVenta').modal('show');", "EdicionVenta") End Sub Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim DbRow As DataRow = Nothing + DbRow = TmpDT.Rows(GvRow.RowIndex) TmpDT.Rows.Remove(DbRow) + GvPS.DataSource = TmpDT GvPS.DataBind() + CalculaTotalesVenta() + Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion) End Sub @@ -2442,22 +2907,15 @@ Partial Class Ventas_PortalCliente End If DdlClasificacion.SelectedIndex = -1 DdlUM.Items.Clear() - UpVenta.Update() Else RegistraScript("ClosePopup();", "AddUpdatePS") - End If + End If + + UpAddPedido.Update() End Sub Private Sub AgregarPS() - If Modalidad = "A" Then - AgregarProductoServicio(TxtCantidad.Text.ToDecimal, DdlUM.SelectedValue.ToEntero, DdlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, - DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, TxtObs.Text, TxtPrecio.Text.ToDecimal, 0, -1, "", CveSubProyecto, "") - - CalculaTotalesVenta() - - - - ElseIf Modalidad = "U" Then + If Modalidad = "U" Then Dim ErrorEdit As Boolean = True Dim Contador As Integer = 0 @@ -2475,7 +2933,12 @@ Partial Class Ventas_PortalCliente TmpDT.Rows.RemoveAt(Contador) TmpDT.AcceptChanges() End If - End If + End If + + AgregarProductoServicio(TxtCantidad.Text.ToDecimal, DdlUM.SelectedValue.ToEntero, DdlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, + DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, TxtObs.Text, TxtPrecio.Text.ToDecimal, 0, -1, "", CveSubProyecto, "") + + CalculaTotalesVenta() End Sub @@ -2616,13 +3079,13 @@ Partial Class Ventas_PortalCliente GvPS.DataSource = view GvPS.DataBind() - UpTabPedidos.Update() - End Sub - + UpAddPedido.Update() + End Sub + #End Region - + #Region "GUARDAR VENTA" - + Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False) ObjFactura = New Modelos.Factura ObjFactura.Version = "3.3" @@ -2911,6 +3374,10 @@ Partial Class Ventas_PortalCliente ViewState("CveVenta") = ObjFactura.CveVenta + If ObjFactura.CveVenta > 0 Then + EnviarCorreoPedido(ObjFactura) + End If + 'MENSAJE PRINCIPAL MensajeAlert.AppendFormat(String.Format("
    El {0}: {1} se generó correctamente.

    ", ObjFactura.TipoDocumento, ObjFactura.SerieFolio)) @@ -2970,6 +3437,10 @@ Partial Class Ventas_PortalCliente End If End Sub + Private Sub EnviarCorreoPedido(ObjFactura As Modelos.Factura) + Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, ObjFactura.CveVenta, True, ObjFactura, "")) + Hilo.Start() + End Sub Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing) @@ -3067,11 +3538,12 @@ Partial Class Ventas_PortalCliente TxtObs.Text = "" CalculaTotalesVenta() UpTabPedidos.Update() - End Sub - + End Sub + #End Region - -#End Region - - + +#End Region + + End Class + From 57c72a98ecadd66d3b3f03f348ecc6b2ca6f8212 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 14 Jul 2020 19:39:27 -0700 Subject: [PATCH 13/56] =?UTF-8?q?nuevo=20cat=C3=A1logo=20de=20tipo=20gasto?= =?UTF-8?q?,=20PA=20en=20Resp=5FToday?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/CatTipoGasto.aspx | 13 ++++---- Compras/CatTipoGasto.aspx.cs | 61 +++++++++++++++++++++++++++++++++--- 2 files changed, 63 insertions(+), 11 deletions(-) diff --git a/Compras/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx index 0857adb09..f930bc624 100644 --- a/Compras/CatTipoGasto.aspx +++ b/Compras/CatTipoGasto.aspx @@ -8,13 +8,13 @@ - Catálogo de Motivos de Rechazo de Paquetes + Catálogo de Tipo Gastos de Rechazo de Paquetes
  • - +
  • @@ -23,7 +23,7 @@ - + @@ -45,7 +45,7 @@
    - + +

    diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs index e10e6156f..88885b992 100644 --- a/Compras/CatTipoGasto.aspx.cs +++ b/Compras/CatTipoGasto.aspx.cs @@ -41,13 +41,64 @@ public partial class Compras_CatTipoGasto : ClsPaginas ObjAC.Dispose(); } - protected void LnkEditar_Click(object sender, EventArgs e) + protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e) { - BtnAgregarTiposDModal.Text = "Actualizar"; - GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); - CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero(); - DescripcionTxt.Text = GvRow.DataKey("Descripcion"); + BtnAgregarTipoGasto.Text = "Agregar"; + TxtTipoGasto.Text = ""; + ChkEstatus.Checked = true; + ChkEstatus.Enabled = false; UpModalTiposD.Update(); RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); } + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarTipoGasto.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero(); + TxtTipoGasto.Text = GvRow.DataKey("TipoGasto"); + ChkEstatus.Checked = GvRow.DataKey("Estatus") == "Activo"; + ChkEstatus.Enabled = true; + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero(); + ClsAC ObjAC = new ClsAC(); + if (ObjAC.RemoveTipoGasto(CveTipoGasto)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se eliminó el Tipo de Gasto correctamente"); + } + ObjAC.Dispose(); + } + + protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e) + { + ClsAC ObjAC = new ClsAC(); + if (BtnAgregarTipoGasto.Text == "Agregar") + { + if (ObjAC.AddTipoGasto(TxtTipoGasto.Text,UsuarioActual.CveUsuario)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se agregó el Tipo de Gasto correctamente"); + } + }else + { + if (ObjAC.UpdateTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,CveTipoGasto)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se actualizó el Tipo de Gasto correctamente"); + } + } + ObjAC.Dispose(); + } } \ No newline at end of file From bdff2b00149d989b74214001c493b045f0b0a147 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 15 Jul 2020 11:05:06 -0700 Subject: [PATCH 14/56] -- verificar exitencia pendientede surtir, en ajuste inventario --- Inventarios/EntradasSalidas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index da17d5806..9eaa25b5d 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -3699,7 +3699,7 @@ Partial Class Inventarios_EntradasSalidas 'VALIDA EXISTENCIAS SALIDA E INSERTA DETALLES For Each Dr As DataRow In DtMovimientosSalidaInvFisico.Rows - If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero) >= Dr("Cantidad").ToString.ToDouble Then + If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1) >= Dr("Cantidad").ToString.ToDouble Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then From 04d2244f77d07a140145ba13a02f9793d63d34a2 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 15 Jul 2020 11:18:20 -0700 Subject: [PATCH 15/56] enable event validation = false --- Inventarios/EntradasSalidas.aspx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 9a90ffba9..6114ccac7 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -1,4 +1,5 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasSalidas.aspx.vb" Inherits="Inventarios_EntradasSalidas" %> +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasSalidas.aspx.vb" Inherits="Inventarios_EntradasSalidas" EnableEventValidation="false" %> + <%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %> From 4c8b9e2cb0c28011c8db0ab7ad4abbec124599f4 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 15 Jul 2020 16:35:15 -0700 Subject: [PATCH 16/56] CatTipo de gasto terminado --- App_Code/ClsCompras.vb | 151 +++++++++++++++++++++++++---------- Compras/CatTipoGasto.aspx.cs | 23 +++--- 2 files changed, 118 insertions(+), 56 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 88fb94258..33dc7e050 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2239,11 +2239,11 @@ Public Class ClsCompras End Try Return Retorno - End Function + End Function #End Region - + #Region "TIPOS DE GASTOS" - + Public Function GetTipoGasto(CveTipoGasto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_TiposGastosGet") @@ -2261,50 +2261,113 @@ Public Class ClsCompras End Try Return Retorno - End Function + End Function + + Public Function AddTipoGasto(TipoGasto As String, Estatus As Boolean, FechaIng As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_TiposGastosAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateTipoGasto(CveTipoGasto As Integer, TipoGasto As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_TiposGastosUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto + .Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveTipoGasto(CveTipoGasto As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_TiposGastosRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + #End Region - + #Region "VINCULAR PAGO" - 'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean - ' Dim Retorno As Boolean = False - ' DataAdapter("PA_Comp_VincularPagoGet") - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - ' .Add("@Tipo", SqlDbType.Int).Value = Tipo - ' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - ' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - ' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor - ' End With - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - ' Return Retorno - 'End Function - - 'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean - ' Dim Retorno As Boolean = False - ' DataAdapter("PA_Comp_VincularComplementoPagoGet") - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - ' .Add("@Monto", SqlDbType.Float).Value = Monto - ' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos - ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - ' End With - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - ' Return Retorno - 'End Function - + 'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Comp_VincularPagoGet") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + ' .Add("@Tipo", SqlDbType.Int).Value = Tipo + ' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + ' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + ' Return Retorno + 'End Function + + 'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Comp_VincularComplementoPagoGet") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + ' .Add("@Monto", SqlDbType.Float).Value = Monto + ' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + ' Return Retorno + 'End Function + Public Function AddComplementoPago(CveIE As Integer, CveCompra As Integer, Importe As Decimal, CvePrePolizaDetalle As Integer, CveFactura As Integer) As Integer Dim Retorno As Integer = 0 DataAdapter("PA_Comp_ComplementoPagoAdd") diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs index 88885b992..4ffb4c9b7 100644 --- a/Compras/CatTipoGasto.aspx.cs +++ b/Compras/CatTipoGasto.aspx.cs @@ -32,13 +32,13 @@ public partial class Compras_CatTipoGasto : ClsPaginas private void CargaDatos() { - ClsAC ObjAC = new ClsAC(); - if (ObjAC.GetTipoGasto()) + ClsCompras ObjCompras = new ClsCompras(); + if (ObjCompras.GetTipoGasto(-1,UsuarioActual.CveEmpresa)) { - GvDatos.DataSource = ObjAC.DtResultados; + GvDatos.DataSource = ObjCompras.DtResultados; GvDatos.DataBind(); } - ObjAC.Dispose(); + ObjCompras.Dispose(); } protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e) @@ -46,7 +46,6 @@ public partial class Compras_CatTipoGasto : ClsPaginas BtnAgregarTipoGasto.Text = "Agregar"; TxtTipoGasto.Text = ""; ChkEstatus.Checked = true; - ChkEstatus.Enabled = false; UpModalTiposD.Update(); RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); } @@ -66,23 +65,23 @@ public partial class Compras_CatTipoGasto : ClsPaginas { GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero(); - ClsAC ObjAC = new ClsAC(); - if (ObjAC.RemoveTipoGasto(CveTipoGasto)) + ClsCompras ObjCompras = new ClsCompras(); + if (ObjCompras.RemoveTipoGasto(CveTipoGasto)) { CargaDatos(); UpDatos.Update(); RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); Alert("Se eliminó el Tipo de Gasto correctamente"); } - ObjAC.Dispose(); + ObjCompras.Dispose(); } protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e) { - ClsAC ObjAC = new ClsAC(); + ClsCompras ObjCompras = new ClsCompras(); if (BtnAgregarTipoGasto.Text == "Agregar") { - if (ObjAC.AddTipoGasto(TxtTipoGasto.Text,UsuarioActual.CveUsuario)) + if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,DateTime.Now.ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa)) { CargaDatos(); UpDatos.Update(); @@ -91,7 +90,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas } }else { - if (ObjAC.UpdateTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,CveTipoGasto)) + if (ObjCompras.UpdateTipoGasto(CveTipoGasto,TxtTipoGasto.Text,ChkEstatus.Checked,-1,-1)) { CargaDatos(); UpDatos.Update(); @@ -99,6 +98,6 @@ public partial class Compras_CatTipoGasto : ClsPaginas Alert("Se actualizó el Tipo de Gasto correctamente"); } } - ObjAC.Dispose(); + ObjCompras.Dispose(); } } \ No newline at end of file From 7db630eb1e453e5c206de3141ca8ebfd7c44b130 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 16 Jul 2020 10:38:35 -0700 Subject: [PATCH 17/56] =?UTF-8?q?validaci=C3=B3n=20para=20la=20fecha=20de?= =?UTF-8?q?=20caducidad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntradasSalidas.aspx.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index da17d5806..8299297e3 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1193,6 +1193,8 @@ Partial Class Inventarios_EntradasSalidas Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero() + Dim FechaCaducidadVal As Date = If(RowPS("AplicaCaducidad").ToString = "True", FechaCaducidad, MinFecha) + If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then Valido = False Alert("El producto requiere Serie-Lote", TipoMensaje.MsgAdvertencia) @@ -1201,7 +1203,7 @@ Partial Class Inventarios_EntradasSalidas 'salida If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen - Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), FechaCaducidad) + Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), FechaCaducidadVal) ' LbAgregar.ToolTip = Existencia.ToString If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND Serie = '{SerieLote}'", "")}") < 0 Then If Existencia <= 0 Then From 8a3f0e47a8d2aaf2b0435fef116d8f9fe726863c Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 16 Jul 2020 14:52:05 -0700 Subject: [PATCH 18/56] chk inactivado --- Inventarios/AjustesSeccionAlmacen.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx index ac203fa05..dde09a6a1 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx +++ b/Inventarios/AjustesSeccionAlmacen.aspx @@ -64,7 +64,7 @@ - + From 26518379d363cdba0aeab99f60c6864dfba1ceeb Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 16 Jul 2020 14:53:07 -0700 Subject: [PATCH 19/56] correcciones a carga centro de costo --- Compras/Compras.aspx.vb | 33 ++++++++------- Compras/RepCxP.aspx.vb | 2 +- OC/OC.aspx.vb | 20 ++++----- Ventas/Ventas.aspx.vb | 92 ++++++++++++++++++++--------------------- 4 files changed, 73 insertions(+), 74 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index ffdea1526..0dca73192 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7385,21 +7385,23 @@ Partial Class Compras_Compras End If - ''Unificacion de PrePolizas - 'If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then - ' If Not ObjConta.PrePolizaUnificacion(Ant.CvePrePoliza, CvePrePoliza) Then - ' ErrorPrepoliza = True - ' Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError) - ' End If - 'End If + If UsuarioActual.CveEmpresa.Contiene(83) Then + 'Unificacion de PrePolizas + If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then + If Not ObjConta.PrePolizaUnificacion(Ant.CvePrePoliza, CvePrePoliza) Then + ErrorPrepoliza = True + Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError) + End If + End If - ''Simplificacion de PrePolizas - 'If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then - ' If Not ObjConta.PrePolizaSimplificacion(Ant.CvePrePoliza, UsuarioActual.CveEmpresa) Then - ' ErrorPrepoliza = True - ' Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) - ' End If - 'End If + 'Simplificacion de PrePolizas + If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then + If Not ObjConta.PrePolizaSimplificacion(Ant.CvePrePoliza, UsuarioActual.CveEmpresa) Then + ErrorPrepoliza = True + Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) + End If + End If + End If Next importeMovimiento = 0 @@ -17357,7 +17359,7 @@ Partial Class Compras_Compras Private Sub CargaSubProyecto() Dim CveProyecto = If(DdlProyecto.SelectedValue.ToEntero > 0, DdlProyecto.SelectedValue.ToEntero, -1) DdlSubProyecto.Items.Clear() - If CveProyecto > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto.Contiene(1, 2) Then + If CveProyecto > 0 Then DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(CveProyecto, -1, UsuarioActual.CveEmpresa, 1)) End If DdlSubProyecto.DataBind() @@ -19692,7 +19694,6 @@ Partial Class Compras_Compras Next TmpDT.AcceptChanges() - Alert((TmpDT.Select("Consec = " & gvr.RowIndex + 1)(0))("NoDeducible").ToString()) AddPS2(EsNoDeducible:=EsNoDeducible) End Sub diff --git a/Compras/RepCxP.aspx.vb b/Compras/RepCxP.aspx.vb index a77e3cd8e..fdd9bf68e 100644 --- a/Compras/RepCxP.aspx.vb +++ b/Compras/RepCxP.aspx.vb @@ -177,7 +177,7 @@ Partial Class Compras_RepCxP GvCxP.Columns(10).Visible = False Dim Contador As Integer = 2 Dim CargaColumnaVencido As Boolean = False - Dim Dr As DataRow = Mov.DtResultados.Rows(0) + Dim Dr As DataRow = DtDatos.Rows(0) If Dr("NomC1").ToString <> "" Then GvCxP.Columns(Contador).Visible = True GvCxP.Columns(Contador).HeaderText = Dr("NomC1").ToString diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index fea9eb9c6..df5a5f844 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -695,20 +695,20 @@ Partial Class OC divtxtprioridad.Visible = False End If - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - - End If - CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, TtituloProyecto, TituloSubProyecto) CargarCentrosDeCosto(Nothing, DdlSubProyectoContrato, LblProyecto, LblSubProyecto) DivProyecto.Visible = DdlProyecto.Visible + DdlSubProyecto.Items.Clear() + ' aqui tiene otras condiciones especiales + DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) 'If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, CveEmpresaActual, -1, 1), GlobalDTSubProyectos(-1, -1, CveEmpresaActual, 1)) ' DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlSubProyectoContrato.Items.Clear() + DdlSubProyectoContrato.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) 'If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, CveEmpresaActual, -1, 1), GlobalDTSubProyectos(-1, -1, CveEmpresaActual, 1)) ' DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) + DdlSubProyectoContrato.DataBind() + DdlSubProyectoContrato.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'SOLO SE MUESTRA CUANDO ES REGISTRO NUEVO If Not CveOrdenCompra > 0 Then If UsuarioActual.Empresa.EsComercializadora And Not CveCotizacion > 0 Then diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ac3635c77..1a485b0e6 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1948,7 +1948,7 @@ Partial Class Ventas CreaDTmpF() CreaDTDocumentosRelacionados() CargaDdlSubProyectos() - CargaProyecto() + 'CargaProyecto() CargaSucursales() CargaClasificaciones() @@ -4760,14 +4760,14 @@ Partial Class Ventas UpINV.Update() End Sub Private Sub CargaSubProyecto(Optional CveSubProyecto As Integer = -1) - DdlSubProyecto.Items.Clear() - DdlSubProyecto.SelectedValue = Nothing - If DdlProyecto.SelectedValue.ToEntero() > 0 Then - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) - End If - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) + 'DdlSubProyecto.Items.Clear() + 'DdlSubProyecto.SelectedValue = Nothing + 'If DdlProyecto.SelectedValue.ToEntero() > 0 Then + ' DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + ' 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) + 'End If + 'DdlSubProyecto.DataBind() + 'DdlSubProyecto.Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) If CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(CveSubProyecto) End Sub @@ -6153,23 +6153,23 @@ Partial Class Ventas TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal) Dim ClienteRetIVA = Me.ClienteRetIVA - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - 'ClienteRetIVA = 0.0D - If ClienteRetIVA <= 0 Then - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - ClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then - ClienteRetIVA = 0.06D - End If + + If ClienteRetIVA <= 0 Then + If CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then + ClienteRetIVA = 0.06D + DdlTipoRetencion.SelectedValueExist("4") + LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero + TrRetIVA.Style.Add("display", "") + DdlTipoRetencion.Visible = True + ElseIf DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + ClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + ClienteRetIVA = 0.04D End If - ' LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero - TrRetIVA.Style.Add("display", "") - DdlTipoRetencion.Visible = True End If + TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero() TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text TmpDT.Rows(e.RowIndex)("Cantidad") = Cantidad @@ -8582,9 +8582,9 @@ Partial Class Ventas End Select ObjFactura.ComplementoINE = INE End If - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - ObjFactura.CveTipoRetencion = DdlTipoRetencion.SelectedValue.ToEntero() - End If + + ObjFactura.CveTipoRetencion = DdlTipoRetencion.SelectedValue.ToEntero() + ObjFactura.NuevaFactura = Me.NuevaFactura End Sub @@ -9506,10 +9506,8 @@ Partial Class Ventas Next End If - Dim CveTipoRetencion As Integer = 0 - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - CveTipoRetencion = factura.CveTipoRetencion - End If + + 'SI LA FACTURA ESTA PAGADA DEBE MARCAR LA DEVOLUCION POR SI SE QUIERE AMORTIZAR If (ObjFacturaNC IsNot Nothing AndAlso ObjFacturaNC.Pagado > 0) AndAlso factura.TipoDocto = "Dev" Then @@ -9531,7 +9529,7 @@ Partial Class Ventas CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM, DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False), - Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then + Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then @@ -15229,24 +15227,23 @@ Partial Class Ventas End If Dim ClienteRetIVA = Me.ClienteRetIVA - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - 'ClienteRetIVA = 0.0D - If ClienteRetIVA <= 0 Then - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - ClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then - ClienteRetIVA = 0.06D - End If + If ClienteRetIVA <= 0 Then + If CBool(DrPS("EsOutSourcing").ToString()) Then + ClienteRetIVA = 0.06D + DdlTipoRetencion.SelectedValueExist("4") + ElseIf DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + ClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + ClienteRetIVA = 0.04D End If - - ' LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero - TrRetIVA.Style.Add("display", "") - DdlTipoRetencion.Visible = True End If + LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero + TrRetIVA.Style.Add("display", "") + DdlTipoRetencion.Visible = True + + Row("IVA") = Row("PorcentajeIVA") Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) @@ -15283,6 +15280,7 @@ Partial Class Ventas Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion Row("CveVentaDetallePedido2") = CveVentaDetallePedido2 Row("CuentaPredial") = CuentaPredial + Row("EsOutSourcing") = DrPS("EsOutSourcing") If UsuarioActual.CveEmpresa = 119 Then If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA @@ -25861,8 +25859,8 @@ Partial Class Ventas Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs) If CveVenta <= 0 OrElse EsCreaApartirDe Then - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then + + If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then For Each RowServicio As DataRow In TmpDT.Rows Dim tClienteRetIVA = ClienteRetIVA If tClienteRetIVA <= 0 Then @@ -25895,7 +25893,7 @@ Partial Class Ventas End If - End If + End If UpPS.Update() From 7cf2df795a9d567b3ca7c52d370eb3d98b1ef98c Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Thu, 16 Jul 2020 15:23:10 -0700 Subject: [PATCH 20/56] GlobalDTOCEstatusUsuarios, GlobalDTBancosCuentas, OC anticpos --- AC/RegDevengadoIngresos.aspx.vb | 2 +- AC/RegNomina.aspx.vb | 4 +- AC/RegRecaudado.aspx.vb | 4 +- App_Code/ClsBancos.vb | 3 +- App_Code/ClsOC.vb | 38 ++++ App_Code/ClsPaginas.vb | 44 ++++- App_Code/Modelos.vb | 126 +++++++++---- Ashx/SIGFacturacion.ashx | 86 ++++++--- Bancos/CIF.aspx.vb | 4 +- Bancos/CargarConciliacionesBancarias.aspx.vb | 4 +- Bancos/ConciliacionesBancarias.aspx.vb | 8 +- Bancos/Creditos.aspx.vb | 2 +- Bancos/CreditosPagoMultiple.aspx.vb | 4 +- Bancos/CuentasBancarias.aspx.vb | 15 +- Bancos/CuentasBancariasDetalle.aspx.vb | 38 ++-- Bancos/DepositoTerminal.aspx.vb | 9 +- Bancos/DepositosCaja.aspx.vb | 8 +- Bancos/Devoluciones.aspx.cs | 6 +- Bancos/IE.aspx.vb | 153 +++++++++++++--- Bancos/IE2.aspx.vb | 4 +- Bancos/OtrosIE.aspx.vb | 8 +- Bancos/OtrosIngresos.aspx.vb | 2 +- Bancos/PagoAcreedor.aspx.cs | 12 +- Bancos/PagoDeudor.aspx.cs | 18 +- Bancos/PagoElectronico.aspx.vb | 4 +- Bancos/PagoElectronicoGrupos.aspx.vb | 6 +- Bancos/PolizaCheque.aspx.vb | 10 +- Bancos/PopIECompras.aspx.vb | 6 +- Bancos/PopIEVentas.aspx.vb | 6 +- Bancos/PopUpBuscarIE.aspx.vb | 2 +- Bancos/PrestamoPersonal.aspx.cs | 12 +- Bancos/ProductosFinancieros.aspx.vb | 8 +- Bancos/ProveedoresAbonar.aspx.vb | 12 +- Bancos/ProveedoresCreditos.aspx.vb | 6 +- Bancos/Reembolsos.aspx.vb | 12 +- Bancos/RegistroPagoIntermediario.aspx.vb | 4 +- Bancos/RepCobrado.aspx.vb | 2 +- Bancos/RepCobradoDetalle.aspx.vb | 2 +- Bancos/RepComprobaciones.aspx.cs | 2 +- Bancos/RepCreditos.aspx.vb | 2 +- Bancos/RepIE.aspx.vb | 6 +- Bancos/RepProgramaciones.aspx.vb | 6 +- Bancos/RepProgramarRecursos.aspx.vb | 2 +- Bancos/RepSaldos.aspx.vb | 2 +- Bancos/RepSaldosPeriodo.aspx.cs | 2 +- Bancos/SaldarCajaChica.aspx.cs | 2 +- Bancos/Transferencias.aspx.vb | 18 +- Compras/Compras.aspx.vb | 18 +- Compras/Reembolsos.aspx.vb | 8 +- Compras/ReembolsosComprobaciones.aspx.vb | 8 +- Compras/RembolsosSinAsignar.aspx.vb | 2 +- Compras/RepPagado.aspx.cs | 2 +- Compras/RepPagadoDetalle.aspx.cs | 2 +- Compras/RepPagadoPeriodo.aspx.cs | 2 +- Compras/RepRembolsoComprobaciones.aspx.vb | 2 +- Contabilidad/DiarioPagos.aspx.vb | 2 +- Contabilidad/FisImpuestos.aspx.vb | 2 +- Contabilidad/RegPrePoliza.aspx.vb | 2 +- Contabilidad/RegPrePoliza1.aspx.vb | 2 +- Contabilidad/RegPrePolizaS.aspx.vb | 2 +- Global.asax | 10 +- OC/OC.aspx | 23 ++- OC/OC.aspx.vb | 176 +++++++++++++++---- Sistemas/CatSesiones.aspx.vb | 6 +- Sistemas/UsuarioDetalle.aspx.vb | 27 +-- Ventas/ClientesAbonar.aspx.vb | 16 +- Ventas/PV.aspx.vb | 12 +- Ventas/ProductosFinancieros.aspx.vb | 6 +- Ventas/RepRecuperacion.aspx.vb | 2 +- Ventas/RepRecuperacionDetalle.aspx.vb | 2 +- Ventas/RepRecuperacionPeriodo.aspx.cs | 2 +- Ventas/Ventas.aspx.vb | 18 +- asmx/WSApp.asmx | 84 ++++++--- asmx/WSSIGApp.asmx | 44 +++-- 74 files changed, 855 insertions(+), 363 deletions(-) diff --git a/AC/RegDevengadoIngresos.aspx.vb b/AC/RegDevengadoIngresos.aspx.vb index 67cdfeec5..ea4ca5fc8 100644 --- a/AC/RegDevengadoIngresos.aspx.vb +++ b/AC/RegDevengadoIngresos.aspx.vb @@ -24,7 +24,7 @@ Partial Class AC_RegDevengadoIngresos End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'If CveMoneda > 0 Then ' dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) diff --git a/AC/RegNomina.aspx.vb b/AC/RegNomina.aspx.vb index ddfa77da1..e1dd07a3b 100644 --- a/AC/RegNomina.aspx.vb +++ b/AC/RegNomina.aspx.vb @@ -296,7 +296,7 @@ Partial Class AC_RegNomina DdlNominaPersonal.DataBind() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas DdlCuenta.DataSource = dt DdlCuenta.DataBind() TbIE.Visible = True @@ -385,7 +385,7 @@ Partial Class AC_RegNomina If Seleccion.Contiene("3", "4") Then Dim dr As DataRow - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then 'DdlMoneda.SelectedValue = dr("CveMoneda").ToString IdCtaBancaria = dr("IdCtaContable").ToString.ToEntero diff --git a/AC/RegRecaudado.aspx.vb b/AC/RegRecaudado.aspx.vb index 8988a86be..de95a10d1 100644 --- a/AC/RegRecaudado.aspx.vb +++ b/AC/RegRecaudado.aspx.vb @@ -28,7 +28,7 @@ Partial Class AC_RegRecaudado End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'If CveMoneda > 0 Then ' dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -137,7 +137,7 @@ Partial Class AC_RegRecaudado Dim IdCtaConCuentaBancaria As Integer = 0 - Dim drcb As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero).FiltroPrimero("") + Dim drcb As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("") If drcb IsNot Nothing Then IdCtaConCuentaBancaria = drcb("IdCtaContable").ToString.ToEntero End If diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index c795ada73..49c81b77f 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1404,7 +1404,7 @@ Public Class ClsBancos NotificarA As String, EsAbonoEnCuenta As Boolean, AplicaImpuestos As Boolean, IDPoliza As Integer, CvePrePoliza As Integer, Comprobante As String, CveUsuario As Integer, CveEmpresa As Integer, Optional CveCuentaDeposito As Integer = -1, Optional PagoElectronico As String = "-1", Optional CveEstatusIE As Integer = 1, Optional CveCuentaTarjeta As Integer = -1, Optional Referencia As String = "-1", Optional CveIESustitucion As Integer = -1, Optional CveCorte As Integer = -1, Optional CveProveedorIntermediario As Integer = -1, Optional FueConciliado As Boolean = False, - Optional MesesSinIntereses As Integer = -1, Optional Modulo As String = "", Optional ConceptoCIE As String = "") As Integer + Optional MesesSinIntereses As Integer = -1, Optional Modulo As String = "", Optional ConceptoCIE As String = "", Optional CveOCAnticipo As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Banc_IEAdd") @@ -1444,6 +1444,7 @@ Public Class ClsBancos .Add("@CveIE", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@FolioRegistro", SqlDbType.VarChar, 50).Direction = ParameterDirection.Output .Add("@Modulo", SqlDbType.VarChar).Value = Modulo + .Add("@CveOCAnticipo", SqlDbType.Int).Value = CveOCAnticipo End With Try diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 5a2e41f76..4a1cd26ba 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -2553,6 +2553,44 @@ Public Class ClsOC Return Retorno End Function + Public Function GetOCAnticipo(CveOrdenCompra As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OC_OCAnticipo") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los anticipos relacionados", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetOCAnticipoSaldo(CveOrdenCompra As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OC_OCAnticipoSaldo") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el saldo de la compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 531cadc14..31d99593f 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1453,21 +1453,33 @@ Public Class ClsPaginas ' Application("GlobalDTBancosCuentas") = value ' End Set 'End Property - Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1) As DataTable + Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1) As DataTable Get + Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancosCuentasUsuarios(-1) Then + Application(AppNombre) = ObjBancos.DtResultados + Else + Application(AppNombre) = Nothing + End If + ObjBancos.Dispose() + End If Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa) If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario = {1}", Str, CveUsuario) If CveCuenta > -1 Then Str = String.Format("{0} AND CveCuenta = {1}", Str, CveCuenta) If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo")) - Dim Dv As New DataView(DirectCast(Application("GlobalDTBancosCuentas"), DataTable), Str, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str, "", DataViewRowState.CurrentRows) GlobalDTBancosCuentas = Dv.ToTable Dv.Dispose() 'GlobalDTBancosCuentas = DirectCast(Application("GlobalDTBancosCuentas"), DataTable) End Get Set(value As DataTable) - Application("GlobalDTBancosCuentas") = value + Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property Property GlobalDTTipoTransacciones() As DataTable @@ -2831,6 +2843,22 @@ Public Class ClsPaginas End Property Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable Get + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + Application(AppNombre) = ObjOC.DtResultados + Else + Application(AppNombre) = Nothing + End If + + ObjOC.Dispose() + + End If + If CveEmpresa <> -1 Then Dim filtro As New StringBuilder filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) @@ -2840,15 +2868,19 @@ Public Class ClsPaginas If Tipo <> "" Then filtro.AppendFormat(" AND Tipo='{0}'", Tipo) End If - Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) GlobalDTOCEstatusUsuarios = Dv.ToTable Dv.Dispose() + Else - GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) + GlobalDTOCEstatusUsuarios = DirectCast(Application(AppNombre), DataTable) End If + + End Get Set(value As DataTable) - Application("GlobalDTOCEstatusUsuarios") = value + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 5e08bcb3a..923cb67bf 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -3216,13 +3216,13 @@ Namespace Modelos Dim PorcentajeImpuestoPago As Decimal = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal - If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows.Count = 1 Then - IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContable").ToString.ToEntero + If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count = 1 Then + IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("IdCtaContable").ToString.ToEntero ' CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContableSIG").ToString.ToEntero End If If IdCtaContable <= 0 Then - CuentasContablesInvalidas.AppendFormat("
    {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero) + CuentasContablesInvalidas.AppendFormat("
    {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("NumCuentaMoneda").ToString.ToEntero) idCuentaContabilizacion = 0 End If @@ -7165,37 +7165,58 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTBancos") = value End Set End Property - 'Property GlobalDTBancosCuentas(CveUsuario As Integer) As DataTable + + + 'Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1) As DataTable ' Get + ' Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa) - ' If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario ={1}", Str, CveUsuario) + ' If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario = {1}", Str, CveUsuario) + ' If CveCuenta > -1 Then Str = String.Format("{0} AND CveCuenta = {1}", Str, CveCuenta) + ' If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo")) ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTBancosCuentas"), DataTable), Str, "", DataViewRowState.CurrentRows) ' GlobalDTBancosCuentas = Dv.ToTable ' Dv.Dispose() - + ' 'GlobalDTBancosCuentas = DirectCast(HttpContext.Current.Application("GlobalDTBancosCuentas"), DataTable) ' End Get ' Set(value As DataTable) ' HttpContext.Current.Application("GlobalDTBancosCuentas") = value ' End Set 'End Property - Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1) As DataTable + + Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1) As DataTable Get + Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancosCuentasUsuarios(-1) Then + HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing + End If + ObjBancos.Dispose() + End If Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa) If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario = {1}", Str, CveUsuario) If CveCuenta > -1 Then Str = String.Format("{0} AND CveCuenta = {1}", Str, CveCuenta) If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo")) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTBancosCuentas"), DataTable), Str, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str, "", DataViewRowState.CurrentRows) GlobalDTBancosCuentas = Dv.ToTable Dv.Dispose() - 'GlobalDTBancosCuentas = DirectCast(HttpContext.Current.Application("GlobalDTBancosCuentas"), DataTable) + 'GlobalDTBancosCuentas = DirectCast(Application("GlobalDTBancosCuentas"), DataTable) End Get Set(value As DataTable) - HttpContext.Current.Application("GlobalDTBancosCuentas") = value + Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value End Set End Property + + + Property GlobalDTTipoTransacciones() As DataTable Get If UsuarioActual.CveEmpresa = 66 Then @@ -8449,6 +8470,45 @@ Namespace Modelos #End Region #Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************" + + Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + Get + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing + End If + + ObjOC.Dispose() + + End If + + Dim filtro As New StringBuilder + filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + If CveUsuario > 0 Then + filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + End If + If Tipo <> "" Then + filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + End If + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTOCEstatusUsuarios = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + + Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -8463,28 +8523,30 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTOCEstatus") = value End Set End Property - Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable - Get - If CveEmpresa <> -1 Then - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) - End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value - End Set - End Property + + + 'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim filtro As New StringBuilder + ' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + ' If CveUsuario > 0 Then + ' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + ' End If + ' If Tipo <> "" Then + ' filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + ' End If + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTOCEstatusUsuarios = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value + ' End Set + 'End Property #End Region diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index 06a0be6c8..5ab24ec65 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -3278,30 +3278,72 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOCEstatus") = value End Set - End Property - Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable - Get - If CveEmpresa <> -1 Then - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) - End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value - End Set End Property + Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + Get + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing + End If + + ObjOC.Dispose() + + End If + + Dim filtro As New StringBuilder + filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + If CveUsuario > 0 Then + filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + End If + If Tipo <> "" Then + filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + End If + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTOCEstatusUsuarios = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + + + + + + 'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim filtro As New StringBuilder + ' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + ' If CveUsuario > 0 Then + ' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + ' End If + ' If Tipo <> "" Then + ' filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + ' End If + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTOCEstatusUsuarios = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value + ' End Set + 'End Property + #End Region diff --git a/Bancos/CIF.aspx.vb b/Bancos/CIF.aspx.vb index 81ed903e1..2bcbfe125 100644 --- a/Bancos/CIF.aspx.vb +++ b/Bancos/CIF.aspx.vb @@ -9,7 +9,7 @@ Partial Class Bancos_CIF Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then - DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentas.DataBind() 'DdlCuentas.Items.Insert(0, New ListItem("Seleccione una Cuenta", "-1")) @@ -29,7 +29,7 @@ Partial Class Bancos_CIF Dim ObjBancos As New ClsBancos Dim ObjMov As New ClsContabilidad(ObjBancos.IniciaTransacSQL) Dim Importe As Double = TxtImporte.Text.ToDouble - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() Dim ErrorTransaccion As Boolean = False Dim Folio As String = ObjBancos.GetNextFolio(DdlCuentas.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero).ToString Dim CvePrePoliza As Integer diff --git a/Bancos/CargarConciliacionesBancarias.aspx.vb b/Bancos/CargarConciliacionesBancarias.aspx.vb index 27ab10ceb..8fe358133 100644 --- a/Bancos/CargarConciliacionesBancarias.aspx.vb +++ b/Bancos/CargarConciliacionesBancarias.aspx.vb @@ -41,11 +41,11 @@ Partial Class Bancos_CargarConciliacionesBancarias Private Sub InicializaValores() 'Cargar Cuentas - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuenta.DataBind() - DdlCuentaModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentaModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentaModal.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCuentaModal.DataBind() diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb index c8957ee63..62f9142a4 100644 --- a/Bancos/ConciliacionesBancarias.aspx.vb +++ b/Bancos/ConciliacionesBancarias.aspx.vb @@ -74,7 +74,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx Private Sub InicializaValores() 'Cargar Cuentas - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuenta.DataBind() @@ -627,13 +627,13 @@ Partial Class Bancos_ConciliacionesBancariasaspx If DdlCuenta.SelectedValue.ToEntero > 0 Then Dim CveCuenta As Integer = 0 Dim CveCuentaComplementaria As Integer = 0 - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("CveMoneda").ToString.ToEntero + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("CveMoneda").ToString.ToEntero Dim ObjConta As New ClsContabilidad If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContable").ToString}").Rows.Count > 0 Then - CveCuenta = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContable").ToString}").Rows(0)("CveCuenta").ToString.ToEntero + CveCuenta = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContable").ToString}").Rows(0)("CveCuenta").ToString.ToEntero If CveMoneda > 1 Then - CveCuentaComplementaria = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContableComplementaria").ToString}").Rows(0)("CveCuenta").ToString.ToEntero + CveCuentaComplementaria = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContableComplementaria").ToString}").Rows(0)("CveCuenta").ToString.ToEntero End If End If End If diff --git a/Bancos/Creditos.aspx.vb b/Bancos/Creditos.aspx.vb index 00b8d2425..437d9c1de 100644 --- a/Bancos/Creditos.aspx.vb +++ b/Bancos/Creditos.aspx.vb @@ -174,7 +174,7 @@ Partial Class Bancos_Creditos DdlCSTipoMoneda.DataBind() 'Carga CuentasBancarias para CuentaCredito y CuentaDeposito - DtCuentasBancarias = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DtCuentasBancarias = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) CargaCuentasDeposito() End Sub diff --git a/Bancos/CreditosPagoMultiple.aspx.vb b/Bancos/CreditosPagoMultiple.aspx.vb index 70a1873b4..3389cd8d3 100644 --- a/Bancos/CreditosPagoMultiple.aspx.vb +++ b/Bancos/CreditosPagoMultiple.aspx.vb @@ -69,7 +69,7 @@ Partial Class Bancos_CreditosPagoMultiple Private Sub CargaCuentas(tTipoTransaccion As Integer) DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If CveMoneda > 0 Then dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -137,7 +137,7 @@ Partial Class Bancos_CreditosPagoMultiple Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero diff --git a/Bancos/CuentasBancarias.aspx.vb b/Bancos/CuentasBancarias.aspx.vb index 6d32e50af..0726942d5 100644 --- a/Bancos/CuentasBancarias.aspx.vb +++ b/Bancos/CuentasBancarias.aspx.vb @@ -62,17 +62,22 @@ Partial Class Bancos_CuentasBancarias Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting Dim ObjBancos As New ClsBancos + If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - If ObjBancos.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados - End If - + DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados + 'End If + Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion) End If + ObjBancos.Dispose() If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb index 698e4aab8..2b4c1f02f 100644 --- a/Bancos/CuentasBancariasDetalle.aspx.vb +++ b/Bancos/CuentasBancariasDetalle.aspx.vb @@ -203,12 +203,13 @@ Partial Class Bancos_CuentasBancariasDetalle End If Next - If Not ErrorUsuarios Then - If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjCuentasBancariasDetalle.DtResultados - Else - ErrorUsuarios = True - End If + If Not ErrorUsuarios Then + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjCuentasBancariasDetalle.DtResultados + 'Else + ' ErrorUsuarios = True + 'End If End If End If @@ -221,11 +222,12 @@ Partial Class Bancos_CuentasBancariasDetalle Else If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble, DDlCuentaContable.SelectedValue.ToEntero, DdlCuentaContableComplementaria.SelectedValue.ToEntero, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text, ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked) Then 'CargaDatos() - If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjCuentasBancariasDetalle.DtResultados - Else - ErrorUsuarios = True - End If + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjCuentasBancariasDetalle.DtResultados + 'Else + ' ErrorUsuarios = True + 'End If UpDatos.Update() Else ErrorUsuarios = True @@ -322,9 +324,10 @@ Partial Class Bancos_CuentasBancariasDetalle If Obj.AddBancosCuentasUsuarios(CveCuenta, DdlUsuarios.SelectedValue.ToEntero) Then DTUsuarios = Obj.DtResultados GVU.DataSource = Obj.DtResultados - If Obj.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = Obj.DtResultados - End If + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If Obj.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Obj.DtResultados + 'End If End If Else If DTUsuarios.FiltraParametros(String.Format("CveUsuario = {0}", DdlUsuarios.SelectedValue.ToString)).Rows.Count > 0 Then @@ -377,9 +380,10 @@ Partial Class Bancos_CuentasBancariasDetalle GVU.EditIndex = -1 DTUsuarios = ObjBancos.DtResultados GVU.DataSource = ObjBancos.DtResultados - If ObjBancos.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados - End If + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados + 'End If Alert("El usuario se eliminó correctamente.", TipoMensaje.MsgInformacion) End If Else diff --git a/Bancos/DepositoTerminal.aspx.vb b/Bancos/DepositoTerminal.aspx.vb index 88a929585..210c6c88e 100644 --- a/Bancos/DepositoTerminal.aspx.vb +++ b/Bancos/DepositoTerminal.aspx.vb @@ -137,8 +137,8 @@ Partial Class Bancos_DepositoTerminal #Region "CARGA COMBOS" Private Sub CargaCuentas() - DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) - DdlCuentaTerminal.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaTerminal.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones().FiltraParametros("CveTipoTransaccion in (11,12)") DdlCuentaDeposito.DataBind() @@ -149,7 +149,7 @@ Partial Class Bancos_DepositoTerminal End Sub Private Sub DdlCuentaSelectIndexChange() - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) If dr IsNot Nothing Then IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero @@ -233,7 +233,8 @@ Partial Class Bancos_DepositoTerminal Dim CveCuentaBancariaDestino As Integer = 0 Dim IDPoliza As Integer = 0 Dim FolioPoliza As String = "" - Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") + Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa +).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") Dim MsgError As String = "" If drDestino IsNot Nothing Then diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 71e9a4b23..d11da1c2f 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -24,10 +24,10 @@ Partial Class Bancos_DepositosCaja End Sub Private Sub CargaCuentas() - DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentaDeposito.DataBind() - DdlCajaChica.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCajaChica.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCajaChica.DataBind() End Sub @@ -80,8 +80,8 @@ Partial Class Bancos_DepositosCaja Dim IdCuentaBancariaDestino As Integer = 0 Dim CveCuentaBancariaOrigen As Integer = 0 Dim CveCuentaBancariaDestino As Integer = 0 - Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero($"CveCuenta = {DdlCajaChica.SelectedValue}") - Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") + Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero($"CveCuenta = {DdlCajaChica.SelectedValue}") + Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") If drOrigen IsNot Nothing Then CveMoneda = drOrigen("CveMoneda").ToString.ToEntero diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index da3d4ae99..991e48ded 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -114,7 +114,7 @@ public partial class Bancos_Devoluciones : ClsPaginas } protected void CargaCuentas() { - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuenta.Items.Insert(0, new ListItem("Seleccione Cuenta", "-1")); } @@ -158,7 +158,7 @@ public partial class Bancos_Devoluciones : ClsPaginas protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { int idcuenta; - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); IDCtaContableBancos = idcuenta; long Folio; @@ -332,7 +332,7 @@ public partial class Bancos_Devoluciones : ClsPaginas int CveConceptoContableDevolucion = 0; int CvePlantillaPoliza = 0; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; int cveProveedor = (DdlProveedores.SelectedValue.ToEntero() > 0) ? DdlProveedores.SelectedValue.ToEntero() : -1; diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 14d3f041a..fce9a37a2 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -289,14 +289,38 @@ Partial Class Bancos_IE ViewState("CveMoneda") = value End Set End Property + Private Property CveOCSolicitudAnticipo As Integer Get - Return ViewState("CveOCSolicitudAnticipo").ToString.ToEntero + + If ViewState("CveOCSolicitudAnticipo") Is Nothing Then + Return -1 + Else + Return ViewState("CveOCSolicitudAnticipo").ToString.ToEntero + End If + End Get Set(value As Integer) ViewState("CveOCSolicitudAnticipo") = value End Set End Property + + Private Property SaldoOCAnticipo As Decimal + Get + If ViewState("SaldoOCAnticipo") Is Nothing Then + Return -1 + Else + Return ViewState("SaldoOCAnticipo").ToString.ToDecimal + End If + + End Get + Set(value As Decimal) + ViewState("SaldoOCAnticipo") = value + End Set + End Property + + + Private Property EstaContabilizado As Boolean Get Return CBool(ViewState("EstaContabilizado")) @@ -1561,7 +1585,7 @@ Partial Class Bancos_IE Banco.Dispose() TxtFolio.Text = Folio.ToString - Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If drI IsNot Nothing Then CargaNotas(drI("CveMoneda").ToString.ToEntero) @@ -1574,7 +1598,7 @@ Partial Class Bancos_IE TxtFolio.Text = "" End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then @@ -1741,9 +1765,9 @@ Partial Class Bancos_IE Dim dt As DataTable If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Else - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas End If @@ -2441,7 +2465,19 @@ Partial Class Bancos_IE EsValido = False End If End If - Dep.Dispose() + Dep.Dispose() + + + + 'If CveOCSolicitudAnticipo > 0 Then + ' If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then + + ' EsValido = False + ' Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) + + ' End If + 'End If + Return EsValido End Function @@ -2457,9 +2493,6 @@ Partial Class Bancos_IE Exit Sub End If - - - Dim ObjIE As New ClsBancos() Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) @@ -2477,8 +2510,9 @@ Partial Class Bancos_IE Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

    " Dim Msg As New StringBuilder - If CveIE = -1 Then - + If CveIE = -1 Then + + Dim CveCuentaDeposito As Integer = 0 If DdlCuentaDeposito.Items.Count > 0 Then CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero @@ -2654,7 +2688,7 @@ Partial Class Bancos_IE CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), - ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte) + ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte, CveOCAnticipo:=CveOCSolicitudAnticipo) If CveIE > 0 Then @@ -5405,19 +5439,45 @@ Partial Class Bancos_IE Private Sub InicializaSolicitudAnticipoOC() If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then If Request("CveOC") IsNot Nothing AndAlso Request("CveOC").ToString.ToEntero > 0 Then + CveOCSolicitudAnticipo = Request("CveOC").ToString.ToEntero + TxtImporte.Enabled = False + End If End If If CveOCSolicitudAnticipo > 0 Then + Dim ObjOC As New ClsOC + + If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then + SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal + Else + SaldoOCAnticipo = 0 + End If + + + If ObjOC.GetSolicitudAnticipo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then + Dim DrOC = ObjOC.DtResultados.FiltroPrimero("") - If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) AndAlso DrOC("CveIEAnticipo").ToString = "" Then + + If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) Then TxtObservaciones.Text = DrOC("Descripcion").ToString - TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero - TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + If DrOC("ImporteAnticipo").ToString.ToDecimal > SaldoOCAnticipo Then + + 'TxtImporte.Text = SaldoOCAnticipo.ToString().FormatoNumero + 'TxtImporteLetra.Text = SaldoOCAnticipo.ToString().FormatoNumero.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + Alert($"El importe solcitado es superior al saldo de la compra, importe solicitado: {DrOC("ImporteAnticipo").ToString.FormatoNumero} saldo: {SaldoOCAnticipo.ToString().FormatoNumero }", TipoMensaje.MsgAdvertencia) + BtnGuardar.Enabled = False + Else + TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero + TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + End If + DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString CveMoneda = DrOC("CveMoneda").ToString.ToEntero CargaCuenta(DrOC("CveMoneda").ToString.ToEntero) @@ -5433,19 +5493,72 @@ Partial Class Bancos_IE End If CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero Else - If DrOC("CveIEAnticipo").ToString <> "" Then - Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError) - End If + 'If DrOC("CveIEAnticipo").ToString <> "" Then + ' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError) + 'End If + If DrOC("TipoTermino").ToString = "3" Then ' cuando es tipo rechazado + Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ha sido cancelada.", TipoMensaje.MsgError) + CveOCSolicitudAnticipo = -1 + BtnGuardar.Enabled = False + End If - CveOCSolicitudAnticipo = -1 - BtnGuardar.Enabled = False + End If Else Alert("Ocurrió un error al actualizar el estatus de anticipo de la OC/REQ. Por favor actualice y vuelva a intentar.", TipoMensaje.MsgError) End If + + + 'If ObjOC.GetSolicitudAnticipo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then + ' Dim DrOC = ObjOC.DtResultados.FiltroPrimero("") + ' If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) AndAlso DrOC("CveIEAnticipo").ToString = "" Then + ' TxtObservaciones.Text = DrOC("Descripcion").ToString + + ' If DrOC("ImporteAnticipo").ToString.ToDecimal > SaldoOCAnticipo Then + + ' 'TxtImporte.Text = SaldoOCAnticipo.ToString().FormatoNumero + ' 'TxtImporteLetra.Text = SaldoOCAnticipo.ToString().FormatoNumero.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + ' Alert($"El importe solcitado es superior al saldo de la compra, importe solicitado: {DrOC("ImporteAnticipo").ToString.FormatoNumero} saldo: {SaldoOCAnticipo.ToString().FormatoNumero } se cambio", TipoMensaje.MsgAdvertencia) + ' Else + ' TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero + ' TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + ' End If + + ' DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString + ' CveMoneda = DrOC("CveMoneda").ToString.ToEntero + ' CargaCuenta(DrOC("CveMoneda").ToString.ToEntero) + ' UpCuentaDeposito.Update() + ' If DrOC("CveProveedor").ToString.ToEntero > 0 Then + ' HdnCveProveedor.Value = DrOC("CveProveedor").ToString + ' RBL.SelectedValue = "P" + ' RBL_SelectedIndexChanged(RBL, Nothing) + ' DdlProveedores.SelectedValue = HdnCveProveedor.Value + ' DdlProveedores_selectedindexchange(DdlProveedores, Nothing) + ' DdlProveedores.SelectedText = RazonSocial + ' ' BuscaCargaProveedor() + ' End If + ' CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero + ' Else + ' If DrOC("CveIEAnticipo").ToString <> "" Then + ' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError) + ' End If + ' If DrOC("TipoTermino").ToString = "3" Then ' cuando es tipo rechazado + ' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ha sido cancelada.", TipoMensaje.MsgError) + ' End If + + ' CveOCSolicitudAnticipo = -1 + ' BtnGuardar.Enabled = False + ' End If + 'Else + ' Alert("Ocurrió un error al actualizar el estatus de anticipo de la OC/REQ. Por favor actualice y vuelva a intentar.", TipoMensaje.MsgError) + 'End If + + + ObjOC.Dispose() End If diff --git a/Bancos/IE2.aspx.vb b/Bancos/IE2.aspx.vb index dd2087068..e2e7f1477 100644 --- a/Bancos/IE2.aspx.vb +++ b/Bancos/IE2.aspx.vb @@ -617,7 +617,7 @@ Partial Class Bancos_IE End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then DdlMoneda.SelectedValue = dr("CveMoneda").ToString IDCtaContable = dr("IdCtaContable").ToString.ToEntero @@ -699,7 +699,7 @@ Partial Class Bancos_IE Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas 'If CveMoneda > 0 Then ' dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) diff --git a/Bancos/OtrosIE.aspx.vb b/Bancos/OtrosIE.aspx.vb index 613a8f020..7729de625 100644 --- a/Bancos/OtrosIE.aspx.vb +++ b/Bancos/OtrosIE.aspx.vb @@ -115,7 +115,7 @@ Partial Class Bancos_OtrosIE Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -144,7 +144,7 @@ Partial Class Bancos_OtrosIE TxtFolio.Text = "" End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero End If @@ -477,7 +477,7 @@ Partial Class Bancos_OtrosIE 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If DdlCuenta.SelectedValue.ToEntero > 0 Then - Dim DR As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) + Dim DR As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) If DR IsNot Nothing Then TxtImporte.Text = DTMovimientos.SUM("Abono", "IdCuenta =" & DR("IdCtaContable").ToString).ToString UPPDocumento.Update() @@ -490,7 +490,7 @@ Partial Class Bancos_OtrosIE Dim Retorno As Integer = 0 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If CveCuenta > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & CveCuenta) + Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & CveCuenta) If drr IsNot Nothing Then Retorno = drr("IdCtaContable").ToString.ToEntero End If diff --git a/Bancos/OtrosIngresos.aspx.vb b/Bancos/OtrosIngresos.aspx.vb index 4fa0e06c9..8e0730b19 100644 --- a/Bancos/OtrosIngresos.aspx.vb +++ b/Bancos/OtrosIngresos.aspx.vb @@ -23,7 +23,7 @@ Partial Class Bancos_OtrosIngresos Private Sub CargaCuentas() 'DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(1) + DdlCuenta.DataSource = GlobalDTBancosCuentas(1, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 34d0a9b14..cdcd5066d 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -159,8 +159,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas protected void CargaCuentas() { - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas - DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas + DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuentaPrestamo.DataBind(); @@ -184,7 +184,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas #region "PAGO ACREEDORES" protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); CveMonedaCuentaPago = 0; if (dr != null) { @@ -278,7 +278,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 21; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); @@ -617,7 +617,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas #region "PRESTAMO ACREEDORES" protected void DdlCuentaPrestamo_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); int tCveMoneda = 0; if (dr != null) { @@ -687,7 +687,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 45; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 6e56741cc..88424c2bd 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -213,8 +213,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas DdlCuenta.Items.Clear(); DdlCuentaPrestamo.Items.Clear(); - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas - DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas + DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuentaPrestamo.DataBind(); @@ -264,8 +264,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas protected void DdlCuentaPrestamo_SelectedIndexChanged(object sender, EventArgs e) { int idcuenta, idcuentaComp; - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuenta); - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuentaComp); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuenta); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuentaComp); IDCtaContableBancosPrestamo = idcuenta; IDCtaContableBancosComplementariaPrestamo = idcuentaComp; @@ -276,7 +276,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas TxtFolioPrestamo.Text = Folio.ToString(); - CveMonedaPrestamo = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); + CveMonedaPrestamo = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); if (CveMonedaPrestamo == 2) { @@ -551,8 +551,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { int idcuenta, idcuentacomplementaria; - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuentacomplementaria); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuentacomplementaria); IDCtaContableBancos = idcuenta; IDCtaContableBancosComplementario = idcuentacomplementaria; @@ -562,7 +562,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas bancos.Dispose(); TxtFolio.Text = Folio.ToString(); - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); HdnMonPago.Value = CveMoneda.ToString(); if (CveMoneda == 2) { @@ -653,7 +653,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas int CveConceptoContablePagoComplementaria = 256; int CvePlantillaPoliza = 39; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; decimal tipoCambio = (TxtTCDolaresPago.Visible == true) ? TxtTCDolaresPago.Text.ToDecimal() : 1; diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index 9e4dcebc6..7374d32e0 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -190,11 +190,11 @@ Partial Class Bancos_PagoElectronico #Region " C A R G A - D A T O S " Private Sub CargaCuentas() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayout = 1") + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayout = 1") DdlCuenta.DataBind() UpFiltros.Update() - DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayout = 1") + DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayout = 1") DdlCuentaReportes.DataBind() UpFiltrosReporte.Update() End Sub diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 8ff8ceec9..94f711266 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -327,16 +327,16 @@ Partial Class Bancos_PagoElectronicoGrupos #Region " C A R G A - D A T O S " Private Sub CargaCuentas() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayoutGrupos = 1") DdlCuenta.DataBind() UpFiltros.Update() - DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") + DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayoutGrupos = 1") DdlCuentaReportes.DataBind() UpFiltrosReporte.Update() - DdlCuentaEnviados.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") + DdlCuentaEnviados.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayoutGrupos = 1") DdlCuentaEnviados.DataBind() UpFiltroEnviados.Update() diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index 0a8276153..56533019e 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -213,7 +213,7 @@ Partial Class Bancos_PolizaCheque Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) @@ -296,7 +296,7 @@ Partial Class Bancos_PolizaCheque 'TxtFolio.Text = "" 'End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero End If @@ -868,7 +868,7 @@ Partial Class Bancos_PolizaCheque Dim ConceptoPoliza As String = TxtObservaciones.Text If ConceptoPoliza = "" Then ConceptoPoliza = TxtPagueseA.Text Dim CveMoneda As Integer = 1 - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero End If @@ -1190,7 +1190,7 @@ Partial Class Bancos_PolizaCheque 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If DdlCuenta.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) + Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) If drr IsNot Nothing Then TxtImporte.Text = DtMovimientos.SUM("Abono", "IdCuenta =" & drr("IdCtaContable").ToString).ToString UPPDocumento.Update() @@ -1206,7 +1206,7 @@ Partial Class Bancos_PolizaCheque 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If CveCuenta > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & CveCuenta) + Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & CveCuenta) If drr IsNot Nothing Then Retorno = drr("IdCtaContable").ToString.ToEntero End If diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 639c41138..b305df95f 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -759,7 +759,7 @@ Partial Class Bancos_PopIECompras Private Sub CargaCuentas() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -1076,7 +1076,7 @@ Partial Class Bancos_PopIECompras Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged Dim Folio As Long - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim TCveMoneda = -1 If dr IsNot Nothing Then @@ -1453,7 +1453,7 @@ Partial Class Bancos_PopIECompras Select Case RBLContado.SelectedValue Case "1" ' Banco If DdlCuenta.SelectedValue.ToEntero > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If Case "2", "3", "4", "5", "6" 'FyE, Ingresos, Deudores, Acreedores If ChkPagarDolares.Checked Then diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index ef708b810..3d83cb0b4 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -853,7 +853,7 @@ Partial Class Bancos_PopIEVentas Private Sub CargaCuentas() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -1039,7 +1039,7 @@ Partial Class Bancos_PopIEVentas Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged Dim Folio As Long - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim TCveMoneda = -1 If dr IsNot Nothing Then @@ -1452,7 +1452,7 @@ Partial Class Bancos_PopIEVentas Select Case RBLContado.SelectedValue Case "1" ' Banco If DdlCuenta.SelectedValue.ToEntero > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If Case "2", "3", "4", "5" 'FyE, Ingresos, Deudores If ChkPagarDolares.Checked Then diff --git a/Bancos/PopUpBuscarIE.aspx.vb b/Bancos/PopUpBuscarIE.aspx.vb index d46b4d027..48abdea72 100644 --- a/Bancos/PopUpBuscarIE.aspx.vb +++ b/Bancos/PopUpBuscarIE.aspx.vb @@ -56,7 +56,7 @@ Partial Class Bancos_PopUpBuscarIE End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveBanco = '" & DdlBanco.SelectedValue.ToEntero & "'") + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveBanco = '" & DdlBanco.SelectedValue.ToEntero & "'") DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1")) End Sub diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs index 45868524e..f9674a6bb 100644 --- a/Bancos/PrestamoPersonal.aspx.cs +++ b/Bancos/PrestamoPersonal.aspx.cs @@ -124,8 +124,8 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas protected void CargaCuentas() { - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas - DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas + DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuentaPrestamo.DataBind(); @@ -156,7 +156,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas #region "PAGO ACREEDORES" protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); int tCveMoneda = 0; if (dr != null) { @@ -229,7 +229,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 21; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); @@ -456,7 +456,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas #region "PRESTAMO ACREEDORES" protected void DdlCuentaPrestamo_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); int tCveMoneda = 0; if (dr != null) { @@ -520,7 +520,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 8; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); diff --git a/Bancos/ProductosFinancieros.aspx.vb b/Bancos/ProductosFinancieros.aspx.vb index fccebada4..c37c9eb41 100644 --- a/Bancos/ProductosFinancieros.aspx.vb +++ b/Bancos/ProductosFinancieros.aspx.vb @@ -118,7 +118,7 @@ Partial Class Bancos_ProductosFinancieros CargaTipoTrasaccion() End Sub Private Sub CargaCuentas() - DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentas.DataBind() DdlCuentas.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -254,7 +254,7 @@ Partial Class Bancos_ProductosFinancieros End Sub Protected Sub DdlCuentas_SelectedIndexChanged(sender As Object, e As EventArgs) ObtieneFolio() - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuentas.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentas.SelectedValue) If dr IsNot Nothing Then If dr("UsaTarjeta").ToString = "True" Then CargaTarjetas() @@ -295,7 +295,7 @@ Partial Class Bancos_ProductosFinancieros 'Variables de controles Dim Importe As Double = TxtImporte.Text.ToDouble - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() Dim Fecha = TxtFecha.Text.ToDate 'Variables de error @@ -313,7 +313,7 @@ Partial Class Bancos_ProductosFinancieros End If 'OBTIENE LA CUENTA CONTABLE DEL BANCO - Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) + Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) Dim CtaCuenta = -1 If DtCuentas.Rows.Count = 1 Then diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index c19a66acc..d6b4ed630 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -830,7 +830,7 @@ Partial Class Bancos_ProveedoresAbonar 'Saca moneda en que se va a pagar segun metodo de pago If DdlCuenta.SelectedValue.ToEntero > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If If TxtImporte.Text.ToDouble > 0 Then @@ -853,7 +853,7 @@ Partial Class Bancos_ProveedoresAbonar 'cheque If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa.Contiene(13, 83) Then FolioFijo = TxtFolio.Text.ToEntero - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/ProveedoresAbonar", 2, ImporteSeleccionado, ImporteSeleccionado, GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TxtFechaDocumento.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/ProveedoresAbonar", 2, ImporteSeleccionado, ImporteSeleccionado, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TxtFechaDocumento.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) If CveMoneda = 2 Then If TxtTCDolares.Visible Then @@ -867,7 +867,7 @@ Partial Class Bancos_ProveedoresAbonar End If End If - Dim CveIE As Integer = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), ConceptoCIE:=TxtConceptoCIE.Text) + Dim CveIE As Integer = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), ConceptoCIE:=TxtConceptoCIE.Text) If CveIE > 0 Then @@ -2454,7 +2454,7 @@ Partial Class Bancos_ProveedoresAbonar #Region " CUENTAS MOVTO " Private Sub CargaCuentas(tTipoTransaccion As Integer) DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If ChkPagarPesos.Checked Then dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1)) @@ -2488,7 +2488,7 @@ Partial Class Bancos_ProveedoresAbonar Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then If ChkPagarPesos.Checked Then CveMoneda = 2 @@ -2518,7 +2518,7 @@ Partial Class Bancos_ProveedoresAbonar End If Dim IdCuentaBancaria As Integer - Dim dr2 As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr2 As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr2 IsNot Nothing Then IdCuentaBancaria = dr2("IdCtaContable").ToString.ToEntero If dr("UsaTarjeta").ToString = "True" Then diff --git a/Bancos/ProveedoresCreditos.aspx.vb b/Bancos/ProveedoresCreditos.aspx.vb index 145376793..dd61ce7dc 100644 --- a/Bancos/ProveedoresCreditos.aspx.vb +++ b/Bancos/ProveedoresCreditos.aspx.vb @@ -778,9 +778,9 @@ Partial Class Bancos_ProveedoresCreditos Dim dt As DataTable If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Else - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas End If @@ -1306,7 +1306,7 @@ Partial Class Bancos_ProveedoresCreditos If MsgError = "" Then - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim IdCuentaBancaria As Integer = 0 If dr IsNot Nothing Then diff --git a/Bancos/Reembolsos.aspx.vb b/Bancos/Reembolsos.aspx.vb index b5a751933..f8530d25c 100644 --- a/Bancos/Reembolsos.aspx.vb +++ b/Bancos/Reembolsos.aspx.vb @@ -77,7 +77,7 @@ Partial Class Bancos_Reembolsos ViewState("CveMoneda") = 1 'Cargar Filtros - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1 DdlCajaChica.DataSource = dt DdlCajaChica.DataBind() @@ -159,7 +159,7 @@ Partial Class Bancos_Reembolsos Protected Sub DdlCajaChica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCajaChica.SelectedIndexChanged ViewState("CveCajaChica") = DdlCajaChica.SelectedValue - Dim dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveCuenta = {0}", CveCajaChica)) + Dim dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0}", CveCajaChica)) If dt.Rows.Count = 1 Then IdCuentaBeneficiario = dt.Rows(0)("IdCtaContable").ToString.ToEntero @@ -245,7 +245,7 @@ Partial Class Bancos_Reembolsos Private Sub CargaCuentas() DdlCuenta.Items.Clear() DdlCuenta.SelectedIndex = -1 - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveMoneda = {0} ", 1)) DdlCuenta.DataSource = dt @@ -258,7 +258,7 @@ Partial Class Bancos_Reembolsos #Region " SELECTED INDEX CHANGED " Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero @@ -389,7 +389,7 @@ Partial Class Bancos_Reembolsos CvePrePolizaVieja = ObjMov.AddPrePolizas("Banc", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, FechaPrePoliza, "Comprobación: " & TxtObservaciones.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIE = DDlCheques.SelectedValue.ToEntero CveIERegistrado = CveIE - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If DdlPersonal.Visible AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then CvePersonal = DdlPersonal.SelectedValue.ToEntero If dr IsNot Nothing Then @@ -770,7 +770,7 @@ Partial Class Bancos_Reembolsos If DDlCheques.SelectedValue.ToEntero > 0 Then CveIE = DDlCheques.SelectedValue.ToEntero CveIERegistrado = DDlCheques.SelectedValue.ToEntero - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If DdlPersonal.Visible AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then CvePersonal = DdlPersonal.SelectedValue.ToEntero If dr IsNot Nothing Then diff --git a/Bancos/RegistroPagoIntermediario.aspx.vb b/Bancos/RegistroPagoIntermediario.aspx.vb index 17e4bc86e..86bf1f0bf 100644 --- a/Bancos/RegistroPagoIntermediario.aspx.vb +++ b/Bancos/RegistroPagoIntermediario.aspx.vb @@ -60,7 +60,7 @@ Partial Class Bancos_PagosIntermediarios End Sub Private Sub CargaCuentas() - DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentaDeposito.DataBind() DdlCuentaDeposito_SelectedIndexChanged(Nothing, Nothing) End Sub @@ -84,7 +84,7 @@ Partial Class Bancos_PagosIntermediarios End Sub Protected Sub DdlCuentaDeposito_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDeposito.SelectedIndexChanged - Dim dr As DataRow = GlobalDTBancosCuentas(-1).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero diff --git a/Bancos/RepCobrado.aspx.vb b/Bancos/RepCobrado.aspx.vb index 29b9d94e8..970fbe2e9 100644 --- a/Bancos/RepCobrado.aspx.vb +++ b/Bancos/RepCobrado.aspx.vb @@ -108,7 +108,7 @@ Partial Class Ventas_RepRecuperacion Protected Sub DdlBanco_SelectedIndexChanged(sender As Object, e As EventArgs) DdlCuentaBancaria.Items.Clear() If DdlBanco.SelectedValue.ToEntero > 0 Then - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") End If DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() diff --git a/Bancos/RepCobradoDetalle.aspx.vb b/Bancos/RepCobradoDetalle.aspx.vb index b37cec1e1..16ad3e3ca 100644 --- a/Bancos/RepCobradoDetalle.aspx.vb +++ b/Bancos/RepCobradoDetalle.aspx.vb @@ -165,7 +165,7 @@ Partial Class Ventas_RepRecuperacionDetalle Public Sub CargaCuentas() DdlCuentaBancaria.Items.Clear() If DdlBanco.SelectedValue.ToEntero > 0 Then - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") End If DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() diff --git a/Bancos/RepComprobaciones.aspx.cs b/Bancos/RepComprobaciones.aspx.cs index ea263ffc5..8c167511a 100644 --- a/Bancos/RepComprobaciones.aspx.cs +++ b/Bancos/RepComprobaciones.aspx.cs @@ -61,7 +61,7 @@ public partial class Bancos_RepComprobaciones : ClsPaginas } protected void CargaCuentas() { - DdlCuentas.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("Banco = 'Empresa'"); + DdlCuentas.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:= UsuarioActual.CveEmpresa).FiltraParametros("Banco = 'Empresa'"); DdlCuentas.DataBind(); DdlCuentas.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlCuentas.SelectedValue = "-1"; diff --git a/Bancos/RepCreditos.aspx.vb b/Bancos/RepCreditos.aspx.vb index 64dd6df90..fad76f264 100644 --- a/Bancos/RepCreditos.aspx.vb +++ b/Bancos/RepCreditos.aspx.vb @@ -472,7 +472,7 @@ Partial Class Bancos_RepCreditos ''obtengo la cuenta de pago, de crediproveedores Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(-1).FiltroPrimero("CveTipoCuenta = 7") 'obtiene la primer cuenta de crediproveedores + Dim drBC As DataRow = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") 'obtiene la primer cuenta de crediproveedores If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, drE("Referencia").ToString.Trim, "-1", CveCuenta, CveCompra, -1, 1, drE("FechaInicio").ToString.ToDate, drE("FechaVencimiento").ToString.ToDate, drE("Tasa").ToString.ToDouble, drE("SobreTasa").ToString.ToDouble, 0.16, drE("Plazo").ToString.ToEntero, diff --git a/Bancos/RepIE.aspx.vb b/Bancos/RepIE.aspx.vb index 280292a78..86d45e51d 100644 --- a/Bancos/RepIE.aspx.vb +++ b/Bancos/RepIE.aspx.vb @@ -281,7 +281,7 @@ Partial Class Bancos_RepIE CLABE = "" Banco = "" - Dim dr As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero).FiltroPrimero("") + Dim dr As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("") If dr IsNot Nothing Then @@ -377,7 +377,7 @@ Partial Class Bancos_RepIE #Region "CARGA COMBOS FILTRO" Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1")) @@ -514,7 +514,7 @@ Partial Class Bancos_RepIE Private Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing AndAlso dr("UsaTarjeta").ToString = "True" Then CargaGridTarjetas() diff --git a/Bancos/RepProgramaciones.aspx.vb b/Bancos/RepProgramaciones.aspx.vb index a751d4c22..0a7d19d3d 100644 --- a/Bancos/RepProgramaciones.aspx.vb +++ b/Bancos/RepProgramaciones.aspx.vb @@ -41,7 +41,7 @@ Partial Class Bancos_RepProgramaciones End If 'inserto el movimiento en creditos Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveTipoCuenta = 7") + Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0, -1, Gvr.DataKey("Total").ToDouble, 0, 0, -1, Gvr.DataKey("CveProveedor").ToEntero, 1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -96,7 +96,7 @@ Partial Class Bancos_RepProgramaciones 'inserto el movimiento en creditos Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveTipoCuenta = 7") + Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0, @@ -149,7 +149,7 @@ Partial Class Bancos_RepProgramaciones End If 'inserto el movimiento en creditos Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveTipoCuenta = 7") + Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0, diff --git a/Bancos/RepProgramarRecursos.aspx.vb b/Bancos/RepProgramarRecursos.aspx.vb index 7fceb03ec..b5f74e352 100644 --- a/Bancos/RepProgramarRecursos.aspx.vb +++ b/Bancos/RepProgramarRecursos.aspx.vb @@ -145,7 +145,7 @@ Partial Class Bancos_RepProgramarRecursos DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1)) DdlProyecto.DataBind() - DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DtTipoTransaccion = GlobalDTTipoTransacciones.FiltraParametros("Tipo = 'Egs'") Dim CveProveedor As Integer = IfNull(Request("CveProveedor"), "-1").ToString.ToEntero diff --git a/Bancos/RepSaldos.aspx.vb b/Bancos/RepSaldos.aspx.vb index 9fd784860..4d3ed5bc6 100644 --- a/Bancos/RepSaldos.aspx.vb +++ b/Bancos/RepSaldos.aspx.vb @@ -41,7 +41,7 @@ Partial Class Bancos_RepSaldos 'End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1")) End Sub diff --git a/Bancos/RepSaldosPeriodo.aspx.cs b/Bancos/RepSaldosPeriodo.aspx.cs index 031a9db89..3d97ac4d8 100644 --- a/Bancos/RepSaldosPeriodo.aspx.cs +++ b/Bancos/RepSaldosPeriodo.aspx.cs @@ -38,7 +38,7 @@ public partial class Bancos_RepSaldosPeriodo : ClsPaginas txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString(); - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:UsuarioActual.CveEmpresa); DdlCuenta.DataBind(); DdlCuenta.Items.Insert(0, new ListItem("Todas", "-1")); diff --git a/Bancos/SaldarCajaChica.aspx.cs b/Bancos/SaldarCajaChica.aspx.cs index 533ebf16a..6af169e05 100644 --- a/Bancos/SaldarCajaChica.aspx.cs +++ b/Bancos/SaldarCajaChica.aspx.cs @@ -22,7 +22,7 @@ public partial class Bancos_SaldarCajaChica : ClsPaginas private void CargaCajaChica() { DdlCajaChica.Items.Clear(); - DdlCajaChica.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveTipoCuenta = 1")); + DdlCajaChica.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoCuenta = 1")); DdlCajaChica.DataBind(); } diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index 826813cd0..097a21b4f 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -51,7 +51,7 @@ Partial Class Bancos_Transferencias Opcion = -1 End If - DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If Opcion = 1 Then LtlTitulo.Text = "Domicialización de tarjeta" @@ -92,8 +92,8 @@ Partial Class Bancos_Transferencias Private Sub VerificaMonedas() 'si es la destino verifico si la moneda es la misma, sino pregunto por la paridad cambiaria - Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaOrigen.SelectedValue.ToEntero)) - Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaDestino.SelectedValue.ToEntero)) + Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaOrigen.SelectedValue.ToEntero)) + Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaDestino.SelectedValue.ToEntero)) 'Dim tCveMonedaOrigen, tCveMonedaDestino As Integer If drOrigen IsNot Nothing AndAlso drDestino IsNot Nothing Then tCveMonedaOrigen = drOrigen("CveMoneda").ToString.ToEntero @@ -157,7 +157,7 @@ Partial Class Bancos_Transferencias CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) End If - If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then + If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then CargaGridTarjetas() Else GvTC.Visible = False @@ -241,11 +241,11 @@ Partial Class Bancos_Transferencias Next - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue)) + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue)) If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero If Opcion = -1 Then - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue)) + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue)) If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero Else CveMonedaOrigen = CveMonedaDestino @@ -462,8 +462,8 @@ Partial Class Bancos_Transferencias Private Sub EnviaCorreo(Comprobante As String) - Dim dtcorreo As DataTable = GlobalDTBancosCuentas(-1, DdlCuentaOrigen.SelectedValue.ToEntero) - dtcorreo.Merge(GlobalDTBancosCuentas(-1, DdlCuentaDestino.SelectedValue.ToEntero)) + Dim dtcorreo As DataTable = GlobalDTBancosCuentas(-1, DdlCuentaOrigen.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa) + dtcorreo.Merge(GlobalDTBancosCuentas(-1, DdlCuentaDestino.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa)) ' Dim CorreosCCP As New List(Of String) Dim StrCorreos As New StringBuilder @@ -593,7 +593,7 @@ Partial Class Bancos_Transferencias Private Sub chkMovimientoTarjeta_CheckedChanged(sender As Object, e As EventArgs) Handles chkMovimientoTarjeta.CheckedChanged If chkMovimientoTarjeta.Checked Then - If GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then + If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then CargaGridTarjetas() End If Else diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index ffdea1526..7368cb346 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1446,7 +1446,7 @@ Partial Class Compras_Compras End If 'Condiciones de la Compra - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) DdlCajaChica.DataSource = dt @@ -2504,7 +2504,7 @@ Partial Class Compras_Compras TrRembolsoPersonal.Visible = True End If - Dim DtCajaChica As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim DtCajaChica As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DtCajaChica = DtCajaChica.FiltraParametros(String.Format("CveTipoCuenta = 1")) DdlRembolsoCajaChica.DataSource = DtCajaChica DdlRembolsoCajaChica.Items.Insert(0, New ListItem("Sin Seleccionar", "-1")) @@ -4360,7 +4360,7 @@ Partial Class Compras_Compras If RBLContado.SelectedValue = "1" Then ImportePago = TxtDocumentoImporte.Text.Trim.ToDecimal - Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0) + Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0) If Dr IsNot Nothing Then CveMonedaPago = Dr("CveMoneda").ToString.ToEntero @@ -4378,7 +4378,7 @@ Partial Class Compras_Compras CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaPago.Text.Trim.ToDate, TxtDocumentoFolio.Text.Trim, DdlProveedor.SelectedItem.Text.Trim, ImportePago, CveMonedaPago, TCPago, TxtDocumentoObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1)) ElseIf RBLContado.SelectedValue = "6" Then ImportePago = TxtDocumentoImporteCaja.Text.Trim.ToDecimal - Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuentaCaja.SelectedValue}").Rows(0) + Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuentaCaja.SelectedValue}").Rows(0) If Dr IsNot Nothing Then CveMonedaPago = Dr("CveMoneda").ToString.ToEntero End If @@ -11714,12 +11714,12 @@ Partial Class Compras_Compras Private Sub CargaCuentas() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveTipoCuenta <> 1")) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoCuenta <> 1")) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCuentaCaja.Items.Clear() - DdlCuentaCaja.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveTipoCuenta = 1")) + DdlCuentaCaja.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoCuenta = 1")) DdlCuentaCaja.DataBind() DdlCuentaCaja.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -12497,7 +12497,7 @@ Partial Class Compras_Compras Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged Dim Folio As Long - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero @@ -12524,7 +12524,7 @@ Partial Class Compras_Compras Protected Sub DdlCuentaCaja_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaCaja.SelectedIndexChanged Dim Folio As Long - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuentaCaja.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaCaja.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero @@ -13570,7 +13570,7 @@ Partial Class Compras_Compras ViewState("CvePersonal") = DdlPersonalReembolso.SelectedValue End Sub Protected Sub DdlCajaChica2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaCajaChicaReembolso.SelectedIndexChanged - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuentaCajaChicaReembolso.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaCajaChicaReembolso.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero diff --git a/Compras/Reembolsos.aspx.vb b/Compras/Reembolsos.aspx.vb index cc4340b53..701fc3dd6 100644 --- a/Compras/Reembolsos.aspx.vb +++ b/Compras/Reembolsos.aspx.vb @@ -52,7 +52,7 @@ Partial Class Compras_Reembolsos ViewState("CveMoneda") = 1 'Cargar Filtros - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1 DdlCajaChica.DataSource = dt DdlCajaChica.DataBind() @@ -185,7 +185,7 @@ Partial Class Compras_Reembolsos Private Sub CargaCuentas() DdlCuenta.Items.Clear() DdlCuenta.SelectedIndex = -1 - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = {1}", 1, DdlTipoTransaccion.SelectedValue)) DdlCuenta.DataSource = dt @@ -198,7 +198,7 @@ Partial Class Compras_Reembolsos #Region " SELECTED INDEX CHANGED " Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero @@ -304,7 +304,7 @@ Partial Class Compras_Reembolsos CvePrePolizaVieja = ObjMov.AddPrePolizas("Banc", 9, TxtImporteVinculado.Text.ToDouble, TxtImporteVinculado.Text.ToDouble, CveMoneda, FechaPrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIE = DDlCheques.SelectedValue.ToEntero CveIERegistrado = CveIE - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If DdlPersonal.Visible AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then CvePersonal = DdlPersonal.SelectedValue.ToEntero If dr IsNot Nothing Then diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 592f5814e..dcbdefffc 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -86,7 +86,7 @@ Partial Class Compras_ReembolsosComprobaciones Folio = "" 'Cargar Filtros - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1 DdlCajaChica.DataSource = dt DdlCajaChica.DataBind() @@ -236,7 +236,7 @@ Partial Class Compras_ReembolsosComprobaciones Private Sub CargaCuentas() DdlCuenta.Items.Clear() DdlCuenta.SelectedIndex = -1 - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1)) @@ -304,7 +304,7 @@ Partial Class Compras_ReembolsosComprobaciones #Region " SELECTED INDEX CHANGED " Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero @@ -472,7 +472,7 @@ Partial Class Compras_ReembolsosComprobaciones End If End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero diff --git a/Compras/RembolsosSinAsignar.aspx.vb b/Compras/RembolsosSinAsignar.aspx.vb index 9d2135031..47920f421 100644 --- a/Compras/RembolsosSinAsignar.aspx.vb +++ b/Compras/RembolsosSinAsignar.aspx.vb @@ -66,7 +66,7 @@ Partial Class Compras_RembolsosSinAsignar ViewState("CveCajaChica") = -2 'Cargar Filtros - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1 DdlCajaChica.DataSource = dt DdlCajaChica.DataBind() diff --git a/Compras/RepPagado.aspx.cs b/Compras/RepPagado.aspx.cs index 8a9f73844..0de7863ff 100644 --- a/Compras/RepPagado.aspx.cs +++ b/Compras/RepPagado.aspx.cs @@ -129,7 +129,7 @@ public partial class Compras_RepPagado : ClsPaginas DdlCuentaBancaria.Items.Clear(); if (DdlBanco.SelectedValue.ToEntero() > 0) { - DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); + DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1, CveEmpresa:= UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); } DdlCuentaBancaria.Items.Insert(0, new ListItem("Todos", "-1")); DdlCuentaBancaria.DataBind(); diff --git a/Compras/RepPagadoDetalle.aspx.cs b/Compras/RepPagadoDetalle.aspx.cs index aad25717b..a5bded5ec 100644 --- a/Compras/RepPagadoDetalle.aspx.cs +++ b/Compras/RepPagadoDetalle.aspx.cs @@ -170,7 +170,7 @@ public partial class Compras_RepPágadoDetalle : ClsPaginas DdlCuentaBancaria.Items.Clear(); if (DdlBanco.SelectedValue.ToEntero() > 0) { - DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); + DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); } DdlCuentaBancaria.Items.Insert(0, new ListItem("Todos", "-1")); DdlCuentaBancaria.DataBind(); diff --git a/Compras/RepPagadoPeriodo.aspx.cs b/Compras/RepPagadoPeriodo.aspx.cs index e8c67c71f..d1ff01d33 100644 --- a/Compras/RepPagadoPeriodo.aspx.cs +++ b/Compras/RepPagadoPeriodo.aspx.cs @@ -137,7 +137,7 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas DdlCuentaBancaria.Items.Clear(); if (DdlBanco.SelectedValue.ToEntero() > 0) { - DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); + DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1, CveEmpresa:= UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); } DdlCuentaBancaria.Items.Insert(0, new ListItem("Todos", "-1")); DdlCuentaBancaria.DataBind(); diff --git a/Compras/RepRembolsoComprobaciones.aspx.vb b/Compras/RepRembolsoComprobaciones.aspx.vb index cbf7068ce..3c1bb16b5 100644 --- a/Compras/RepRembolsoComprobaciones.aspx.vb +++ b/Compras/RepRembolsoComprobaciones.aspx.vb @@ -67,7 +67,7 @@ Partial Class Compras_RepRembolsoComprobaciones ViewState("CveMoneda") = 1 'Cargar Filtros - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1 DdlCajaChica.DataSource = dt DdlCajaChica.DataBind() diff --git a/Contabilidad/DiarioPagos.aspx.vb b/Contabilidad/DiarioPagos.aspx.vb index 1e0659299..58492f5e6 100644 --- a/Contabilidad/DiarioPagos.aspx.vb +++ b/Contabilidad/DiarioPagos.aspx.vb @@ -129,7 +129,7 @@ Partial Class Contabilidad_DiarioPagos Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta IN (2)") + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta IN (2)") DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1")) End Sub diff --git a/Contabilidad/FisImpuestos.aspx.vb b/Contabilidad/FisImpuestos.aspx.vb index 948d38a5b..4ca322152 100644 --- a/Contabilidad/FisImpuestos.aspx.vb +++ b/Contabilidad/FisImpuestos.aspx.vb @@ -514,7 +514,7 @@ Partial Class Contabilidad_FisImpuestos 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If CveCuenta > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & CveCuenta) + Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & CveCuenta) If drr IsNot Nothing Then Retorno = drr("IdCtaContable").ToString.ToEntero End If diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 06f7207db..8286d7e17 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -1331,7 +1331,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaCuentas() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub diff --git a/Contabilidad/RegPrePoliza1.aspx.vb b/Contabilidad/RegPrePoliza1.aspx.vb index 0d84d4c48..cee888e0f 100644 --- a/Contabilidad/RegPrePoliza1.aspx.vb +++ b/Contabilidad/RegPrePoliza1.aspx.vb @@ -1462,7 +1462,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub CargaCuentas() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 3ab52f059..4bcbca048 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1446,7 +1446,7 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub Private Sub CargaCuentas() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub diff --git a/Global.asax b/Global.asax index 153a21570..9f62bf9f2 100644 --- a/Global.asax +++ b/Global.asax @@ -79,8 +79,8 @@ 'C A R G A - O R D E N E S - D E - C O M P R A S Dim ObjOC As New ClsOC - If ObjOC.GetEstatus() Then Application("GlobalDTOCEstatus") = ObjOC.DtResultados Else Application("GlobalDTOCEstatus") = Nothing - If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing + If ObjOC.GetEstatus() Then Application("GlobalDTOCEstatus") = ObjOC.DtResultados Else Application("GlobalDTOCEstatus") = Nothing + 'If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing ObjOC.Dispose() @@ -179,9 +179,9 @@ 'B A N C O S - Dim ObjBancos As New ClsBancos - 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing - If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing + Dim ObjBancos As New ClsBancos + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = ObjBancos.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing If ObjBancos.GetBancos_TiposTransaccion(-1) Then Application("GlobalDTTipoTransacciones") = ObjBancos.DtResultados Else Application("GlobalDTTipoTransacciones") = Nothing If ObjBancos.GetBancos_EstatusIE() Then Application("GlobalDTBancosEstatusIE") = ObjBancos.DtResultados Else Application("GlobalDTBancosEstatusIE") = Nothing If ObjBancos.GetBancos() Then Application("GlobalDTBancos") = ObjBancos.DtResultados Else Application("GlobalDTBancos") = Nothing diff --git a/OC/OC.aspx b/OC/OC.aspx index 9d5447314..af0786933 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -467,7 +467,21 @@
    -
    + + + + + + + + + + + + + + + <%--
    Folio:
    @@ -476,7 +490,7 @@ $
    -
    +
    --%>
    @@ -2021,7 +2035,12 @@ + +
    + +
    +
    diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index fea9eb9c6..8dec38e47 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -485,6 +485,37 @@ Partial Class OC End Property Private Property NumRow As Integer + + Private Property SaldoOCAnticipo As Double + Get + If ViewState("SaldoOCAnticipo") Is Nothing Then + Return 0 + Else + Return ViewState("SaldoOCAnticipo").ToString.ToDouble + End If + + End Get + Set(value As Double) + ViewState("SaldoOCAnticipo") = value + End Set + End Property + + + + Private Property ImporteAnticipos As Double + Get + If ViewState("ImporteAnticipos") Is Nothing Then + Return 0 + Else + Return ViewState("ImporteAnticipos").ToString.ToDouble + End If + + End Get + Set(value As Double) + ViewState("ImporteAnticipos") = value + End Set + End Property + #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -725,7 +756,7 @@ Partial Class OC End If End If - InicializaSolicitarAnticipo() + 'InicializaSolicitarAnticipo() If TipoOC = "REQ" Then BtnSolicitudAnticipo.Visible = False @@ -1181,8 +1212,9 @@ Partial Class OC MPContrato.Enabled = False 'SOLICITUD DE ANTICIPO CveIEAnticipo = objOC.CveIEAnticipo - LtImporteIEAnticipo.Text = objOC.ImporteAnticipo.FormatoNumero - LtFolioIEAnticipo.Text = $"{objOC.FolioIEAnticipo}" + + 'LtImporteIEAnticipo.Text = objOC.ImporteAnticipo.FormatoNumero + 'LtFolioIEAnticipo.Text = $"{objOC.FolioIEAnticipo}" CveVenta = objOC.CveVenta TieneVenta = objOC.TieneVenta @@ -1197,15 +1229,8 @@ Partial Class OC 'Anticipos CargarOptionAnticipos() - Dim objbancos As New ClsBancos - If objbancos.GetPrePolizasDetalle(-1, -1, pCveOrdenCompra) AndAlso objbancos.DtResultados.Rows.Count > 0 Then - BtnSolicitudAnticipo.Visible = False - generarAnticipo.Text = "Ver Anticipo" - generarAnticipo.NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", objbancos.DtResultados.Rows(0)("CveIE")) - Else - generarAnticipo.NavigateUrl = String.Format("/Bancos/IE.aspx?CveOrdenCompra={0}&CveProveedor={1}", pCveOrdenCompra, objOC.CveProveedor.ToString) - End If - objbancos.Dispose() + CargaAnticiposSolicitudes() + CveCotizacion = objOC.DtResultados.Rows(0)("CveCotizacion").ToString.ToEntero If CveCotizacion > 0 Then @@ -2438,7 +2463,7 @@ Partial Class OC LugarEntrega, UsuarioActual.CveUsuario, CveEmpresaActual, GvD.Rows(0).FCHiddenField("HdnCvePresupuestoEgreso").Value.ToString.ToEntero, pCveProveedor:=CveProveedor, pCveProveedorSucursal:=CveProveedorSucursal, RequiereCotizacion:=ChkCotizacion.Checked, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), - CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, + CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto) Then CveOrdenCompra = OC.CveOrdenCompra CveEstatus = CboE.SelectedValue.ToEntero @@ -3023,7 +3048,7 @@ Partial Class OC CveUsuario, CveEmpresaActual, 0, pCveProveedor:=CveProveedor, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, - CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero) Then + CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero) Then 'CREA POLIZA POR CADA PROVEEDOR @@ -3089,7 +3114,7 @@ Partial Class OC If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, - EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, + EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion) Then @@ -4915,24 +4940,36 @@ Partial Class OC #End Region #Region " SOLICITAR ANTICIPOS " - Private Sub InicializaSolicitarAnticipo() - If CveOrdenCompra > 0 Then - If CveIEAnticipo > 0 Then - PorletIEAnticipo.Visible = True - UpIEAnticipo.Update() - Else - If GlobalDTOCEstatus(CveEmpresaActual).FiltroPrimeroValor("TipoTermino", $"CveEstatus = {CveEstatus}").ToEntero.Contiene(0, 3) Then - BtnSolicitudAnticipo.Visible = True - DdlSAUsuario.DataSource = GlobalDTUsuarios(-1, CveEmpresaActual) - DdlSAUsuario.DataBind() - DdlSAUsuario.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - End If + 'Private Sub InicializaSolicitarAnticipo() + ' If CveOrdenCompra > 0 Then + + ' If CveIEAnticipo > 0 Then + ' PorletIEAnticipo.Visible = True + ' UpIEAnticipo.Update() + ' Else + ' If GlobalDTOCEstatus(CveEmpresaActual).FiltroPrimeroValor("TipoTermino", $"CveEstatus = {CveEstatus}").ToEntero.Contiene(0, 3) Then + ' BtnSolicitudAnticipo.Visible = True + ' DdlSAUsuario.DataSource = GlobalDTUsuarios(-1, CveEmpresaActual) + ' DdlSAUsuario.DataBind() + ' DdlSAUsuario.Items.Insert(0, New ListItem("Seleccione", "-1")) + ' End If + ' End If + + ' End If + 'End Sub + + + Protected Sub BtnSolicitarAnticipo_Click(sender As Object, e As EventArgs) Handles BtnSolicitarAnticipo.Click + + + + If TxtSAImporte.Text.ToDecimal > SaldoOCAnticipo Then + + Alert("El importe solicitado supera el saldo de la orden de compra", TipoMensaje.MsgAdvertencia) + Exit Sub End If - End Sub - Protected Sub BtnSolicitarAnticipo_Click(sender As Object, e As EventArgs) Handles BtnSolicitarAnticipo.Click Dim Descripcion As New StringBuilder Descripcion.AppendFormat("Importe anticipo : ${0} ({1}%) - Pagar anticipo - Observacion: {2} ", TxtSAImporte.Text.FormatoNumero, TxtSAImPorcentaje.Text, CveOrdenCompra, TxtSAObservaciones.Text) @@ -7896,6 +7933,85 @@ Partial Class OC 'End If End Sub + + Private Sub CargaAnticiposSolicitudes() + + + If CveOrdenCompra > 0 Then + + If CveIEAnticipo > 0 Then + PorletIEAnticipo.Visible = True + UpIEAnticipo.Update() + Else + + End If + + End If + + + + + Dim objbancos As New ClsOC + + + If objbancos.GetOCAnticipoSaldo(CveOrdenCompra, UsuarioActual.CveEmpresa) AndAlso objbancos.DtResultados.Rows.Count > 0 Then + + SaldoOCAnticipo = objbancos.DtResultados(0)("Saldo").ToString.ToDecimal + LblSaldoOCAnticipo.Text = $"Saldo OC ${SaldoOCAnticipo.ToString.FormatoNumero}" + + If SaldoOCAnticipo > 0 Then + + DdlSAUsuario.Items.Clear() + + If GlobalDTOCEstatus(CveEmpresaActual).FiltroPrimeroValor("TipoTermino", $"CveEstatus = {CveEstatus}").ToEntero.Contiene(0, 3) Then + BtnSolicitudAnticipo.Visible = True + DdlSAUsuario.DataSource = GlobalDTUsuarios(-1, CveEmpresaActual) + DdlSAUsuario.DataBind() + DdlSAUsuario.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + + BtnSolicitudAnticipo.Visible = True + 'generarAnticipo.Text = "Ver Anticipo" + + Else + + BtnSolicitudAnticipo.Visible = False + + 'generarAnticipo.Text = "Ver Anticipo" + 'generarAnticipo.NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", objbancos.DtResultados.Rows(0)("CveIE")) + + End If + + + Else + ' generarAnticipo.NavigateUrl = String.Format("/Bancos/IE.aspx?CveOrdenCompra={0}&CveProveedor={1}", CveCompra, DdlProveedorContacto.SelectedValue.ToEntero) + End If + + + If objbancos.GetOCAnticipo(CveOrdenCompra, UsuarioActual.CveEmpresa) Then + + If objbancos.DtResultados.Rows.Count > 0 Then + + PorletIEAnticipo.Visible = True + GvAnticpos.DataSource = objbancos.DtResultados + ImporteAnticipos = objbancos.DtResultados.SUM("Importe") + + End If + + Else + GvAnticpos.DataSource = Nothing + ImporteAnticipos = 0 + End If + GvAnticpos.DataBind() + + objbancos.Dispose() + + + UpAcciones.Update() + UpSolicitarAnticipo.Update() + End Sub + 'Private Sub CargaVentaRelacionada() ' Dim GridViewPSAux As GridView = GvD ' Dim CveOCDetalle As New StringBuilder() diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 0b2111830..d16e69fa2 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -428,9 +428,9 @@ Partial Class Sistemas_CatSesiones End Sub Private Sub CargaOCEstatusUsuarios() - Dim ObjOC As New ClsOC - If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing - ObjOC.Dispose() + 'Dim ObjOC As New ClsOC + 'If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing + 'ObjOC.Dispose() End Sub 'Compras diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 1465720ec..855f31886 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -1310,16 +1310,19 @@ Partial Class Sistemas_UsuarioDetalle ' Application("GlobalDTProyectosUsuarios") = Nothing ' TieneError = True 'End If - End If - - 'RECARGA GLOBAL BANCOS - If ObjBancos.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados - End If - - 'RECARGA GLOBAL ESTATUS + End If + + 'RECARGA GLOBAL BANCOS + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing 'ObjBancos.DtResultados + ' End If + + 'RECARGA GLOBAL ESTATUS If ObjOC.GetEstatus() Then Application("GlobalDTOCEstatus") = ObjOC.DtResultados Else Application("GlobalDTOCEstatus") = Nothing - If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing + + GlobalDTOCEstatusUsuarios(UsuarioActual.CveEmpresa) = Nothing + + 'If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing 'RECARGA GLOBAL ALMACEN @@ -2185,14 +2188,14 @@ Partial Class Sistemas_UsuarioDetalle If UsuarioControlado Then DdlCuentasBancarias.DataSource = DtCuentasBancariasControlado.FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}") Else - DdlCuentasBancarias.DataSource = GlobalDTBancosCuentas(-1, -1, -1).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentasBancarias.DataSource = GlobalDTBancosCuentas(-1, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}", "", {"CveCuenta", "NumCuentaMoneda"}) End If End If DdlCuentasBancarias.DataBind() DdlCuentasBancarias.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub Private Sub CargaDtCuentasBancarias() - DtCuentasBancarias = GlobalDTBancosCuentas(CveUsuario, -1, -1).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}") + DtCuentasBancarias = GlobalDTBancosCuentas(CveUsuario, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}") DtCuentasBancarias.Columns.Add("Accion", GetType(Integer)) CargaGvCuentasBancarias() @@ -4130,7 +4133,7 @@ Partial Class Sistemas_UsuarioDetalle Private Sub CargaCuentasBancariasAsignar() DdlCuentasBancariasAsignar.Items.Clear() If DdlEmpresaAsignaciones.SelectedValue.ToEntero > 0 Then - DdlCuentasBancariasAsignar.DataSource = GlobalDTBancosCuentas(-1, -1, -1).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignarPermiso.SelectedValue}", "", {"CveCuenta", "NumCuenta"}) + DdlCuentasBancariasAsignar.DataSource = GlobalDTBancosCuentas(-1, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignarPermiso.SelectedValue}", "", {"CveCuenta", "NumCuenta"}) End If DdlCuentasBancariasAsignar.DataBind() DdlCuentasBancariasAsignar.Items.Insert(0, New ListItem("Seleccione", "-1")) diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 7cc5d63d5..b70308ad1 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -355,7 +355,7 @@ Partial Class Ventas_ClientesAbonar Private Sub CargaCuentas() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If ChkPagarPesos.Checked Then dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1)) @@ -454,10 +454,10 @@ Partial Class Ventas_ClientesAbonar Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim moneda As Integer = 0 If DdlCuenta.SelectedValue > 0 Then - moneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + moneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If CveMonedaPago = moneda @@ -495,7 +495,7 @@ Partial Class Ventas_ClientesAbonar If IfNull(Request("CveMoneda"), "-1").ToString.ToEntero = -1 Then CargaDatos(-1) - moneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + moneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero If moneda = 1 Then 'DivTC.Visible = True DivTCDolares.Visible = False @@ -709,7 +709,7 @@ Partial Class Ventas_ClientesAbonar Dim ConceptoPoliza As String = String.Format("{0} {1}", TxtAboneA.Text, TxtObservaciones.Text) If DdlCuenta.SelectedValue > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero Else CveMoneda = If(Request("CveMoneda").ToString.ToEntero > 0, Request("CveMoneda").ToString.ToEntero, 1) End If @@ -742,7 +742,7 @@ Partial Class Ventas_ClientesAbonar End If - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario) + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario) Else If RblTipoPago.SelectedValue.Contiene("3") Then CveIE = DdlIngreso.SelectedValue.ToEntero @@ -2738,7 +2738,7 @@ Partial Class Ventas_ClientesAbonar End If Dim DTTipoTransacciones As DataTable = GlobalDTTipoTransacciones.FiltraParametros($"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}") - Dim DTCuentas As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta={DdlCuenta.SelectedValue}") + Dim DTCuentas As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta={DdlCuenta.SelectedValue}") Dim ClaveFormaPagoSAT As String = "" Dim Cuentapago As String = "" @@ -3048,7 +3048,7 @@ Partial Class Ventas_ClientesAbonar TxtTCDolaresDolares.Text = GlobalTipoCambio(Fecha).FormatoNumero(4) End If - Dim moneda As Integer = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + Dim moneda As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero If CveMonedaFiltro = -1 Then RegistraScript(String.Format("FnCambia(0,0,0,0,-1,{0});", moneda)) Else diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index da3eeb9e4..36c19f71e 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5237,11 +5237,11 @@ Partial Class PV DdlCuentaTransferencia.Items.Clear() - DdlCuentaEfectivo.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaTarjetaCredito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaTarjetaDebito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaCheque.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaTransferencia.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaEfectivo.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaTarjetaCredito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaTarjetaDebito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaCheque.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaTransferencia.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) DdlCuentaEfectivo.DataBind() DdlCuentaTarjetaCredito.DataBind() @@ -5420,7 +5420,7 @@ Partial Class PV Private Sub CargaCuentasTerminal() DdlCuentasTerminal.Items.Clear() - DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentasTerminal.DataBind() DdlCuentasTerminal.Items.Insert(0, New ListItem("Seleccione", "-1")) UPTarjetaTermminal.Update() diff --git a/Ventas/ProductosFinancieros.aspx.vb b/Ventas/ProductosFinancieros.aspx.vb index 390a9827f..91f84fd58 100644 --- a/Ventas/ProductosFinancieros.aspx.vb +++ b/Ventas/ProductosFinancieros.aspx.vb @@ -118,7 +118,7 @@ Partial Class Bancos_ProductosFinancieros CargaTipoTrasaccion() End Sub Private Sub CargaCuentas() - DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentas.DataBind() DdlCuentas.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -284,7 +284,7 @@ Partial Class Bancos_ProductosFinancieros 'Variables de controles Dim Importe As Double = TxtImporte.Text.ToDouble - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() Dim Fecha = TxtFecha.Text.ToDate 'Variables de error @@ -306,7 +306,7 @@ Partial Class Bancos_ProductosFinancieros 'End If 'OBTIENE LA CUENTA CONTABLE DEL BANCO - Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) + Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) Dim CtaCuenta = -1 If DtCuentas.Rows.Count = 1 Then diff --git a/Ventas/RepRecuperacion.aspx.vb b/Ventas/RepRecuperacion.aspx.vb index 5ca328ee7..4199b39f2 100644 --- a/Ventas/RepRecuperacion.aspx.vb +++ b/Ventas/RepRecuperacion.aspx.vb @@ -180,7 +180,7 @@ Partial Class Ventas_RepRecuperacion Protected Sub DdlBanco_SelectedIndexChanged(sender As Object, e As EventArgs) DdlCuentaBancaria.Items.Clear() - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() End Sub diff --git a/Ventas/RepRecuperacionDetalle.aspx.vb b/Ventas/RepRecuperacionDetalle.aspx.vb index fd8ccd5a9..53c4e2c6a 100644 --- a/Ventas/RepRecuperacionDetalle.aspx.vb +++ b/Ventas/RepRecuperacionDetalle.aspx.vb @@ -230,7 +230,7 @@ Partial Class Ventas_RepRecuperacionDetalle Public Sub CargaCuentas() DdlCuentaBancaria.Items.Clear() If DdlBanco.SelectedValue.ToEntero > 0 Then - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") End If DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() diff --git a/Ventas/RepRecuperacionPeriodo.aspx.cs b/Ventas/RepRecuperacionPeriodo.aspx.cs index 1c1c01be8..3718754c3 100644 --- a/Ventas/RepRecuperacionPeriodo.aspx.cs +++ b/Ventas/RepRecuperacionPeriodo.aspx.cs @@ -298,7 +298,7 @@ public partial class Ventas_RepRecuperacionPeriodo : ClsPaginas DdlCuentaBancaria.Items.Clear(); if (DdlBanco.SelectedValue.ToEntero() > 0) { - DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); + DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1, CveEmpresa:= UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); } DdlCuentaBancaria.Items.Insert(0, new ListItem("Todos", "-1")); DdlCuentaBancaria.DataBind(); diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ac3635c77..c3842f329 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5651,8 +5651,8 @@ Partial Class Ventas DdlCuentasTerminal.Items.Clear() DdlCuentaTerminalModal.Items.Clear() - DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) - DdlCuentaTerminalModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaTerminalModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentasTerminal.DataBind() DdlCuentaTerminalModal.DataBind() @@ -11206,13 +11206,13 @@ Partial Class Ventas Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeIVA").ToDecimal - If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows.Count = 1 Then - IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("IdCtaContable").ToString().ToEntero() + If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count = 1 Then + IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("IdCtaContable").ToString().ToEntero() ' CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("IdCtaContableSIG").ToString().ToEntero() End If If IdCtaContable <= 0 Then - CuentasContablesInvalidas.AppendFormat("
    {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("NumCuentaMoneda").ToString().ToEntero()) + CuentasContablesInvalidas.AppendFormat("
    {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("NumCuentaMoneda").ToString().ToEntero()) idCuentaContabilizacion = 0 End If @@ -18048,7 +18048,7 @@ Partial Class Ventas DdlCuentaCheque.Items.Clear() DdlCuentaTransferencia.Items.Clear() - Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) @@ -18076,13 +18076,13 @@ Partial Class Ventas Case 1 DivContadoOtrosCuenta.Attributes.Add("class", "col-md-3") DivMesesSinIntereses2.Visible = True - DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) Exit Select Case 2 - DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) Exit Select Case 3 - DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) Exit Select Case -1 DdlCuentaOtrosContado.DataSource = Nothing diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 05cc6f529..fa5c03748 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -248,29 +248,69 @@ Public Class WSApp Application("GlobalTipoCambio") = value End Set + End Property + + Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + Get + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing + End If + + ObjOC.Dispose() + + End If + + Dim filtro As New StringBuilder + filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + If CveUsuario > 0 Then + filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + End If + If Tipo <> "" Then + filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + End If + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTOCEstatusUsuarios = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set End Property - Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable - Get - If CveEmpresa <> -1 Then - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) - End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTOCEstatusUsuarios") = value - End Set - End Property + + 'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim filtro As New StringBuilder + ' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + ' If CveUsuario > 0 Then + ' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + ' End If + ' If Tipo <> "" Then + ' filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + ' End If + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTOCEstatusUsuarios = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTOCEstatusUsuarios") = value + ' End Set + 'End Property + + Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then diff --git a/asmx/WSSIGApp.asmx b/asmx/WSSIGApp.asmx index 1a6b79d95..71ad666ea 100644 --- a/asmx/WSSIGApp.asmx +++ b/asmx/WSSIGApp.asmx @@ -264,28 +264,44 @@ Public Class WSSIGApp End Set End Property + Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable Get - If CveEmpresa <> -1 Then - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) + + ObjOC.Dispose() + End If + + Dim filtro As New StringBuilder + filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + If CveUsuario > 0 Then + filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + End If + If Tipo <> "" Then + filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + End If + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTOCEstatusUsuarios = Dv.ToTable + Dv.Dispose() + End Get Set(value As DataTable) - Application("GlobalDTOCEstatusUsuarios") = value + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value End Set End Property + Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then From 8a9db7a6c5356508ee05242cb9aa83075c41e0d8 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 16 Jul 2020 17:46:34 -0700 Subject: [PATCH 21/56] -- ajuste en recomendar la seccion --- Inventarios/AjustesSeccionAlmacen.aspx.vb | 13 ++++++++++--- Inventarios/Apartados.aspx | 4 ++-- Inventarios/Apartados.aspx.vb | 8 ++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 478c321f9..6eec3379f 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -76,6 +76,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim CveMovimientoDetalleEntrada As Integer = 0 Dim Cont As Integer = 0 + Dim Lista As New Hashtable For Each gvr As GridViewRow In GvD.Rows 'que este seleccionado y que tenga diferente seccion @@ -84,7 +85,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True) End If - + Lista.Add(gvr.DataKey("CvePS").ToEntero, gvr.FCDropDownList("DDlS").SelectedValue.ToEntero) 'guardo que dato le corresponde If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.DataKey("Existencia").ToDecimal, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, -1, CveSeccionAlmacen:=gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=gvr.DataKey("Serie"), Lote:=gvr.DataKey("Lote"), FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de salida" @@ -108,15 +109,20 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal() Dim CveUM As Integer = Row("CveUM").ToString().ToEntero() - Dim CveSeccionAlmacen As Integer = GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero() + Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero() Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal() Dim Serie As String = Row("Serie").ToString() Dim Lote As String = Row("Lote").ToString() Dim FechaCaducidad As Date = IfNull(Row("FechaCaducidad"), MinFecha).ToString.ToDate + + 'actualizamos el PS, para que tenga el aplica seccion ObjPS.UpdateAplicaSeccionAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True) + If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then + ErrorMovInv = True + End If If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then ErrorMovInv = True @@ -132,11 +138,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen End If End If - + Lista = Nothing End If If Not ErrorMovInv Then ObjInventario.Commit() + GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing CargaDatos() Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion) Else diff --git a/Inventarios/Apartados.aspx b/Inventarios/Apartados.aspx index 36a17a7c0..27be34de9 100644 --- a/Inventarios/Apartados.aspx +++ b/Inventarios/Apartados.aspx @@ -403,7 +403,7 @@
    - + @@ -418,7 +418,7 @@ - + diff --git a/Inventarios/Apartados.aspx.vb b/Inventarios/Apartados.aspx.vb index f48ad283d..21708ab8a 100644 --- a/Inventarios/Apartados.aspx.vb +++ b/Inventarios/Apartados.aspx.vb @@ -805,10 +805,14 @@ Partial Class Inventarios_Apartados If e.Row.RowType = DataControlRowType.DataRow Then e.Row.FCTextBox("TxtCantidad").Attributes.Add("onblur", String.Format("ValidaCantidad(this,{0})", e.Row.DBCampo("Cantidad"))) If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero > 0 Then + Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + If dtt.Rows.Count = 0 Then + e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + dtt.Dispose() End If End If From 67aba388f54267718e2743d38733fdc56d4a31f4 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 17 Jul 2020 13:42:46 -0700 Subject: [PATCH 22/56] avance --- App_Code/ClsOIEventos.vb | 283 ++++++++++++++++++++++++++++ App_Code/ClsPaginas.vb | 2 + OI/CatDocumentoCategoria.aspx | 76 ++++++++ OI/CatDocumentoCategoria.aspx.cs | 104 ++++++++++ OI/CatDocumentoSubCategoria.aspx | 76 ++++++++ OI/CatDocumentoSubCategoria.aspx.cs | 114 +++++++++++ OI/Documentos.aspx | 49 +++++ OI/Documentos.aspx.cs | 30 +++ 8 files changed, 734 insertions(+) create mode 100644 OI/CatDocumentoCategoria.aspx create mode 100644 OI/CatDocumentoCategoria.aspx.cs create mode 100644 OI/CatDocumentoSubCategoria.aspx create mode 100644 OI/CatDocumentoSubCategoria.aspx.cs create mode 100644 OI/Documentos.aspx create mode 100644 OI/Documentos.aspx.cs diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 551593b30..8a65a1f30 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2743,8 +2743,291 @@ Public Class ClsOIEventos Return Retorno End Function + + #End Region +#Region "OI_Documentos" + +#Region "OI_DocumentosCategorias" + Public Function GetDocumentoCategoria(Optional CveCategoria As Integer = -1, Optional Categoria As String = "-1") As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosCategoriasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria + .Add("@Categoria", SqlDbType.NVarChar).Value = Categoria + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddDocumentoCategoria(Categoria As String, Estado As Boolean) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosCategoriasAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Categoria", SqlDbType.NVarChar).Value = Categoria + .Add("@Estado", SqlDbType.Bit).Value = Estado + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateDocumentoCategoria(CveCategoria As Integer, Categoria As String, Estado As Boolean) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosCategoriasUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria + .Add("@Categoria", SqlDbType.NVarChar).Value = Categoria + .Add("@Estado", SqlDbType.Bit).Value = Estado + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveDocumentoCategoria(CveCategoria As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosCategoriasRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCategoria", SqlDbType.NVarChar).Value = CveCategoria + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region "OI_DocumentosSubCategoria" + Public Function GetDocumentoSubCategoria(Optional CveSubCategoria As Integer = -1, Optional SubCategoria As String = "-1") As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosSubCategoriasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria + .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddDocumentoSubCategoria(SubCategoria As String, CveCategoria As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosSubCategoriasAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateDocumentoSubCategoria(CveSubCategoria As Integer, SubCategoria As String, CveCategoria As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosSubCategoriasUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria + .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveDocumentoSubCategoria(CveSubCategoria As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosSubCategoriasRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubCategoria", SqlDbType.NVarChar).Value = CveSubCategoria + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region "Documentos" + Public Function GetDocumento(CveDocumento As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddDocumento(CveSubCategoria As Integer, Descripcion As String, Observacion As String, Version As String, CveEstatus As Integer, ArchivoFisico As String, + Responsable As String, FechaAprobacion As Date, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria + .Add("@Descripcion", SqlDbType.NVarChar).Value = Descripcion + .Add("@Observacion", SqlDbType.NVarChar).Value = Observacion + .Add("@Version", SqlDbType.NVarChar).Value = Version + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@ArchivoFisico", SqlDbType.NVarChar).Value = ArchivoFisico + .Add("@Responsable", SqlDbType.NVarChar).Value = Responsable + .Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion + .Add("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el Documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateDocumento(CveDocumento As Integer, CveSubCategoria As Integer, Descripcion As String, Observacion As String, Version As String, CveEstatus As Integer, ArchivoFisico As String, + Responsable As String, FechaAprobacion As Date, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento + .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria + .Add("@Descripcion", SqlDbType.NVarChar).Value = Descripcion + .Add("@Observacion", SqlDbType.NVarChar).Value = Observacion + .Add("@Version", SqlDbType.NVarChar).Value = Version + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@ArchivoFisico", SqlDbType.NVarChar).Value = ArchivoFisico + .Add("@Responsable", SqlDbType.NVarChar).Value = Responsable + .Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion + .Add("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el Documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveDocumento(CveDocumento As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#End Region ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 9a4c0c915..5e207a0c5 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4552,6 +4552,8 @@ Public Class ClsPaginas PaginaDict.Add("/OI/RepDesarrollo.aspx".ToUpper(), 475) PaginaDict.Add("/OI/DesarrolloWizard.aspx".ToUpper(), 474) PaginaDict.Add("/OI/SubidasADS.aspx".ToUpper(), 476) + PaginaDict.Add("/OI/CatDocumentoCategoria.aspx".ToUpper(), 760) + PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), 761) #End Region #Region "Planeacion" 'PLANEACIÓN diff --git a/OI/CatDocumentoCategoria.aspx b/OI/CatDocumentoCategoria.aspx new file mode 100644 index 000000000..e935eec64 --- /dev/null +++ b/OI/CatDocumentoCategoria.aspx @@ -0,0 +1,76 @@ +<%@ Page Title="OI - Catálogo de Categorías de Documentos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatDocumentoCategoria.aspx.cs" Inherits="OI_CatDocumentoCategoria" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Categorías de Documentos + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + <%----%> + + + + + + + + + + + diff --git a/OI/CatDocumentoCategoria.aspx.cs b/OI/CatDocumentoCategoria.aspx.cs new file mode 100644 index 000000000..8efdf08c4 --- /dev/null +++ b/OI/CatDocumentoCategoria.aspx.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class OI_CatDocumentoCategoria : ClsPaginas +{ + + private int CveCategoria + { + get + { + return ViewState["CveCategoria"].ToString().ToEntero(); + } + + set + { + ViewState["CveCategoria"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoCategoria()) + { + GvDatos.DataSource = ObjOI.DtResultados; + GvDatos.DataBind(); + } + ObjOI.Dispose(); + } + + protected void BtnAgregarCategoria_Click(object sender, EventArgs e) + { + BtnAgregarCategoriaDoc.Text = "Agregar"; + TxtCategoria.Text = ""; + ChkEstatus.Checked = true; + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarCategoriaDoc.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCategoria = GvRow.DataKey("CveCategoria").ToEntero(); + TxtCategoria.Text = GvRow.DataKey("Categoria"); + ChkEstatus.Checked = GvRow.DataKey("Estado").ToString() == "True"; + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCategoria = GvRow.DataKey("CveCategoria").ToEntero(); + ClsCompras ObjCompras = new ClsCompras(); + if (ObjCompras.RemoveTipoGasto(CveCategoria)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se eliminó la Categoría de Documento correctamente"); + } + ObjCompras.Dispose(); + } + + protected void BtnAgregarCategoriaDoc_Click(object sender, EventArgs e) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (BtnAgregarCategoriaDoc.Text == "Agregar") + { + if (ObjOI.AddDocumentoCategoria(TxtCategoria.Text,ChkEstatus.Checked)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se agregó la Categoría de Documento correctamente"); + } + }else + { + if (ObjOI.UpdateDocumentoCategoria(CveCategoria,TxtCategoria.Text,ChkEstatus.Checked)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se actualizó la Categoría de Documento correctamente"); + } + } + ObjOI.Dispose(); + } +} \ No newline at end of file diff --git a/OI/CatDocumentoSubCategoria.aspx b/OI/CatDocumentoSubCategoria.aspx new file mode 100644 index 000000000..a7986a1bd --- /dev/null +++ b/OI/CatDocumentoSubCategoria.aspx @@ -0,0 +1,76 @@ +<%@ Page Title="OI - Catálogo de Subcategorías de Documentos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatDocumentoSubCategoria.aspx.cs" Inherits="OI_CatDocumentoSubCategoria" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Subcategorías de Documentos + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + <%----%> + + + + + + + + + + + diff --git a/OI/CatDocumentoSubCategoria.aspx.cs b/OI/CatDocumentoSubCategoria.aspx.cs new file mode 100644 index 000000000..709f6e89a --- /dev/null +++ b/OI/CatDocumentoSubCategoria.aspx.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class OI_CatDocumentoSubCategoria : ClsPaginas +{ + private int CveSubCategoria + { + get + { + return ViewState["CveSubCategoria"].ToString().ToEntero(); + } + + set + { + ViewState["CveSubCategoria"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + CargaCategoria(); + } + } + + private void CargaDatos() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoSubCategoria()) + { + GvDatos.DataSource = ObjOI.DtResultados; + GvDatos.DataBind(); + } + ObjOI.Dispose(); + } + + private void CargaCategoria() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoCategoria()) + { + DdlCategorias.DataSource = ObjOI.DtResultados.FiltraParametros("Estado = 1"); + DdlCategorias.DataBind(); + } + ObjOI.Dispose(); + } + + protected void BtnAgregarSubCategoria_Click(object sender, EventArgs e) + { + BtnAgregarSubCategoriaDoc.Text = "Agregar"; + TxtSubCategoria.Text = ""; + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarSubCategoriaDoc.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveSubCategoria = GvRow.DataKey("CveSubCategoria").ToEntero(); + TxtSubCategoria.Text = GvRow.DataKey("SubCategoria"); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveSubCategoria = GvRow.DataKey("CveSubCategoria").ToEntero(); + ClsCompras ObjCompras = new ClsCompras(); + if (ObjCompras.RemoveTipoGasto(CveSubCategoria)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se eliminó la Categoría de Documento correctamente"); + } + ObjCompras.Dispose(); + } + + protected void BtnAgregarSubCategoriaDoc_Click(object sender, EventArgs e) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (BtnAgregarSubCategoriaDoc.Text == "Agregar") + { + if (ObjOI.AddDocumentoSubCategoria(TxtSubCategoria.Text, DdlCategorias.SelectedValue.ToEntero())) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se agregó la Categoría de Documento correctamente"); + } + } + else + { + if (ObjOI.UpdateDocumentoSubCategoria(CveSubCategoria, TxtSubCategoria.Text, DdlCategorias.SelectedValue.ToEntero())) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se actualizó la Categoría de Documento correctamente"); + } + } + ObjOI.Dispose(); + } +} \ No newline at end of file diff --git a/OI/Documentos.aspx b/OI/Documentos.aspx new file mode 100644 index 000000000..31ddb86a4 --- /dev/null +++ b/OI/Documentos.aspx @@ -0,0 +1,49 @@ +<%@ Page Title="OI - Documentos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Documentos.aspx.cs" Inherits="OI_Documentos" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Documentos + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + diff --git a/OI/Documentos.aspx.cs b/OI/Documentos.aspx.cs new file mode 100644 index 000000000..e087c71c9 --- /dev/null +++ b/OI/Documentos.aspx.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class OI_Documentos : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumento(-1,UsuarioActual.CveEmpresa)) + { + GvDatos.DataSource = ObjOI.DtResultados; + GvDatos.DataBind(); + } + ObjOI.Dispose(); + } +} \ No newline at end of file From aaed1507dffb78e3974da8722f684e469ade8968 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 17 Jul 2020 15:31:07 -0700 Subject: [PATCH 23/56] - --- App_Code/ClsPaginas.vb | 2 ++ OI/DocumentoDetalle.aspx | 33 +++++++++++++++++++++++++++++++++ OI/DocumentoDetalle.aspx.cs | 16 ++++++++++++++++ OI/Documentos.aspx | 11 ++++++++--- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 OI/DocumentoDetalle.aspx create mode 100644 OI/DocumentoDetalle.aspx.cs diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 5e207a0c5..724b8b4e4 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4554,6 +4554,8 @@ Public Class ClsPaginas PaginaDict.Add("/OI/SubidasADS.aspx".ToUpper(), 476) PaginaDict.Add("/OI/CatDocumentoCategoria.aspx".ToUpper(), 760) PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), 761) + PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), 762) + PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), 763) #End Region #Region "Planeacion" 'PLANEACIÓN diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx new file mode 100644 index 000000000..c68c94b1e --- /dev/null +++ b/OI/DocumentoDetalle.aspx @@ -0,0 +1,33 @@ +<%@ Page Title="OI - Documentos detalle" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="DocumentoDetalle.aspx.cs" Inherits="OI_DocumentoDetalle" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Documentos detalle + + + + + <%--
  • + +
  • +
  • + Imprimir PDF +
  • +
  • + Imprimir Excel +
  • --%> +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs new file mode 100644 index 000000000..bc578cd90 --- /dev/null +++ b/OI/DocumentoDetalle.aspx.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class OI_DocumentoDetalle : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/OI/Documentos.aspx b/OI/Documentos.aspx index 31ddb86a4..724ec70d8 100644 --- a/OI/Documentos.aspx +++ b/OI/Documentos.aspx @@ -16,15 +16,20 @@
  • - +
  • + Imprimir PDF +
  • +
  • + Imprimir Excel +
  • - From 860febad73c7111bf7ecd04a9486dab7ac9d6dbd Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 17 Jul 2020 16:55:27 -0700 Subject: [PATCH 24/56] =?UTF-8?q?Talamus=20Correci=C3=B3n=20Columnas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TareasProgramadas/Tareas119.ashx | 51 +++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index afd3762fe..3801b68c5 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -63,8 +63,36 @@ public class TareasJam : IHttpHandler string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + try + { + if (File.Exists(RutaProductos)) + { + File.Delete(RutaProductos); + } - //"ftp://us2.hostedftp.com/", "agrojam", "A12345678"; + if (File.Exists(RutaVentas)) + { + File.Delete(RutaVentas); + } + + if (File.Exists(RutaClientes)) + { + File.Delete(RutaClientes); + } + + if (File.Exists(RutaAlmacenes)) + { + File.Delete(RutaAlmacenes); + } + + } + catch (Exception ex) { + SBLog.AppendLine("Error al eliminar archivos"); + } + + + + ////"ftp://us2.hostedftp.com/", "agrojam", "A12345678"; //string FTPServer = "ftp://127.0.0.1/"; //string TFPUsr = "Toor"; //string FTPPass = "agj-3500"; @@ -148,18 +176,27 @@ public class TareasJam : IHttpHandler DTClientes.Columns[11].ColumnName = "phone.areaCode"; DTClientes.Columns[12].ColumnName = "phone.number"; - DTClientes.Columns.RemoveAt(12); - DTClientes.Columns.RemoveAt(11); - DTClientes.Columns.RemoveAt(10); - DTClientes.Columns.RemoveAt(8); - DTClientes.Columns.RemoveAt(7); + //DTClientes.Columns.RemoveAt(12); + //DTClientes.Columns.RemoveAt(11); + //DTClientes.Columns.RemoveAt(10); + //DTClientes.Columns.RemoveAt(8); + //DTClientes.Columns.RemoveAt(7); DTClientes.AcceptChanges(); DTVentas.Columns.RemoveAt(7); - DTVentas.Columns.RemoveAt(6); + //DTVentas.Columns.RemoveAt(6); + + DTVentas.Columns[3].ColumnName = "Sale Date"; + DTVentas.Columns[6].ColumnName = "Transaction ID"; DTVentas.AcceptChanges(); + + DTAlmacenes.Columns[2].ColumnName = "Description"; + DTAlmacenes.Columns[3].ColumnName = "Stock Date"; + DTAlmacenes.AcceptChanges(); + + DataTable dtCloned = DTVentas.Clone(); dtCloned.Columns[3].DataType = typeof(string); From 56a73e6e1fa9225eaacd89077013b0164794f1c0 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 17 Jul 2020 17:01:00 -0700 Subject: [PATCH 25/56] =?UTF-8?q?validaci=C3=B3n=20para=20agregar=20un=20p?= =?UTF-8?q?roducto=20ahora=20considera=20si=20aplica=20fecha=20caducidad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntradasSalidas.aspx.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 66928519a..692b3f871 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1472,9 +1472,10 @@ Partial Class Inventarios_EntradasSalidas Dim Cont As Integer = 0 If DdlConcepto.SelectedValue.Contiene({"3", "11", "13", "21", "30", "31"}) Then For Each Dr As DataRow In DtMovimientos.Rows - If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("Serie").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) >= Dr("Cantidad").ToString.ToDouble Then + Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha) + If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("Serie").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), FechaCaducidad:=FechaCaducidadVal) >= Dr("Cantidad").ToString.ToDouble Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=FechaCaducidadVal, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then Mensaje = "Error al guardar los movimientos" ErrorMovInv = True Exit For From bb324aa0f21ea911aca5adad6127ee52e0381e00 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 17 Jul 2020 17:51:19 -0700 Subject: [PATCH 26/56] -- ajustes secciones --- Inventarios/AjustesSeccionAlmacen.aspx.vb | 18 +++++++++++++----- Inventarios/EntregaAlmacen.aspx.vb | 7 ++++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 6eec3379f..7dc1c3c02 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -115,8 +115,6 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim Lote As String = Row("Lote").ToString() Dim FechaCaducidad As Date = IfNull(Row("FechaCaducidad"), MinFecha).ToString.ToDate - - 'actualizamos el PS, para que tenga el aplica seccion ObjPS.UpdateAplicaSeccionAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True) @@ -325,11 +323,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen CveSeccionAlmacen = DrSeccion("CveSeccion").ToString().ToEntero() End If - Dim Serie As String = RowExcel("Serie").ToString() + Dim Serie As String = RowExcel("Serie").ToString().Trim Dim Lote As String = RowExcel("Lote").ToString() Dim FechaCaducidad As Date = IfNull(RowExcel("FechaCaducidad"), MinFecha).ToString.ToDate - Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}") + Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'") If RowExistencia IsNot Nothing AndAlso CveSeccionAlmacen > 0 Then Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero() @@ -339,6 +337,13 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim FechaCaducidadSalida As Date = IfNull(RowExistencia("FechaCaducidad"), MinFecha).ToString.ToDate Dim PUSalida As Decimal = RowExistencia("PU").ToString() + 'condicion para ajustar la seccion y permita hacer los cambios en el trigger + If CveSeccionAlmacenSalida > 0 Then + ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True) + Else + ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, False) + End If + 'GENERA LA SALIDA DE LOS PRODUCTOS QUE VIENEN EN EL EXCEL If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadSalida, CveUM, CvePS, PUSalida, CveSeccionAlmacen:=CveSeccionAlmacenSalida, Serie:=SerieSalida, Lote:=LoteSalida, FechaCaducidad:=FechaCaducidadSalida, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then ErrorMovInv = True @@ -362,6 +367,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen 'ACTUALIZAMOS EL PS, PARA QUE TENGA EL APLICA SECCION ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True) + If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then + ErrorMovInv = True + End If If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, CantidadEntrada, CveUMEntrada, CvePSEntrada, PUEntrada, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then ErrorMovInv = True @@ -377,7 +385,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen End If If RowExistencia Is Nothing Then - ExistenciasNoEncontradas.AppendFormat("{0},", SeccionAlmacen) + ExistenciasNoEncontradas.AppendFormat("{0} - S:{1}
    ", Codigo, Serie) ErrorMovInv = True End If diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 8dff1f8c8..7ef8db2d1 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2,6 +2,7 @@ Option Explicit On Imports System.Data +Imports System.Data.Entity.Core.Common.CommandTrees Imports System.IO Imports Extensiones @@ -655,7 +656,7 @@ Partial Class Inventarios_EntregaAlmacen Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString Case "Ing", "Ped" Filtro = "CveConcepto IN (3,40)" - Case "Dev" + Case "Dev", "dPe" 'cuand es devolucionventa=1, es cancelación de la devolución If EsDevolucionVenta = 1 Then Filtro = "CveConcepto = 18" Else Filtro = "CveConcepto IN (3,40)" Case Else @@ -2180,7 +2181,7 @@ Partial Class Inventarios_EntregaAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, 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, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, 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, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccionAlmacen").ToString.ToEntero, -1)) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") Exit For @@ -2339,7 +2340,7 @@ Partial Class Inventarios_EntregaAlmacen End If For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, 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, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1), EsInterno:=EsInterno) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, 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, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccionAlmacen").ToString.ToEntero, -1), EsInterno:=EsInterno) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") Exit For From b1f337764d29e22fdc4f380c1c174f4a1e581e63 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 17 Jul 2020 17:51:30 -0700 Subject: [PATCH 27/56] - correccion de titulos --- Compras/CatTipoGasto.aspx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Compras/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx index f930bc624..c1f4a738e 100644 --- a/Compras/CatTipoGasto.aspx +++ b/Compras/CatTipoGasto.aspx @@ -8,7 +8,7 @@ - Catálogo de Tipo Gastos de Rechazo de Paquetes + Catálogo de Tipo Gasto @@ -23,11 +23,11 @@ - + - - + + From ac200c81ce947ec22d861be117335ef8ebfee373 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 17 Jul 2020 17:51:48 -0700 Subject: [PATCH 28/56] - consideracion de importes negativos, que se coloreen --- Contabilidad/RepIVA.aspx.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index f694ee2bc..7c6df76ed 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -134,15 +134,19 @@ public partial class Contabilidad_RepIVA : ClsPaginas { Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() > 0 ? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() > 0 ? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0)); - Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2); + Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal() + Math.Round(e.Row.DBCampo("IVANoDeducible").ToDecimal()), 2); if (dif > 1) { - e.Row.ForeColor = System.Drawing.Color.Red; - e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err"; + e.Row.ForeColor = System.Drawing.Color.Red; + e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err"; - e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + e.Row.DBCampo("SubTotal") + " - IVA:" + e.Row.DBCampo("IVA"); + e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + SubTotal + " - IVA:" + e.Row.DBCampo("IVA"); } } + if (e.Row.DBCampo("IVA").ToDecimal() < 0 || e.Row.DBCampo("IEPS").ToDecimal() < 0 || e.Row.DBCampo("SubTotal16").ToDecimal() < 0 || e.Row.DBCampo("SubTotal8").ToDecimal() < 0 || e.Row.DBCampo("valorActosImp0").ToDecimal() < 0) + { + e.Row.ForeColor = System.Drawing.Color.Red; + } } } From 59611c12e7e6aa26ec52ed23c1bafea016a290a1 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 17 Jul 2020 20:17:44 -0700 Subject: [PATCH 29/56] Aplicar impuestos lcoales en nota de credito si la factura tiene. --- Ventas/Ventas.aspx.vb | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ac3635c77..fd76c078e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -22426,13 +22426,30 @@ Partial Class Ventas DdlTipoComprobante.SelectedValue = "Egs" Dim AplicaImpuestosLocales As Boolean = False - Dim ObjCliente As New ClsClientes - If ObjCliente.GetClienteImpuestosLocales(CveCliente) Then - 'se cargan impuestos locales - Dim DtClienteImpuesto As DataTable = ObjCliente.DtResultados.FiltraParametros("Seleccionado = 1", "Orden") - AplicaImpuestosLocales = (DtClienteImpuesto IsNot Nothing AndAlso DtClienteImpuesto.Rows.Count > 0) + 'Dim ObjCliente As New ClsClientes + 'If ObjCliente.GetClienteImpuestosLocales(CveCliente) Then + ' 'se cargan impuestos locales + ' Dim DtClienteImpuesto As DataTable = ObjCliente.DtResultados.FiltraParametros("Seleccionado = 1", "Orden") + ' AplicaImpuestosLocales = (DtClienteImpuesto IsNot Nothing AndAlso DtClienteImpuesto.Rows.Count > 0) + 'End If + 'ObjCliente.Dispose() + + 'CARGA IMPUESTOS LOCALES + Dim ObjVentas As New ClsVentas() + If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + AplicaImpuestosLocales = True + + TrOtros.Visible = True + TmpDTImpuestos = ObjVentas.DtResultados + GvImpuestosLocales2.DataSource = ObjVentas.DtResultados + GvImpuestosLocales2.DataBind() + + GvImpuestosLocales2.Enabled = False + GvImpuestosLocales2.Visible = True + End If End If - ObjCliente.Dispose() + ObjVentas.Dispose() AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento) From 2b35950c0e91d54a86a67c9a02708b0006b8c638 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Sat, 18 Jul 2020 13:49:51 -0700 Subject: [PATCH 30/56] Entradas salidas --- App_Code/ClsPaginas.vb | 8 +++++++- Inventarios/EntradasSalidas.aspx | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 826659d4d..31e46852b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1460,7 +1460,13 @@ Public Class ClsPaginas If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then Dim ObjBancos As New ClsBancos If ObjBancos.GetBancosCuentasUsuarios(-1) Then - Application(AppNombre) = ObjBancos.DtResultados + + If CveEmpresa > 0 Then + Application(AppNombre) = ObjBancos.DtResultados.FiltraParametros($"CveEmpresa = { CveEmpresa }") + Else + Application(AppNombre) = ObjBancos.DtResultados + End If + Else Application(AppNombre) = Nothing End If diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 6114ccac7..317886ea8 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -1049,7 +1049,9 @@
    - <%----%> + + +
    @@ -1062,6 +1064,19 @@ + + + + + + + + + + + + + From a9cf1de47015fbed5245e0d8c79b230e8622d9e8 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 18 Jul 2020 18:44:15 -0700 Subject: [PATCH 31/56] -- ajustes de serie/lote/caducidad --- Inventarios/InventarioFisicoDetalle.aspx | 18 ++-- Inventarios/InventarioFisicoDetalle.aspx.vb | 95 ++++++++++++++------- Inventarios/RepAnomalias.aspx | 4 +- Inventarios/RepAnomalias.aspx.vb | 2 +- 4 files changed, 78 insertions(+), 41 deletions(-) diff --git a/Inventarios/InventarioFisicoDetalle.aspx b/Inventarios/InventarioFisicoDetalle.aspx index c702804ee..48a1e6086 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx +++ b/Inventarios/InventarioFisicoDetalle.aspx @@ -240,23 +240,23 @@ - -
    - -
    - -
    -
    +
    + + +
    + + +
    @@ -325,7 +325,7 @@ - + @@ -349,7 +349,7 @@ - + diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index 208728062..3bfb676f9 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -88,10 +88,8 @@ Partial Class Inventarios_InventarioFisicoDetalle #Region " CARGA DATOS " Private Sub CargaDatos(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) - Dim ObjInventario As New ClsInventarios - DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - DdlSeccionAlmacen.DataBind() - DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) + Dim ObjInventario As New ClsInventarios + If ObjInventario.GetInventarioFisico(CveInventarioFisico, CveEmpresa, -1, -1) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then Dim CveEstatus = ObjInventario.DtResultados.FiltroPrimeroValor("CveEstatus") Select Case CveEstatus @@ -230,9 +228,9 @@ Partial Class Inventarios_InventarioFisicoDetalle Dim Inventario As New ClsInventarios If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then If Inventario.DtResultados.Rows.Count > 0 Then - GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen") > 0 + GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0 GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> "" - GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha + GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable Else GvIFD.DataSource = Nothing @@ -259,48 +257,83 @@ Partial Class Inventarios_InventarioFisicoDetalle Dim CveUnidadMedida As Integer Dim Codigo As String = If(TxtCodigo.Text.Trim <> "", TxtCodigo.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes - Dim SeccionAlmacen As String = If(DdlSeccionAlmacen.SelectedValue.ToEntero > -1, DdlSeccionAlmacen.SelectedItem.Text, "") - Dim CveSeccionAlmacen As Integer = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedValue.ToEntero, -1) - Dim SerieLote As String = TxtCodigoSerie.Text.Trim + Dim Serie As String = TxtCodigoSerie.Text.Trim Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1") - Dim FechaCaducidad As String = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString) - Dim CveMetodoInv As Integer = -1 + Dim FechaCaducidad As String=MinFecha.ToString + Dim CveSeccionAlmacen As Integer = -1 + Dim Cantidad = TxtCantidadProducto.Text.ToDouble Dim dr As DataRow - dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ") - - If dr IsNot Nothing Then - CveMetodoInv = dr("Inv_CveMetodoInventario").ToString.ToEntero + 'dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ") + dr = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}'") + + + + If dr IsNot Nothing Then + CveProducto = dr("CvePS").ToString.ToEntero - CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero + CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero + 'Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1" + Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1" + Dim AplicaLote As Boolean = dr("AplicaLote") = "1" + Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1" + + 'divSeccionAlmacen.Visible = AplicaSeccion + divLote.Visible = AplicaLote + divFechaCaducidad.Visible = AplicaCaducidad + divSerie.Visible = AplicaSerie + UPAgregarPro.Update() - If CveMetodoInv = 5 And SerieLote = "" Then + If AplicaSerie And Serie = "" Then RFVSerie.Enabled = True RFVSerie.Visible = True RFVSerie.SetFocusOnError = True RFVSerie.Validate() RFVSerie.ValidationGroup = " " Exit Sub + End If + If AplicaLote And Lote = "" Then + RFVLote.Enabled = True + RFVLote.Visible = True + RFVLote.SetFocusOnError = True + RFVLote.Validate() + RFVLote.ValidationGroup = " " + Exit Sub End If + If AplicaCaducidad Then + If TxtFechaCaducidad.Text.Trim = "" Then + RFVCaducidad.Enabled = True + RFVCaducidad.Visible = True + RFVCaducidad.SetFocusOnError = True + RFVCaducidad.Validate() + RFVCaducidad.ValidationGroup = " " + Exit Sub + End If + FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString) + End If RFVSerie.ValidationGroup = "GrpIngresar" RFVSerie.Enabled = False - - 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS - If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then - Alert($"La serie indicada {SerieLote} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + RFVLote.ValidationGroup = "GrpIngresar" + RFVLote.Enabled = False + RFVCaducidad.ValidationGroup = "GrpIngresar" + RFVCaducidad.Enabled = False + + 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS + If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then + Alert($"La serie indicada {Serie} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub End If Dim Consulto As Boolean = False Using Inventarios As New ClsInventarios - If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(CveMetodoInv = 5, 1, Cantidad), SerieLote, UsuarioActual.CveUsuario, - CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then + If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario, + CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0 - GvIFDUltimoRegistrado.Columns(5).Visible = SerieLote <> "-1" + GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "-1" GvIFDUltimoRegistrado.Columns(6).Visible = Lote <> "-1" GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad <> "01/01/1900" @@ -310,7 +343,7 @@ Partial Class Inventarios_InventarioFisicoDetalle GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PS").ToString - GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen + GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = "" GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad @@ -332,9 +365,11 @@ Partial Class Inventarios_InventarioFisicoDetalle TxtCodigoSerie.Text = "" TxtCodigo.Text = "" TxtCantidadProducto.Text = "1" - DdlSeccionAlmacen.SelectedValue = "-1" TxtLote.Text = "" TxtFechaCaducidad.Text = "" + divLote.Visible = False + divFechaCaducidad.Visible = False + divSerie.Visible = False RegistraScript("playsonidito('beep-07.wav')") Else TxtCodigoSerie.Text = "" @@ -346,8 +381,10 @@ Partial Class Inventarios_InventarioFisicoDetalle Else TxtCodigoBarras.Text = "" TxtCodigoSerie.Text = "" - TxtCodigo.Text = "" - DdlSeccionAlmacen.SelectedValue = "-1" + TxtCodigo.Text = "" + divLote.Visible = False + divFechaCaducidad.Visible = False + divSerie.Visible = False TxtLote.Text = "" TxtFechaCaducidad.Text = "" Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError) @@ -530,7 +567,7 @@ Partial Class Inventarios_InventarioFisicoDetalle Dim AplicaLote As Boolean = Producto("AplicaLote") = "1" Dim AplicaSerie As Boolean = Producto("AplicaSerie") = "1" - divSeccionAlmacen.Visible = AplicaSeccion + 'divSeccionAlmacen.Visible = AplicaSeccion divLote.Visible = AplicaLote divFechaCaducidad.Visible = AplicaCaducidad divSerie.Visible = AplicaSerie diff --git a/Inventarios/RepAnomalias.aspx b/Inventarios/RepAnomalias.aspx index 8d3185711..3751b969e 100644 --- a/Inventarios/RepAnomalias.aspx +++ b/Inventarios/RepAnomalias.aspx @@ -200,7 +200,7 @@ - + @@ -234,7 +234,7 @@ - + diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index a239ccbab..a71900ab2 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -275,7 +275,7 @@ Partial Class Inventarios_RepAnomalias Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable) Gv.Columns(4).Visible = resultado.MAX("Serie") <> "" Gv.Columns(5).Visible = resultado.MAX("Lote") <> "" - Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad") <> "" + Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha End Sub End Class From c69ef11e8b07546b26d0b66ff0ca585d5fb1e380 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 18 Jul 2020 18:45:18 -0700 Subject: [PATCH 32/56] cargas de subproyectos --- App_Code/ClsPaginas.vb | 10 +++++----- Ventas/Ventas.aspx.vb | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 826659d4d..8f6a1371d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8073,7 +8073,7 @@ Public Class ClsPaginas End Sub #End Region - Public Sub CargarCentrosDeCosto(DdlProyecto As DropDownList, DdlSubProyecto As DropDownList, LthProyectoP As Label, LblSubProyecto As Label) + Public Sub CargarCentrosDeCosto(DdlProyecto As DropDownList, DdlSubProyecto As DropDownList, LthProyectoP As Label, LblSubProyecto As Label, Optional AplicaTodos As String = "Todos") Select Case UsuarioActual.Empresa.Tipo_CentroCosto Case 1 If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False @@ -8096,15 +8096,15 @@ Public Class ClsPaginas End Select If DdlProyecto IsNot Nothing Then - DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"})) + DdlProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"})) DdlProyecto.DataBind() - DdlProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + If AplicaTodos <> "" Then DdlProyecto.Items.Insert(0, New ListItem(AplicaTodos, "-1")) End If If DdlSubProyecto IsNot Nothing Then - DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) + DdlSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + If AplicaTodos <> "" Then DdlSubProyecto.Items.Insert(0, New ListItem(AplicaTodos, "-1")) End If End Sub End Class diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index bfca81a44..c2c4b072e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2451,8 +2451,8 @@ Partial Class Ventas CargaFletes() - CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyectoHeader, LblSubProyecto) - CargarCentrosDeCosto(DdlProyectoPyME, DdlSubProyectoPyME, LblProyectoPyME, LblSubProyectoPyME) + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyectoHeader, LblSubProyecto, AplicaTodos:="") + CargarCentrosDeCosto(DdlProyectoPyME, DdlSubProyectoPyME, LblProyectoPyME, LblSubProyectoPyME, AplicaTodos:="") BrSubProyecto.Visible = DdlProyecto.Visible divProyectoPyME.Visible = DdlProyecto.Visible @@ -14418,8 +14418,8 @@ Partial Class Ventas DdlSubProyecto.Items.Clear() DdlSubProyecto.DataSource = DTSucursal - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlSubProyecto.SelectedValue = "-1" + 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlSubProyecto.SelectedValue = "-1" DdlSubProyecto.DataBind() DdlSubProyecto.SelectedValueExist(DdlSubProyectoDatos.SelectedValue) CambiaSucursal() From 1bf14135c2c22c294cff6239f9663fc8e6af31c1 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 20 Jul 2020 11:54:24 -0700 Subject: [PATCH 33/56] =?UTF-8?q?RepAnexoCatalogo,=20RepBalanzeComprobacio?= =?UTF-8?q?n,=20RepmovimientosAuxiliares=20=20=20validaci=C3=B3n=20formato?= =?UTF-8?q?s=20de=20fecha=20y=20cuenta=20requerida.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contabilidad2/RepAnexoCatalogo.aspx | 20 +++++++++++++++++-- Contabilidad2/RepBalanzaComprobacion.aspx | 18 ++++++++++++++--- .../RepMovimientosAuxiliaresCatalogo.aspx | 14 ++++++++----- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/Contabilidad2/RepAnexoCatalogo.aspx b/Contabilidad2/RepAnexoCatalogo.aspx index 25b3cdce0..492905e64 100644 --- a/Contabilidad2/RepAnexoCatalogo.aspx +++ b/Contabilidad2/RepAnexoCatalogo.aspx @@ -31,7 +31,7 @@
    - + "><%--class="expand"--%>
    @@ -40,6 +40,7 @@
    • F. I.
    • +
      @@ -47,7 +48,12 @@ + + + +
      +
    • F. F.
    • @@ -58,15 +64,25 @@ + + + + +
    -
  • Cuentas: +
  • Cuenta:
  • + + + + +
  • diff --git a/Contabilidad2/RepBalanzaComprobacion.aspx b/Contabilidad2/RepBalanzaComprobacion.aspx index c860c8b3d..41b29877a 100644 --- a/Contabilidad2/RepBalanzaComprobacion.aspx +++ b/Contabilidad2/RepBalanzaComprobacion.aspx @@ -23,7 +23,7 @@
    - +
    @@ -36,6 +36,10 @@ + + + +
    @@ -46,17 +50,25 @@ + + + +
    - +
    - + + + + +
    diff --git a/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx b/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx index b650f8c53..036079ba9 100644 --- a/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx +++ b/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx @@ -35,7 +35,7 @@
    - +
    @@ -50,8 +50,8 @@ - - + +
    @@ -65,8 +65,8 @@ - - + +
    @@ -82,6 +82,10 @@ + + + + From 1868bffe8c21ca98ed41a9082471a6e4d2de51fa Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 20 Jul 2020 18:22:26 -0700 Subject: [PATCH 34/56] avance de insert y update --- App_Code/ClsOIEventos.vb | 52 +++++++- OI/DocumentoDetalle.aspx | 93 ++++++++++++- OI/DocumentoDetalle.aspx.cs | 253 +++++++++++++++++++++++++++++++++++- 3 files changed, 391 insertions(+), 7 deletions(-) diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 8a65a1f30..4e36ab9e0 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2944,9 +2944,9 @@ Public Class ClsOIEventos End Function Public Function AddDocumento(CveSubCategoria As Integer, Descripcion As String, Observacion As String, Version As String, CveEstatus As Integer, ArchivoFisico As String, - Responsable As String, FechaAprobacion As Date, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Responsable As String, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Integer - Dim Retorno As Boolean = False + Dim Retorno As Integer = -1 DataAdapter("PA_OI_DocumentosAdd") @@ -2958,15 +2958,15 @@ Public Class ClsOIEventos .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus .Add("@ArchivoFisico", SqlDbType.NVarChar).Value = ArchivoFisico .Add("@Responsable", SqlDbType.NVarChar).Value = Responsable - .Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion .Add("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveDocumento", SqlDbType.Int).Direction = ParameterDirection.Output End With Try SqlAdapter.Fill(Data) - Retorno = True + Retorno = SqlAdapter.SelectCommand.Parameters("@CveDocumento").Value.ToString().ToEntero() Catch ex As Exception OnError("Ocurrió un error al agregar el Documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try @@ -3027,6 +3027,50 @@ Public Class ClsOIEventos End Function #End Region +#Region "OI_DocumentosAutorizacion" + Public Function AddDocumentoAutorizacion(CveDocumento As Integer, CveUsuario As Integer, Adjunto As String) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("OI_DocumentosAutorizacionesAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Adjunto", SqlDbType.NVarChar).Value = Adjunto + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el usuario para autorizar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetDocumentoAutorizacion(CveDocumento As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosAutorizacionesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el usuario o usuarios para autorizar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + #End Region ' IDisposable diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx index c68c94b1e..f84a72807 100644 --- a/OI/DocumentoDetalle.aspx +++ b/OI/DocumentoDetalle.aspx @@ -26,8 +26,97 @@
    - + + +
    +
    + + +
    +
    + + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    + + +
    +
    +

    +
    + " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4; border:1px solid #e5e5e5" /> + " class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    - \ No newline at end of file +
    diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index bc578cd90..315d1512b 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -6,11 +6,262 @@ using System.Web.UI; using System.Web.UI.WebControls; using Extensiones; using System.Data; +using System.IO; public partial class OI_DocumentoDetalle : ClsPaginas { + private int CveDocumento + { + get + { + return ViewState["CveDocumento"].ToString().ToEntero(); + } + + set + { + ViewState["CveDocumento"] = value; + } + } + + private string ErrorMensaje + { + get + { + return ViewState["ErrorMensaje"].ToString(); + } + + set + { + ViewState["ErrorMensaje"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) { - + if (!IsPostBack) + { + //CargarUsuarios(); + //CargarSubCategoria(); + //CargarResponsable(); + //CargarCveDocumento(); + //if (this.CveDocumento > 0) + //{ + // CargarDocumentoYaExistente(); + // CargarUsuariosAutorizo(); + // ConfiguracionActualizar(); + //} + Cargar(); + } } + #region "CARGAS" + private void CargarCveDocumento() + { + string CveDocumentoAux = Page.Request["CveDocumento"]; + if (CveDocumentoAux != null) + { + this.CveDocumento = CveDocumentoAux.ToEntero(); + } + else + { + this.CveDocumento = -1; + } + } + + private void CargarUsuarios() + { + GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); + GvUsuarios.DataBind(); + } + + private void CargarSubCategoria() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoSubCategoria()) + { + DdlSubCategoria.DataSource = ObjOI.DtResultados; + DdlSubCategoria.DataBind(); + } + ObjOI.Dispose(); + } + + private void CargarResponsable() + { + TxtResponsable.Text = UsuarioActual.Nombre; + } + + private void CargarDocumentoYaExistente() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumento(this.CveDocumento, UsuarioActual.CveEmpresa)) + { + if (ObjOI.DtResultados.Rows.Count > 0) + { + DataRow Documento = ObjOI.DtResultados.Rows[0]; + + TxtDescripcion.Text = Documento["Descripcion"].ToString(); + DdlSubCategoria.SelectedValue = Documento["CveSubCategoria"].ToString(); + DdlEstatus.SelectedValue = Documento["CveEstatus"].ToString(); + TxtVersion.Text = Documento["Version"].ToString(); + TxtResponsable.Text = Documento["Responsable"].ToString(); + TxtObs.InnerText = Documento["Observacion"].ToString(); + + } + } + ObjOI.Dispose(); + } + + private void CargarUsuariosAutorizo() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento)) + { + DataTable UsuariosAutorizo = ObjOI.DtResultados; + GridViewRowCollection UsuariosRowCollection = GvUsuarios.Rows; + foreach (GridViewRow UsuarioRow in UsuariosRowCollection) + { + int CveUsuarioRow = UsuarioRow.DataKey("CveUsuario").ToEntero(); + UsuarioRow.FCCheckBox("ChkUnir").Checked = UsuariosAutorizo.COUNT("CveUsuario", string.Format("CveUsuario = {0}", CveUsuarioRow)) > 0; + } + } + ObjOI.Dispose(); + } + + private void ConfiguracionActualizar() + { + LkbGuardar.Text = "Actualizar"; + } + + private void Cargar() + { + CargarUsuarios(); + CargarSubCategoria(); + CargarResponsable(); + CargarCveDocumento(); + if (this.CveDocumento > 0) + { + CargarDocumentoYaExistente(); + CargarUsuariosAutorizo(); + ConfiguracionActualizar(); + } + } + #endregion + + #region "GENERAR DOCUMENTO" + private string GuardarArchivo(int CveDocumento) + { + string RutaArchivo = "-1"; + List Filesgral = TxtDocumentoFile.getfiles().Archivos; + + foreach (Archivo fileItem in Filesgral) + { + try + { + string Version = TxtVersion.Text; + string NombreArchivo = fileItem.filenameO; + //Preparamos la ruta donde moveremos el archivo cargado + string NombreArchivoGuardado = string.Format("{0}_{1}_{2}", CveDocumento, Version, NombreArchivo); + string RutaDestino = UsuarioActual.Empresa.Ruta + @"DocumentosRepo\" + NombreArchivoGuardado; + + //Si no existe la carpeta donde se guardan se crea + if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo")) + { + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo"); + } + //Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa + System.IO.File.Move(fileItem.FileUrl, RutaDestino); + RutaArchivo = RutaDestino; + } + catch (Exception e) + { + Alert(e.Message); + } + } + return RutaArchivo; + } + + protected void LblGuardar_Click(object sender, EventArgs e) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + ObjOI.IniciaTransacSQL(); + bool TieneError = false; + + //Esta variable es requerida más adelante + int CveDocumento = 0; + string RutaArchivo = "-1"; + + CveDocumento = GuardarDocumento(ref ObjOI, ref TieneError);//Se crea el Documento + if (!TieneError) { RutaArchivo = AsignarArchivoAlDocumento(CveDocumento, ref ObjOI, ref TieneError); }//Se guarda el archivo fisico y se asigna al Documento generado + if (!TieneError) { GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento + + + //Gestión de errores y resultados + if (!TieneError) + { + ObjOI.Commit(); + Alert("Documento guardado correctamente"); + } + else + { + ObjOI.RollBack(); + Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError); + this.CveDocumento = CveDocumento; + Cargar(); + UpCliente.Update(); + } + ObjOI.Dispose(); + } + + private int GuardarDocumento(ref ClsOIEventos ObjOI, ref bool TieneError) + { + int CveDocumentoPadre = this.CveDocumento > 0 ? this.CveDocumento : -1; //Asociamos el nuevo insert con un CveDocumento ya generado en caso de ser una nueva versión del documento + + int CveDocumento = ObjOI.AddDocumento(DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, DdlEstatus.SelectedValue.ToEntero(), + "", TxtResponsable.Text, CveDocumentoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + if (!(CveDocumento > 0)) + { + TieneError = true; + this.ErrorMensaje = "Hubo un error al guardr el Documento"; + } + return CveDocumento; + } + + private string AsignarArchivoAlDocumento(int CveDocumento, ref ClsOIEventos ObjOI, ref bool TieneError) + { + string RutaArchivo = GuardarArchivo(CveDocumento); + if (RutaArchivo != "-1") + { + if (!ObjOI.UpdateDocumento(CveDocumento, -1, "-1", "-1", "-1", -1, RutaArchivo, "-1", ModExtensiones.MinFecha, -1, -1, -1)) + { + TieneError = true; + this.ErrorMensaje = "Hubo un error al asignar el archivo"; + } + } + else + { + TieneError = true; + this.ErrorMensaje = "Hubo un error al guardar el archivo"; + } + return RutaArchivo; + } + + private void GuardarUsuariosQueAutorizan(int CveDocumento, string RutaArchivo, ref ClsOIEventos ObjOI, ref bool TieneError) + { + GridViewRowCollection GridUsuarios = GvUsuarios.Rows; + foreach (GridViewRow GvRow in GridUsuarios) + { + if (GvRow.FCCheckBox("ChkUnir").Checked && !TieneError) + { + int CveUsuario = GvRow.DataKey("CveUsuario").ToEntero(); + if (!ObjOI.AddDocumentoAutorizacion(CveDocumento, CveUsuario, RutaArchivo)) + { + TieneError = true; + this.ErrorMensaje = "Hubo un error al asignar los usuarios a este documento"; + break; + } + } + } + } + #endregion + + } \ No newline at end of file From 4dbd71a5e071ddf9d5b7c280a37d84c7e52f063d Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 20 Jul 2020 18:45:06 -0700 Subject: [PATCH 35/56] Mensaje folio duplicado ClsBancos --- App_Code/ClsBancos.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 49c81b77f..b4ce6e00d 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1453,9 +1453,11 @@ Public Class ClsBancos _Folio = SqlAdapter.SelectCommand.Parameters("@FolioRegistro").Value.ToString Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Or Ex1.Message.Contains("Número: 2601;") Then + If Ex1.Message.Contains("Número: 2627;") Then Me.OnError("Ocurrió un error al Guardar el Movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ElseIf Ex1.Message.Contains("Número: 2601;") Then Alert("Ya existe un movimiento bancario con el mismo Folio: " & Folio & ".", TipoMensaje.MsgAdvertencia) + Me.OnError("Ocurrió un error al Guardar el Movimiento. Ya existe un movimiento bancario con el mismo Folio: " & Folio & ".", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Else Me.OnError("Ocurrió un error al Guardar el Movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If From 1096d1907d9591787055ca95e22e4b5aac62c5ae Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 21 Jul 2020 09:03:00 -0700 Subject: [PATCH 36/56] avance aun falta probar cosas --- OI/DocumentoDetalle.aspx | 11 ++++- OI/DocumentoDetalle.aspx.cs | 99 ++++++++++++++++++++++++++----------- 2 files changed, 78 insertions(+), 32 deletions(-) diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx index f84a72807..fd387dcc1 100644 --- a/OI/DocumentoDetalle.aspx +++ b/OI/DocumentoDetalle.aspx @@ -72,8 +72,15 @@
    - - +
    + + + +
    +
    + + +
    diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index 315d1512b..d8a3f2ac5 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -36,20 +36,23 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } + private string ArchivoAdjuntoNombre + { + get + { + return ViewState["ArchivoAdjuntoNombre"].ToString(); + } + + set + { + ViewState["ArchivoAdjuntoNombre"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { - //CargarUsuarios(); - //CargarSubCategoria(); - //CargarResponsable(); - //CargarCveDocumento(); - //if (this.CveDocumento > 0) - //{ - // CargarDocumentoYaExistente(); - // CargarUsuariosAutorizo(); - // ConfiguracionActualizar(); - //} Cargar(); } } @@ -105,6 +108,10 @@ public partial class OI_DocumentoDetalle : ClsPaginas TxtResponsable.Text = Documento["Responsable"].ToString(); TxtObs.InnerText = Documento["Observacion"].ToString(); + ArchivoAdjuntoNombre = Documento["ArchivoFisico"].ToString(); + string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_'); + string ArchivoAdjunto = ArchivoAux[2]; + LkbDescargarArchivo.Text = string.Format("Descargar Archivo: {0}",ArchivoAdjunto); } } ObjOI.Dispose(); @@ -151,29 +158,31 @@ public partial class OI_DocumentoDetalle : ClsPaginas { string RutaArchivo = "-1"; List Filesgral = TxtDocumentoFile.getfiles().Archivos; - - foreach (Archivo fileItem in Filesgral) + if (TxtDocumentoFile.Text != "") { - try + foreach (Archivo fileItem in Filesgral) { - string Version = TxtVersion.Text; - string NombreArchivo = fileItem.filenameO; - //Preparamos la ruta donde moveremos el archivo cargado - string NombreArchivoGuardado = string.Format("{0}_{1}_{2}", CveDocumento, Version, NombreArchivo); - string RutaDestino = UsuarioActual.Empresa.Ruta + @"DocumentosRepo\" + NombreArchivoGuardado; - - //Si no existe la carpeta donde se guardan se crea - if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo")) + try { - Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo"); + string Version = TxtVersion.Text; + string NombreArchivo = fileItem.filenameO; + //Preparamos la ruta donde moveremos el archivo cargado + string NombreArchivoGuardado = string.Format("{0}_{1}_{2}", CveDocumento, Version, NombreArchivo); + string RutaDestino = UsuarioActual.Empresa.Ruta + @"DocumentosRepo\" + NombreArchivoGuardado; + + //Si no existe la carpeta donde se guardan se crea + if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo")) + { + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo"); + } + //Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa + System.IO.File.Move(fileItem.FileUrl, RutaDestino); + RutaArchivo = NombreArchivoGuardado; + } + catch (Exception e) + { + Alert(e.Message); } - //Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa - System.IO.File.Move(fileItem.FileUrl, RutaDestino); - RutaArchivo = RutaDestino; - } - catch (Exception e) - { - Alert(e.Message); } } return RutaArchivo; @@ -220,7 +229,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas if (!(CveDocumento > 0)) { TieneError = true; - this.ErrorMensaje = "Hubo un error al guardr el Documento"; + this.ErrorMensaje = "Hubo un error al guardar el Documento"; } return CveDocumento; } @@ -263,5 +272,35 @@ public partial class OI_DocumentoDetalle : ClsPaginas } #endregion + #region "DESCARGAR ARCHIVO" + protected void LkbSubirNuevoArchivo_Click(object sender,EventArgs e) + { + DivDescargarArchivo.Visible = false; + DivSubirArchivo.Visible = true; + UpDerecha.Update(); + } + + protected void LkbDescargarNuevoArchivo_Click(object sender,EventArgs e) + { + DivDescargarArchivo.Visible = true; + DivSubirArchivo.Visible = false; + UpDerecha.Update(); + } + + protected void LkbDescargarArchivo_Click(object sender,EventArgs e) + { + string Ruta = string.Format("{0}Empresas/{1}/Temp/RH/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoAdjuntoNombre); + byte[] archivoBytes = File.ReadAllBytes(Ruta); + + HttpContext.Current.Response.Clear(); + HttpContext.Current.Response.ClearContent(); + HttpContext.Current.Response.ContentType = "application/octet-stream"; + HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", ArchivoAdjuntoNombre)); + HttpContext.Current.Response.AddHeader("Content-Length", archivoBytes.Length.ToString()); + HttpContext.Current.Response.OutputStream.Write(archivoBytes, 0, archivoBytes.Length); + HttpContext.Current.Response.End(); + } + #endregion + } \ No newline at end of file From befd26c7732063693dcf37c50f9671b2fcbc9a78 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 21 Jul 2020 10:14:33 -0700 Subject: [PATCH 37/56] -ajustes de seccion --- Inventarios/AjustesSeccionAlmacen.aspx | 3 ++- Inventarios/AjustesSeccionAlmacen.aspx.vb | 5 ++++- Inventarios/Apartados.aspx | 2 +- Inventarios/EntradasSalidas.aspx | 2 +- Inventarios/EntradasSalidas.aspx.vb | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx index dde09a6a1..4fc1c050d 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx +++ b/Inventarios/AjustesSeccionAlmacen.aspx @@ -56,7 +56,8 @@ - + + diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 7dc1c3c02..726db4464 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -84,8 +84,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True) + Else + ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, False) End If - Lista.Add(gvr.DataKey("CvePS").ToEntero, gvr.FCDropDownList("DDlS").SelectedValue.ToEntero) 'guardo que dato le corresponde + If Not Lista.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then Lista.Add(gvr.DataKey("CvePS").ToEntero, gvr.FCDropDownList("DDlS").SelectedValue.ToEntero) 'guardo que dato le corresponde + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.DataKey("Existencia").ToDecimal, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, -1, CveSeccionAlmacen:=gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=gvr.DataKey("Serie"), Lote:=gvr.DataKey("Lote"), FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de salida" diff --git a/Inventarios/Apartados.aspx b/Inventarios/Apartados.aspx index 27be34de9..b146d2360 100644 --- a/Inventarios/Apartados.aspx +++ b/Inventarios/Apartados.aspx @@ -227,7 +227,7 @@ - + diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 317886ea8..c1fabff01 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -1439,7 +1439,7 @@
    - +

    -
    +
    -
    -
    +
    + -
    + + + diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index d8a3f2ac5..23c3b49e7 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -110,8 +110,9 @@ public partial class OI_DocumentoDetalle : ClsPaginas ArchivoAdjuntoNombre = Documento["ArchivoFisico"].ToString(); string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_'); - string ArchivoAdjunto = ArchivoAux[2]; - LkbDescargarArchivo.Text = string.Format("Descargar Archivo: {0}",ArchivoAdjunto); + string ArchivoAdjunto = ArchivoAux[1]; + LkbDescargarArchivo.Text = ArchivoAdjunto; + DivDescargarArchivo.Visible = true; } } ObjOI.Dispose(); @@ -154,39 +155,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas #endregion #region "GENERAR DOCUMENTO" - private string GuardarArchivo(int CveDocumento) - { - string RutaArchivo = "-1"; - List Filesgral = TxtDocumentoFile.getfiles().Archivos; - if (TxtDocumentoFile.Text != "") - { - foreach (Archivo fileItem in Filesgral) - { - try - { - string Version = TxtVersion.Text; - string NombreArchivo = fileItem.filenameO; - //Preparamos la ruta donde moveremos el archivo cargado - string NombreArchivoGuardado = string.Format("{0}_{1}_{2}", CveDocumento, Version, NombreArchivo); - string RutaDestino = UsuarioActual.Empresa.Ruta + @"DocumentosRepo\" + NombreArchivoGuardado; - - //Si no existe la carpeta donde se guardan se crea - if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo")) - { - Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo"); - } - //Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa - System.IO.File.Move(fileItem.FileUrl, RutaDestino); - RutaArchivo = NombreArchivoGuardado; - } - catch (Exception e) - { - Alert(e.Message); - } - } - } - return RutaArchivo; - } + protected void LblGuardar_Click(object sender, EventArgs e) { @@ -208,13 +177,13 @@ public partial class OI_DocumentoDetalle : ClsPaginas { ObjOI.Commit(); Alert("Documento guardado correctamente"); + //this.CveDocumento = CveDocumento; + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}",CveDocumento)); } else { ObjOI.RollBack(); Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError); - this.CveDocumento = CveDocumento; - Cargar(); UpCliente.Update(); } ObjOI.Dispose(); @@ -236,6 +205,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas private string AsignarArchivoAlDocumento(int CveDocumento, ref ClsOIEventos ObjOI, ref bool TieneError) { + string RutaArchivo = GuardarArchivo(CveDocumento); if (RutaArchivo != "-1") { @@ -245,7 +215,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas this.ErrorMensaje = "Hubo un error al asignar el archivo"; } } - else + else if(RutaArchivo == "Error") { TieneError = true; this.ErrorMensaje = "Hubo un error al guardar el archivo"; @@ -272,24 +242,47 @@ public partial class OI_DocumentoDetalle : ClsPaginas } #endregion - #region "DESCARGAR ARCHIVO" - protected void LkbSubirNuevoArchivo_Click(object sender,EventArgs e) + #region "ARCHIVO ADJUNTO" + private string GuardarArchivo(int CveDocumento) { - DivDescargarArchivo.Visible = false; - DivSubirArchivo.Visible = true; - UpDerecha.Update(); + string RutaArchivo = "-1"; + List Filesgral = TxtDocumentoFile.getfiles().Archivos; + if (TxtDocumentoFile.Text != "[]") + { + foreach (Archivo fileItem in Filesgral) + { + try + { + string Version = TxtVersion.Text; + string NombreArchivo = fileItem.filenameO; + //Preparamos la ruta donde moveremos el archivo cargado + string NombreArchivoGuardado = string.Format("{0}_{1}", CveDocumento, NombreArchivo); + string RutaDestino = UsuarioActual.Empresa.Ruta + @"DocumentosRepo\" + NombreArchivoGuardado; + + //Si no existe la carpeta donde se guardan se crea + if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo")) + { + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo"); + } + //Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa + System.IO.File.Move(fileItem.FileUrl, RutaDestino); + RutaArchivo = NombreArchivoGuardado; + } + catch (Exception e) + { + Alert(e.Message); + RutaArchivo = "Error"; + } + } + } + return RutaArchivo; } - protected void LkbDescargarNuevoArchivo_Click(object sender,EventArgs e) - { - DivDescargarArchivo.Visible = true; - DivSubirArchivo.Visible = false; - UpDerecha.Update(); - } + protected void LkbDescargarArchivo_Click(object sender,EventArgs e) { - string Ruta = string.Format("{0}Empresas/{1}/Temp/RH/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoAdjuntoNombre); + string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoAdjuntoNombre); byte[] archivoBytes = File.ReadAllBytes(Ruta); HttpContext.Current.Response.Clear(); From d8dc66900b852286b9e69cc95d34867f1d5fdbba Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 21 Jul 2020 19:27:50 -0700 Subject: [PATCH 42/56] integrando el endpoint para descargar las firmas --- TareasProgramadas/Tareas72.ashx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/TareasProgramadas/Tareas72.ashx b/TareasProgramadas/Tareas72.ashx index 1edc5d88a..f3d4ba7aa 100644 --- a/TareasProgramadas/Tareas72.ashx +++ b/TareasProgramadas/Tareas72.ashx @@ -66,13 +66,31 @@ public class Tareas72 : IHttpHandler string JsonStringFormat = JsonString.Replace("Resultado(", "{\"Resultado\":").Replace(")", "}"); DataSet dataSet = JsonConvert.DeserializeObject(JsonStringFormat); DataTable dataTable = dataSet.Tables["Resultado"]; - if (dataTable.Rows[0]["eventoId"].ToString() == "Hdc") + string eventoId = dataTable.Rows[0]["eventoId"].ToString(); + if (eventoId == "Hdc" | eventoId == "HDC") { int EstatusEntregado = 3; //MANDAMOS A ACTUALIZAR CON ESTATUS DE ENTREGADO if (ObjGenerales.UpdatePaqueteriasGuias(CvePaqueteriaGuia, -1, -1, -1, EstatusEntregado, "-1", "", "", -1, -1, "-1", "-1", "")) { + #region 'DESCARGAR IMAGEN' + string rastreo = Guia["Rastreo"].ToString(); + string uriConsultaFirma = string.Format("https://cc.paquetexpress.com.mx/ptxws/rest/api/v1/entrega/firma/{0}/@1@2@3@4@5", rastreo); + + HttpClient ClientFirma = new HttpClient(); + HttpResponseMessage ResponseMessageFirma = ClientFirma.GetAsync(uriConsultaFirma).Result; + string JsonStringFirma = ResponseMessageFirma.Content.ReadAsStringAsync().Result; + string JsonStringFormatFirma = JsonStringFirma.Replace("callback(", "{\"callback\":").Replace(")", "}"); + DataSet dataSetFirma = JsonConvert.DeserializeObject(JsonStringFormatFirma); + DataTable dataTableFirma = dataSetFirma.Tables["callback"]; + + string ImagenBase64 = dataTableFirma.Rows[0]["imagen"].ToString(); + byte[] ImagenByteArray = Convert.FromBase64String(ImagenBase64); + string rutaDestino = ModExtensiones.DirectorioEmpresas + "72\\" + "Documentos\\Guias\\" + CvePaqueteriaGuia + ".jpg"; + File.WriteAllBytes(rutaDestino,ImagenByteArray); + #endregion + #region 'MANDAR CORREOS' int CveCliente = Guia["CveCliente"].ToString().ToEntero(); int CveVenta = Guia["CveAgrupador"].ToString().ToEntero(); @@ -123,7 +141,7 @@ public class Tareas72 : IHttpHandler ObjVentas.Dispose(); ObjVendedores.Dispose(); ObjEmpresa.Dispose(); - return false; + return retorno; } public bool IsReusable From d9f3fb126104f5c2f80aa8df72ae08db70a9dedc Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 21 Jul 2020 19:44:12 -0700 Subject: [PATCH 43/56] =?UTF-8?q?correcci=C3=B3n=20de=20ortograf=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RH/Personal.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RH/Personal.aspx b/RH/Personal.aspx index b9c257e6c..fdad5f44e 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -4614,7 +4614,7 @@ - +
    @@ -3538,7 +3538,7 @@ diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 390c3f3f6..f7f4d4d35 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -4671,12 +4671,17 @@ Partial Class RH_Personal Dim Fecha As String = DateTime.Now.ToString("dd/MM/yyyy") Dim Solicitante As String = UsuarioActual.Nombre Dim anio As Integer = GvRow.DataKey("FechaInicio").ToDate().Year + Dim FechaPeriodo As String = GvRow.DataKey("Periodo") + + + + If Periodoingreso > PeriodoInicio Then anio = anio - 1 - End If - - - Dim FechaPeriodo As String = String.Format("{0:dd/MM}/{1}", fechaIngreso, anio) + End If + + + If File.Exists(RutaFormato) Then Dim objGemDocument As New clsGemBoxDocument(RutaFormato) @@ -6123,10 +6128,36 @@ Partial Class RH_Personal End If If TxtFIPrimaVacacional.Text = "0" Or TxtFIPrimaVacacional.Text = "" Or TxtFIAguinaldo.Text = "-1" Then TxtFIPrimaVacacional.Text = "25" - End If + End If + + + TxtFISalariodiarioImss.Text = TxtSalarioCotizado.Text TxtFactordeIntegracion.Text = "" - TxtFISalarioDiarioIntegrado.Text = "" + TxtFISalarioDiarioIntegrado.Text = "" + + + + Dim objRH As New ClsRH + + If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then + If objRH.DtResultados.Rows.Count > 0 Then + + If objRH.DtResultados.Rows.Count > 0 Then + TxtFIDiasVacaciones.Text = objRH.DtResultados(0)("Dias").ToString + Else + TxtFIDiasVacaciones.Text = "6" + End If + Else + + End If + End If + + objRH.Dispose() + + + + RegistraScript("$('#DmodalFactordeIntegraccion').modal()") UpFactordeintegracion.Update() End Sub diff --git a/RH/RepPersonalInconsistencias.aspx.vb b/RH/RepPersonalInconsistencias.aspx.vb index bf9d0b4e9..763ea5656 100644 --- a/RH/RepPersonalInconsistencias.aspx.vb +++ b/RH/RepPersonalInconsistencias.aspx.vb @@ -181,7 +181,7 @@ Partial Class RH_RepPersonalInconsistencias Dim ObjAF As New ClsAF() If ObjAF.GetLicenciasVencidas(-1, -1, UsuarioActual.CveEmpresa, Estatus:=1) Then - GvLicencias.DataSource = ObjAF.DtResultados + GvLicencias.DataSource = ObjAF.DtResultados.FiltraParametros("CveEstatusPersonal = 1") Else GvLicencias.DataSource = Nothing diff --git a/vwd.webinfo b/vwd.webinfo index 6a84ef014..4edae1c8c 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -80,6 +80,10 @@ + + + + From 4c74ec5d46f99c2b7ae873a3e1b05af6d3f1ece4 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 22 Jul 2020 19:47:27 -0700 Subject: [PATCH 49/56] =?UTF-8?q?notificac=C3=B3n=20por=20correo=20agregad?= =?UTF-8?q?a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsOIEventos.vb | 20 +++++++++ OI/DocumentoDetalle.aspx | 2 +- OI/DocumentoDetalle.aspx.cs | 84 ++++++++++++++++++++++++++++++++----- OI/Documentos.aspx | 19 ++++----- OI/Documentos.aspx.cs | 2 +- 5 files changed, 103 insertions(+), 24 deletions(-) diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 4e36ab9e0..6abe367d1 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2922,6 +2922,26 @@ Public Class ClsOIEventos #End Region #Region "Documentos" + Public Function ListadoDocumentos(CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_ListarDocumentos") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el listado de documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetDocumento(CveDocumento As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx index ad0062d3e..d5af82e6c 100644 --- a/OI/DocumentoDetalle.aspx +++ b/OI/DocumentoDetalle.aspx @@ -97,7 +97,7 @@ - diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index 23c3b49e7..6955095d9 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -7,6 +7,7 @@ using System.Web.UI.WebControls; using Extensiones; using System.Data; using System.IO; +using System.Text; public partial class OI_DocumentoDetalle : ClsPaginas { @@ -155,7 +156,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas #endregion #region "GENERAR DOCUMENTO" - + protected void LblGuardar_Click(object sender, EventArgs e) { @@ -166,19 +167,24 @@ public partial class OI_DocumentoDetalle : ClsPaginas //Esta variable es requerida más adelante int CveDocumento = 0; string RutaArchivo = "-1"; + string CorreosNotificacion = ""; + byte[] ArchivoNotifiacion = null; CveDocumento = GuardarDocumento(ref ObjOI, ref TieneError);//Se crea el Documento if (!TieneError) { RutaArchivo = AsignarArchivoAlDocumento(CveDocumento, ref ObjOI, ref TieneError); }//Se guarda el archivo fisico y se asigna al Documento generado - if (!TieneError) { GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento - + if (!TieneError) { CorreosNotificacion = GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento + if (!TieneError) + { + ArchivoNotifiacion = GenerarArchivoByte(RutaArchivo); + NotificarPorCorreo(CorreosNotificacion, RutaArchivo, ArchivoNotifiacion); + } //Gestión de errores y resultados if (!TieneError) { ObjOI.Commit(); Alert("Documento guardado correctamente"); - //this.CveDocumento = CveDocumento; - Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}",CveDocumento)); + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}", CveDocumento)); } else { @@ -215,7 +221,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas this.ErrorMensaje = "Hubo un error al asignar el archivo"; } } - else if(RutaArchivo == "Error") + else if (RutaArchivo == "Error") { TieneError = true; this.ErrorMensaje = "Hubo un error al guardar el archivo"; @@ -223,8 +229,9 @@ public partial class OI_DocumentoDetalle : ClsPaginas return RutaArchivo; } - private void GuardarUsuariosQueAutorizan(int CveDocumento, string RutaArchivo, ref ClsOIEventos ObjOI, ref bool TieneError) + private string GuardarUsuariosQueAutorizan(int CveDocumento, string RutaArchivo, ref ClsOIEventos ObjOI, ref bool TieneError) { + StringBuilder CorreosReturn = new StringBuilder(""); GridViewRowCollection GridUsuarios = GvUsuarios.Rows; foreach (GridViewRow GvRow in GridUsuarios) { @@ -237,12 +244,19 @@ public partial class OI_DocumentoDetalle : ClsPaginas this.ErrorMensaje = "Hubo un error al asignar los usuarios a este documento"; break; } + else + { + CorreosReturn.AppendFormat("{0},", GvRow.DataKey("Correo")); + } } } + + return CorreosReturn.ToString(); } #endregion #region "ARCHIVO ADJUNTO" + private string GuardarArchivo(int CveDocumento) { string RutaArchivo = "-1"; @@ -278,9 +292,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas return RutaArchivo; } - - - protected void LkbDescargarArchivo_Click(object sender,EventArgs e) + protected void LkbDescargarArchivo_Click(object sender, EventArgs e) { string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoAdjuntoNombre); byte[] archivoBytes = File.ReadAllBytes(Ruta); @@ -295,5 +307,57 @@ public partial class OI_DocumentoDetalle : ClsPaginas } #endregion + #region "NOTIFICACIONES CORREO" + private void NotificarPorCorreo(string Para, string NombreArchivo, byte[] Adjunto) + { + string Descripcion = TxtDescripcion.Text; + string Asunto = "Se le ha agregado como participante en el desarrollo de un Documento"; + string a = string.Format("{0} -- {1} --- {2}", Descripcion, Para, ""); + a.GuardaLog(); + + ClsSisMail Mail = new ClsSisMail(); + + if (Adjunto != null) + { + List LSRutasMail = new List(); + ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail(); + + { + var withBlock = itemMail; + itemMail.ArchivoBinario = Adjunto; + itemMail.NombreArchivo = NombreArchivo; + } + + LSRutasMail.Add(itemMail); + + + Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Descripcion, "", LSRutasMail); + Mail = null/* TODO Change to default(_) if this is not a reference type */; + } + else + { + Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Descripcion, ""); + Mail = null/* TODO Change to default(_) if this is not a reference type */; + } + } + + private byte[] GenerarArchivoByte(string NombreArchivo) + { + string ArchivoEnviar = string.Format(@"{0}DocumentosRepo\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo); + if (File.Exists(ArchivoEnviar)) + { + System.IO.FileStream fs = System.IO.File.Open(ArchivoEnviar, System.IO.FileMode.Open, System.IO.FileAccess.Read); + byte[] buff = new byte[fs.Length + 1]; + if (fs.Length > 0) + { + fs.Read(buff, 0, (fs.Length.ToString().ToEntero() - 1)); + fs.Close(); + } + return buff; + } + + return new byte[] { }; + } + #endregion } \ No newline at end of file diff --git a/OI/Documentos.aspx b/OI/Documentos.aspx index 724ec70d8..5a202ebaa 100644 --- a/OI/Documentos.aspx +++ b/OI/Documentos.aspx @@ -32,18 +32,13 @@ EmptyDataText="No se encontraron Documentos Registrados" ToolTip="Listado de Documentos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None"> - - - - - - - - - <%-- - --%> - - + + + + + + <%----%> + diff --git a/OI/Documentos.aspx.cs b/OI/Documentos.aspx.cs index e087c71c9..2f162df73 100644 --- a/OI/Documentos.aspx.cs +++ b/OI/Documentos.aspx.cs @@ -20,7 +20,7 @@ public partial class OI_Documentos : ClsPaginas private void CargaDatos() { ClsOIEventos ObjOI = new ClsOIEventos(); - if (ObjOI.GetDocumento(-1,UsuarioActual.CveEmpresa)) + if (ObjOI.ListadoDocumentos(UsuarioActual.CveEmpresa)) { GvDatos.DataSource = ObjOI.DtResultados; GvDatos.DataBind(); From 782891be9269fe58339e61c3e3f37b19275730de Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 23 Jul 2020 09:12:39 -0700 Subject: [PATCH 50/56] correcciones y agregados --- OI/DocumentoDetalle.aspx.cs | 17 +++++++++++++++-- OI/Documentos.aspx | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index 6955095d9..0c35f9eb6 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -71,6 +71,18 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } + private void CargarMensajeNuevoEditado() + { + string MensajeNuevoEditado = Page.Request["Mensaje"]; + if (MensajeNuevoEditado == "Nuevo") + { + Alert("El Documento ha sido creado correctamente"); + }else if(MensajeNuevoEditado == "Editado") + { + Alert("Los cambios en el Documento han sido guardado correctamente"); + } + } + private void CargarUsuarios() { GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); @@ -151,6 +163,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas CargarDocumentoYaExistente(); CargarUsuariosAutorizo(); ConfiguracionActualizar(); + CargarMensajeNuevoEditado(); } } #endregion @@ -183,8 +196,8 @@ public partial class OI_DocumentoDetalle : ClsPaginas if (!TieneError) { ObjOI.Commit(); - Alert("Documento guardado correctamente"); - Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}", CveDocumento)); + string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "Editado";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje)); } else { diff --git a/OI/Documentos.aspx b/OI/Documentos.aspx index 5a202ebaa..818d0df70 100644 --- a/OI/Documentos.aspx +++ b/OI/Documentos.aspx @@ -14,7 +14,7 @@
  • - +
  • Imprimir PDF From afd17ba911a81d6e52794c0ea05766c1cd2ecaed Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Jul 2020 09:31:20 -0700 Subject: [PATCH 51/56] - visualziacion serie/lote --- Inventarios/InventarioFisicoDetalle.aspx | 2 +- Inventarios/InventarioFisicoDetalle.aspx.vb | 34 ++++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Inventarios/InventarioFisicoDetalle.aspx b/Inventarios/InventarioFisicoDetalle.aspx index 48a1e6086..6a15e7ad1 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx +++ b/Inventarios/InventarioFisicoDetalle.aspx @@ -229,7 +229,7 @@
    - +
    diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index 3bfb676f9..4cc513ac3 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -229,6 +229,7 @@ Partial Class Inventarios_InventarioFisicoDetalle If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then If Inventario.DtResultados.Rows.Count > 0 Then GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0 + GvIFD.Columns(5).Visible = Inventario.DtResultados.MAX("SerieLote") <> "" GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> "" GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable @@ -333,16 +334,16 @@ Partial Class Inventarios_InventarioFisicoDetalle CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0 - GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "-1" + GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "" GvIFDUltimoRegistrado.Columns(6).Visible = Lote <> "-1" - GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad <> "01/01/1900" + GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad.ToDate > MinFecha If GvIFDUltimoRegistrado.Rows.Count > 0 Then GvIFDUltimoRegistrado.Rows(0).Cells(0).Text = Now GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString - GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PS").ToString + GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PSCodigo").ToString GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = "" GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote @@ -559,18 +560,21 @@ Partial Class Inventarios_InventarioFisicoDetalle ' End Sub - Protected Sub TxtCodigoBarras_Change(sender As Object, e As EventArgs) - Dim Producto As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{TxtCodigoBarras.Text}'") + 'Protected Sub TxtCodigoBarras_Change(sender As Object, e As EventArgs) + ' Dim Producto As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{TxtCodigoBarras.Text}'") - Dim AplicaSeccion As Boolean = Producto("AplicaSeccion") = "1" - Dim AplicaCaducidad As Boolean = Producto("AplicaCaducidad") = "1" - Dim AplicaLote As Boolean = Producto("AplicaLote") = "1" - Dim AplicaSerie As Boolean = Producto("AplicaSerie") = "1" + ' If Producto IsNot Nothing Then + ' Dim AplicaSeccion As Boolean = Producto("AplicaSeccion") = "1" + ' Dim AplicaCaducidad As Boolean = Producto("AplicaCaducidad") = "1" + ' Dim AplicaLote As Boolean = Producto("AplicaLote") = "1" + ' Dim AplicaSerie As Boolean = Producto("AplicaSerie") = "1" - 'divSeccionAlmacen.Visible = AplicaSeccion - divLote.Visible = AplicaLote - divFechaCaducidad.Visible = AplicaCaducidad - divSerie.Visible = AplicaSerie - UPAgregarPro.Update() - End Sub + ' 'divSeccionAlmacen.Visible = AplicaSeccion + ' divLote.Visible = AplicaLote + ' divFechaCaducidad.Visible = AplicaCaducidad + ' divSerie.Visible = AplicaSerie + ' End If + + ' UPAgregarPro.Update() + 'End Sub End Class From cefe0093f967278f2075802684cddc7e9acbe6fd Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Jul 2020 09:32:14 -0700 Subject: [PATCH 52/56] -- secciones recomendadas --- Inventarios/EntregaAlmacen.aspx.vb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 7ef8db2d1..1fda0e0ee 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -886,9 +886,13 @@ Partial Class Inventarios_EntregaAlmacen If CBool(e.Row.DBCampo("AplicaSeccion")) Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True If DdlAlmacen.SelectedValue.ToEntero > 0 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + If dtt.Rows.Count > 1 Then + e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + dtt.Dispose() End If Else From 15129caaa050946819a05e8b637aec88d7fa50df Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Jul 2020 09:32:54 -0700 Subject: [PATCH 53/56] numeropedimento --- App_Code/Timbrado.vb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 88e4f9c15..5bdb7d46f 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -1164,6 +1164,7 @@ Public Class Timbrado End If Next If concep.CuentaPredial <> "" Then cfdi.agregarCuentaPredial(concep.CuentaPredial) + If concep.NumeroPedimento <> "" Then cfdi.agregarInformacionAduanera(concep.NumeroPedimento) Next End If @@ -1749,6 +1750,7 @@ Public Class Timbrado End If Next If concep.CuentaPredial <> "" Then cfdi.CuentaPredial(concep.CuentaPredial) + If concep.NumeroPedimento <> "" Then cfdi.InformacionAduanera(concep.NumeroPedimento) Next End If @@ -2365,6 +2367,11 @@ Public Class Timbrado End If If concep.Noidentificacion <> "" Then comprobante.Conceptos(i).NoIdentificacion = concep.Noidentificacion + If concep.CuentaPredial <> "" Then comprobante.Conceptos(i).CuentaPredial = New Profact.TimbraCFDI33.ComprobanteConceptoCuentaPredial() With {.Numero = concep.CuentaPredial} + If concep.NumeroPedimento <> "" Then + comprobante.Conceptos(i).InformacionAduanera = New Profact.TimbraCFDI33.ComprobanteConceptoInformacionAduanera(1) {} 'solo un codigo por el momento + comprobante.Conceptos(i).InformacionAduanera(0) = New Profact.TimbraCFDI33.ComprobanteConceptoInformacionAduanera() With {.NumeroPedimento = concep.NumeroPedimento} + End If j = 0 k = 0 From 9a1fc3543034dabd233ef00a5e9a17cdb0355e1b Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Jul 2020 11:14:21 -0700 Subject: [PATCH 54/56] filtro de usuarios, solo los activos --- Inventarios/InventarioFisicoDetalle.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index 4cc513ac3..a1678237c 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -57,7 +57,7 @@ Partial Class Inventarios_InventarioFisicoDetalle #Region " USUARIOS " Private Sub CargaUsuarios() - ddlUsuario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) + ddlUsuario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "Nombre") ddlUsuario.DataBind() UPPInventario.Update() ddlUsuario.SelectedValue = UsuarioActual.CveUsuario.ToString @@ -206,7 +206,7 @@ Partial Class Inventarios_InventarioFisicoDetalle lbFechaI.Text = ObjInventario.FechaI lbFechaF.Text = ObjInventario.FechaF - Alert("Ocurrió un error al obterner el inventario fisico") + Alert("Ocurrió un error al obterner el inventario fisico", TipoMensaje.MsgError) End If ObjInventario.Dispose() From 080af0b7cb170f9f1bda4f691b1bb70762eff8f9 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 23 Jul 2020 11:14:31 -0700 Subject: [PATCH 55/56] secciones de almacen --- Inventarios/TraspasoAlmacen.aspx | 2 +- Inventarios/TraspasoAlmacen.aspx.vb | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 785ef1ff6..3c6546336 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -665,7 +665,7 @@ - + diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 09ed1a802..9ce5b10d3 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1482,8 +1482,8 @@ Partial Class Inventarios_TraspasoAlmacen GvDatosRecepcion.Columns(6).Visible = Dtt.MAX("Serie") <> "" GvDatosRecepcion.Columns(7).Visible = Dtt.MAX("Lote") <> "" - GvDatosRecepcion.Columns(8).Visible = Dtt.MAX("FechaCaducidad") <> "" - GvDatosRecepcion.Columns(9).Visible = Dtt.MAX("Serie") <> "" + GvDatosRecepcion.Columns(8).Visible = Dtt.MAX("FechaCaducidad").ToDate > MinFecha + GvDatosRecepcion.Columns(9).Visible = Dtt.MAX("CveSeccionAlmacen").ToEntero > 0 'Dt.Dispose() End If @@ -1533,10 +1533,15 @@ Partial Class Inventarios_TraspasoAlmacen Else e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", String.Format("ValidaCantidad(this,{0});", e.Row.DBCampo("Cantidad"))) If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenRecepcion.SelectedValue.ToEntero > 0 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero) + + Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + If dtt.Rows.Count > 1 Then + e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + dtt.Dispose() + End If End If From 328e017241ed1f4109cbaab07e2fd04ce58557aa Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 23 Jul 2020 12:53:13 -0700 Subject: [PATCH 56/56] =?UTF-8?q?se=20ajust=C3=B3=20el=20tama=C3=B1o=20de?= =?UTF-8?q?=20los=20correos=20de=20las=20paqueter=C3=ADas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- General/PopUpPaqueteriasGuias.aspx.cs | 4 ++-- General/RepPaqueteriasGuias.aspx.cs | 4 ++-- Inventarios/EntregaAlmacen.aspx.vb | 4 ++-- Inventarios/EntregasPorRealizar.aspx.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs index 3c8e94472..12badb3fb 100644 --- a/General/PopUpPaqueteriasGuias.aspx.cs +++ b/General/PopUpPaqueteriasGuias.aspx.cs @@ -761,7 +761,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas strBody.Append(""); strBody.Append(""); strBody.Append(""); - strBody.Append(" "); + strBody.Append(" "); strBody.Append("
    "); strBody.Append($""); strBody.Append("
    "); @@ -770,7 +770,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas strBody.Append("

    "); strBody.Append($"

    {FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}

    "); strBody.Append("
    "); - strBody.Append(" "); + strBody.Append("
    "); strBody.Append(DetalleTable); strBody.Append("
    "); strBody.Append("
    "); diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index af2e3a827..bddef6c59 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -1110,7 +1110,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas strBody.Append(""); strBody.Append(""); strBody.Append(""); - strBody.Append(" "); + strBody.Append(" "); strBody.Append("
    "); strBody.Append($""); strBody.Append("
    "); @@ -1120,7 +1120,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas strBody.Append($"

    {FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}

    "); strBody.Append("

    Su Pedido:

    "); strBody.Append("
    "); - strBody.Append(" "); + strBody.Append("
    "); strBody.Append(DetalleTable); strBody.Append("
    "); strBody.Append("
    "); diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 1fda0e0ee..85cdf7b62 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -3228,7 +3228,7 @@ Partial Class Inventarios_EntregaAlmacen strBody.Append("") strBody.Append("") strBody.Append("") - strBody.Append(" ") + strBody.Append(" ") strBody.Append("
    ") strBody.Append($"") strBody.Append("
    ") @@ -3239,7 +3239,7 @@ Partial Class Inventarios_EntregaAlmacen strBody.Append("

    ") strBody.Append($"

    {FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}

    ") strBody.Append("
    ") - strBody.Append(" ") + strBody.Append("
    ") strBody.Append(DetalleTable) strBody.Append(" ") strBody.Append("
    ") diff --git a/Inventarios/EntregasPorRealizar.aspx.cs b/Inventarios/EntregasPorRealizar.aspx.cs index 689c7d368..d3a5ba81e 100644 --- a/Inventarios/EntregasPorRealizar.aspx.cs +++ b/Inventarios/EntregasPorRealizar.aspx.cs @@ -151,7 +151,7 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas strBody.Append(""); strBody.Append(""); strBody.Append(""); - strBody.Append(" "); + strBody.Append(" "); strBody.Append("
    "); strBody.Append($""); strBody.Append("
    "); @@ -161,7 +161,7 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas strBody.Append("

    "); strBody.Append($"

    {FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}

    "); strBody.Append("
    "); - strBody.Append(" "); + strBody.Append("
    "); strBody.Append(DetalleTable); strBody.Append("
    "); strBody.Append("
    ");