From 3b1e1a17e65e5f36374b91993bef1d44d664e9ed Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 25 Apr 2025 09:49:02 -0700 Subject: [PATCH 1/5] --Sobr/Falt en rep cortes --- Bancos/RepCortes.aspx | 5 +++++ Bancos/RepCortes.aspx.vb | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Bancos/RepCortes.aspx b/Bancos/RepCortes.aspx index 0f8f26f74..d6fc48fb1 100644 --- a/Bancos/RepCortes.aspx +++ b/Bancos/RepCortes.aspx @@ -448,6 +448,11 @@ + + + + + diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index 177d8cb61..ca533a117 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -231,6 +231,10 @@ Partial Class Bancos_RepCortes DtCortesVentas = DsDatos.Tables(0) GvD.DataSource = DtCortesVentas + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + GvD.Columns(3).Visible = True + End If + divDetalle.Visible = True 'RESUMEN DtCortesVentasResumen = DsDatos.Tables(1) From 0a57ae4ae0a751c33e77dcb66f45c053f2396758 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 25 Apr 2025 18:50:06 -0700 Subject: [PATCH 2/5] --FIX cortes --- Bancos/PopIEVentas.aspx.vb | 66 ++++++++++++++++++++++++--------- Bancos/RepCortes.aspx | 4 +- Bancos/RepCortes.aspx.vb | 6 ++- Compras/PopUpVerFactura.aspx.vb | 2 +- Ventas/ClientesAbonar.aspx.vb | 65 +++++++++++++++++++++++++++++++- 5 files changed, 120 insertions(+), 23 deletions(-) diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 7f47b4731..4fd113f60 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -545,16 +545,7 @@ Partial Class Bancos_PopIEVentas FechaVenta = dr("Fecha").ToString.ToDate SaldoVenta = dr("Saldo").ToString.ToDouble - - 'Cortes de Caja - If UsuarioActual.TienePermisoProceso(160) Then - CargaCorteCaja() - End If - - If UsuarioActual.Empresa.Funcionalidad(531) = "1" OrElse (dr("CveCorte").ToString.ToEntero > 0) Then 'toma como proridad el que viene de - CveCorte = dr("CveCorte").ToString.ToEntero - End If - + Me.CveCorte = CargaCorteCaja(pCveVenta, UsuarioActual) If RFCCliente.ToUpper <> "XAXX010101000" Then Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero @@ -581,18 +572,57 @@ Partial Class Bancos_PopIEVentas ObjVenta.Dispose() End Sub - Private Sub CargaCorteCaja() - 'Checar si hay un Turno Abierto - Dim ObjPVenta As New ClsPuntoVenta + Protected Function CargaCorteCaja(CveVenta As Integer, UsuarioActual As Usuario) As Integer + Dim CveCorte As Integer = -1 - If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then + Dim CveCorteVenta As Integer = -1 + Dim EsCredito As Boolean = False + Dim UsaCorteActual As Boolean = False - If ObjPVenta.DtResultados.Rows.Count > 0 Then - CveCorte = ObjPVenta.CveCorte + If CveVenta > 0 Then + Using ObjVentas As New ClsVentas + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then + EsCredito = If(ObjVentas.DtResultados.FiltroPrimeroValor("CondicionesPago").ToEntero() = 1, True, False) + CveCorteVenta = ObjVentas.DtResultados.FiltroPrimeroValor("CveCorte").ToEntero() + End If + End Using + + If UsuarioActual.TienePermisoProceso(160) OrElse UsuarioActual.TienePermisoProceso(371) Then + 'SI ES FACTURA A CREDITO + If EsCredito OrElse CveCorteVenta <= 0 Then + UsaCorteActual = True + End If + End If + + 'SI ES CONTADO TOMAR EL DE LA VENTA + If Not EsCredito Then + UsaCorteActual = False + End If + + 'EN BDH TOMAR EL DE LA VENTA + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + UsaCorteActual = False + End If + Else + If UsuarioActual.TienePermisoProceso(160) OrElse UsuarioActual.TienePermisoProceso(371) Then + UsaCorteActual = True End If End If - ObjPVenta.Dispose() - End Sub + + If UsaCorteActual Then + Dim ObjPVenta As New ClsPuntoVenta + If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then + If ObjPVenta.DtResultados.Rows.Count > 0 Then + CveCorte = ObjPVenta.CveCorte + End If + End If + ObjPVenta.Dispose() + Else + CveCorte = CveCorteVenta + End If + + Return CveCorte + End Function Private Sub CargaCliente(ByVal CveCliente As Integer, RFC As String) Dim ObjCliente As New ClsClientes diff --git a/Bancos/RepCortes.aspx b/Bancos/RepCortes.aspx index d6fc48fb1..7c9ebeeb3 100644 --- a/Bancos/RepCortes.aspx +++ b/Bancos/RepCortes.aspx @@ -131,7 +131,7 @@ - + @@ -315,7 +315,7 @@ - <%----%> + diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index ca533a117..5827880e9 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -90,6 +90,10 @@ Partial Class Bancos_RepCortes GvDatos.Columns(4).Visible = True End If + If UsuarioActual.CveRol = 1 Then + GvDatos.Columns(21).Visible = True 'COLUMNA DE CveCorte + End If + GvP.DataBind() GvDep.DataBind() GvPorIVA.DataBind() @@ -219,7 +223,7 @@ Partial Class Bancos_RepCortes Dim ConsultaPorSucursal As Boolean = UsuarioActual.Empresa.Funcionalidad(382) = "1" If ConsultaPorSucursal Then - CveCorte = -1 + 'CveCorte = -1 FechaConsulta = gvr.DataKey("FechaInicial").ToDate() End If diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 3ebde3353..b81b0efbe 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1749,7 +1749,7 @@ Partial Class PopUpVerFactura End Using End If - CveCorte = -1 + 'CveCorte = -1 End If Dim ObjVenta As New ClsVentas diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 184fd643b..216ca1ed8 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -10,6 +10,14 @@ Partial Class Ventas_ClientesAbonar #Region "Propiedades" + Private Property CveCorte As Integer + Get + Return ViewState("CveCorte").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveCorte") = value + End Set + End Property Private ReadOnly Property CveCliente As Integer Get Return ViewState("CveCliente").ToString.ToEntero @@ -172,6 +180,7 @@ Partial Class Ventas_ClientesAbonar Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then + Me.CveCorte = -1 CveMonedaPago = -1 If Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente").ToString.ToEntero > 0 Then ViewState("CveCliente") = Request("CveCliente").ToString.ToEntero @@ -229,6 +238,8 @@ Partial Class Ventas_ClientesAbonar ChkPagarDolares.Visible = False End If RegistraScript($"TipoCambioActual = {GlobalTipoCambio(Fecha).FormatoNumero(4)}") + + Me.CveCorte = CargaCorteCaja(-1, UsuarioActual) End If RVTxtFechaDocumento.MaximumValue = NowADS().ToString("dd/MM/yyyy") @@ -255,6 +266,58 @@ Partial Class Ventas_ClientesAbonar End Sub + Protected Function CargaCorteCaja(CveVenta As Integer, UsuarioActual As Usuario) As Integer + Dim CveCorte As Integer = -1 + + Dim CveCorteVenta As Integer = -1 + Dim EsCredito As Boolean = False + Dim UsaCorteActual As Boolean = False + + If CveVenta > 0 Then + Using ObjVentas As New ClsVentas + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then + EsCredito = If(ObjVentas.DtResultados.FiltroPrimeroValor("CondicionesPago").ToEntero() = 1, True, False) + CveCorteVenta = ObjVentas.DtResultados.FiltroPrimeroValor("CveCorte").ToEntero() + End If + End Using + + If UsuarioActual.TienePermisoProceso(160) OrElse UsuarioActual.TienePermisoProceso(371) Then + 'SI ES FACTURA A CREDITO + If EsCredito OrElse CveCorteVenta <= 0 Then + UsaCorteActual = True + End If + End If + + 'SI ES CONTADO TOMAR EL DE LA VENTA + If Not EsCredito Then + UsaCorteActual = False + End If + + 'EN BDH TOMAR EL DE LA VENTA + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + UsaCorteActual = False + End If + Else + If UsuarioActual.TienePermisoProceso(160) OrElse UsuarioActual.TienePermisoProceso(371) Then + UsaCorteActual = True + End If + End If + + If UsaCorteActual Then + Dim ObjPVenta As New ClsPuntoVenta + If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then + If ObjPVenta.DtResultados.Rows.Count > 0 Then + CveCorte = ObjPVenta.CveCorte + End If + End If + ObjPVenta.Dispose() + Else + CveCorte = CveCorteVenta + End If + + Return CveCorte + End Function + Private Sub CargaTipoTransaccion() DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros("Tipo = 'Ing' AND Estatus = 1 ") DdlTipoTransaccion.DataBind() @@ -870,7 +933,7 @@ Partial Class Ventas_ClientesAbonar CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, Folio, 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, - CveProveedorIntermediario:=CveProvIntermediario, ImporteDeduccionesPago:=TxtImporteDeduccionesPago.Text.ToDecimal, FechaEmision:=FechaEmision) + CveProveedorIntermediario:=CveProvIntermediario, ImporteDeduccionesPago:=TxtImporteDeduccionesPago.Text.ToDecimal, FechaEmision:=FechaEmision, CveCorte:=Me.CveCorte) If Folio = "-1" Then TxtFolio.Text = ObjIE.Folio.ToString() End If From c4e58b18fc96eb62e99c4479b241229a94b7c5d9 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 28 Apr 2025 15:51:29 -0700 Subject: [PATCH 3/5] TareasProgramadas Envio de estado cuenta, compras cvetipoOperacion, , reembolsos filtror rwo acumulado, ajkustes carta porte, OC carga desde excel filtro rows vacios, personal cuentas deposito --- Ashx/TareasProgramadas.ashx | 17 +- Compras/Compras.aspx.vb | 6 +- Compras/Proveedores.aspx | 186 ++++++------- Compras/ReembolsosComprobaciones.aspx.vb | 2 +- .../Grales/Formatos/CartaPorteTimbrado.rdlc | 7 +- OC/OC.aspx.vb | 22 ++ OI/Proyecto.aspx | 50 +++- RH/Personal.aspx | 200 +++++++++++++- RH/Personal.aspx.vb | 248 +++++++++++++++--- 9 files changed, 577 insertions(+), 161 deletions(-) diff --git a/Ashx/TareasProgramadas.ashx b/Ashx/TareasProgramadas.ashx index fb461e57e..8e79bea06 100644 --- a/Ashx/TareasProgramadas.ashx +++ b/Ashx/TareasProgramadas.ashx @@ -108,7 +108,9 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState context.Response.Write(retorno) Case "EstadosCuenta" 'CargaEstadosCuenta(context, 119, 227774) - CargaEstadosCuenta(context, 119, -1, FechaEnvio, FechaActual) + 'CargaEstadosCuenta(context, 119, -1, FechaEnvio, FechaActual) + Dim tCveEmpresa As Integer = context.Request("CveEmpresa").ToString.ToEntero + CargaEstadosCuenta(context, tCveEmpresa, -1, FechaEnvio, FechaActual) Case "ScoreCard" CargaScoreCard(context, 140, FechaEnvio) @@ -354,6 +356,9 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState #Region "E S T A D O S D E C U E N T A" Private Sub CargaEstadosCuenta(ByVal context As HttpContext, pCveEmpresa As Integer, pCveCliente As Integer, FechaEnvio As DateTime, FechaActual As DateTime) + + Dim Usuario As Usuario = ValidaUsuarioSistema(100, pCveEmpresa) + Dim Retorno As New JArray() Dim DtEmpresas As DataTable = Nothing Using ObjEmpresas As New ClsSisEmpresas() @@ -364,7 +369,7 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState If DtEmpresas IsNot Nothing Then For Each Row As DataRow In DtEmpresas.Rows - Dim Usuario As Usuario = ValidaUsuarioSistema(100, Row("CveEmpresa").ToString().ToEntero()) + 'Dim Usuario As Usuario = ValidaUsuarioSistema(100, Row("CveEmpresa").ToString().ToEntero()) Dim obj As JObject = EjecutarEnvioEstadoCuenta(Usuario, FechaEnvio, FechaActual, pCveCliente:=pCveCliente) Retorno.Add(obj) @@ -499,7 +504,9 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState Dim Envio As Boolean = False If Not String.IsNullOrEmpty(Correo) Then + 'Correo = "oscar.irigoyen@adssistemas.mx" Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + GuardaLog($"Log envio Estados Cuenta correo {If(Envio, "Enviado", "Error")} CveCliente {CveCliente} ") End If If Envio Then @@ -522,6 +529,7 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState New JProperty("Cliente", Cliente.Nombre) )) End If + End If Next End If @@ -857,7 +865,10 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState If sw.Elapsed.TotalSeconds > 10 Then GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") End If - If MR IsNot Nothing Then MR.Dispose() + If MR IsNot Nothing Then + 'MR.Close() + MR.Dispose() + End If Return Bytes End Function diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 6ed284990..985b03230 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2562,7 +2562,7 @@ Partial Class Compras_Compras DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) End If - If DIOTCveTipoOperacion.Contiene(0, 3) Then ' 85 - Otros + If DIOTCveTipoOperacion.Contiene(0, 3, 4) Then ' 85 - Otros If UsuarioActual.CveEmpresa <> 119 Then DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) @@ -2585,7 +2585,7 @@ Partial Class Compras_Compras DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) End If - If DIOTCveTipoOperacion.Contiene(3) Then ' 85 - Otros + If DIOTCveTipoOperacion.Contiene(3, 4) Then ' 85 - Otros If UsuarioActual.CveEmpresa <> 119 Then DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) @@ -2619,7 +2619,7 @@ Partial Class Compras_Compras DdlRetISRConcepto.Items.Insert(0, New ListItem("Arrendamiento", "2")) End If - If DIOTCveTipoOperacion.Contiene(3) Then ' 85 - Otros + If DIOTCveTipoOperacion.Contiene(3, 4) Then ' 85 - Otros If UsuarioActual.CveEmpresa <> 119 Then DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1")) DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2")) diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index 4a7d61348..4c7dd8fa6 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -3326,89 +3326,89 @@ - -
+
+
-
-
-
-
- - -
-
-
-
- - - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - <%----%> - -
-
-
-
- - - -
-
-
-
-
-
- - - -
-
-
-
- - -
-
-
-
-
- - -
+
+ + +
-
-
- - - +
+
+
+ + + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + + +
+
+
+
+
+
+ + + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + + +
+
-
-
@@ -3427,38 +3427,38 @@
-
-
-
+
+
+
-
-
+
+
-
- - +
+ +
-
-
+
+
-
- - - Seleccione uno - - - - +
+ + + Seleccione uno + + + + + +
-
-
- + + + + +
@@ -320,6 +314,36 @@