diff --git a/AC/RegDevengadoIngresos.aspx.vb b/AC/RegDevengadoIngresos.aspx.vb index 67cdfeec5..ea4ca5fc8 100644 --- a/AC/RegDevengadoIngresos.aspx.vb +++ b/AC/RegDevengadoIngresos.aspx.vb @@ -24,7 +24,7 @@ Partial Class AC_RegDevengadoIngresos End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'If CveMoneda > 0 Then ' dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) diff --git a/AC/RegNomina.aspx.vb b/AC/RegNomina.aspx.vb index ddfa77da1..e1dd07a3b 100644 --- a/AC/RegNomina.aspx.vb +++ b/AC/RegNomina.aspx.vb @@ -296,7 +296,7 @@ Partial Class AC_RegNomina DdlNominaPersonal.DataBind() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas DdlCuenta.DataSource = dt DdlCuenta.DataBind() TbIE.Visible = True @@ -385,7 +385,7 @@ Partial Class AC_RegNomina If Seleccion.Contiene("3", "4") Then Dim dr As DataRow - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then 'DdlMoneda.SelectedValue = dr("CveMoneda").ToString IdCtaBancaria = dr("IdCtaContable").ToString.ToEntero diff --git a/AC/RegRecaudado.aspx.vb b/AC/RegRecaudado.aspx.vb index 8988a86be..de95a10d1 100644 --- a/AC/RegRecaudado.aspx.vb +++ b/AC/RegRecaudado.aspx.vb @@ -28,7 +28,7 @@ Partial Class AC_RegRecaudado End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'If CveMoneda > 0 Then ' dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -137,7 +137,7 @@ Partial Class AC_RegRecaudado Dim IdCtaConCuentaBancaria As Integer = 0 - Dim drcb As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero).FiltroPrimero("") + Dim drcb As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("") If drcb IsNot Nothing Then IdCtaConCuentaBancaria = drcb("IdCtaContable").ToString.ToEntero End If diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index c795ada73..49c81b77f 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1404,7 +1404,7 @@ Public Class ClsBancos NotificarA As String, EsAbonoEnCuenta As Boolean, AplicaImpuestos As Boolean, IDPoliza As Integer, CvePrePoliza As Integer, Comprobante As String, CveUsuario As Integer, CveEmpresa As Integer, Optional CveCuentaDeposito As Integer = -1, Optional PagoElectronico As String = "-1", Optional CveEstatusIE As Integer = 1, Optional CveCuentaTarjeta As Integer = -1, Optional Referencia As String = "-1", Optional CveIESustitucion As Integer = -1, Optional CveCorte As Integer = -1, Optional CveProveedorIntermediario As Integer = -1, Optional FueConciliado As Boolean = False, - Optional MesesSinIntereses As Integer = -1, Optional Modulo As String = "", Optional ConceptoCIE As String = "") As Integer + Optional MesesSinIntereses As Integer = -1, Optional Modulo As String = "", Optional ConceptoCIE As String = "", Optional CveOCAnticipo As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Banc_IEAdd") @@ -1444,6 +1444,7 @@ Public Class ClsBancos .Add("@CveIE", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@FolioRegistro", SqlDbType.VarChar, 50).Direction = ParameterDirection.Output .Add("@Modulo", SqlDbType.VarChar).Value = Modulo + .Add("@CveOCAnticipo", SqlDbType.Int).Value = CveOCAnticipo End With Try diff --git a/App_Code/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/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 531cadc14..826659d4d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1453,21 +1453,33 @@ Public Class ClsPaginas ' Application("GlobalDTBancosCuentas") = value ' End Set 'End Property - Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1) As DataTable + Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1) As DataTable Get + Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancosCuentasUsuarios(-1) Then + Application(AppNombre) = ObjBancos.DtResultados + Else + Application(AppNombre) = Nothing + End If + ObjBancos.Dispose() + End If Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa) If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario = {1}", Str, CveUsuario) If CveCuenta > -1 Then Str = String.Format("{0} AND CveCuenta = {1}", Str, CveCuenta) If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo")) - Dim Dv As New DataView(DirectCast(Application("GlobalDTBancosCuentas"), DataTable), Str, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str, "", DataViewRowState.CurrentRows) GlobalDTBancosCuentas = Dv.ToTable Dv.Dispose() 'GlobalDTBancosCuentas = DirectCast(Application("GlobalDTBancosCuentas"), DataTable) End Get Set(value As DataTable) - Application("GlobalDTBancosCuentas") = value + Dim AppNombre As String = String.Format("GlobalDTBancosCuentas-{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property Property GlobalDTTipoTransacciones() As DataTable @@ -2831,6 +2843,22 @@ Public Class ClsPaginas End Property Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable Get + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + Application(AppNombre) = ObjOC.DtResultados + Else + Application(AppNombre) = Nothing + End If + + ObjOC.Dispose() + + End If + If CveEmpresa <> -1 Then Dim filtro As New StringBuilder filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) @@ -2840,15 +2868,19 @@ Public Class ClsPaginas If Tipo <> "" Then filtro.AppendFormat(" AND Tipo='{0}'", Tipo) End If - Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) GlobalDTOCEstatusUsuarios = Dv.ToTable Dv.Dispose() + Else - GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) + GlobalDTOCEstatusUsuarios = DirectCast(Application(AppNombre), DataTable) End If + + End Get Set(value As DataTable) - Application("GlobalDTOCEstatusUsuarios") = value + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property @@ -4100,6 +4132,7 @@ Public Class ClsPaginas PaginaDict.Add("/OI/Circular.aspx".ToUpper(), 756) PaginaDict.Add("/OI/CircularDetalle.aspx".ToUpper(), 757) PaginaDict.Add("/OI/CircularDetalleB.aspx".ToUpper(), 757) + PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759) #End Region diff --git a/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/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index 06a0be6c8..5ab24ec65 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -3278,30 +3278,72 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOCEstatus") = value End Set - End Property - Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable - Get - If CveEmpresa <> -1 Then - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) - End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value - End Set End Property + Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + Get + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing + End If + + ObjOC.Dispose() + + End If + + Dim filtro As New StringBuilder + filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + If CveUsuario > 0 Then + filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + End If + If Tipo <> "" Then + filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + End If + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTOCEstatusUsuarios = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + + + + + + 'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim filtro As New StringBuilder + ' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + ' If CveUsuario > 0 Then + ' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + ' End If + ' If Tipo <> "" Then + ' filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + ' End If + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTOCEstatusUsuarios = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value + ' End Set + 'End Property + #End Region diff --git a/Bancos/CIF.aspx.vb b/Bancos/CIF.aspx.vb index 81ed903e1..2bcbfe125 100644 --- a/Bancos/CIF.aspx.vb +++ b/Bancos/CIF.aspx.vb @@ -9,7 +9,7 @@ Partial Class Bancos_CIF Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then - DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentas.DataBind() 'DdlCuentas.Items.Insert(0, New ListItem("Seleccione una Cuenta", "-1")) @@ -29,7 +29,7 @@ Partial Class Bancos_CIF Dim ObjBancos As New ClsBancos Dim ObjMov As New ClsContabilidad(ObjBancos.IniciaTransacSQL) Dim Importe As Double = TxtImporte.Text.ToDouble - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() Dim ErrorTransaccion As Boolean = False Dim Folio As String = ObjBancos.GetNextFolio(DdlCuentas.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero).ToString Dim CvePrePoliza As Integer diff --git a/Bancos/CargarConciliacionesBancarias.aspx.vb b/Bancos/CargarConciliacionesBancarias.aspx.vb index 27ab10ceb..8fe358133 100644 --- a/Bancos/CargarConciliacionesBancarias.aspx.vb +++ b/Bancos/CargarConciliacionesBancarias.aspx.vb @@ -41,11 +41,11 @@ Partial Class Bancos_CargarConciliacionesBancarias Private Sub InicializaValores() 'Cargar Cuentas - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuenta.DataBind() - DdlCuentaModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentaModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentaModal.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCuentaModal.DataBind() diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb index c8957ee63..62f9142a4 100644 --- a/Bancos/ConciliacionesBancarias.aspx.vb +++ b/Bancos/ConciliacionesBancarias.aspx.vb @@ -74,7 +74,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx Private Sub InicializaValores() 'Cargar Cuentas - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuenta.DataBind() @@ -627,13 +627,13 @@ Partial Class Bancos_ConciliacionesBancariasaspx If DdlCuenta.SelectedValue.ToEntero > 0 Then Dim CveCuenta As Integer = 0 Dim CveCuentaComplementaria As Integer = 0 - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("CveMoneda").ToString.ToEntero + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("CveMoneda").ToString.ToEntero Dim ObjConta As New ClsContabilidad If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContable").ToString}").Rows.Count > 0 Then - CveCuenta = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContable").ToString}").Rows(0)("CveCuenta").ToString.ToEntero + CveCuenta = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContable").ToString}").Rows(0)("CveCuenta").ToString.ToEntero If CveMoneda > 1 Then - CveCuentaComplementaria = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContableComplementaria").ToString}").Rows(0)("CveCuenta").ToString.ToEntero + CveCuentaComplementaria = ObjConta.DtResultados.FiltraParametros($"IdCompaq = {GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)("IdCtaContableComplementaria").ToString}").Rows(0)("CveCuenta").ToString.ToEntero End If End If End If diff --git a/Bancos/Creditos.aspx.vb b/Bancos/Creditos.aspx.vb index 00b8d2425..437d9c1de 100644 --- a/Bancos/Creditos.aspx.vb +++ b/Bancos/Creditos.aspx.vb @@ -174,7 +174,7 @@ Partial Class Bancos_Creditos DdlCSTipoMoneda.DataBind() 'Carga CuentasBancarias para CuentaCredito y CuentaDeposito - DtCuentasBancarias = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DtCuentasBancarias = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) CargaCuentasDeposito() End Sub diff --git a/Bancos/CreditosPagoMultiple.aspx.vb b/Bancos/CreditosPagoMultiple.aspx.vb index 70a1873b4..3389cd8d3 100644 --- a/Bancos/CreditosPagoMultiple.aspx.vb +++ b/Bancos/CreditosPagoMultiple.aspx.vb @@ -69,7 +69,7 @@ Partial Class Bancos_CreditosPagoMultiple Private Sub CargaCuentas(tTipoTransaccion As Integer) DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If CveMoneda > 0 Then dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -137,7 +137,7 @@ Partial Class Bancos_CreditosPagoMultiple Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero diff --git a/Bancos/CuentasBancarias.aspx.vb b/Bancos/CuentasBancarias.aspx.vb index 6d32e50af..0726942d5 100644 --- a/Bancos/CuentasBancarias.aspx.vb +++ b/Bancos/CuentasBancarias.aspx.vb @@ -62,17 +62,22 @@ Partial Class Bancos_CuentasBancarias Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting Dim ObjBancos As New ClsBancos + If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - If ObjBancos.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados - End If - + DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados + 'End If + Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion) End If + ObjBancos.Dispose() If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb index 698e4aab8..2b4c1f02f 100644 --- a/Bancos/CuentasBancariasDetalle.aspx.vb +++ b/Bancos/CuentasBancariasDetalle.aspx.vb @@ -203,12 +203,13 @@ Partial Class Bancos_CuentasBancariasDetalle End If Next - If Not ErrorUsuarios Then - If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjCuentasBancariasDetalle.DtResultados - Else - ErrorUsuarios = True - End If + If Not ErrorUsuarios Then + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjCuentasBancariasDetalle.DtResultados + 'Else + ' ErrorUsuarios = True + 'End If End If End If @@ -221,11 +222,12 @@ Partial Class Bancos_CuentasBancariasDetalle Else If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble, DDlCuentaContable.SelectedValue.ToEntero, DdlCuentaContableComplementaria.SelectedValue.ToEntero, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text, ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked) Then 'CargaDatos() - If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjCuentasBancariasDetalle.DtResultados - Else - ErrorUsuarios = True - End If + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjCuentasBancariasDetalle.DtResultados + 'Else + ' ErrorUsuarios = True + 'End If UpDatos.Update() Else ErrorUsuarios = True @@ -322,9 +324,10 @@ Partial Class Bancos_CuentasBancariasDetalle If Obj.AddBancosCuentasUsuarios(CveCuenta, DdlUsuarios.SelectedValue.ToEntero) Then DTUsuarios = Obj.DtResultados GVU.DataSource = Obj.DtResultados - If Obj.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = Obj.DtResultados - End If + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If Obj.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Obj.DtResultados + 'End If End If Else If DTUsuarios.FiltraParametros(String.Format("CveUsuario = {0}", DdlUsuarios.SelectedValue.ToString)).Rows.Count > 0 Then @@ -377,9 +380,10 @@ Partial Class Bancos_CuentasBancariasDetalle GVU.EditIndex = -1 DTUsuarios = ObjBancos.DtResultados GVU.DataSource = ObjBancos.DtResultados - If ObjBancos.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados - End If + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then + ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados + 'End If Alert("El usuario se eliminó correctamente.", TipoMensaje.MsgInformacion) End If Else diff --git a/Bancos/DepositoTerminal.aspx.vb b/Bancos/DepositoTerminal.aspx.vb index 88a929585..210c6c88e 100644 --- a/Bancos/DepositoTerminal.aspx.vb +++ b/Bancos/DepositoTerminal.aspx.vb @@ -137,8 +137,8 @@ Partial Class Bancos_DepositoTerminal #Region "CARGA COMBOS" Private Sub CargaCuentas() - DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) - DdlCuentaTerminal.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaTerminal.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones().FiltraParametros("CveTipoTransaccion in (11,12)") DdlCuentaDeposito.DataBind() @@ -149,7 +149,7 @@ Partial Class Bancos_DepositoTerminal End Sub Private Sub DdlCuentaSelectIndexChange() - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) If dr IsNot Nothing Then IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero @@ -233,7 +233,8 @@ Partial Class Bancos_DepositoTerminal Dim CveCuentaBancariaDestino As Integer = 0 Dim IDPoliza As Integer = 0 Dim FolioPoliza As String = "" - Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") + Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa +).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") Dim MsgError As String = "" If drDestino IsNot Nothing Then diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 71e9a4b23..d11da1c2f 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -24,10 +24,10 @@ Partial Class Bancos_DepositosCaja End Sub Private Sub CargaCuentas() - DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentaDeposito.DataBind() - DdlCajaChica.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCajaChica.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCajaChica.DataBind() End Sub @@ -80,8 +80,8 @@ Partial Class Bancos_DepositosCaja Dim IdCuentaBancariaDestino As Integer = 0 Dim CveCuentaBancariaOrigen As Integer = 0 Dim CveCuentaBancariaDestino As Integer = 0 - Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero($"CveCuenta = {DdlCajaChica.SelectedValue}") - Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") + Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero($"CveCuenta = {DdlCajaChica.SelectedValue}") + Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero($"CveCuenta = {DdlCuentaDeposito.SelectedValue}") If drOrigen IsNot Nothing Then CveMoneda = drOrigen("CveMoneda").ToString.ToEntero diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index da3d4ae99..991e48ded 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -114,7 +114,7 @@ public partial class Bancos_Devoluciones : ClsPaginas } protected void CargaCuentas() { - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuenta.Items.Insert(0, new ListItem("Seleccione Cuenta", "-1")); } @@ -158,7 +158,7 @@ public partial class Bancos_Devoluciones : ClsPaginas protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { int idcuenta; - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); IDCtaContableBancos = idcuenta; long Folio; @@ -332,7 +332,7 @@ public partial class Bancos_Devoluciones : ClsPaginas int CveConceptoContableDevolucion = 0; int CvePlantillaPoliza = 0; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; int cveProveedor = (DdlProveedores.SelectedValue.ToEntero() > 0) ? DdlProveedores.SelectedValue.ToEntero() : -1; diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 14d3f041a..fce9a37a2 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -289,14 +289,38 @@ Partial Class Bancos_IE ViewState("CveMoneda") = value End Set End Property + Private Property CveOCSolicitudAnticipo As Integer Get - Return ViewState("CveOCSolicitudAnticipo").ToString.ToEntero + + If ViewState("CveOCSolicitudAnticipo") Is Nothing Then + Return -1 + Else + Return ViewState("CveOCSolicitudAnticipo").ToString.ToEntero + End If + End Get Set(value As Integer) ViewState("CveOCSolicitudAnticipo") = value End Set End Property + + Private Property SaldoOCAnticipo As Decimal + Get + If ViewState("SaldoOCAnticipo") Is Nothing Then + Return -1 + Else + Return ViewState("SaldoOCAnticipo").ToString.ToDecimal + End If + + End Get + Set(value As Decimal) + ViewState("SaldoOCAnticipo") = value + End Set + End Property + + + Private Property EstaContabilizado As Boolean Get Return CBool(ViewState("EstaContabilizado")) @@ -1561,7 +1585,7 @@ Partial Class Bancos_IE Banco.Dispose() TxtFolio.Text = Folio.ToString - Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If drI IsNot Nothing Then CargaNotas(drI("CveMoneda").ToString.ToEntero) @@ -1574,7 +1598,7 @@ Partial Class Bancos_IE TxtFolio.Text = "" End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then @@ -1741,9 +1765,9 @@ Partial Class Bancos_IE Dim dt As DataTable If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Else - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas End If @@ -2441,7 +2465,19 @@ Partial Class Bancos_IE EsValido = False End If End If - Dep.Dispose() + Dep.Dispose() + + + + 'If CveOCSolicitudAnticipo > 0 Then + ' If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then + + ' EsValido = False + ' Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) + + ' End If + 'End If + Return EsValido End Function @@ -2457,9 +2493,6 @@ Partial Class Bancos_IE Exit Sub End If - - - Dim ObjIE As New ClsBancos() Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) @@ -2477,8 +2510,9 @@ Partial Class Bancos_IE Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" Dim Msg As New StringBuilder - If CveIE = -1 Then - + If CveIE = -1 Then + + Dim CveCuentaDeposito As Integer = 0 If DdlCuentaDeposito.Items.Count > 0 Then CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero @@ -2654,7 +2688,7 @@ Partial Class Bancos_IE CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), - ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte) + ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte, CveOCAnticipo:=CveOCSolicitudAnticipo) If CveIE > 0 Then @@ -5405,19 +5439,45 @@ Partial Class Bancos_IE Private Sub InicializaSolicitudAnticipoOC() If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then If Request("CveOC") IsNot Nothing AndAlso Request("CveOC").ToString.ToEntero > 0 Then + CveOCSolicitudAnticipo = Request("CveOC").ToString.ToEntero + TxtImporte.Enabled = False + End If End If If CveOCSolicitudAnticipo > 0 Then + Dim ObjOC As New ClsOC + + If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then + SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal + Else + SaldoOCAnticipo = 0 + End If + + + If ObjOC.GetSolicitudAnticipo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then + Dim DrOC = ObjOC.DtResultados.FiltroPrimero("") - If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) AndAlso DrOC("CveIEAnticipo").ToString = "" Then + + If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) Then TxtObservaciones.Text = DrOC("Descripcion").ToString - TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero - TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + If DrOC("ImporteAnticipo").ToString.ToDecimal > SaldoOCAnticipo Then + + 'TxtImporte.Text = SaldoOCAnticipo.ToString().FormatoNumero + 'TxtImporteLetra.Text = SaldoOCAnticipo.ToString().FormatoNumero.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + Alert($"El importe solcitado es superior al saldo de la compra, importe solicitado: {DrOC("ImporteAnticipo").ToString.FormatoNumero} saldo: {SaldoOCAnticipo.ToString().FormatoNumero }", TipoMensaje.MsgAdvertencia) + BtnGuardar.Enabled = False + Else + TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero + TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + End If + DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString CveMoneda = DrOC("CveMoneda").ToString.ToEntero CargaCuenta(DrOC("CveMoneda").ToString.ToEntero) @@ -5433,19 +5493,72 @@ Partial Class Bancos_IE End If CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero Else - If DrOC("CveIEAnticipo").ToString <> "" Then - Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError) - End If + 'If DrOC("CveIEAnticipo").ToString <> "" Then + ' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError) + 'End If + If DrOC("TipoTermino").ToString = "3" Then ' cuando es tipo rechazado + Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ha sido cancelada.", TipoMensaje.MsgError) + CveOCSolicitudAnticipo = -1 + BtnGuardar.Enabled = False + End If - CveOCSolicitudAnticipo = -1 - BtnGuardar.Enabled = False + End If Else Alert("Ocurrió un error al actualizar el estatus de anticipo de la OC/REQ. Por favor actualice y vuelva a intentar.", TipoMensaje.MsgError) End If + + + 'If ObjOC.GetSolicitudAnticipo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then + ' Dim DrOC = ObjOC.DtResultados.FiltroPrimero("") + ' If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) AndAlso DrOC("CveIEAnticipo").ToString = "" Then + ' TxtObservaciones.Text = DrOC("Descripcion").ToString + + ' If DrOC("ImporteAnticipo").ToString.ToDecimal > SaldoOCAnticipo Then + + ' 'TxtImporte.Text = SaldoOCAnticipo.ToString().FormatoNumero + ' 'TxtImporteLetra.Text = SaldoOCAnticipo.ToString().FormatoNumero.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + ' Alert($"El importe solcitado es superior al saldo de la compra, importe solicitado: {DrOC("ImporteAnticipo").ToString.FormatoNumero} saldo: {SaldoOCAnticipo.ToString().FormatoNumero } se cambio", TipoMensaje.MsgAdvertencia) + ' Else + ' TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero + ' TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + ' End If + + ' DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString + ' CveMoneda = DrOC("CveMoneda").ToString.ToEntero + ' CargaCuenta(DrOC("CveMoneda").ToString.ToEntero) + ' UpCuentaDeposito.Update() + ' If DrOC("CveProveedor").ToString.ToEntero > 0 Then + ' HdnCveProveedor.Value = DrOC("CveProveedor").ToString + ' RBL.SelectedValue = "P" + ' RBL_SelectedIndexChanged(RBL, Nothing) + ' DdlProveedores.SelectedValue = HdnCveProveedor.Value + ' DdlProveedores_selectedindexchange(DdlProveedores, Nothing) + ' DdlProveedores.SelectedText = RazonSocial + ' ' BuscaCargaProveedor() + ' End If + ' CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero + ' Else + ' If DrOC("CveIEAnticipo").ToString <> "" Then + ' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError) + ' End If + ' If DrOC("TipoTermino").ToString = "3" Then ' cuando es tipo rechazado + ' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ha sido cancelada.", TipoMensaje.MsgError) + ' End If + + ' CveOCSolicitudAnticipo = -1 + ' BtnGuardar.Enabled = False + ' End If + 'Else + ' Alert("Ocurrió un error al actualizar el estatus de anticipo de la OC/REQ. Por favor actualice y vuelva a intentar.", TipoMensaje.MsgError) + 'End If + + + ObjOC.Dispose() End If diff --git a/Bancos/IE2.aspx.vb b/Bancos/IE2.aspx.vb index dd2087068..e2e7f1477 100644 --- a/Bancos/IE2.aspx.vb +++ b/Bancos/IE2.aspx.vb @@ -617,7 +617,7 @@ Partial Class Bancos_IE End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then DdlMoneda.SelectedValue = dr("CveMoneda").ToString IDCtaContable = dr("IdCtaContable").ToString.ToEntero @@ -699,7 +699,7 @@ Partial Class Bancos_IE Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas 'If CveMoneda > 0 Then ' dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) diff --git a/Bancos/OtrosIE.aspx.vb b/Bancos/OtrosIE.aspx.vb index 613a8f020..7729de625 100644 --- a/Bancos/OtrosIE.aspx.vb +++ b/Bancos/OtrosIE.aspx.vb @@ -115,7 +115,7 @@ Partial Class Bancos_OtrosIE Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -144,7 +144,7 @@ Partial Class Bancos_OtrosIE TxtFolio.Text = "" End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero End If @@ -477,7 +477,7 @@ Partial Class Bancos_OtrosIE 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If DdlCuenta.SelectedValue.ToEntero > 0 Then - Dim DR As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) + Dim DR As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) If DR IsNot Nothing Then TxtImporte.Text = DTMovimientos.SUM("Abono", "IdCuenta =" & DR("IdCtaContable").ToString).ToString UPPDocumento.Update() @@ -490,7 +490,7 @@ Partial Class Bancos_OtrosIE Dim Retorno As Integer = 0 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If CveCuenta > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & CveCuenta) + Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & CveCuenta) If drr IsNot Nothing Then Retorno = drr("IdCtaContable").ToString.ToEntero End If diff --git a/Bancos/OtrosIngresos.aspx.vb b/Bancos/OtrosIngresos.aspx.vb index 4fa0e06c9..8e0730b19 100644 --- a/Bancos/OtrosIngresos.aspx.vb +++ b/Bancos/OtrosIngresos.aspx.vb @@ -23,7 +23,7 @@ Partial Class Bancos_OtrosIngresos Private Sub CargaCuentas() 'DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(1) + DdlCuenta.DataSource = GlobalDTBancosCuentas(1, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 34d0a9b14..cdcd5066d 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -159,8 +159,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas protected void CargaCuentas() { - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas - DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas + DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuentaPrestamo.DataBind(); @@ -184,7 +184,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas #region "PAGO ACREEDORES" protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); CveMonedaCuentaPago = 0; if (dr != null) { @@ -278,7 +278,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 21; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); @@ -617,7 +617,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas #region "PRESTAMO ACREEDORES" protected void DdlCuentaPrestamo_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); int tCveMoneda = 0; if (dr != null) { @@ -687,7 +687,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 45; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 6e56741cc..88424c2bd 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -213,8 +213,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas DdlCuenta.Items.Clear(); DdlCuentaPrestamo.Items.Clear(); - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas - DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas + DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuentaPrestamo.DataBind(); @@ -264,8 +264,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas protected void DdlCuentaPrestamo_SelectedIndexChanged(object sender, EventArgs e) { int idcuenta, idcuentaComp; - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuenta); - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuentaComp); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuenta); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)), out idcuentaComp); IDCtaContableBancosPrestamo = idcuenta; IDCtaContableBancosComplementariaPrestamo = idcuentaComp; @@ -276,7 +276,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas TxtFolioPrestamo.Text = Folio.ToString(); - CveMonedaPrestamo = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); + CveMonedaPrestamo = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); if (CveMonedaPrestamo == 2) { @@ -551,8 +551,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { int idcuenta, idcuentacomplementaria; - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); - Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuentacomplementaria); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuenta); + Int32.TryParse(get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableComplementaria", String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)), out idcuentacomplementaria); IDCtaContableBancos = idcuenta; IDCtaContableBancosComplementario = idcuentacomplementaria; @@ -562,7 +562,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas bancos.Dispose(); TxtFolio.Text = Folio.ToString(); - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); HdnMonPago.Value = CveMoneda.ToString(); if (CveMoneda == 2) { @@ -653,7 +653,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas int CveConceptoContablePagoComplementaria = 256; int CvePlantillaPoliza = 39; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; decimal tipoCambio = (TxtTCDolaresPago.Visible == true) ? TxtTCDolaresPago.Text.ToDecimal() : 1; diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index 9e4dcebc6..7374d32e0 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -190,11 +190,11 @@ Partial Class Bancos_PagoElectronico #Region " C A R G A - D A T O S " Private Sub CargaCuentas() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayout = 1") + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayout = 1") DdlCuenta.DataBind() UpFiltros.Update() - DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayout = 1") + DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayout = 1") DdlCuentaReportes.DataBind() UpFiltrosReporte.Update() End Sub diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 8ff8ceec9..94f711266 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -327,16 +327,16 @@ Partial Class Bancos_PagoElectronicoGrupos #Region " C A R G A - D A T O S " Private Sub CargaCuentas() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayoutGrupos = 1") DdlCuenta.DataBind() UpFiltros.Update() - DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") + DdlCuentaReportes.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayoutGrupos = 1") DdlCuentaReportes.DataBind() UpFiltrosReporte.Update() - DdlCuentaEnviados.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") + DdlCuentaEnviados.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("UsaLayoutGrupos = 1") DdlCuentaEnviados.DataBind() UpFiltroEnviados.Update() diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index 0a8276153..56533019e 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -213,7 +213,7 @@ Partial Class Bancos_PolizaCheque Private Sub CargaCuenta() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) @@ -296,7 +296,7 @@ Partial Class Bancos_PolizaCheque 'TxtFolio.Text = "" 'End If - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero End If @@ -868,7 +868,7 @@ Partial Class Bancos_PolizaCheque Dim ConceptoPoliza As String = TxtObservaciones.Text If ConceptoPoliza = "" Then ConceptoPoliza = TxtPagueseA.Text Dim CveMoneda As Integer = 1 - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero End If @@ -1190,7 +1190,7 @@ Partial Class Bancos_PolizaCheque 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If DdlCuenta.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) + Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) If drr IsNot Nothing Then TxtImporte.Text = DtMovimientos.SUM("Abono", "IdCuenta =" & drr("IdCtaContable").ToString).ToString UPPDocumento.Update() @@ -1206,7 +1206,7 @@ Partial Class Bancos_PolizaCheque 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If CveCuenta > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & CveCuenta) + Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & CveCuenta) If drr IsNot Nothing Then Retorno = drr("IdCtaContable").ToString.ToEntero End If diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 639c41138..b305df95f 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -759,7 +759,7 @@ Partial Class Bancos_PopIECompras Private Sub CargaCuentas() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -1076,7 +1076,7 @@ Partial Class Bancos_PopIECompras Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged Dim Folio As Long - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim TCveMoneda = -1 If dr IsNot Nothing Then @@ -1453,7 +1453,7 @@ Partial Class Bancos_PopIECompras Select Case RBLContado.SelectedValue Case "1" ' Banco If DdlCuenta.SelectedValue.ToEntero > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If Case "2", "3", "4", "5", "6" 'FyE, Ingresos, Deudores, Acreedores If ChkPagarDolares.Checked Then diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index ef708b810..3d83cb0b4 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -853,7 +853,7 @@ Partial Class Bancos_PopIEVentas Private Sub CargaCuentas() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) 'dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)) @@ -1039,7 +1039,7 @@ Partial Class Bancos_PopIEVentas Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged Dim Folio As Long - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim TCveMoneda = -1 If dr IsNot Nothing Then @@ -1452,7 +1452,7 @@ Partial Class Bancos_PopIEVentas Select Case RBLContado.SelectedValue Case "1" ' Banco If DdlCuenta.SelectedValue.ToEntero > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If Case "2", "3", "4", "5" 'FyE, Ingresos, Deudores If ChkPagarDolares.Checked Then diff --git a/Bancos/PopUpBuscarIE.aspx.vb b/Bancos/PopUpBuscarIE.aspx.vb index d46b4d027..48abdea72 100644 --- a/Bancos/PopUpBuscarIE.aspx.vb +++ b/Bancos/PopUpBuscarIE.aspx.vb @@ -56,7 +56,7 @@ Partial Class Bancos_PopUpBuscarIE End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveBanco = '" & DdlBanco.SelectedValue.ToEntero & "'") + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveBanco = '" & DdlBanco.SelectedValue.ToEntero & "'") DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1")) End Sub diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs index 45868524e..f9674a6bb 100644 --- a/Bancos/PrestamoPersonal.aspx.cs +++ b/Bancos/PrestamoPersonal.aspx.cs @@ -124,8 +124,8 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas protected void CargaCuentas() { - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas - DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1"); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); //quito las cajas chicas + DdlCuentaPrestamo.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1"); DdlCuenta.DataBind(); DdlCuentaPrestamo.DataBind(); @@ -156,7 +156,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas #region "PAGO ACREEDORES" protected void DdlCuenta_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)); int tCveMoneda = 0; if (dr != null) { @@ -229,7 +229,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 21; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); @@ -456,7 +456,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas #region "PRESTAMO ACREEDORES" protected void DdlCuentaPrestamo_SelectedIndexChanged(object sender, EventArgs e) { - DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); + DataRow dr = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaPrestamo.SelectedValue)); int tCveMoneda = 0; if (dr != null) { @@ -520,7 +520,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas int CveConceptoContablePrestamoComplementario = 202; int CvePlantillaPoliza = 8; int CvePrePoliza = 0; - int CveMoneda = get_GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); + int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); int FolioFijo = 0; int IDPoliza = 0; StringBuilder Msg = new StringBuilder(); diff --git a/Bancos/ProductosFinancieros.aspx.vb b/Bancos/ProductosFinancieros.aspx.vb index fccebada4..c37c9eb41 100644 --- a/Bancos/ProductosFinancieros.aspx.vb +++ b/Bancos/ProductosFinancieros.aspx.vb @@ -118,7 +118,7 @@ Partial Class Bancos_ProductosFinancieros CargaTipoTrasaccion() End Sub Private Sub CargaCuentas() - DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentas.DataBind() DdlCuentas.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -254,7 +254,7 @@ Partial Class Bancos_ProductosFinancieros End Sub Protected Sub DdlCuentas_SelectedIndexChanged(sender As Object, e As EventArgs) ObtieneFolio() - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuentas.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentas.SelectedValue) If dr IsNot Nothing Then If dr("UsaTarjeta").ToString = "True" Then CargaTarjetas() @@ -295,7 +295,7 @@ Partial Class Bancos_ProductosFinancieros 'Variables de controles Dim Importe As Double = TxtImporte.Text.ToDouble - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() Dim Fecha = TxtFecha.Text.ToDate 'Variables de error @@ -313,7 +313,7 @@ Partial Class Bancos_ProductosFinancieros End If 'OBTIENE LA CUENTA CONTABLE DEL BANCO - Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) + Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) Dim CtaCuenta = -1 If DtCuentas.Rows.Count = 1 Then diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index c19a66acc..d6b4ed630 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -830,7 +830,7 @@ Partial Class Bancos_ProveedoresAbonar 'Saca moneda en que se va a pagar segun metodo de pago If DdlCuenta.SelectedValue.ToEntero > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If If TxtImporte.Text.ToDouble > 0 Then @@ -853,7 +853,7 @@ Partial Class Bancos_ProveedoresAbonar 'cheque If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa.Contiene(13, 83) Then FolioFijo = TxtFolio.Text.ToEntero - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/ProveedoresAbonar", 2, ImporteSeleccionado, ImporteSeleccionado, GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TxtFechaDocumento.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/ProveedoresAbonar", 2, ImporteSeleccionado, ImporteSeleccionado, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TxtFechaDocumento.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) If CveMoneda = 2 Then If TxtTCDolares.Visible Then @@ -867,7 +867,7 @@ Partial Class Bancos_ProveedoresAbonar End If End If - Dim CveIE As Integer = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), ConceptoCIE:=TxtConceptoCIE.Text) + Dim CveIE As Integer = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), ConceptoCIE:=TxtConceptoCIE.Text) If CveIE > 0 Then @@ -2454,7 +2454,7 @@ Partial Class Bancos_ProveedoresAbonar #Region " CUENTAS MOVTO " Private Sub CargaCuentas(tTipoTransaccion As Integer) DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If ChkPagarPesos.Checked Then dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1)) @@ -2488,7 +2488,7 @@ Partial Class Bancos_ProveedoresAbonar Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then If ChkPagarPesos.Checked Then CveMoneda = 2 @@ -2518,7 +2518,7 @@ Partial Class Bancos_ProveedoresAbonar End If Dim IdCuentaBancaria As Integer - Dim dr2 As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr2 As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr2 IsNot Nothing Then IdCuentaBancaria = dr2("IdCtaContable").ToString.ToEntero If dr("UsaTarjeta").ToString = "True" Then diff --git a/Bancos/ProveedoresCreditos.aspx.vb b/Bancos/ProveedoresCreditos.aspx.vb index 145376793..dd61ce7dc 100644 --- a/Bancos/ProveedoresCreditos.aspx.vb +++ b/Bancos/ProveedoresCreditos.aspx.vb @@ -778,9 +778,9 @@ Partial Class Bancos_ProveedoresCreditos Dim dt As DataTable If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Else - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas End If @@ -1306,7 +1306,7 @@ Partial Class Bancos_ProveedoresCreditos If MsgError = "" Then - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim IdCuentaBancaria As Integer = 0 If dr IsNot Nothing Then diff --git a/Bancos/Reembolsos.aspx.vb b/Bancos/Reembolsos.aspx.vb index b5a751933..f8530d25c 100644 --- a/Bancos/Reembolsos.aspx.vb +++ b/Bancos/Reembolsos.aspx.vb @@ -77,7 +77,7 @@ Partial Class Bancos_Reembolsos ViewState("CveMoneda") = 1 'Cargar Filtros - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1 DdlCajaChica.DataSource = dt DdlCajaChica.DataBind() @@ -159,7 +159,7 @@ Partial Class Bancos_Reembolsos Protected Sub DdlCajaChica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCajaChica.SelectedIndexChanged ViewState("CveCajaChica") = DdlCajaChica.SelectedValue - Dim dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveCuenta = {0}", CveCajaChica)) + Dim dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0}", CveCajaChica)) If dt.Rows.Count = 1 Then IdCuentaBeneficiario = dt.Rows(0)("IdCtaContable").ToString.ToEntero @@ -245,7 +245,7 @@ Partial Class Bancos_Reembolsos Private Sub CargaCuentas() DdlCuenta.Items.Clear() DdlCuenta.SelectedIndex = -1 - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveMoneda = {0} ", 1)) DdlCuenta.DataSource = dt @@ -258,7 +258,7 @@ Partial Class Bancos_Reembolsos #Region " SELECTED INDEX CHANGED " Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero @@ -389,7 +389,7 @@ Partial Class Bancos_Reembolsos CvePrePolizaVieja = ObjMov.AddPrePolizas("Banc", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, FechaPrePoliza, "Comprobación: " & TxtObservaciones.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIE = DDlCheques.SelectedValue.ToEntero CveIERegistrado = CveIE - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If DdlPersonal.Visible AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then CvePersonal = DdlPersonal.SelectedValue.ToEntero If dr IsNot Nothing Then @@ -770,7 +770,7 @@ Partial Class Bancos_Reembolsos If DDlCheques.SelectedValue.ToEntero > 0 Then CveIE = DDlCheques.SelectedValue.ToEntero CveIERegistrado = DDlCheques.SelectedValue.ToEntero - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If DdlPersonal.Visible AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then CvePersonal = DdlPersonal.SelectedValue.ToEntero If dr IsNot Nothing Then diff --git a/Bancos/RegistroPagoIntermediario.aspx.vb b/Bancos/RegistroPagoIntermediario.aspx.vb index 17e4bc86e..86bf1f0bf 100644 --- a/Bancos/RegistroPagoIntermediario.aspx.vb +++ b/Bancos/RegistroPagoIntermediario.aspx.vb @@ -60,7 +60,7 @@ Partial Class Bancos_PagosIntermediarios End Sub Private Sub CargaCuentas() - DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentaDeposito.DataBind() DdlCuentaDeposito_SelectedIndexChanged(Nothing, Nothing) End Sub @@ -84,7 +84,7 @@ Partial Class Bancos_PagosIntermediarios End Sub Protected Sub DdlCuentaDeposito_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDeposito.SelectedIndexChanged - Dim dr As DataRow = GlobalDTBancosCuentas(-1).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaDeposito.SelectedValue) If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero diff --git a/Bancos/RepCobrado.aspx.vb b/Bancos/RepCobrado.aspx.vb index 29b9d94e8..970fbe2e9 100644 --- a/Bancos/RepCobrado.aspx.vb +++ b/Bancos/RepCobrado.aspx.vb @@ -108,7 +108,7 @@ Partial Class Ventas_RepRecuperacion Protected Sub DdlBanco_SelectedIndexChanged(sender As Object, e As EventArgs) DdlCuentaBancaria.Items.Clear() If DdlBanco.SelectedValue.ToEntero > 0 Then - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") End If DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() diff --git a/Bancos/RepCobradoDetalle.aspx.vb b/Bancos/RepCobradoDetalle.aspx.vb index b37cec1e1..16ad3e3ca 100644 --- a/Bancos/RepCobradoDetalle.aspx.vb +++ b/Bancos/RepCobradoDetalle.aspx.vb @@ -165,7 +165,7 @@ Partial Class Ventas_RepRecuperacionDetalle Public Sub CargaCuentas() DdlCuentaBancaria.Items.Clear() If DdlBanco.SelectedValue.ToEntero > 0 Then - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") End If DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() diff --git a/Bancos/RepComprobaciones.aspx.cs b/Bancos/RepComprobaciones.aspx.cs index ea263ffc5..8c167511a 100644 --- a/Bancos/RepComprobaciones.aspx.cs +++ b/Bancos/RepComprobaciones.aspx.cs @@ -61,7 +61,7 @@ public partial class Bancos_RepComprobaciones : ClsPaginas } protected void CargaCuentas() { - DdlCuentas.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("Banco = 'Empresa'"); + DdlCuentas.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:= UsuarioActual.CveEmpresa).FiltraParametros("Banco = 'Empresa'"); DdlCuentas.DataBind(); DdlCuentas.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlCuentas.SelectedValue = "-1"; diff --git a/Bancos/RepCreditos.aspx.vb b/Bancos/RepCreditos.aspx.vb index 64dd6df90..fad76f264 100644 --- a/Bancos/RepCreditos.aspx.vb +++ b/Bancos/RepCreditos.aspx.vb @@ -472,7 +472,7 @@ Partial Class Bancos_RepCreditos ''obtengo la cuenta de pago, de crediproveedores Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(-1).FiltroPrimero("CveTipoCuenta = 7") 'obtiene la primer cuenta de crediproveedores + Dim drBC As DataRow = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") 'obtiene la primer cuenta de crediproveedores If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, drE("Referencia").ToString.Trim, "-1", CveCuenta, CveCompra, -1, 1, drE("FechaInicio").ToString.ToDate, drE("FechaVencimiento").ToString.ToDate, drE("Tasa").ToString.ToDouble, drE("SobreTasa").ToString.ToDouble, 0.16, drE("Plazo").ToString.ToEntero, diff --git a/Bancos/RepIE.aspx.vb b/Bancos/RepIE.aspx.vb index 280292a78..86d45e51d 100644 --- a/Bancos/RepIE.aspx.vb +++ b/Bancos/RepIE.aspx.vb @@ -281,7 +281,7 @@ Partial Class Bancos_RepIE CLABE = "" Banco = "" - Dim dr As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero).FiltroPrimero("") + Dim dr As DataRow = GlobalDTBancosCuentas(-1, DdlCuenta.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("") If dr IsNot Nothing Then @@ -377,7 +377,7 @@ Partial Class Bancos_RepIE #Region "CARGA COMBOS FILTRO" Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1")) @@ -514,7 +514,7 @@ Partial Class Bancos_RepIE Private Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) If dr IsNot Nothing AndAlso dr("UsaTarjeta").ToString = "True" Then CargaGridTarjetas() diff --git a/Bancos/RepProgramaciones.aspx.vb b/Bancos/RepProgramaciones.aspx.vb index a751d4c22..0a7d19d3d 100644 --- a/Bancos/RepProgramaciones.aspx.vb +++ b/Bancos/RepProgramaciones.aspx.vb @@ -41,7 +41,7 @@ Partial Class Bancos_RepProgramaciones End If 'inserto el movimiento en creditos Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveTipoCuenta = 7") + Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0, -1, Gvr.DataKey("Total").ToDouble, 0, 0, -1, Gvr.DataKey("CveProveedor").ToEntero, 1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -96,7 +96,7 @@ Partial Class Bancos_RepProgramaciones 'inserto el movimiento en creditos Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveTipoCuenta = 7") + Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0, @@ -149,7 +149,7 @@ Partial Class Bancos_RepProgramaciones End If 'inserto el movimiento en creditos Dim CveCuenta As Integer - Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveTipoCuenta = 7") + Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7") If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0, diff --git a/Bancos/RepProgramarRecursos.aspx.vb b/Bancos/RepProgramarRecursos.aspx.vb index 7fceb03ec..b5f74e352 100644 --- a/Bancos/RepProgramarRecursos.aspx.vb +++ b/Bancos/RepProgramarRecursos.aspx.vb @@ -145,7 +145,7 @@ Partial Class Bancos_RepProgramarRecursos DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1)) DdlProyecto.DataBind() - DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DtTipoTransaccion = GlobalDTTipoTransacciones.FiltraParametros("Tipo = 'Egs'") Dim CveProveedor As Integer = IfNull(Request("CveProveedor"), "-1").ToString.ToEntero diff --git a/Bancos/RepSaldos.aspx.vb b/Bancos/RepSaldos.aspx.vb index 9fd784860..4d3ed5bc6 100644 --- a/Bancos/RepSaldos.aspx.vb +++ b/Bancos/RepSaldos.aspx.vb @@ -41,7 +41,7 @@ Partial Class Bancos_RepSaldos 'End Sub Private Sub CargaCuenta() DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuenta.DataBind() DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1")) End Sub diff --git a/Bancos/RepSaldosPeriodo.aspx.cs b/Bancos/RepSaldosPeriodo.aspx.cs index 031a9db89..3d97ac4d8 100644 --- a/Bancos/RepSaldosPeriodo.aspx.cs +++ b/Bancos/RepSaldosPeriodo.aspx.cs @@ -38,7 +38,7 @@ public partial class Bancos_RepSaldosPeriodo : ClsPaginas txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString(); - DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario); + DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:UsuarioActual.CveEmpresa); DdlCuenta.DataBind(); DdlCuenta.Items.Insert(0, new ListItem("Todas", "-1")); diff --git a/Bancos/SaldarCajaChica.aspx.cs b/Bancos/SaldarCajaChica.aspx.cs index 533ebf16a..6af169e05 100644 --- a/Bancos/SaldarCajaChica.aspx.cs +++ b/Bancos/SaldarCajaChica.aspx.cs @@ -22,7 +22,7 @@ public partial class Bancos_SaldarCajaChica : ClsPaginas private void CargaCajaChica() { DdlCajaChica.Items.Clear(); - DdlCajaChica.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveTipoCuenta = 1")); + DdlCajaChica.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoCuenta = 1")); DdlCajaChica.DataBind(); } diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index 826813cd0..097a21b4f 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -51,7 +51,7 @@ Partial Class Bancos_Transferencias Opcion = -1 End If - DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If Opcion = 1 Then LtlTitulo.Text = "Domicialización de tarjeta" @@ -92,8 +92,8 @@ Partial Class Bancos_Transferencias Private Sub VerificaMonedas() 'si es la destino verifico si la moneda es la misma, sino pregunto por la paridad cambiaria - Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaOrigen.SelectedValue.ToEntero)) - Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaDestino.SelectedValue.ToEntero)) + Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaOrigen.SelectedValue.ToEntero)) + Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentaDestino.SelectedValue.ToEntero)) 'Dim tCveMonedaOrigen, tCveMonedaDestino As Integer If drOrigen IsNot Nothing AndAlso drDestino IsNot Nothing Then tCveMonedaOrigen = drOrigen("CveMoneda").ToString.ToEntero @@ -157,7 +157,7 @@ Partial Class Bancos_Transferencias CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) End If - If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then + If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then CargaGridTarjetas() Else GvTC.Visible = False @@ -241,11 +241,11 @@ Partial Class Bancos_Transferencias Next - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue)) + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue)) If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero If Opcion = -1 Then - dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue)) + dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue)) If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero Else CveMonedaOrigen = CveMonedaDestino @@ -462,8 +462,8 @@ Partial Class Bancos_Transferencias Private Sub EnviaCorreo(Comprobante As String) - Dim dtcorreo As DataTable = GlobalDTBancosCuentas(-1, DdlCuentaOrigen.SelectedValue.ToEntero) - dtcorreo.Merge(GlobalDTBancosCuentas(-1, DdlCuentaDestino.SelectedValue.ToEntero)) + Dim dtcorreo As DataTable = GlobalDTBancosCuentas(-1, DdlCuentaOrigen.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa) + dtcorreo.Merge(GlobalDTBancosCuentas(-1, DdlCuentaDestino.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa)) ' Dim CorreosCCP As New List(Of String) Dim StrCorreos As New StringBuilder @@ -593,7 +593,7 @@ Partial Class Bancos_Transferencias Private Sub chkMovimientoTarjeta_CheckedChanged(sender As Object, e As EventArgs) Handles chkMovimientoTarjeta.CheckedChanged If chkMovimientoTarjeta.Checked Then - If GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then + If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then CargaGridTarjetas() End If Else diff --git a/Compras/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx new file mode 100644 index 000000000..f930bc624 --- /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 Gastos de Rechazo de Paquetes + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + 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.vb b/Compras/Compras.aspx.vb index ffdea1526..e8d8ba33a 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1446,7 +1446,7 @@ Partial Class Compras_Compras End If 'Condiciones de la Compra - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) DdlCajaChica.DataSource = dt @@ -2504,7 +2504,7 @@ Partial Class Compras_Compras TrRembolsoPersonal.Visible = True End If - Dim DtCajaChica As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim DtCajaChica As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DtCajaChica = DtCajaChica.FiltraParametros(String.Format("CveTipoCuenta = 1")) DdlRembolsoCajaChica.DataSource = DtCajaChica DdlRembolsoCajaChica.Items.Insert(0, New ListItem("Sin Seleccionar", "-1")) @@ -4360,7 +4360,7 @@ Partial Class Compras_Compras If RBLContado.SelectedValue = "1" Then ImportePago = TxtDocumentoImporte.Text.Trim.ToDecimal - Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0) + Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0) If Dr IsNot Nothing Then CveMonedaPago = Dr("CveMoneda").ToString.ToEntero @@ -4378,7 +4378,7 @@ Partial Class Compras_Compras CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaPago.Text.Trim.ToDate, TxtDocumentoFolio.Text.Trim, DdlProveedor.SelectedItem.Text.Trim, ImportePago, CveMonedaPago, TCPago, TxtDocumentoObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1)) ElseIf RBLContado.SelectedValue = "6" Then ImportePago = TxtDocumentoImporteCaja.Text.Trim.ToDecimal - Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuentaCaja.SelectedValue}").Rows(0) + Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta = {DdlCuentaCaja.SelectedValue}").Rows(0) If Dr IsNot Nothing Then CveMonedaPago = Dr("CveMoneda").ToString.ToEntero End If @@ -7385,21 +7385,23 @@ Partial Class Compras_Compras End If - ''Unificacion de PrePolizas - 'If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then - ' If Not ObjConta.PrePolizaUnificacion(Ant.CvePrePoliza, CvePrePoliza) Then - ' ErrorPrepoliza = True - ' Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError) - ' End If - 'End If + If UsuarioActual.CveEmpresa.Contiene(83) Then + 'Unificacion de PrePolizas + If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then + If Not ObjConta.PrePolizaUnificacion(Ant.CvePrePoliza, CvePrePoliza) Then + ErrorPrepoliza = True + Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError) + End If + End If - ''Simplificacion de PrePolizas - 'If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then - ' If Not ObjConta.PrePolizaSimplificacion(Ant.CvePrePoliza, UsuarioActual.CveEmpresa) Then - ' ErrorPrepoliza = True - ' Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) - ' End If - 'End If + 'Simplificacion de PrePolizas + If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then + If Not ObjConta.PrePolizaSimplificacion(Ant.CvePrePoliza, UsuarioActual.CveEmpresa) Then + ErrorPrepoliza = True + Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) + End If + End If + End If Next importeMovimiento = 0 @@ -11714,12 +11716,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 +12499,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 +12526,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 +13572,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 +17359,7 @@ Partial Class Compras_Compras Private Sub CargaSubProyecto() Dim CveProyecto = If(DdlProyecto.SelectedValue.ToEntero > 0, DdlProyecto.SelectedValue.ToEntero, -1) DdlSubProyecto.Items.Clear() - If CveProyecto > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto.Contiene(1, 2) Then + If CveProyecto > 0 Then DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(CveProyecto, -1, UsuarioActual.CveEmpresa, 1)) End If DdlSubProyecto.DataBind() @@ -19692,7 +19694,6 @@ Partial Class Compras_Compras Next TmpDT.AcceptChanges() - Alert((TmpDT.Select("Consec = " & gvr.RowIndex + 1)(0))("NoDeducible").ToString()) AddPS2(EsNoDeducible:=EsNoDeducible) End Sub diff --git a/Compras/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/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs index 97e830f06..3c8e94472 100644 --- a/General/PopUpPaqueteriasGuias.aspx.cs +++ b/General/PopUpPaqueteriasGuias.aspx.cs @@ -787,11 +787,11 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas strBody.Append("
    "); strBody.Append("

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

    "); strBody.Append("

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

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

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

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

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

    "); strBody.Append("

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

    "); strBody.Append(" "); diff --git a/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..dde09a6a1 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx +++ b/Inventarios/AjustesSeccionAlmacen.aspx @@ -64,7 +64,7 @@ - + diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 191beda8c..478c321f9 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -13,10 +13,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen End Sub Private Sub CargaCombos() - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + DdlAlmacen.DataSource = DtAlmacenes DdlAlmacen.DataBind() - DdlAlmacenExcel.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacenExcel.DataSource = DtAlmacenes DdlAlmacenExcel.DataBind() DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) @@ -216,7 +218,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "") If Tipo = "EXCEL" Then Dim CveAlmacen As Integer = DdlAlmacenExcel.SelectedValue.ToEntero() - Dim CveSubProyecto As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}") + Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}") CargarArchivo(Directorio, file.filename, CveAlmacen, CveSubProyecto) Else @@ -267,7 +269,10 @@ Partial Class Inventarios_AjustesSeccionAlmacen If Not ErrorArchivo Then Dim ErrorMovInv As Boolean = False - Dim RowNoEncontrados As New StringBuilder() + Dim CodigosNoEncontrados As New StringBuilder() + Dim SeccionesNoEncontradas As New StringBuilder() + Dim ExistenciasNoEncontradas As New StringBuilder() + Dim NumAgregados As Integer = 0 Dim ObjInventario As New ClsInventarios() @@ -275,7 +280,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Try Dim DtExistenciasSecciones As DataTable = Nothing - If ObjInventario.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacenExcel.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then DtExistenciasSecciones = ObjInventario.DtResultados.Copy() End If @@ -293,9 +298,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen For Each RowExcel As DataRow In DtExcel.Rows Dim Codigo As String = RowExcel("Código").ToString.Trim() - Dim PS As String = RowExcel("Producto/Servicio").ToString().Trim() + 'Dim PS As String = RowExcel("Producto/Servicio").ToString().Trim() - Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Codigo).FiltroPrimero($"PS='{PS}'") + Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo='{Codigo}'") If DrPS IsNot Nothing Then If Not ErrorMovInv Then @@ -319,7 +324,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}") - If RowExistencia IsNot Nothing Then + If RowExistencia IsNot Nothing AndAlso CveSeccionAlmacen > 0 Then Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero() Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal() Dim SerieSalida As String = RowExistencia("Serie").ToString() @@ -362,13 +367,22 @@ Partial Class Inventarios_AjustesSeccionAlmacen End If Else ErrorMovInv = True - RowNoEncontrados.AppendFormat("{0},", Codigo) + End If + + If RowExistencia Is Nothing Then + ExistenciasNoEncontradas.AppendFormat("{0},", SeccionAlmacen) + ErrorMovInv = True + End If + + If CveSeccionAlmacen <= 0 Then + SeccionesNoEncontradas.AppendFormat("{0},", SeccionAlmacen) + ErrorMovInv = True End If End If Else ErrorMovInv = True - RowNoEncontrados.AppendFormat("{0},", Codigo) + CodigosNoEncontrados.AppendFormat("{0},", Codigo) End If Next @@ -383,10 +397,21 @@ Partial Class Inventarios_AjustesSeccionAlmacen ObjInventario.RollBack() Dim SbError As New StringBuilder() - SbError.Append("Ocurrió un error al guardar") - If RowNoEncontrados.Length > 0 Then - SbError.Append("Los siguientes códigos no fueron encontrados en el sistema.
    ") - SbError.Append(RowNoEncontrados.ToString()) + SbError.Append("Ocurrió un error al guardar.
    ") + + If CodigosNoEncontrados.Length > 0 Then + SbError.Append("
    Los siguientes códigos no fueron encontrados en el sistema.
    ") + SbError.Append(CodigosNoEncontrados.ToString()) + End If + + If ExistenciasNoEncontradas.Length > 0 Then + SbError.Append($"
    Los siguientes códigos no se encontraron existencias en el almacen: '{DdlAlmacenExcel.SelectedItem.Text}'.
    ") + SbError.Append(ExistenciasNoEncontradas.ToString()) + End If + + If SeccionesNoEncontradas.Length > 0 Then + SbError.Append("
    Las siguientes secciones de almacen no fueron encontradas en el sistema.
    ") + SbError.Append(SeccionesNoEncontradas.ToString()) End If Alert(SbError.ToString(), TipoMensaje.MsgError) diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 9a90ffba9..6114ccac7 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -1,4 +1,5 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasSalidas.aspx.vb" Inherits="Inventarios_EntradasSalidas" %> +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasSalidas.aspx.vb" Inherits="Inventarios_EntradasSalidas" EnableEventValidation="false" %> + <%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %> diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index da17d5806..66928519a 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1193,6 +1193,8 @@ Partial Class Inventarios_EntradasSalidas Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero() + Dim FechaCaducidadVal As Date = If(RowPS("AplicaCaducidad").ToString = "True", FechaCaducidad, MinFecha) + If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then Valido = False Alert("El producto requiere Serie-Lote", TipoMensaje.MsgAdvertencia) @@ -1201,7 +1203,7 @@ Partial Class Inventarios_EntradasSalidas 'salida If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen - Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), FechaCaducidad) + Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), FechaCaducidadVal) ' LbAgregar.ToolTip = Existencia.ToString If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND Serie = '{SerieLote}'", "")}") < 0 Then If Existencia <= 0 Then @@ -3699,7 +3701,7 @@ Partial Class Inventarios_EntradasSalidas 'VALIDA EXISTENCIAS SALIDA E INSERTA DETALLES For Each Dr As DataRow In DtMovimientosSalidaInvFisico.Rows - If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero) >= Dr("Cantidad").ToString.ToDouble Then + If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1) >= Dr("Cantidad").ToString.ToDouble Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index d2acbfd5f..8dff1f8c8 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -3256,11 +3256,11 @@ Partial Class Inventarios_EntregaAlmacen strBody.Append("
    ") strBody.Append("

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

    ") strBody.Append("

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

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

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

    "); strBody.Append("

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

    "); strBody.Append(" "); diff --git a/OC/OC.aspx b/OC/OC.aspx index 9d5447314..af0786933 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -467,7 +467,21 @@
    -
    + + + + + + + + + + + + + + + <%--
    Folio:
    @@ -476,7 +490,7 @@ $
    -
    +
    --%>
    @@ -2021,7 +2035,12 @@ + +
    + +
    +
    diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index fea9eb9c6..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/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/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 0b2111830..32bd90384 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -153,9 +153,10 @@ Partial Class Sistemas_CatSesiones Private Sub CargaAlmacenUsuarios() - Dim Obj As New ClsSisUsuarios - If Obj.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = Obj.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing - Obj.Dispose() + GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing + 'Dim Obj As New ClsSisUsuarios + 'If Obj.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = Obj.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing + 'Obj.Dispose() End Sub Private Sub CargaClientes() @@ -267,8 +268,9 @@ Partial Class Sistemas_CatSesiones Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados Else Application("GlobalDTUsuarios") = Nothing - End If - If ObjUsuarios.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing + End If + GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing + 'If ObjUsuarios.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing ObjUsuarios.Dispose() 'Fin Carga Usuarios End Sub @@ -428,9 +430,9 @@ Partial Class Sistemas_CatSesiones End Sub Private Sub CargaOCEstatusUsuarios() - Dim ObjOC As New ClsOC - If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing - ObjOC.Dispose() + 'Dim ObjOC As New ClsOC + 'If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing + 'ObjOC.Dispose() End Sub 'Compras diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 1465720ec..855f31886 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -1310,16 +1310,19 @@ Partial Class Sistemas_UsuarioDetalle ' Application("GlobalDTProyectosUsuarios") = Nothing ' TieneError = True 'End If - End If - - 'RECARGA GLOBAL BANCOS - If ObjBancos.GetBancosCuentasUsuarios(-1) Then - GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados - End If - - 'RECARGA GLOBAL ESTATUS + End If + + 'RECARGA GLOBAL BANCOS + 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing 'ObjBancos.DtResultados + ' End If + + 'RECARGA GLOBAL ESTATUS If ObjOC.GetEstatus() Then Application("GlobalDTOCEstatus") = ObjOC.DtResultados Else Application("GlobalDTOCEstatus") = Nothing - If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing + + GlobalDTOCEstatusUsuarios(UsuarioActual.CveEmpresa) = Nothing + + 'If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing 'RECARGA GLOBAL ALMACEN @@ -2185,14 +2188,14 @@ Partial Class Sistemas_UsuarioDetalle If UsuarioControlado Then DdlCuentasBancarias.DataSource = DtCuentasBancariasControlado.FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}") Else - DdlCuentasBancarias.DataSource = GlobalDTBancosCuentas(-1, -1, -1).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentasBancarias.DataSource = GlobalDTBancosCuentas(-1, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}", "", {"CveCuenta", "NumCuentaMoneda"}) End If End If DdlCuentasBancarias.DataBind() DdlCuentasBancarias.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub Private Sub CargaDtCuentasBancarias() - DtCuentasBancarias = GlobalDTBancosCuentas(CveUsuario, -1, -1).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}") + DtCuentasBancarias = GlobalDTBancosCuentas(CveUsuario, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}") DtCuentasBancarias.Columns.Add("Accion", GetType(Integer)) CargaGvCuentasBancarias() @@ -4130,7 +4133,7 @@ Partial Class Sistemas_UsuarioDetalle Private Sub CargaCuentasBancariasAsignar() DdlCuentasBancariasAsignar.Items.Clear() If DdlEmpresaAsignaciones.SelectedValue.ToEntero > 0 Then - DdlCuentasBancariasAsignar.DataSource = GlobalDTBancosCuentas(-1, -1, -1).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignarPermiso.SelectedValue}", "", {"CveCuenta", "NumCuenta"}) + DdlCuentasBancariasAsignar.DataSource = GlobalDTBancosCuentas(-1, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignarPermiso.SelectedValue}", "", {"CveCuenta", "NumCuenta"}) End If DdlCuentasBancariasAsignar.DataBind() DdlCuentasBancariasAsignar.Items.Insert(0, New ListItem("Seleccione", "-1")) diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index 1f560654a..afd3762fe 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -10,6 +10,7 @@ using System.Web.Services.Protocols; using GemBox.Spreadsheet; using System.Data; using System.Text; +using System.Collections.Generic; public class TareasJam : IHttpHandler { @@ -57,9 +58,21 @@ public class TareasJam : IHttpHandler DataTable DTClientes = new DataTable(); DataTable DTAlmacenes = new DataTable(); - string FTPServer = "ftp://127.0.0.1/"; - string TFPUsr = "Toor"; - string FTPPass = "agj-3500"; + string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + + + //"ftp://us2.hostedftp.com/", "agrojam", "A12345678"; + //string FTPServer = "ftp://127.0.0.1/"; + //string TFPUsr = "Toor"; + //string FTPPass = "agj-3500"; + + + string FTPServer = "ftp://us2.hostedftp.com"; + string TFPUsr = "agrojam"; + string FTPPass = "A12345678"; bool ErrorProceso = false; @@ -179,8 +192,8 @@ public class TareasJam : IHttpHandler string tmpString = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd"); dRow[3] = tmpString; } - DTAlmacenes.AcceptChanges(); - + DTAlmacenes.AcceptChanges(); + } @@ -197,10 +210,7 @@ public class TareasJam : IHttpHandler if (!ErrorProceso) { - string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; - string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; - string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; - string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx"; + SpreadsheetInfo.SetLicense(Extensiones.ModExtensiones.SerialGemBoxSpreadsheet()); @@ -344,24 +354,53 @@ public class TareasJam : IHttpHandler string Cuerpo = Respuesta ? $"Correcto
    Tarea de carga de archios Corteva realizada correctamente
    {SBLog.ToString()}" : $"Error
    Error tarea de carga de archios Corteva
    {SBLog.ToString()}" ; - MandaCorreo(Cuerpo, Respuesta); + + + + MandaCorreo(Cuerpo, Respuesta, RutaProductos, RutaVentas, RutaClientes, RutaAlmacenes); return Respuesta; } - private void MandaCorreo(string Cuerpo, bool ErrorProceso) + private void MandaCorreo(string Cuerpo, bool ErrorProceso, string RutaProductos, string RutaVentas, string RutaClientes, string RutaAlmacenes) { try { + + List ListaArchivos = new List(); + + ClsSisMail.ArchivoMail Productos = new ClsSisMail.ArchivoMail(); + ClsSisMail.ArchivoMail Ventas = new ClsSisMail.ArchivoMail(); + ClsSisMail.ArchivoMail Clientes = new ClsSisMail.ArchivoMail(); + ClsSisMail.ArchivoMail Almacenes = new ClsSisMail.ArchivoMail(); + + Productos.Ruta = RutaProductos; + Ventas.Ruta = RutaVentas; + Clientes.Ruta = RutaClientes; + Almacenes.Ruta = RutaAlmacenes; + + //FileInfo FIp = new FileInfo(RutaProductos); + //FileInfo FIv = new FileInfo(RutaVentas); + //FileInfo FIc = new FileInfo(RutaClientes); + //FileInfo FIa = new FileInfo(RutaAlmacenes); + + + + ListaArchivos.Add(Productos); + ListaArchivos.Add(Ventas); + ListaArchivos.Add(Clientes); + ListaArchivos.Add(Almacenes); + + ClsSisMail Correo = new ClsSisMail(); string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx"; - // string Para = "oscar.irigoyen@adssistemas.mx"; + // string Para = "oscar.irigoyen@adssistemas.mx"; string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}"; - Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo); + Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos); }catch(Exception ex) { diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index d537bc6bb..71897ac72 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -7028,8 +7028,6 @@ } - + diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 7cc5d63d5..b70308ad1 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -355,7 +355,7 @@ Partial Class Ventas_ClientesAbonar Private Sub CargaCuentas() DdlCuenta.Items.Clear() - Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) If ChkPagarPesos.Checked Then dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1)) @@ -454,10 +454,10 @@ Partial Class Ventas_ClientesAbonar Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'recargo la moneda con la que se va a pagar - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) Dim moneda As Integer = 0 If DdlCuenta.SelectedValue > 0 Then - moneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + moneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If CveMonedaPago = moneda @@ -495,7 +495,7 @@ Partial Class Ventas_ClientesAbonar If IfNull(Request("CveMoneda"), "-1").ToString.ToEntero = -1 Then CargaDatos(-1) - moneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + moneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero If moneda = 1 Then 'DivTC.Visible = True DivTCDolares.Visible = False @@ -709,7 +709,7 @@ Partial Class Ventas_ClientesAbonar Dim ConceptoPoliza As String = String.Format("{0} {1}", TxtAboneA.Text, TxtObservaciones.Text) If DdlCuenta.SelectedValue > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero Else CveMoneda = If(Request("CveMoneda").ToString.ToEntero > 0, Request("CveMoneda").ToString.ToEntero, 1) End If @@ -742,7 +742,7 @@ Partial Class Ventas_ClientesAbonar End If - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario) + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario) Else If RblTipoPago.SelectedValue.Contiene("3") Then CveIE = DdlIngreso.SelectedValue.ToEntero @@ -2738,7 +2738,7 @@ Partial Class Ventas_ClientesAbonar End If Dim DTTipoTransacciones As DataTable = GlobalDTTipoTransacciones.FiltraParametros($"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}") - Dim DTCuentas As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta={DdlCuenta.SelectedValue}") + Dim DTCuentas As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveCuenta={DdlCuenta.SelectedValue}") Dim ClaveFormaPagoSAT As String = "" Dim Cuentapago As String = "" @@ -3048,7 +3048,7 @@ Partial Class Ventas_ClientesAbonar TxtTCDolaresDolares.Text = GlobalTipoCambio(Fecha).FormatoNumero(4) End If - Dim moneda As Integer = GlobalDTBancosCuentas(-1).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero + Dim moneda As Integer = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero If CveMonedaFiltro = -1 Then RegistraScript(String.Format("FnCambia(0,0,0,0,-1,{0});", moneda)) Else diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index da3eeb9e4..36c19f71e 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5237,11 +5237,11 @@ Partial Class PV DdlCuentaTransferencia.Items.Clear() - DdlCuentaEfectivo.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaTarjetaCredito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaTarjetaDebito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaCheque.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) - DdlCuentaTransferencia.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaEfectivo.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaTarjetaCredito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaTarjetaDebito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaCheque.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) + DdlCuentaTransferencia.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero))) DdlCuentaEfectivo.DataBind() DdlCuentaTarjetaCredito.DataBind() @@ -5420,7 +5420,7 @@ Partial Class PV Private Sub CargaCuentasTerminal() DdlCuentasTerminal.Items.Clear() - DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentasTerminal.DataBind() DdlCuentasTerminal.Items.Insert(0, New ListItem("Seleccione", "-1")) UPTarjetaTermminal.Update() diff --git a/Ventas/ProductosFinancieros.aspx.vb b/Ventas/ProductosFinancieros.aspx.vb index 390a9827f..91f84fd58 100644 --- a/Ventas/ProductosFinancieros.aspx.vb +++ b/Ventas/ProductosFinancieros.aspx.vb @@ -118,7 +118,7 @@ Partial Class Bancos_ProductosFinancieros CargaTipoTrasaccion() End Sub Private Sub CargaCuentas() - DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentas.DataBind() DdlCuentas.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -284,7 +284,7 @@ Partial Class Bancos_ProductosFinancieros 'Variables de controles Dim Importe As Double = TxtImporte.Text.ToDouble - Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() + Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero() Dim Fecha = TxtFecha.Text.ToDate 'Variables de error @@ -306,7 +306,7 @@ Partial Class Bancos_ProductosFinancieros 'End If 'OBTIENE LA CUENTA CONTABLE DEL BANCO - Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) + Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"}) Dim CtaCuenta = -1 If DtCuentas.Rows.Count = 1 Then diff --git a/Ventas/RepRecuperacion.aspx.vb b/Ventas/RepRecuperacion.aspx.vb index 5ca328ee7..4199b39f2 100644 --- a/Ventas/RepRecuperacion.aspx.vb +++ b/Ventas/RepRecuperacion.aspx.vb @@ -180,7 +180,7 @@ Partial Class Ventas_RepRecuperacion Protected Sub DdlBanco_SelectedIndexChanged(sender As Object, e As EventArgs) DdlCuentaBancaria.Items.Clear() - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() End Sub diff --git a/Ventas/RepRecuperacionDetalle.aspx.vb b/Ventas/RepRecuperacionDetalle.aspx.vb index fd8ccd5a9..53c4e2c6a 100644 --- a/Ventas/RepRecuperacionDetalle.aspx.vb +++ b/Ventas/RepRecuperacionDetalle.aspx.vb @@ -230,7 +230,7 @@ Partial Class Ventas_RepRecuperacionDetalle Public Sub CargaCuentas() DdlCuentaBancaria.Items.Clear() If DdlBanco.SelectedValue.ToEntero > 0 Then - DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") + DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}") End If DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCuentaBancaria.DataBind() diff --git a/Ventas/RepRecuperacionPeriodo.aspx.cs b/Ventas/RepRecuperacionPeriodo.aspx.cs index 1c1c01be8..3718754c3 100644 --- a/Ventas/RepRecuperacionPeriodo.aspx.cs +++ b/Ventas/RepRecuperacionPeriodo.aspx.cs @@ -298,7 +298,7 @@ public partial class Ventas_RepRecuperacionPeriodo : ClsPaginas DdlCuentaBancaria.Items.Clear(); if (DdlBanco.SelectedValue.ToEntero() > 0) { - DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); + DdlCuentaBancaria.DataSource = get_GlobalDTBancosCuentas(-1, CveEmpresa:= UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero()}"); } DdlCuentaBancaria.Items.Insert(0, new ListItem("Todos", "-1")); DdlCuentaBancaria.DataBind(); diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ac3635c77..bfca81a44 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1948,7 +1948,7 @@ Partial Class Ventas CreaDTmpF() CreaDTDocumentosRelacionados() CargaDdlSubProyectos() - CargaProyecto() + 'CargaProyecto() CargaSucursales() CargaClasificaciones() @@ -4760,14 +4760,14 @@ Partial Class Ventas UpINV.Update() End Sub Private Sub CargaSubProyecto(Optional CveSubProyecto As Integer = -1) - DdlSubProyecto.Items.Clear() - DdlSubProyecto.SelectedValue = Nothing - If DdlProyecto.SelectedValue.ToEntero() > 0 Then - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) - End If - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) + 'DdlSubProyecto.Items.Clear() + 'DdlSubProyecto.SelectedValue = Nothing + 'If DdlProyecto.SelectedValue.ToEntero() > 0 Then + ' DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + ' 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) + 'End If + 'DdlSubProyecto.DataBind() + 'DdlSubProyecto.Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) If CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(CveSubProyecto) End Sub @@ -5651,8 +5651,8 @@ Partial Class Ventas DdlCuentasTerminal.Items.Clear() DdlCuentaTerminalModal.Items.Clear() - DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) - DdlCuentaTerminalModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentasTerminal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) + DdlCuentaTerminalModal.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"}) DdlCuentasTerminal.DataBind() DdlCuentaTerminalModal.DataBind() @@ -6153,23 +6153,23 @@ Partial Class Ventas TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal) Dim ClienteRetIVA = Me.ClienteRetIVA - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - 'ClienteRetIVA = 0.0D - If ClienteRetIVA <= 0 Then - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - ClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then - ClienteRetIVA = 0.06D - End If + + If ClienteRetIVA <= 0 Then + If CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then + ClienteRetIVA = 0.06D + DdlTipoRetencion.SelectedValueExist("4") + LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero + TrRetIVA.Style.Add("display", "") + DdlTipoRetencion.Visible = True + ElseIf DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + ClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + ClienteRetIVA = 0.04D End If - ' LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero - TrRetIVA.Style.Add("display", "") - DdlTipoRetencion.Visible = True End If + TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero() TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text TmpDT.Rows(e.RowIndex)("Cantidad") = Cantidad @@ -8582,9 +8582,9 @@ Partial Class Ventas End Select ObjFactura.ComplementoINE = INE End If - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - ObjFactura.CveTipoRetencion = DdlTipoRetencion.SelectedValue.ToEntero() - End If + + ObjFactura.CveTipoRetencion = DdlTipoRetencion.SelectedValue.ToEntero() + ObjFactura.NuevaFactura = Me.NuevaFactura End Sub @@ -9506,10 +9506,8 @@ Partial Class Ventas Next End If - Dim CveTipoRetencion As Integer = 0 - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - CveTipoRetencion = factura.CveTipoRetencion - End If + + 'SI LA FACTURA ESTA PAGADA DEBE MARCAR LA DEVOLUCION POR SI SE QUIERE AMORTIZAR If (ObjFacturaNC IsNot Nothing AndAlso ObjFacturaNC.Pagado > 0) AndAlso factura.TipoDocto = "Dev" Then @@ -9531,7 +9529,7 @@ Partial Class Ventas CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM, DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False), - Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then + Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then @@ -11206,13 +11204,13 @@ Partial Class Ventas Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeIVA").ToDecimal - If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows.Count = 1 Then - IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("IdCtaContable").ToString().ToEntero() + If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count = 1 Then + IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("IdCtaContable").ToString().ToEntero() ' CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("IdCtaContableSIG").ToString().ToEntero() End If If IdCtaContable <= 0 Then - CuentasContablesInvalidas.AppendFormat("
    {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("NumCuentaMoneda").ToString().ToEntero()) + CuentasContablesInvalidas.AppendFormat("
    {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("NumCuentaMoneda").ToString().ToEntero()) idCuentaContabilizacion = 0 End If @@ -15229,24 +15227,23 @@ Partial Class Ventas End If Dim ClienteRetIVA = Me.ClienteRetIVA - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - 'ClienteRetIVA = 0.0D - If ClienteRetIVA <= 0 Then - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - ClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then - ClienteRetIVA = 0.06D - End If + If ClienteRetIVA <= 0 Then + If CBool(DrPS("EsOutSourcing").ToString()) Then + ClienteRetIVA = 0.06D + DdlTipoRetencion.SelectedValueExist("4") + ElseIf DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + ClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + ClienteRetIVA = 0.04D End If - - ' LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero - TrRetIVA.Style.Add("display", "") - DdlTipoRetencion.Visible = True End If + LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero + TrRetIVA.Style.Add("display", "") + DdlTipoRetencion.Visible = True + + Row("IVA") = Row("PorcentajeIVA") Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) @@ -15283,6 +15280,7 @@ Partial Class Ventas Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion Row("CveVentaDetallePedido2") = CveVentaDetallePedido2 Row("CuentaPredial") = CuentaPredial + Row("EsOutSourcing") = DrPS("EsOutSourcing") If UsuarioActual.CveEmpresa = 119 Then If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA @@ -18048,7 +18046,7 @@ Partial Class Ventas DdlCuentaCheque.Items.Clear() DdlCuentaTransferencia.Items.Clear() - Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) + Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) @@ -18076,13 +18074,13 @@ Partial Class Ventas Case 1 DivContadoOtrosCuenta.Attributes.Add("class", "col-md-3") DivMesesSinIntereses2.Visible = True - DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) Exit Select Case 2 - DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) Exit Select Case 3 - DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) + DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero()))) Exit Select Case -1 DdlCuentaOtrosContado.DataSource = Nothing @@ -25861,8 +25859,8 @@ Partial Class Ventas Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs) If CveVenta <= 0 OrElse EsCreaApartirDe Then - If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then - If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then + + If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then For Each RowServicio As DataRow In TmpDT.Rows Dim tClienteRetIVA = ClienteRetIVA If tClienteRetIVA <= 0 Then @@ -25895,7 +25893,7 @@ Partial Class Ventas End If - End If + End If UpPS.Update() diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 05cc6f529..fa5c03748 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -248,29 +248,69 @@ Public Class WSApp Application("GlobalTipoCambio") = value End Set + End Property + + Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + Get + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing + End If + + ObjOC.Dispose() + + End If + + Dim filtro As New StringBuilder + filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + If CveUsuario > 0 Then + filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + End If + If Tipo <> "" Then + filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + End If + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTOCEstatusUsuarios = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set End Property - Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable - Get - If CveEmpresa <> -1 Then - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) - End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTOCEstatusUsuarios") = value - End Set - End Property + + 'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim filtro As New StringBuilder + ' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + ' If CveUsuario > 0 Then + ' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + ' End If + ' If Tipo <> "" Then + ' filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + ' End If + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTOCEstatusUsuarios = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTOCEstatusUsuarios") = value + ' End Set + 'End Property + + Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then diff --git a/asmx/WSSIGApp.asmx b/asmx/WSSIGApp.asmx index 1a6b79d95..71ad666ea 100644 --- a/asmx/WSSIGApp.asmx +++ b/asmx/WSSIGApp.asmx @@ -264,28 +264,44 @@ Public Class WSSIGApp End Set End Property + Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable Get - If CveEmpresa <> -1 Then - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + + Dim ObjOC As New ClsOC + If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then + HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados + Else + HttpContext.Current.Application(AppNombre) = Nothing End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable) + + ObjOC.Dispose() + End If + + Dim filtro As New StringBuilder + filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) + If CveUsuario > 0 Then + filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) + End If + If Tipo <> "" Then + filtro.AppendFormat(" AND Tipo='{0}'", Tipo) + End If + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTOCEstatusUsuarios = Dv.ToTable + Dv.Dispose() + End Get Set(value As DataTable) - Application("GlobalDTOCEstatusUsuarios") = value + Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value End Set End Property + Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then diff --git a/vwd.webinfo b/vwd.webinfo index 65b4102ee..6a84ef014 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -80,6 +80,8 @@ + +