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..48188e68e 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 @@ -365,7 +365,7 @@ Partial Class AC_RegNomina Dim CtaCliente As Integer = 634 ' Municipio de hermosillo - Dim CvePresupuestoIngreso As Integer = 195 ' 2015: 12, 2016: 152, 2017: 160, 2018: 183 + Dim CvePresupuestoIngreso As Integer = 214 ' 2015: 12, 2016: 152, 2017: 160, 2018: 183, 2019: 195 Dim CtaPuente As Integer = 1774 ' INGRESO RECAUDADO PARA NOMINA EN MUNICIPIO, fijo Dim CtaServiciosPersonales As Integer = 1778 ' 2111 -- fijo Dim IdCtaPersonal As Integer = 0 @@ -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/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb index c74216334..b5e500e31 100644 --- a/AF/CatAF.aspx.vb +++ b/AF/CatAF.aspx.vb @@ -87,8 +87,8 @@ Partial Class AF_CatAF DdlEstatus.DataSource = GlobalDTEstadoActivoFijo DdlEstatus.DataBind() DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1")) - CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto) + GvDatos.Columns(7).HeaderText = LblSubProyecto.Text DivProyecto.Visible = LblProyecto.Visible DivProyectoDdl.Visible = LblProyecto.Visible 'DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.CveEmpresa) diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index 6c4ae3256..ccccd30a6 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -302,6 +302,7 @@ Public Class CFDIConceptos Public Property ValorUnitario As Decimal = 0.00D Public Property Importe As Decimal = 0.00D Public Property CuentaPredial As String = "" + Public Property NumeroPedimento As String = "" Public Property ClaveProdServ As String = "" Public Property ClaveUnidad As String = "" Public Property Impuestos As List(Of CFDIConceptosImpuestos) diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index c795ada73..b4ce6e00d 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 @@ -1452,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 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/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/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/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 551593b30..6abe367d1 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2743,8 +2743,355 @@ 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 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 + + 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, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Integer + + Dim Retorno As Integer = -1 + + 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("@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 = 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 + + 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 + +#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 Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 531cadc14..b9cd948c1 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1453,21 +1453,39 @@ 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 + + If CveEmpresa > 0 Then + Application(AppNombre) = ObjBancos.DtResultados.FiltraParametros($"CveEmpresa = { CveEmpresa }") + Else + Application(AppNombre) = ObjBancos.DtResultados + End If + + 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 +2849,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 +2874,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 @@ -4100,6 +4138,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 @@ -4551,6 +4590,10 @@ 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) + PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), 762) + PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), 763) #End Region #Region "Planeacion" 'PLANEACIÓN @@ -8040,7 +8083,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 @@ -8063,15 +8106,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/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 diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 5e08bcb3a..f53ee3502 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 @@ -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) @@ -7165,37 +7173,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 +8478,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 +8531,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/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 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 b/Bancos/RepProgramarRecursos.aspx index e7232caa1..e458a4947 100644 --- a/Bancos/RepProgramarRecursos.aspx +++ b/Bancos/RepProgramarRecursos.aspx @@ -118,7 +118,7 @@ Proyecto: -
Aplica NC:
+
Aplica NC/Dev:
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/RepProveedoresPagos.aspx b/Bancos/RepProveedoresPagos.aspx index d0fec1b56..7b1be4aa2 100644 --- a/Bancos/RepProveedoresPagos.aspx +++ b/Bancos/RepProveedoresPagos.aspx @@ -137,7 +137,7 @@
-
Aplica NC:
+
Aplica NC/Dev:
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/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx new file mode 100644 index 000000000..c1f4a738e --- /dev/null +++ b/Compras/CatTipoGasto.aspx @@ -0,0 +1,76 @@ +<%@ 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 Tipo Gasto + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs new file mode 100644 index 000000000..4ffb4c9b7 --- /dev/null +++ b/Compras/CatTipoGasto.aspx.cs @@ -0,0 +1,103 @@ +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() + { + ClsCompras ObjCompras = new ClsCompras(); + if (ObjCompras.GetTipoGasto(-1,UsuarioActual.CveEmpresa)) + { + GvDatos.DataSource = ObjCompras.DtResultados; + GvDatos.DataBind(); + } + ObjCompras.Dispose(); + } + + protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e) + { + BtnAgregarTipoGasto.Text = "Agregar"; + TxtTipoGasto.Text = ""; + ChkEstatus.Checked = true; + 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(); + 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"); + } + ObjCompras.Dispose(); + } + + protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e) + { + ClsCompras ObjCompras = new ClsCompras(); + if (BtnAgregarTipoGasto.Text == "Agregar") + { + if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,DateTime.Now.ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se agregó el Tipo de Gasto correctamente"); + } + }else + { + if (ObjCompras.UpdateTipoGasto(CveTipoGasto,TxtTipoGasto.Text,ChkEstatus.Checked,-1,-1)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se actualizó el Tipo de Gasto correctamente"); + } + } + ObjCompras.Dispose(); + } +} \ No newline at end of file diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index ded4e0c6f..7537d835a 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -682,7 +682,7 @@ - + <%-- 0 --%> @@ -2338,7 +2338,7 @@ - + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index ffdea1526..7fce911ba 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 @@ -1511,6 +1511,8 @@ Partial Class Compras_Compras CargaFletesAgregados() End If + + InicializaOC() 'Valida si el IVA del XML es está bien calculado @@ -2396,6 +2398,8 @@ Partial Class Compras_Compras EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero DdlTipoCompra.SelectedValueExist(dr("CveTipoCompra")) CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero + + ChkEsNoDeducible.Checked = Boolean.Parse(dr("NoDeducible").ToString) 'Select Case dr("PorcentajeIVA").ToString.ToDouble ' Case 0 ' DdlIVA.SelectedValue = "1" @@ -2504,7 +2508,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")) @@ -2620,6 +2624,7 @@ Partial Class Compras_Compras TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) TmpDT.Columns.Add("CveContrato", GetType(Integer)) + TmpDT.Columns.Add("DifPSSat", GetType(Integer)) @@ -3612,6 +3617,7 @@ Partial Class Compras_Compras tPSCodigo = String.Format("{1} - {0}", ValorXML(node, "descripcion").ToUpper.Trim.Replace(vbCrLf, " ").Replace(vbLf, " ").Replace("'", "''"), ValorXML(node, "noIdentificacion").Trim) End If + 'Alert(ValorXML(node, "ClaveProdServ").Trim) If Version = "3.3" Then If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then @@ -3721,6 +3727,8 @@ Partial Class Compras_Compras 'AGREGA A TMPDT AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CveSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS) + + Next End If @@ -4360,7 +4368,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 +4386,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 @@ -4484,6 +4492,17 @@ Partial Class Compras_Compras 'si el registro es manual, toma el mismo dato If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal + For Each GvRow As GridViewRow In GvPS.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + + If GvRow.FCCheckBox("ChkEsNoDeduciblePS").Checked = False Then + EsNoDeducible = False + Exit For + End If + + End If + Next + 'Compra If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble, LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble, @@ -7385,21 +7404,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 @@ -10753,6 +10774,14 @@ Partial Class Compras_Compras End If + + If e.Row.DataKey("DifPSSat").ToEntero = 1 Then + '#e35b5a + e.Row.BackColor = Drawing.Color.FromArgb(1, 227, 91, 90) + e.Row.Attributes.Add("data-toggle", "tooltip") + e.Row.Attributes.Add("title", "El código del producto del SAT no es igual al código del producto registrado.") + End If + End If End Sub Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting @@ -11016,6 +11045,8 @@ Partial Class Compras_Compras TmpDT.Columns.Add("ImporteConImpuestos", GetType(Double)) TmpDT.Columns.Add("NoDeducible", GetType(Boolean)) + TmpDT.Columns.Add("DifPSSat", GetType(Integer)) + TmpDTOriginal = New DataTable TmpDTOriginal.Columns.Add("Consec", GetType(Integer)) TmpDTOriginal.Columns.Add("Cantidad", GetType(Decimal)) @@ -11714,12 +11745,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 +12528,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 +12555,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 +13601,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 @@ -17357,7 +17388,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 +19723,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/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index b55948612..1c4f06b5f 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 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/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/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/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; + } } } 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 @@ + + + + diff --git a/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs index 97e830f06..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("
    "); @@ -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..bddef6c59 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(); @@ -1105,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("
    "); @@ -1115,18 +1120,18 @@ 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("
    "); 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/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/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx index ac203fa05..4fc1c050d 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx +++ b/Inventarios/AjustesSeccionAlmacen.aspx @@ -56,7 +56,8 @@ - + + @@ -64,7 +65,7 @@ - + diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 191beda8c..726db4464 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) @@ -74,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 @@ -81,7 +84,10 @@ 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 + 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 @@ -106,7 +112,7 @@ 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() @@ -115,6 +121,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen '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 @@ -130,11 +139,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 @@ -216,7 +226,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 +277,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 +288,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 +306,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 @@ -313,13 +326,13 @@ 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 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() @@ -327,6 +340,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 @@ -350,6 +370,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 @@ -362,13 +385,22 @@ Partial Class Inventarios_AjustesSeccionAlmacen End If Else ErrorMovInv = True - RowNoEncontrados.AppendFormat("{0},", Codigo) + End If + + If RowExistencia Is Nothing Then + ExistenciasNoEncontradas.AppendFormat("{0} - S:{1}
    ", Codigo, Serie) + 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 +415,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) diff --git a/Inventarios/Apartados.aspx b/Inventarios/Apartados.aspx index 36a17a7c0..b146d2360 100644 --- a/Inventarios/Apartados.aspx +++ b/Inventarios/Apartados.aspx @@ -227,7 +227,7 @@ - + @@ -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 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) diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 9a90ffba9..7d192b3dd 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" %> @@ -1048,7 +1049,9 @@
    - <%----%> + + +
    @@ -1061,6 +1064,19 @@ + + + + + + + + + + + + + @@ -1167,7 +1183,7 @@ - + @@ -1259,7 +1275,7 @@ - + @@ -1423,7 +1439,7 @@
    - +
    @@ -2021,7 +2035,12 @@ + +
    + +
    +
    diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index fea9eb9c6..523be0307 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 @@ -695,20 +726,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 @@ -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/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/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx new file mode 100644 index 000000000..d5af82e6c --- /dev/null +++ b/OI/DocumentoDetalle.aspx @@ -0,0 +1,131 @@ +<%@ 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 +
  • --%> +
    +
    +
    + + + +
    +
    + + +
    +
    + + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + + +
    + + +
    +
    +

    +
    + " 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"> +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    + + diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs new file mode 100644 index 000000000..0c35f9eb6 --- /dev/null +++ b/OI/DocumentoDetalle.aspx.cs @@ -0,0 +1,376 @@ +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; +using System.IO; +using System.Text; + +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; + } + } + + private string ArchivoAdjuntoNombre + { + get + { + return ViewState["ArchivoAdjuntoNombre"].ToString(); + } + + set + { + ViewState["ArchivoAdjuntoNombre"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Cargar(); + } + } + #region "CARGAS" + private void CargarCveDocumento() + { + string CveDocumentoAux = Page.Request["CveDocumento"]; + if (CveDocumentoAux != null) + { + this.CveDocumento = CveDocumentoAux.ToEntero(); + } + else + { + this.CveDocumento = -1; + } + } + + 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); + 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(); + + ArchivoAdjuntoNombre = Documento["ArchivoFisico"].ToString(); + string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_'); + string ArchivoAdjunto = ArchivoAux[1]; + LkbDescargarArchivo.Text = ArchivoAdjunto; + DivDescargarArchivo.Visible = true; + } + } + 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(); + CargarMensajeNuevoEditado(); + } + } + #endregion + + #region "GENERAR DOCUMENTO" + + + 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"; + 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) { 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(); + 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 + { + ObjOI.RollBack(); + Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError); + 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 guardar 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 if (RutaArchivo == "Error") + { + TieneError = true; + this.ErrorMensaje = "Hubo un error al guardar el archivo"; + } + return RutaArchivo; + } + + 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) + { + 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; + } + else + { + CorreosReturn.AppendFormat("{0},", GvRow.DataKey("Correo")); + } + } + } + + return CorreosReturn.ToString(); + } + #endregion + + #region "ARCHIVO ADJUNTO" + + 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}", 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 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); + + 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 + + #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 new file mode 100644 index 000000000..818d0df70 --- /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 + + + + +
  • + +
  • +
  • + Imprimir PDF +
  • +
  • + Imprimir Excel +
  • +
    +
    +
    + + + + + + + + + + + <%----%> + + + + + + + + + diff --git a/OI/Documentos.aspx.cs b/OI/Documentos.aspx.cs new file mode 100644 index 000000000..2f162df73 --- /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.ListadoDocumentos(UsuarioActual.CveEmpresa)) + { + GvDatos.DataSource = ObjOI.DtResultados; + GvDatos.DataBind(); + } + ObjOI.Dispose(); + } +} \ No newline at end of file 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 d17ec4cc3..c2dd24273 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 + diff --git a/RH/CatCursos.aspx.vb b/RH/CatCursos.aspx.vb index 80c664944..cf3b85c55 100644 --- a/RH/CatCursos.aspx.vb +++ b/RH/CatCursos.aspx.vb @@ -329,7 +329,7 @@ Partial Class RH_CatCursos Dim Archivo As String = $"Empresas/{UsuarioActual.CveEmpresa}/Formatos/CursosInvitados.rdlc" - If Not File.Exists($"{Server.MapPath("~")}/{Archivo}") Then + If Not File.Exists($"{Extensiones.DirectorioBaseEmpresas}/{Archivo}") Then Archivo = "Empresas/Grales/Formatos/CursosInvitados.rdlc" End If @@ -613,7 +613,7 @@ Partial Class RH_CatCursos Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim objConstancias As New ClsConstancias Dim DocumenBitArray As Byte() = Nothing - Dim RutaBase As String = Server.MapPath("~") + Dim RutaBase As String = Extensiones.DirectorioBaseEmpresas Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero @@ -650,7 +650,7 @@ Partial Class RH_CatCursos Dim Contenido As String = "Buen día. Estimado(a) " & _Nombres & vbLf & vbLf & vbLf & vbLf & " Por medio de la presente, el departamento de Capital Humano de esta " & UsuarioActual.Empresa.Empresa & " le hace la cordial invitación para asistir al curso " & _Curso & " impartido por el capacitador " & _Capacitador & ", el día " & dia & " de " & mesArray(mes - 1) & " de " & año & " en lugar " & _Ubicacion & "." & vbLf & vbLf & vbLf & vbLf & "Esperamos contar con su asistencia." If Not File.Exists(RutaArchivo) Then - RutaArchivo = $"{Server.MapPath("~")}\Empresas\Grales\Formatos\CursoInvitacion.docx" + RutaArchivo = $"{ Extensiones.DirectorioBaseEmpresas }\Empresas\Grales\Formatos\CursoInvitacion.docx" End If Dim params As New List(Of ReportParameter) @@ -658,24 +658,22 @@ Partial Class RH_CatCursos params.Add(New ReportParameter("Contenido", Contenido)) params.Add(New ReportParameter("Fecha", Today.ToString)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - Dim DtDatos As New DataTable - Return StreamPDF("Empresas/72/Formatos/CursoInvitacion.rdlc", DtDatos, params, "Invitación a curso", "PDF") - - 'Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo) - 'Dim Tags As New List(Of TagsDocumentos) + Dim DtDatos As New DataTable + + + Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo) + Dim Tags As New List(Of TagsDocumentos) + Tags.Add(New TagsDocumentos("{Curso}", _Curso)) + Tags.Add(New TagsDocumentos("{Contenido}", Contenido)) + + + objGemBoxDocument.SustituirTags(Tags) + objGemBoxDocument.GuardarStreamPDF() - 'Tags.Add(New TagsDocumentos("{Curso}", _Curso)) - 'Tags.Add(New TagsDocumentos("{Contenido}", Contenido)) - - ''objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0) - 'objGemBoxDocument.SustituirTags(Tags) - 'objGemBoxDocument.GuardarStream() - - - 'Return objGemBoxDocument.GetBytesDocumento + Return objGemBoxDocument.GetBytesDocumento End Function @@ -795,12 +793,9 @@ Partial Class RH_CatCursos ContenidoSB.AppendLine("") ContenidoSB.AppendLine("") - - - - Dim BytesDocumento As Byte() = GenerarImvitacion(_Curso, _Capacitador, _Nombres, _CvePersonal, _Fecha, _Ubicacion) - MandaCorreo("Invitación a Curso " & Curso, _Correo, "", ContenidoSB.ToString, BytesDocumento) - + Dim BytesDocumento As Byte() = GenerarImvitacion(_Curso, _Capacitador, _Nombres, _CvePersonal, _Fecha, _Ubicacion) + MandaCorreo("Invitación a Curso " & Curso, _Correo, "", ContenidoSB.ToString, BytesDocumento) + Contador = Contador + 1 Dim valor As Boolean = False diff --git a/RH/CatPersonal.aspx b/RH/CatPersonal.aspx index 4da8a219d..7f100829f 100644 --- a/RH/CatPersonal.aspx +++ b/RH/CatPersonal.aspx @@ -57,14 +57,10 @@
  • - Imprimir -
  • - -
  • - Imprimir + Descargar PDF
  • - Excel + Descargar Excel
  • Personalizar @@ -389,7 +385,6 @@   - Puesto @@ -434,7 +429,7 @@ - SubProyecto + <%--SubProyecto--%>   diff --git a/RH/CatPersonal.aspx.vb b/RH/CatPersonal.aspx.vb index 7bfcaf70e..c915c826e 100644 --- a/RH/CatPersonal.aspx.vb +++ b/RH/CatPersonal.aspx.vb @@ -190,12 +190,12 @@ Partial Class RH_CatPersonal DdlEstatusPersonal.DataBind() End Sub Private Sub CargaProyecto() - DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1) - DdlProyectoAsignado.DataBind() + 'DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1) + 'DdlProyectoAsignado.DataBind() CargaTipoCentroCosto() - If DivProyecto.Visible Then - CargaSubProyectos() - End If + 'If DivProyecto.Visible Then + ' CargaSubProyectos() + 'End If End Sub Private Sub CargaSubProyectos() @@ -214,34 +214,10 @@ Partial Class RH_CatPersonal End Sub Private Sub CargaTipoCentroCosto() - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - DdlSubProyectoAsignado.Items.Clear() - DivProyecto.Visible = False - LblProyecto.Visible = False - LblSubProyecto.Text = "Sucursal:" - - DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyectoAsignado.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyectoAsignado.Items.Clear() - DivProyecto.Visible = False - LblProyecto.Visible = False - LblSubProyecto.Text = "Proyecto:" - - DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyectoAsignado.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.Text = "Sucursal:" - LblSubProyecto.Text = "Proyecto:" - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - LblProyecto.Text = "Proyecto:" - LblSubProyecto.Text = "Sucursal:" - End If + CargarCentrosDeCosto(DdlProyectoAsignado, DdlSubProyectoAsignado, LblProyecto, LblSubProyecto) + DivProyecto.Visible = LblProyecto.Visible + ChkSubProyecto.Text = LblSubProyecto.Text + GvDatos.Columns(12).HeaderText = LblSubProyecto.Text End Sub Private Sub CargaSupervisores() diff --git a/RH/Personal.aspx b/RH/Personal.aspx index ca03ca3c4..9dce78f67 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -568,20 +568,20 @@ -
    +
    + Proyecto: <%-- --%> -
    + SubProyecto: -
    <%--
    @@ -1523,10 +1523,10 @@ - - - - + + + +
    @@ -1602,8 +1602,8 @@ - - + + @@ -3538,7 +3538,7 @@ @@ -4614,7 +4614,7 @@ - +