From 8bea79998c9a1b13cacdc8b3722cb1d1dc55261b Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 27 Dec 2022 07:52:15 -0700 Subject: [PATCH 01/25] =?UTF-8?q?--=20correcci=C3=B3n=20variable=20ieps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 75e53dde0..326cc6a22 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10219,9 +10219,9 @@ Public Class ClsPaginas Dim Ret As New ConceptosRetenciones If UsuarioActual.Empresa.TipoContabilidad = 2 Then - If ObjConta.GetRetCuenta(38, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + If ObjConta.GetRetCuenta(38, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero - If ObjConta.GetRetCuenta(39, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + If ObjConta.GetRetCuenta(39, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero End If From 3b598306a64aea0edc13befec50bc5aff9f593eb Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 27 Dec 2022 07:52:23 -0700 Subject: [PATCH 02/25] -- liga a prepoliza --- Contabilidad/RegPrePolizaS.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2a712db9b..c17a2cb31 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -575,7 +575,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 272) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) - If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) + If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) If CveConceptoContable.Contiene(30, 204, 66, 92) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) From b3181e6553f4c97f7d4d8f98a9bb01c33075debb Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 27 Dec 2022 07:52:49 -0700 Subject: [PATCH 03/25] -- parametro de lote/caducidad --- Inventarios/ResguardoMaterial.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 2771700f8..4185a3525 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -918,7 +918,7 @@ Partial Class Inventarios_ResguardoMaterial CveSeccionAlmacen = -1 End If If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, - Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, + Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" From ac64566449a927127da5162b5272e7078310a4e4 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 27 Dec 2022 07:53:07 -0700 Subject: [PATCH 04/25] - --- Ventas/CatClasificaciones.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index bf140a196..4043ffbbd 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -214,8 +214,8 @@ Partial Class CatClasificaciones End If End If - GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing ObjClasificaciones.Dispose() + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing CargaDatos() UpDatos.Update() From f257a6d907cd07faf666c6451107ff8a6a008110 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 27 Dec 2022 07:53:39 -0700 Subject: [PATCH 05/25] - salta mensaje de cuenta en E119 --- Ventas/ClientesAbonar.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index f03547ae9..f295d80c9 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -1454,7 +1454,7 @@ Partial Class Ventas_ClientesAbonar If ImporteMovimiento <> 0 AndAlso MsgError = "" Then 'Conta ContPAQ - If (IdCtaContable < 1 Or IdCuentaBancaria < 1) Then + If (IdCtaContable < 1 Or IdCuentaBancaria < 1) AndAlso UsuarioActual.CveEmpresa <> 119 Then CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If @@ -3168,7 +3168,7 @@ Partial Class Ventas_ClientesAbonar DT = ReadExcelFile(Directorio + file.filename, True) - If Not dt.Columns(0).ColumnName.ToUpper = "FOLIO" Then + If Not DT.Columns(0).ColumnName.ToUpper = "FOLIO" Then Alert("El nombre de la primera columna debe ser 'Folio'. Favor de corregirlo", TipoMensaje.MsgAdvertencia) Exit Sub End If From 8ab3b0943c4eb8e4c01d80d44c6b1eddf062e863 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 27 Dec 2022 07:54:19 -0700 Subject: [PATCH 06/25] - ifnull cveusuario --- LogIn.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LogIn.aspx.vb b/LogIn.aspx.vb index 3cf8db7c6..1ec1f9d38 100644 --- a/LogIn.aspx.vb +++ b/LogIn.aspx.vb @@ -11,7 +11,7 @@ Partial Class LogIn #Region " PROPIEDADES " Private Property CveUsuario As Integer Get - Return ViewState("CveUsuario").ToString.ToEntero + Return IfNull(ViewState("CveUsuario"), "-1").ToString.ToEntero End Get Set(value As Integer) ViewState("CveUsuario") = value From 6d947f74c15236fabd4f5246c3fc3be2507b9192 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Dec 2022 16:40:40 -0700 Subject: [PATCH 07/25] =?UTF-8?q?--=20mejora=20en=20contabilizai=C3=B3n=20?= =?UTF-8?q?E13,=20E83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 14 ++++++++++---- Bancos/ProveedoresAbonar.aspx.vb | 11 +++++++---- Compras/Compras.aspx.vb | 2 ++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 326cc6a22..efe2c4f5d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9676,14 +9676,20 @@ Public Class ClsPaginas tImporteCompra = (Pago.ImportePago * TCValuacionCompra).RoundSQL tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL End If + Dim ImportePagoMN As Decimal = Pago.ImportePago + Dim UsaComplementaria As Boolean = True If CompraActual.CveMoneda > 1 Then ImporteME = Pago.ImportePago - 'movimiento de pago proveedor - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, Pago.CveConceptoPago, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacionCompra, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + If UsuarioActual.CveEmpresa.Contiene(13, 83) Then 'caso excepcional de complementarias + UsaComplementaria = False + ImportePagoMN = (Pago.ImportePago * TCValuacionCompra).RoundSQL + End If + 'movimiento de pago proveedor + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImportePagoMN, Pago.CveConceptoPago, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacionCompra, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True 'movimiento de pago proveedor Complementaria - If Not ErrorMovtos AndAlso CompraActual.CveMoneda > 1 Then + If Not ErrorMovtos AndAlso CompraActual.CveMoneda > 1 AndAlso UsaComplementaria Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (ImporteME * TCValuacionCompra - ImporteME).RoundSQL, CveConceptoContableComplementaria, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProvComplementaria, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacionCompra, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True @@ -9833,7 +9839,7 @@ Public Class ClsPaginas End If - If Pago.TipoPago = "DD" AndAlso Not ErrorMovtos Then ' D E U D O R D I V E R S O + If Pago.TipoPago = "DD" AndAlso Not ErrorMovtos Then ' D E U D O R D I V E R S O Dim Ret As New ConceptosRetenciones If UsuarioActual.Empresa.TipoContabilidad = 2 Then If ObjConta.GetRetCuenta(66, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index e95df4dd1..8941c6e1b 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -878,7 +878,7 @@ Partial Class Bancos_ProveedoresAbonar End If Next - Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145) + Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83) Dim ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}" Dim Referencia As String = $"{HdnTipoTransaccionAbreviatura.Value}: {TxtFolio.Text.Trim}" Dim tImporteMN As Decimal = TxtImporte.Text.ToDecimal @@ -899,10 +899,13 @@ Partial Class Bancos_ProveedoresAbonar End If Else + Dim ImporteME As Decimal = 0 + If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then + ImporteME = tImporteMN + tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL + End If - If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL - - If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, tImporteMN, 30, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, tImporteMN, 30, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto, ImporteME:=tImporteMN) Then MsgError = "No se pudo insertar la póliza" End If diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index c83d36b37..f8f7b44d8 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6954,6 +6954,8 @@ Partial Class Compras_Compras Case 5 'Proveedores If CveTipoConcepto = 2 Then ConceptoContable = 305 'cuando es acreedor Dim UsaComplementaria As Boolean = True + + If UsuarioActual.CveEmpresa.Contiene(13, 83) Then UsaComplementaria = False If tipoCambioActual <> 1 Then Select Case ConceptoContable Case 5 From 1e9d5e37bc78f4b27b01c99ba77786004d150684 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 29 Dec 2022 18:56:24 -0700 Subject: [PATCH 08/25] SIG. ajax:MaskedEditExtender para numero de telefono, correcion para no recortar el primero caracterer --- Compras/Proveedores.aspx | 4 ++-- OC/OC.aspx | 2 +- OS/OrdenesServicios.aspx | 2 +- Ventas/Clientes.aspx | 13 ++++++------- Ventas/Ventas.aspx | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index 373264917..81d6807c0 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -280,7 +280,7 @@ <%-- --%> <%-- --%> - + @@ -301,7 +301,7 @@ <%-- --%> - + diff --git a/OC/OC.aspx b/OC/OC.aspx index f44a7c14a..a56f4f8d4 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -2366,7 +2366,7 @@
<%----%> - +
diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index 28afc466f..8265b0968 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -172,7 +172,7 @@
- +
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 3d80a5652..e806ed1dc 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -565,8 +565,7 @@
- - +
@@ -583,7 +582,7 @@
- +
@@ -600,7 +599,7 @@
- +
@@ -1851,7 +1850,7 @@
- + <%----%> @@ -5096,7 +5095,7 @@
- +
@@ -5365,7 +5364,7 @@
<%----%> - +
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index bbb1ec166..8ee7e4337 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -5774,7 +5774,7 @@
<%----%> - +
@@ -8115,7 +8115,7 @@
- +
From 93fd95f5ebee0f57507bc5a97ae511c5f0a905b1 Mon Sep 17 00:00:00 2001 From: MLopez Date: Tue, 3 Jan 2023 17:20:05 -0700 Subject: [PATCH 09/25] =?UTF-8?q?Cat=C3=A1logo=20Empresas:=20Contacto=20->?= =?UTF-8?q?=20Representante=20legal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sistemas/Empresa.aspx | 2 +- Sistemas/Empresa.aspx.vb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sistemas/Empresa.aspx b/Sistemas/Empresa.aspx index 73c79e8ff..5e2c2ed6d 100644 --- a/Sistemas/Empresa.aspx +++ b/Sistemas/Empresa.aspx @@ -203,7 +203,7 @@ - Contacto: + Representante Legal: diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb index b095f668a..4f3664346 100644 --- a/Sistemas/Empresa.aspx.vb +++ b/Sistemas/Empresa.aspx.vb @@ -258,7 +258,7 @@ Partial Class Sistemas_Empresa TxtCP.Text = .CP.ToString TxtRFC.Text = .RFC TxtTelefono.Text = .Telefono - TxtContacto.Text = .Contacto + TxtContacto.Text = .Contacto 'Representante legal TxtMail.Text = .Mail DdlTipoFacturacion.SelectedValue = .TipoFacturacion TxtBIUsuario.Text = .BIUsuario From 9b0756c96072ebe4d3ce18f387b6a3965c560d78 Mon Sep 17 00:00:00 2001 From: MLopez Date: Wed, 4 Jan 2023 12:19:30 -0700 Subject: [PATCH 10/25] =?UTF-8?q?Extensiones:=20Corregir=20ruta=20de=20alg?= =?UTF-8?q?unos=20Logs=20Estaban=20fallando=20silenciosamente=20porque=20n?= =?UTF-8?q?o=20ten=C3=ADa=20permiso=20para=20escribir=20en=20la=20carpeta?= =?UTF-8?q?=20ra=C3=ADz=20del=20proyecto,=20ahora=20usa=20la=20carpeta=20L?= =?UTF-8?q?og=20que=20si=20tiene=20permisos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/modExtensiones.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index d00ade5fd..ae5d47fc5 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -240,7 +240,7 @@ Namespace Extensiones strLineaTMP = String.Format("{0} {0}{3}{2}:{1}{0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto) Try - ArchivoW = New StreamWriter(String.Format("{0}\Log.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) + ArchivoW = New StreamWriter(String.Format("{0}\Log\Log.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) Catch ex As Exception Exit Sub End Try @@ -260,7 +260,7 @@ Namespace Extensiones Dim strLineaTMP As String strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto) Try - ArchivoW = New StreamWriter(String.Format("{0}\LogMail.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) + ArchivoW = New StreamWriter(String.Format("{0}\Log\LogMail.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) Catch ex As Exception Exit Sub End Try @@ -280,7 +280,7 @@ Namespace Extensiones ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10) strLineaTMP = String.Format("{0}{1} .. PAC: {2} - Modulo: {3} ..{4}:{5}", Chr(13), Chr(10), CvePAC, Modulo, Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString) Try - ArchivoW = New StreamWriter(String.Format("{0}\LogTimbrado.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) + ArchivoW = New StreamWriter(String.Format("{0}\Log\LogTimbrado.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) Catch ex As UnauthorizedAccessException 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) Exit Sub @@ -303,7 +303,7 @@ Namespace Extensiones strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto) Try - ArchivoW = New StreamWriter(String.Format("{0}\LogCancelacionSAT.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) + ArchivoW = New StreamWriter(String.Format("{0}\Log\LogCancelacionSAT.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) Catch ex As Exception Exit Sub End Try From 99953a69066dc80832ee440684c6635e9119c71f Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 4 Jan 2023 16:12:21 -0700 Subject: [PATCH 11/25] Calculo de usados desde orden de servicio --- Ventas/Ventas.aspx.vb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1908b258e..57ca509db 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4467,7 +4467,12 @@ Partial Class Ventas OS.Dispose() - TxtTotal.Text = TmpDT.SUM("Total").FormatoNumero() + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + CalculaUsados() + End If + + CalculaTotalesVenta(False) GvPS.DataSource = TmpDT DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") @@ -34130,7 +34135,7 @@ Partial Class Ventas Private Function DeshabilitarAplicarNotaDeCredito(RFC As String) As Boolean Dim Retorno As Boolean = False - If UsuarioActual.CveEmpresa = 119 AndAlso RFC.Contiene("XAXX010101000", "XEXX010101000") Then + If UsuarioActual.CveEmpresa = 119 AndAlso RFC.Contiene("XAXX010101000", "XEXX010101000") AndAlso UsuarioActual.CveUsuario <> 1719 Then LBNotaCredito.Visible = False UpnTools.Update() Retorno = True From 13cc62475b05ee1b90367cb4c2e7917c34bf40aa Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 4 Jan 2023 16:13:34 -0700 Subject: [PATCH 12/25] Correcion de rdlc de balance general --- Contabilidad2/Reportes/RepSituacionFinanciera.rdlc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc index 288ba1a15..c783cb174 100644 --- a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc +++ b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc @@ -3035,31 +3035,32 @@ ReportParameter1 + =Sum(iif(Fields!Tipo.Value.ToString() = "A" OR Fields!Tipo.Value.ToString() = "B" OR Fields!Tipo.Value.ToString() = "C" OR Cint(Fields!TipoCuenta.Value) = 9 , Fields!ImporteActual.Value, 0) , "DataSet1") - =Sum( iif(Fields!Sup.Value = "ACTIVO NO CIRCULANTE" OR Fields!Sup.Value="ACTIVO CIRCULANTE" OR Cint(Fields!TipoCuenta.value) = 9 , Fields!ImporteAnterior.Value, 0), "DataSet1") + =Sum(iif(Fields!Tipo.Value.ToString() = "A" OR Fields!Tipo.Value.ToString() = "B" OR Fields!Tipo.Value.ToString() = "C" OR Cint(Fields!TipoCuenta.Value) = 9 , Fields!ImporteAnterior.Value, 0) , "DataSet1") - =Sum( iif(Fields!Sup.Value = "PASIVO CIRCULANTE" OR Fields!Sup.Value = "PASIVO NO CIRCULANTE" , Fields!ImporteActual.Value, 0), "DataSet1") + =Sum(iif(Fields!Tipo.Value.ToString() = "D" AND Cint(Fields!TipoCuenta.Value) = 3 , Fields!ImporteActual.Value, 0) , "DataSet1") - =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "PASIVO CIRCULANTE" OR Fields!Sup.Value = "PASIVO NO CIRCULANTE" , Fields!ImporteAnterior.Value, 0),"DataSet1") + =Sum(iif(Fields!Tipo.Value.ToString() = "D" AND Cint(Fields!TipoCuenta.Value) = 3 , Fields!ImporteAnterior.Value, 0) , "DataSet1") true =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" OR Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteActual.Value, 0),"DataSet1") - =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" OR Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteActual.Value, 0),"DataSet1") + =Sum(iif(Fields!Tipo.Value.ToString() = "F" AND (Cint(Fields!TipoCuenta.Value) = 5 OR Cint(Fields!TipoCuenta.Value) = 6 OR Cint(Fields!TipoCuenta.Value) = 7 OR Cint(Fields!TipoCuenta.Value) = 8) , Fields!ImporteActual.Value, 0) , "DataSet1") =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" OR Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteAnterior.Value, 0),"DataSet1") - =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" OR Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteActual.Value, 0),"DataSet1") + =Sum(iif(Fields!Tipo.Value.ToString() = "F" AND (Cint(Fields!TipoCuenta.Value) = 5 OR Cint(Fields!TipoCuenta.Value) = 6 OR Cint(Fields!TipoCuenta.Value) = 7 OR Cint(Fields!TipoCuenta.Value) = 8) , Fields!ImporteAnterior.Value, 0) , "DataSet1") =Variables!TotalPasivoActual.Value+Variables!TotalPatrimonioHActual.Value From d15f725c8856458bfbc9b0483188d02d8702a791 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 4 Jan 2023 16:21:31 -0700 Subject: [PATCH 13/25] Estado de cuenta con stimulsoft --- Ventas/Clientes.aspx.vb | 255 +++++++++++++++++++++------------------- 1 file changed, 137 insertions(+), 118 deletions(-) diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 4e92f2575..9bc11695d 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -941,10 +941,10 @@ Partial Class Clientes LnkAgregarLineaAdicional.Visible = True GetLineasAdicionales() - End If - - - + End If + + + End If 'EN SERIO SE OCUPA EN CADA POSTBACK ??? IPP 7 SEPTIEMNRE 2017 @@ -4068,10 +4068,10 @@ Partial Class Clientes Private Sub GenerarPDFCrystal(Optional Formato As String = "PDF") Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.rpt", UsuarioActual.Empresa.Ruta)) - Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - - 'OBTENEMOS LOS DATOS + Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + 'OBTENEMOS LOS DATOS Dim DtCxCFact As DataTable = Nothing Dim FI = If(TxtFechaInicioCxP.Text = "" Or TxtFechaInicioCxP.Text = "__/__/____", "-1", TxtFechaInicioCxP.Text) @@ -4276,7 +4276,17 @@ Partial Class Clientes End Try Else If Archivo.Exists Then - ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) + Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.mrt", UsuarioActual.Empresa.Ruta)) + If ArchivoSti.Exists Then + Dim listass As New List(Of ReportParameter) + For Each item As CrystalParametro In lista + listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString())) + Next + ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato) + Else + ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) + End If + Else ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) End If @@ -4319,7 +4329,16 @@ Partial Class Clientes DtCxCFact2.Rows.Add(drr) If Archivo.Exists Then - ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) + Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.mrt", UsuarioActual.Empresa.Ruta)) + If ArchivoSti.Exists Then + Dim listass As New List(Of ReportParameter) + For Each item As CrystalParametro In lista + listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString())) + Next + ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato) + Else + ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) + End If Else ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) End If @@ -4342,9 +4361,9 @@ Partial Class Clientes End Using End If - End Sub + End Sub #End Region - + #Region "E N V I O C O R R E O" Private Sub EnviaCorreo(Liga As String, LigaActivar As String) @@ -4412,11 +4431,11 @@ Partial Class Clientes a.GuardaLog() Dim Mail As New ClsSisMail() Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body) - End Sub + End Sub #End Region - + #Region " COTIZACIONES " - + Protected Sub BtnVerMasCot_Click(sender As Object, e As EventArgs) If BtnVerMasCot.Text = "Ver Más" Then CargaCotizaciones(-1) @@ -4486,11 +4505,11 @@ Partial Class Clientes HLFacturar.HRef = $"/Ventas/Ventas.aspx?CveCotizacion={e.Row.DBCampo("CveVenta")}" End If End If - End Sub + End Sub #End Region - + #Region "D I R E C C I O N E N V I O " - + Private Sub CargaCombosDirecionesClientesSAT() CargaDirClientePais() CargaDirClienteEstado() @@ -4713,12 +4732,12 @@ Partial Class Clientes End If CargaDireccionesEnvio() - End Sub - + End Sub + #End Region - + #Region " IMPORTAR SALDOS " - + Private Sub HLImportarSaldos_Click(sender As Object, e As EventArgs) Handles HLImportarSaldos.Click CargaClientesImportarSaldos() RegistraScript(String.Format("$('#{0}').modal();", "DivImportarSaldos")) @@ -4822,9 +4841,9 @@ Partial Class Clientes e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ChkSaldo(this,{0},{1});", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.DBCampo("Saldo"))) e.Row.FCTextBox("TxtImporte").Attributes.Add("onKeyUp", String.Format("CambiaSaldo({0},this,{1});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"))) End If - End Sub + End Sub #End Region - + #Region "Cuentas/Equipos" Public Sub BtnAgregarCtaEquipo_Click(sender As Object, e As EventArgs) HdnModalidad.Value = "I" @@ -5412,9 +5431,9 @@ Partial Class Clientes End If Return Retorno - End Function + End Function #End Region - + #Region "GPS" Protected Sub btnCargaArrayDisp_Click(sender As Object, e As EventArgs) Handles btnCargaArrayDisp.Click If hdnArrayDispositivo.Value.Length > 0 Then @@ -5555,10 +5574,10 @@ Partial Class Clientes UpMoverDispositivo.Update() RegistraScript($"CargaModalMoverDispositivo({GvRow.DataKey("CveDispositivo")});") - End Sub - + End Sub + #End Region - + #Region "Sucursales" Public Sub CreaDTSucursales() @@ -5792,14 +5811,14 @@ Partial Class Clientes End If End If End If - End Sub - + End Sub + #End Region - + #Region "G P S" - - - + + + Private Sub EnviaCorreoGPS(Liga As String, LigaActivar As String) Try @@ -5870,16 +5889,16 @@ Partial Class Clientes End If ObjClientes.Dispose() - End Sub - - + End Sub + + #End Region - + #Region "C O N T R A T O S" - - - - + + + + Private Sub CargaDatosContrato() If CveCliente <= 0 Then Exit Sub @@ -5924,10 +5943,10 @@ Partial Class Clientes e.Row.CssClass = "Totales white" End If End If - End Sub - + End Sub + #End Region - + #Region "M E T O D O S " Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then @@ -6337,13 +6356,13 @@ Partial Class Clientes End If - 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($"{UsuarioActual.Empresa.Ruta}/Logo.png") @@ -6418,18 +6437,18 @@ Partial Class Clientes ObjClientes.Dispose() Return retorno - End Function - - + End Function + + #End Region - + #Region "C O B R A N Z A" Public Sub Visitas_Click(sender As Object, e As EventArgs) RegistraScript(String.Format("$('#{0}').modal();", "DivVisitas")) - End Sub - + End Sub + #End Region - + #Region "Usuarios" Protected Sub GvUsuarios_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero() @@ -6464,12 +6483,12 @@ Partial Class Clientes e.Row.Cells(5).Visible = False End If End If - End Sub + End Sub #End Region - - + + #Region "C U E N T A S - B A N C A R I A S" - + Private Sub CargaCuentasBancarias(Optional RecargaGlobal As Boolean = False) If CveCliente <= 0 Then Exit Sub @@ -6642,8 +6661,8 @@ Partial Class Clientes TxtNumeroCuenta2.Text = "" TxtConvenioCIE2.Text = "" TxtReferencia2.Text = "" - End Sub - + End Sub + #Region "GRIDVIEW - CUENTAS BANCARIAS" Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -6699,10 +6718,10 @@ Partial Class Clientes GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, -1, True) = Nothing End If - End Sub - + End Sub + #End Region - + Private Sub CargaPSGridCuentasBancos() If CveCliente > 0 Then GvBancosCuentas.DataSource = DTCuentasBancos @@ -6760,9 +6779,9 @@ Partial Class Clientes divestatus.Visible = True UpAddBancos.Update() RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddCuentasBancarias")) - End Sub + End Sub #End Region - + #Region "C L I E N T E S P A G O S R E A L I Z A D O S I M P R I M I R P D F/Excel" Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click GenerarPDF("Excel") @@ -6784,11 +6803,11 @@ Partial Class Clientes ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato) - End Sub + End Sub #End Region - + #Region "VENTAS" - + Public Function imprimirFacturaVenta(CveVenta As Integer) As Byte() Dim ObjVentas As New ClsVentas Dim Vta As Modelos.Factura = Nothing @@ -7019,10 +7038,10 @@ Partial Class Clientes ObjVentas.Dispose() Return PdfFactura(Vta) - End Function - + End Function + #End Region - + #Region "COMERCIO EXTERIOR" Public Sub CargaCombosComercioExterior() @@ -7146,12 +7165,12 @@ Partial Class Clientes End Sub Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs) CargaColonia() - End Sub - + End Sub + #End Region - + #Region "D O C U M E N T A C I O N " - + Private Sub CargaDocumentacionCliente() Dim objRH As New ClsEdocumentacion() @@ -7789,12 +7808,12 @@ Partial Class Clientes RegistraScript("Download('" & baseUrl & "')") - End Sub - + End Sub + #End Region - + #Region "D O C U M E N T O S V E N T A S" - + Private Sub CargaDocumentosVenta(tCveCliente As Integer) Dim objInv As New ClsEdocumentacion @@ -7965,11 +7984,11 @@ Partial Class Clientes objRH.Dispose() - End Sub - - + End Sub + + #End Region - + #Region "PERSONA FISICA" Protected Sub LnkPersonaFisica_Click(sender As Object, e As EventArgs) RegistraScript("$('#DivModalPersonaFisica').modal();") @@ -7994,9 +8013,9 @@ Partial Class Clientes ObjCliente.Dispose() UpDatos.Update() - End Sub + End Sub #End Region - + #Region "USUARIOS PLATAFORMA CLIENTE - 6 " Protected Sub CargaUsuariosPortalCliente() Dim objUsuario As ClsSisUsuarios = New ClsSisUsuarios @@ -8005,19 +8024,19 @@ Partial Class Clientes GvUsuarios.DataBind() End If objUsuario.Dispose() - End Sub + End Sub #End Region - + #Region " DEVOLVER DINERO ANT/NC " Private Sub InicializaDevolverDinero() If UsuarioActual.TienePermisoProceso(247) Then GVAnticipos.Columns(6).Visible = True End If - End Sub + End Sub #End Region - + #Region "MODAL GRAFICA/PEDIDOS" - + Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs) If CargaDatatables() Then RegistraScript("$('#DivModalGrafica').modal('show')") @@ -8354,13 +8373,13 @@ Partial Class Clientes RegistraScript($"CargaGraficaCompratamientoSaldoMensual({Dt5.ToJson},{Dt6.ToJson.Replace($"{Chr(34)}True{Chr(34)}", "true").Replace($"{Chr(34)}False{Chr(34)}", "false")})", "55") UPModalProd.Update() - End Sub - - + End Sub + + #End Region - + #Region "TAB - COMPORTAMIENTO DE VENTAS" - + Private Sub CargaGrupo() DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3")) DdlGrupo.Items.Insert(1, New ListItem("Clasificacion", "4")) @@ -8544,12 +8563,12 @@ Partial Class Clientes ObjVentas.Dispose() GvComportamientoVenta.DataBind() UpDatosComportamientoVenta.Update() - End Sub - + End Sub + #End Region - + #Region "DISPOSITIVOS" - + Protected Sub LnkMoverDispositivo_Click(sender As Object, e As EventArgs) Dim CveDispositivo As Integer = HdnCveDispositivoMover.Value.ToEntero() Dim CveCliente As Integer = DdlClienteDispositivo.SelectedValue.ToEntero() @@ -8587,10 +8606,10 @@ Partial Class Clientes CargaEventoBitacora() NombreDispositivo = "" RegistraScript("$('#DivMoverDispositivo').modal('hide');") - End Sub - + End Sub + #End Region - + #Region "CRM" Protected Sub CargaDatosCRM() Dim ObjCRM = New ClsCRM() @@ -8690,9 +8709,9 @@ Partial Class Clientes Alert("Se Unificó correctamente al Cliente con la Empresa CRM.") End If End If - End Sub + End Sub #End Region - + #Region "PORCENTAJE PRECIO DE MARCAS" Private Sub LnkPorcentajeMarcas_Click(sender As Object, e As EventArgs) Handles LnkPorcentajeMarcas.Click RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajeMarcas")) @@ -8917,9 +8936,9 @@ Partial Class Clientes ObjPS.Dispose() - End Sub + End Sub #End Region - + #Region "PORCENTAJE PRECIO DE PRODUCTOS" Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios")) @@ -9155,12 +9174,12 @@ Partial Class Clientes Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs) DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero(), DdlProducto2) - End Sub + End Sub #End Region - + #Region " A C U M U L A D O R E S" - - + + Protected Sub LnkFacturaUsadosCargos_Click(sender As Object, e As EventArgs) 'CveVentaNota = 0 @@ -9803,11 +9822,11 @@ Partial Class Clientes ' ObjFactura.Timbre = PreParaTimbre(ObjFactura) - End Sub - - + End Sub + + #End Region - + #Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel" Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones") From 578d016b249901a3712c1612817aa054a519dae9 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Wed, 4 Jan 2023 18:46:38 -0700 Subject: [PATCH 14/25] Ordenes de servicio, correciones soportes IE,Saldos iniciales,catps --- App_Code/ClsContabilidad.vb | 4 +- Bancos/IE.aspx.vb | 2 +- Compras/Compras.aspx.vb | 1 + Compras/PopUpVerFactura.aspx.vb | 8 +- Empresas/140/Formatos/OrdenServicio.rdlc | 123 ++--------------------- General/SaldosIniciales.aspx.vb | 28 ++++-- Inventarios/EntradasSalidas.aspx | 2 +- Inventarios/EntradasSalidas.aspx.vb | 13 ++- OS/OrdenesServicios.aspx | 12 ++- OS/OrdenesServicios.aspx.vb | 22 ++-- OS/RepOrdenesServicios.aspx | 57 +++++++++-- OS/RepOrdenesServicios.aspx.vb | 53 ++++++---- OS/RepServicioDomicilio.aspx | 2 +- OS/RepServicioDomicilio.aspx.vb | 36 +++---- Ventas/CatPS.aspx.vb | 22 +++- 15 files changed, 193 insertions(+), 192 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 13fb98ade..f49810f6a 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5969,7 +5969,8 @@ Public Class ClsContabilidad Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, - Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional RegeneraCuenta As Boolean = False) As Boolean + Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional RegeneraCuenta As Boolean = False, + Optional OpActualizarClasificacion As Boolean = False) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasAsignacionesAdd") @@ -5991,6 +5992,7 @@ Public Class ClsContabilidad .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto .Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta + .Add("@OpActualizarClasificacion", SqlDbType.Bit).Value = OpActualizarClasificacion End With Try diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index fb76766aa..f69438c0f 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1423,7 +1423,7 @@ Partial Class Bancos_IE If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Or IDCtaBeneficiario <= 0 AndAlso UsuarioActual.CveEmpresa = 48 Then Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False Else diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 70725c878..bcbc9dbe8 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -12406,6 +12406,7 @@ Partial Class Compras_Compras GvPS.Columns(15).Visible = True GvPS.Columns(16).Visible = True GvPS.Columns(17).Visible = True + GvPS.Columns(18).Visible = True 'Panel General UpPresupuestosAC.Visible = True diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index fc5f5df39..a4b0f456c 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -5422,7 +5422,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Solicito", dr("PersonaSolicito").ToString)) params.Add(New ReportParameter("Descripcion", dr("Descripcion").ToString)) params.Add(New ReportParameter("Recibio", UsuarioActual.Nombre)) - params.Add(New ReportParameter("FechaRecibido", dr("FechaRecepcion").ToString)) + params.Add(New ReportParameter("FechaRecibido", dr("FechaRecepcion").ToString.ToDate.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("FolioOS", dr("Folio").ToString)) params.Add(New ReportParameter("ClienteTelefono", dr("Telefono").ToString)) params.Add(New ReportParameter("ClienteCalle", dr("Direccion").ToString)) @@ -5452,6 +5452,12 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Año", dr("Año").ToString)) params.Add(New ReportParameter("TelefonoContacto", dr("TelefonoContacto").ToString)) + params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy"))) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + + + + 'End If diff --git a/Empresas/140/Formatos/OrdenServicio.rdlc b/Empresas/140/Formatos/OrdenServicio.rdlc index 4a541f29e..bf914db10 100644 --- a/Empresas/140/Formatos/OrdenServicio.rdlc +++ b/Empresas/140/Formatos/OrdenServicio.rdlc @@ -232,7 +232,7 @@ Cantidad + Black @@ -240,7 +240,6 @@ Black - 1pt @@ -278,7 +277,7 @@ PS + Black @@ -286,102 +285,6 @@ Black - 1pt - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.20312cm - - - - - true - true - - - - - - - - - - - - Textbox29 - - - - Black - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - Black - - - @@ -415,15 +318,12 @@ - - Before - DataSet1 2.78954cm 0.06614cm - 1.08562cm + 0.8825cm 16.19696cm @@ -1360,7 +1257,7 @@ - =Parameters!NombreEmpresa.Value + BDH BATERIAS DISTRIBUCIONES DE HERMOSILLO - 0.15874cm + 0.15873cm 0.08599cm 0cm 20.21078cm diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index a4319c79c..76cec5493 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -647,7 +647,7 @@ Partial Class General_SaldosIniciales Dim DTCuentasContables As New DataTable - If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + If UsuarioActual.Empresa.TipoContabilizacion = 1 Or UsuarioActual.CveEmpresa.Contiene(172) Then Dim ObjConta As New ClsContabilidad If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then @@ -2365,14 +2365,14 @@ Partial Class General_SaldosIniciales DTClasificaiones.CaseSensitive = False - For Each dRow As DataRow In dt.Rows + For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows - Dim Clasificacion As String = dRow("Clasificacion").ToString().Trim - Dim Categoria As String = dRow("Categoria").ToString().Trim - Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString().Trim.ToUpper - Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString().Trim.Replace("-", "") - Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString().Trim.Replace("-", "") + Dim Clasificacion As String = Regex.Replace(dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, ""), "[^\u0009\u000A\u000D\u0020-\u007E]", "") + Dim Categoria As String = dRow("Categoria").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") + Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString().Trim.ToUpper.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") + Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString().Trim.Replace("-", "").Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") + Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString().Trim.Replace("-", "").Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") Dim CveClasificacion As Integer = -1 Dim CveUsoClasificacion As Integer = -1 @@ -2441,13 +2441,19 @@ Partial Class General_SaldosIniciales Else ErrorProceso = True End If + Else + + If Not ObjClasificaciones.UpdateClasificacion(Clasificacion, "-1", -1, "-1", -1, "-1", -1, "-1", True, True, CveCategoria, UsuarioActual.CveUsuario, CveClasificacion, UsoClasificacion:=CveUsoClasificacion) Then + ErrorProceso = True + End If + End If If Not ErrorProceso Then If CveCuentaContableIngreso > 0 Then - If Not AsignacionCuenta(ObjConta, 4, CveCuentaContableIngreso, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion) Then + If Not AsignacionCuenta(ObjConta, 4, CveCuentaContableIngreso, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion, OpActualizarClasificacion:=True) Then ErrorProceso = True Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) Exit For @@ -2455,7 +2461,7 @@ Partial Class General_SaldosIniciales End If If CveCuentaContableGasto > 0 Then - If Not AsignacionCuenta(ObjConta, 6, CveCuentaContableGasto, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion) Then + If Not AsignacionCuenta(ObjConta, 6, CveCuentaContableGasto, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion, OpActualizarClasificacion:=True) Then ErrorProceso = True Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) Exit For @@ -2890,7 +2896,7 @@ Partial Class General_SaldosIniciales Private Function AsignacionCuenta(ObjContabilidad As ClsContabilidad, CveConceptoContable As Integer, CveCuentaContable As Integer, CveBancoCuenta As Integer, CveProveedor As Integer, CveCliente As Integer, - CvePersonal As Integer, CveEmpresa As Integer, CveClasificacion As Integer) As Boolean + CvePersonal As Integer, CveEmpresa As Integer, CveClasificacion As Integer, Optional OpActualizarClasificacion As Boolean = False) As Boolean Dim Respuesta As Boolean = False @@ -2898,7 +2904,7 @@ Partial Class General_SaldosIniciales If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, CveEmpresa, CveCuentaContable, -1, CveProveedor, CveCliente, CvePersonal, CveClasificacion, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, - CveTipoGasto:=-1, RegeneraCuenta:=False) Then + CveTipoGasto:=-1, RegeneraCuenta:=False, OpActualizarClasificacion:=OpActualizarClasificacion) Then Respuesta = True End If diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index e3be45123..35e7c1ee6 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -706,7 +706,7 @@
- +
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index bd8a774a5..feebf894c 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -373,7 +373,7 @@ Partial Class Inventarios_EntradasSalidas End If - If IfNull(Request("APOYO"), "").ToString = "1" Then + If IfNull(Request("AL"), "").ToString = "1" Then DivEmitirTransitorio.Visible = True EsApoyoLogistico = True End If @@ -643,7 +643,8 @@ Partial Class Inventarios_EntradasSalidas End If If EsApoyoLogistico Then - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (27)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) + DdlAlmacen.Items.Clear() + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (27)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) End If DdlAlmacenInventarioFisico.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) @@ -1435,7 +1436,7 @@ Partial Class Inventarios_EntradasSalidas Private Sub AgregarPS() - Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("") If ChkEmitirTimbrado.Checked AndAlso ChkEmitirCartaPorte.Checked Then If Not ValidaPSSAT(DrPS) Then Exit Sub @@ -2385,7 +2386,13 @@ Partial Class Inventarios_EntradasSalidas If UsuarioActual.CveUsuario.Contiene(2185, 100) Then DdlConcepto.Items.Add(New ListItem("Entrada por Ajuste", "32")) DdlConcepto.Items.Add(New ListItem("Salida por Ajuste", "34")) + End If + + If EsApoyoLogistico Then + DdlConcepto.Items.Clear() + DdlConcepto.Items.Add(New ListItem("Selecione Uno", "-1")) + DdlConcepto.Items.Add(New ListItem("Salida de Almacen", "3")) End If DdlConcepto.SelectedValue = "-1" diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index c1e5907b2..1508587d5 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -146,15 +146,17 @@
+
Tipo de Orden:
- +
+
@@ -314,10 +316,10 @@ - - + + - - +
#Cant#Cant Servicio + Cuenta y/o Equipo
@@ -326,7 +328,7 @@
ComandosComandos
diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index e51c0bf5a..f358ae335 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -6,6 +6,7 @@ Imports System.IO Imports System.Data Imports Microsoft.Reporting.WebForms Imports ADSNetLibrary.SIGAPI.Models.Sistema +Imports Telerik.Charting.Styles 'Imports msExcel = Microsoft.Office.Interop.Excel 'Imports VBIDE @@ -375,19 +376,24 @@ Partial Class OS_OrdenesServicios If CveOS = -1 Then CargaCliente(-1, 1, True) End If - - Else - LblCuentaEquipoTH.Visible = False + LblCuentaEquipoTH.Visible = False DdlCuentaEquipo.Visible = False End If If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - 'DivDetalles.Attributes.Add("style", "display:none") 'No se usa .visible = false pora que la llamada a updatepanel no cause errores de js en el cliente + DivMateriales.Attributes.Add("style", "display:none") 'No se usa .visible = false pora que la llamada a updatepanel no cause errores de js en el cliente TREstatus.Visible = False + LblCuentaEquipoTH.Visible = False + DdlCuentaEquipo.Visible = False + + + + + TREstatus2.Visible = If(TipoEstatus.Contiene(4, 5), False, True) DdlPsModalFinalizar.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") @@ -1575,10 +1581,10 @@ Partial Class OS_OrdenesServicios Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowIndex = 0 Then - e.Row.Cells(0).Width = Unit.Pixel(200) - e.Row.Cells(1).Width = Unit.Pixel(200) - e.Row.Cells(2).Width = Unit.Pixel(100) - e.Row.Cells(3).Width = Unit.Pixel(500) + e.Row.Cells(0).Width = 200 + e.Row.Cells(1).Width = 200 + e.Row.Cells(2).Width = 100 + e.Row.Cells(3).Width = 500 End If e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left End If diff --git a/OS/RepOrdenesServicios.aspx b/OS/RepOrdenesServicios.aspx index ef3f9d5dd..9ca9c35ee 100644 --- a/OS/RepOrdenesServicios.aspx +++ b/OS/RepOrdenesServicios.aspx @@ -75,12 +75,28 @@ - + <%-- --%> Reporte de Ordenes de Servicio + + + + + + +
  • + Excel +
  • +
    + + + +
    + +
    @@ -226,6 +242,36 @@ + + + Estatus + + + + + + + + + + Técnico Asignado + + + + + + + + + + Ubicación + + + + + + + Fecha Recepción @@ -243,14 +289,7 @@ - - - Estatus - - - - - + Fecha Cita diff --git a/OS/RepOrdenesServicios.aspx.vb b/OS/RepOrdenesServicios.aspx.vb index 18427905d..0b97bc7ba 100644 --- a/OS/RepOrdenesServicios.aspx.vb +++ b/OS/RepOrdenesServicios.aspx.vb @@ -82,28 +82,29 @@ Partial Class OS_RepOrdenesServicios Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.RowIndex = 0 Then - e.Row.Cells(0).Width = Unit.Pixel(50) - e.Row.Cells(1).Width = Unit.Pixel(200) - e.Row.Cells(2).Width = Unit.Pixel(130) - 'e.Row.Cells(3).Width = Unit.Pixel(100) - e.Row.Cells(4).Width = Unit.Pixel(100) - e.Row.Cells(5).Width = Unit.Pixel(100) - 'e.Row.Cells(6).Width = Unit.Pixel(100) - End If + 'If e.Row.RowIndex = 0 Then + ' e.Row.Cells(0).Width = Unit.Pixel(50) + ' e.Row.Cells(1).Width = Unit.Pixel(200) + ' e.Row.Cells(2).Width = Unit.Pixel(130) + ' 'e.Row.Cells(3).Width = Unit.Pixel(100) + ' e.Row.Cells(4).Width = Unit.Pixel(100) + ' e.Row.Cells(5).Width = Unit.Pixel(100) + ' 'e.Row.Cells(6).Width = Unit.Pixel(100) + 'End If e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & "" - e.Row.FCLabel("LtlCliente").Text = "" & e.Row.FCLabel("LtlCliente").Text & "" - e.Row.FCLiteral("LtlFechaRecepcion").Text = "" & e.Row.FCLiteral("LtlFechaRecepcion").Text & "" - e.Row.FCLabel("LtlDescripcion").Text = "" & e.Row.FCLabel("LtlDescripcion").Text & "" - e.Row.FCLabel("LtlUsuarioRecibio").Text = "" & e.Row.FCLabel("LtlUsuarioRecibio").Text & "" - e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = "" & e.Row.FCLiteral("LtlEstatusOrdenServicio").Text & "" + 'e.Row.FCLabel("LtlCliente").Text = "" & e.Row.FCLabel("LtlCliente").Text & "" + 'e.Row.FCLiteral("LtlFechaRecepcion").Text = "" & e.Row.FCLiteral("LtlFechaRecepcion").Text & "" + 'e.Row.FCLabel("LtlDescripcion").Text = "" & e.Row.FCLabel("LtlDescripcion").Text & "" + 'e.Row.FCLabel("LtlUsuarioRecibio").Text = "" & e.Row.FCLabel("LtlUsuarioRecibio").Text & "" + 'e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = "" & e.Row.FCLiteral("LtlEstatusOrdenServicio").Text & "" + End If End Sub - Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click - GvDatos.ExportToExcel("RepOrdenesServicio_" & Now.ToShortDateString) - End Sub + 'Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click + ' GvDatos.ExportToExcel("RepOrdenesServicio_" & Now.ToShortDateString) + 'End Sub #Region "O R D E N A M I E N T O" Private Sub OrdenaDatos() @@ -119,4 +120,22 @@ Partial Class OS_RepOrdenesServicios CargaDatos() UpDatos.Update() End Sub + + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub + + Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + + Imprimir("Excel") + End Sub + Private Sub Imprimir(Optional reporte As String = "PDF") + If GvDatos.Rows.Count > 0 Then + Dim StrFiltro As New StringBuilder + If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin: {0}", txtFechaF.Text) + ExportToExcelG(GvDatos, "OrdenesServicio .xlsx", "Ordenes de Servicio ", UsuarioActual, StrFiltro.ToString, 100, 150) + Else + Alert("Debe consultar para generar un excel", TipoMensaje.MsgAdvertencia) + End If + End Sub + End Class diff --git a/OS/RepServicioDomicilio.aspx b/OS/RepServicioDomicilio.aspx index 8d9eaa9d8..8ed61ce93 100644 --- a/OS/RepServicioDomicilio.aspx +++ b/OS/RepServicioDomicilio.aspx @@ -180,7 +180,7 @@ Orden de Servicio:
    - +
    Asignar diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index 535c6e939..94319395a 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -321,28 +321,28 @@ Partial Class OS_RepServicioDomicilio Private Sub CargaTecnicosAsignar() - Dim ObjOS As New ClsOS - Dim TecnicosSubProyectos As New DataTable - Dim TecnicosResultado As New DataTable + 'Dim ObjOS As New ClsOS + 'Dim TecnicosSubProyectos As New DataTable + 'Dim TecnicosResultado As New DataTable - If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then - TecnicosSubProyectos = ObjOS.DtResultados - End If + 'If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then + ' TecnicosSubProyectos = ObjOS.DtResultados + 'End If - For Each SubProyecto As DataRow In DT_OSSubProyectos.Rows - Dim TecnicosSubProyectoAux As DataTable = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}'", SubProyecto.Item("SubProyecto"))) - If TecnicosSubProyectoAux.Rows.Count > 0 Then - Dim EstatusDeTipoProcesoMenor As Integer = TecnicosSubProyectoAux.Rows(0).Item("CveEstatusOrdenServicio").ToString.ToEntero - Dim dtAuxiliar As New DataTable - dtAuxiliar = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}' AND CveEstatusOrdenServicio = {1}", SubProyecto.Item("SubProyecto"), EstatusDeTipoProcesoMenor), "", {"CveUsuario", "Nombre"}) - TecnicosResultado.Merge(dtAuxiliar) - End If - Next - 'DtTecnicosSubProyectos = TecnicosResultado + 'For Each SubProyecto As DataRow In DT_OSSubProyectos.Rows + ' Dim TecnicosSubProyectoAux As DataTable = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}'", SubProyecto.Item("SubProyecto"))) + ' If TecnicosSubProyectoAux.Rows.Count > 0 Then + ' Dim EstatusDeTipoProcesoMenor As Integer = TecnicosSubProyectoAux.Rows(0).Item("CveEstatusOrdenServicio").ToString.ToEntero + ' Dim dtAuxiliar As New DataTable + ' dtAuxiliar = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}' AND CveEstatusOrdenServicio = {1}", SubProyecto.Item("SubProyecto"), EstatusDeTipoProcesoMenor), "", {"CveUsuario", "Nombre"}) + ' TecnicosResultado.Merge(dtAuxiliar) + ' End If + 'Next + ''DtTecnicosSubProyectos = TecnicosResultado - ObjOS.Dispose() + 'ObjOS.Dispose() - DdlTecnicoAsignar.DataSource = TecnicosResultado + DdlTecnicoAsignar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True'") DdlTecnicoAsignar.DataBind() DdlTecnicoAsignar.Items.Insert(0, New ListItem("Seleccione uno", "-1")) diff --git a/Ventas/CatPS.aspx.vb b/Ventas/CatPS.aspx.vb index 279731048..f7833ab72 100644 --- a/Ventas/CatPS.aspx.vb +++ b/Ventas/CatPS.aspx.vb @@ -254,10 +254,26 @@ Partial Class CatPS Dim lista = New List(Of CrystalParametro) lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)) lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Usuario)) - lista.Add(New CrystalParametro("AplicaVenta", AplicaVenta.ToString)) - lista.Add(New CrystalParametro("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) + lista.Add(New CrystalParametro("AplicaVenta", AplicaVenta.ToString)) + 'lista.Add(New CrystalParametro("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) + + + If Imagen.Exists Then + lista.Add(New CrystalParametro("LogoPath", $"file://{Imagen.FullName}")) + Else + lista.Add(New CrystalParametro("LogoPath", "")) + End If + + + If Archivo.Exists Then + ImprimirbytesPDF(ImprimirPDFCrystal(Archivo.FullName, DtDatos, lista, "Productos y Servicios", Formato), "Productos y Servicios", Formato) + Else + Dim Ruta As String = ModExtensiones.DirectorioBaseEmpresas + $"Empresas\Grales\Formatos\CatPS.rpt" + ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, DtDatos, lista, "Productos y Servicios", Formato), "Productos y Servicios", Formato) + End If + + - ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/CatPS.rpt"), DtDatos, lista, "Productos y Servicios", Formato), "Productos y Servicios", Formato) End Sub From 648f91af2d19aba2ae11c3857423571e682ca56b Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Jan 2023 07:50:35 -0700 Subject: [PATCH 15/25] -- simplificar pago por pago d ingresos por comprobar --- Ventas/Ventas.aspx.vb | 122 +++++++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 54 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1908b258e..fc4d03771 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -16357,75 +16357,89 @@ Partial Class Ventas If importeMovimiento <> 0 Then Dim Pago As New VentaPago + Pago.ImportePagoVenta = importeMovimiento Pago.ImportePago = importeMovimiento Pago.CveIE = CveIEAnticipo Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero() - Pago.TipoPago = "A" + Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal + Pago.TipoPago = "I" + Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero() Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1" Pago.Referencia = gvr.DataKey("Folio") ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) - ' Agregamos el 2 - If tipoCambioPago = 1 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - Else 'Cuando son dolares - If importeMovimiento <> 0 Then - If IdCtaContComplementaria > 0 Or 0 > 0 Then - 'Agregamos la Complementaria - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, Now, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - Else - 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If - End If - End If - End If + 'Dim Pago As New VentaPago + 'Pago.ImportePagoVenta = importeMovimiento + 'Pago.ImportePago = importeMovimiento + 'Pago.CveIE = CveIEAnticipo + 'Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero() + 'Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal + 'Pago.TipoPago = "I" + 'Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate + 'Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero() + 'Pago.Referencia = gvr.DataKey("Folio") - importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal) - importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) + '' Agregamos el 2 + 'If tipoCambioPago = 1 Then + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then + ' ErrorConta = True + ' End If + 'Else 'Cuando son dolares + ' If importeMovimiento <> 0 Then + ' If IdCtaContComplementaria > 0 Or 0 > 0 Then + ' 'Agregamos la Complementaria + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, Now, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then + ' ErrorConta = True + ' End If + ' 'Agregamos la Extranjera + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then + ' ErrorConta = True + ' End If + ' Else + ' 'Agregamos la Extranjera + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then + ' ErrorConta = True + ' End If + ' End If + ' End If + 'End If + + 'importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal) + 'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) - 'Agregamos el 92 - importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal) - importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) - IdCtaContable = IdCtaContAnticipos + ''Agregamos el 92 + 'importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal) + 'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero) + 'IdCtaContable = IdCtaContAnticipos - If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero(), "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - If Not tipoCambioPago = 1 Then - IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos - Else - IdCtaContable = ObjCliente.IdCtaContAnticipos - End If - End If - End If + 'If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero(), "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + ' If ObjCliente.DtResultados.Rows.Count > 0 Then + ' If Not tipoCambioPago = 1 Then + ' IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos + ' Else + ' IdCtaContable = ObjCliente.IdCtaContAnticipos + ' End If + ' End If + 'End If - If UsuarioActual.CveEmpresa.Contiene(119) Then - If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - If Not tipoCambioPago = 1 Then - IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera - Else - IdCtaContable = ObjCliente.IdCtaContClientes - End If - End If - End If - End If + 'If UsuarioActual.CveEmpresa.Contiene(119) Then + ' If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then + ' If ObjCliente.DtResultados.Rows.Count > 0 Then + ' If Not tipoCambioPago = 1 Then + ' IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera + ' Else + ' IdCtaContable = ObjCliente.IdCtaContClientes + ' End If + ' End If + ' End If + 'End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, 555, Concepto, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMN, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then - ErrorConta = True - End If + 'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, 555, Concepto, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMN, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then + ' ErrorConta = True + 'End If End If End If From 18ebf385ef7a7df173613659604fcfca499e3719 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Jan 2023 08:51:45 -0700 Subject: [PATCH 16/25] --cambios en columnas --- OS/RepOrdenesServicios.aspx | 25 ++++++++++++------------- OS/RepOrdenesServicios.aspx.vb | 17 +++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/OS/RepOrdenesServicios.aspx b/OS/RepOrdenesServicios.aspx index ef3f9d5dd..1784d1c11 100644 --- a/OS/RepOrdenesServicios.aspx +++ b/OS/RepOrdenesServicios.aspx @@ -96,8 +96,7 @@
    - - +
    @@ -139,7 +138,7 @@
    - +
    @@ -154,7 +153,7 @@
    - +
    @@ -234,15 +233,6 @@ - - - - Usuario Recibió - - - - - Estatus @@ -251,6 +241,15 @@ + + + Usuario Recibió + + + + + + Fecha Cita diff --git a/OS/RepOrdenesServicios.aspx.vb b/OS/RepOrdenesServicios.aspx.vb index 18427905d..7ef5c6a55 100644 --- a/OS/RepOrdenesServicios.aspx.vb +++ b/OS/RepOrdenesServicios.aspx.vb @@ -27,9 +27,10 @@ Partial Class OS_RepOrdenesServicios Private Sub CargaCombos() 'CargaClientes - DdlClientes.DataSource() = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientes.DataBind() - DdlClientes.Items.Insert(0, New ListItem("Todos", "-1")) + DdlClientes.setEsWebService(True) + 'DdlClientes.DataSource() = GlobalDTCliente(UsuarioActual.CveEmpresa) + 'DdlClientes.DataBind() + 'DdlClientes.Items.Insert(0, New ListItem("Todos", "-1")) 'CargaSubProyectos DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1) @@ -94,11 +95,11 @@ Partial Class OS_RepOrdenesServicios e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & "" - e.Row.FCLabel("LtlCliente").Text = "" & e.Row.FCLabel("LtlCliente").Text & "" - e.Row.FCLiteral("LtlFechaRecepcion").Text = "" & e.Row.FCLiteral("LtlFechaRecepcion").Text & "" - e.Row.FCLabel("LtlDescripcion").Text = "" & e.Row.FCLabel("LtlDescripcion").Text & "" - e.Row.FCLabel("LtlUsuarioRecibio").Text = "" & e.Row.FCLabel("LtlUsuarioRecibio").Text & "" - e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = "" & e.Row.FCLiteral("LtlEstatusOrdenServicio").Text & "" + 'e.Row.FCLabel("LtlCliente").Text = "" & e.Row.FCLabel("LtlCliente").Text & "" + 'e.Row.FCLiteral("LtlFechaRecepcion").Text = "" & e.Row.FCLiteral("LtlFechaRecepcion").Text & "" + 'e.Row.FCLabel("LtlDescripcion").Text = "" & e.Row.FCLabel("LtlDescripcion").Text & "" + 'e.Row.FCLabel("LtlUsuarioRecibio").Text = "" & e.Row.FCLabel("LtlUsuarioRecibio").Text & "" + 'e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = "" & e.Row.FCLiteral("LtlEstatusOrdenServicio").Text & "" End If End Sub Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click From c816b393975f0b8447d28c56ee94794e40c25770 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Jan 2023 08:52:17 -0700 Subject: [PATCH 17/25] -- prepoliza recons --- Inventarios/EntradasSalidas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index bd8a774a5..2d3c0d897 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -3881,7 +3881,7 @@ Partial Class Inventarios_EntradasSalidas Else If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then Contabilizable = False - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 289, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then ErrorMovInv = True End If Else From b5378ad727581886485acee971b8c531b1b0b186 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Jan 2023 08:52:46 -0700 Subject: [PATCH 18/25] -- cambios en lo contable --- Bancos/IE.aspx.vb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index fb76766aa..a2c82ecc4 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1422,15 +1422,15 @@ Partial Class Bancos_IE End If - If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - BtnGuardar.Enabled = False - Else - BtnGuardar.Enabled = True - End If - UpGuardar.Update() - End If + 'If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + ' If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + ' Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + ' BtnGuardar.Enabled = False + ' Else + ' BtnGuardar.Enabled = True + ' End If + ' UpGuardar.Update() + 'End If CargaCuentasDepositos() Else From 85dc73d87bbbb164b2b9745056a59315075b3beb Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 5 Jan 2023 21:07:05 -0700 Subject: [PATCH 19/25] BDH. Validar si tiene ajustes por garantia. si tiene el concepto de descuento por garantia. --- Ventas/PV.aspx.vb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index b1ed5301f..b7f8c3e95 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -3465,6 +3465,11 @@ Partial Class PV MandarCorreoSupervisor = False End If + If TmpDT.FiltraParametros("Obs = 'Descuento por garantía'").Rows.Count > 0 AndAlso (TmpDTAjustes Is Nothing OrElse TmpDTAjustes.Rows.Count = 0) Then + Alert("No se ha especificado la garantía", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + 'If TmpDTAjustes IsNot Nothing AndAlso Not TmpDTAjustes.Rows.Count > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then ' RegistraScript("$('#DModalRecepcionUsados').modal('show');") 'Else From 23a419b9f6d71106a2e337194487255214adcaa6 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Tue, 10 Jan 2023 12:23:17 -0700 Subject: [PATCH 20/25] Apoyo logistico, ordenes de servicio --- App_Code/CalendarEvent.vb | 2 + App_Code/ClsOIEventos.vb | 4 +- App_Code/ClsOS.vb | 21 ++- Ashx/CargaEventos.ashx | 49 ++++++ Compras/PopUpVerFactura.aspx.vb | 3 + Compras/ReembolsosComprobaciones.aspx.vb | 7 +- Contabilidad/PlantillasPolizasDetalle.aspx.vb | 10 ++ Empresas/140/Formatos/OrdenServicio.rdlc | 153 ++++++++++++++++-- Empresas/72/Formatos/OrdenServicio.rdlc | 18 +++ Empresas/Grales/Formatos/OrdenServicio.rdlc | 18 +++ General/SaldosIniciales.aspx.vb | 2 +- Inventarios/EntradasSalidas.aspx.vb | 15 +- Inventarios/RepEntregaAlmacenRuta.aspx.cs | 4 +- OS/OrdenesServicios.aspx.vb | 43 +++-- OS/RepOrdenesServicios.aspx.vb | 15 +- OS/RepServicioDomicilio.aspx | 55 ++++++- OS/RepServicioDomicilio.aspx.vb | 136 +++++++++++----- 17 files changed, 465 insertions(+), 90 deletions(-) diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb index 20e8810af..44dbcf836 100644 --- a/App_Code/CalendarEvent.vb +++ b/App_Code/CalendarEvent.vb @@ -40,6 +40,8 @@ Public Class CalendarEvent Public Property CveOSDetalle As Integer Public Property CveUsuarioAtendio As Integer + Public Property CveSubProyectoUsuarioAtendio As Integer + End Class diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 98f455ac7..f86784260 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2448,10 +2448,10 @@ Public Class ClsOIEventos Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1, Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1, Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1, - Optional CveSubProyecto As Integer = -1) As Boolean + Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1) As Boolean Dim Retorno As Boolean = False - Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, -1, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, + Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioPara, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe, CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto) diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 227fd3a8c..4bb50fc6d 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -64,6 +64,10 @@ Public Class ClsOS Public Property Año As String = "" Public Property CorreoOS As String = "" Public Property FechaInicio As DateTime + Public Property SubProyecto As String + Public Property Condiciones As String + + Private Class Especificaciones Public CveValor As Integer @@ -449,7 +453,8 @@ Public Class ClsOS #Region "ClsOSOrdenesServicios" 'Reporte de Ventas - Public Function GetRepOrdenesServicio(FechaI As String, FechaF As String, FechaTerminado As String, CveCliente As Integer, CveSubProyecto As Integer, CveUsuarioRecibio As Integer, CveTecnico As Integer, CveEstatusOrdenServicio As Integer, CveEmpresa As Integer) As Boolean + Public Function GetRepOrdenesServicio(FechaI As String, FechaF As String, FechaTerminado As String, CveCliente As Integer, CveSubProyecto As Integer, CveUsuarioRecibio As Integer, CveTecnico As Integer, + CveEstatusOrdenServicio As Integer, CveEmpresa As Integer, Optional Opcion As Integer = -1, Optional CveUsuarioAsignado As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosGetRep") @@ -465,6 +470,8 @@ Public Class ClsOS .Add("@CveTecnico", SqlDbType.Int).Value = CveTecnico .Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatusOrdenServicio .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado End With Try @@ -532,6 +539,8 @@ Public Class ClsOS Me.Año = Data.Rows(0)("Año").ToString Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString.ToDateTime Me.CveOSDetalle = Data.Rows(0)("CveOSDetalle").ToString.ToEntero + Me.SubProyecto = Data.Rows(0)("SubProyecto").ToString + Me.Condiciones = Data.Rows(0)("Condiciones").ToString End If Retorno = True @@ -586,7 +595,8 @@ Public Class ClsOS End Function Public Function AddOrdenesServicios(CveCliente As Integer, CveSubProyecto As Integer, PersonaSolicito As String, FechaRecepcion As Date, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveCotizacion As Integer, CveVenta As Integer, CveOSPadre As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, - Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional Correo As String = "") As Boolean + Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional Correo As String = "", + Optional Condiciones As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosAdd") @@ -612,6 +622,7 @@ Public Class ClsOS .Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto .Add("@Año", SqlDbType.VarChar).Value = Año .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@Condiciones", SqlDbType.VarChar).Value = Condiciones .Add("@CveOS", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output @@ -655,8 +666,8 @@ Public Class ClsOS Return Retorno End Function Public Function UpdateOrdenesServicios(PersonaSolicito As String, FechaRecepcion As String, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveOS As Integer, CveUsuarioModifico As Integer, - CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1", - Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Boolean + CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, + Optional Año As String = "-1", Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional Condiciones As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosUpdate") @@ -678,6 +689,7 @@ Public Class ClsOS .Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto .Add("@Año", SqlDbType.VarChar).Value = Año .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@Condiciones", SqlDbType.VarChar).Value = Condiciones End With @@ -1768,3 +1780,4 @@ Public Class ClsOS End Sub #End Region End Class + diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index f376401a6..44ad73a30 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -94,6 +94,49 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Dim ObjEventos As New ClsOIEventos Dim ErrorEventos = False Dim CveEmpresaCRM As Integer = 0 + + Dim DT_SubProyectos As New System.Data.DataTable + + DT_SubProyectos.Columns.Add("CveSubProyecto", GetType(Integer)) + DT_SubProyectos.Columns.Add("backgroundColor") + + 'son 26 + Dim Colores() As String = {"#006699", "#0099cc", "#0066cc", "#0033cc", "#0000ff", "#3333ff", "#3333ff", "#6600ff", "#9933ff", "#cc00ff", "#cc00cc", "#cc0099", "#cc3399", "#cc6699", "#cc0066", "#009933", "#00cc00", "#00cc66", "#009999", "#669900", "#99cc00", "#cccc00", "#cc9900", "#ff9900", "#006666", "#669999"} + + + If CveOS = -2 Then + + Dim objSub As New ClsSubProyectos + Dim DtTempSubproyectos As New DataTable + + If objSub.GetSubProyectos(CveEmpresa) Then + DtTempSubproyectos = objSub.DtResultados.FiltraParametros("", "CveSubProyecto") + End If + + objSub.Dispose() + + Dim ColorIndex As Integer = 0 + + If DtTempSubproyectos.Rows.Count > 0 Then + For Each drow As DataRow In DtTempSubproyectos.Rows + + + Dim Subrow = DT_SubProyectos.NewRow + Subrow("CveSubProyecto") = drow("CveSubProyecto").ToString.ToEntero + Subrow("backgroundColor") = Colores(ColorIndex) + + DT_SubProyectos.Rows.Add(Subrow) + + ColorIndex = ColorIndex + 1 + If ColorIndex >= 25 Then + ColorIndex = 0 + End If + + Next + End If + + End If + If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuarioPara, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF, CveSubProyecto:=CveSubProyecto) Then If ObjEventos.DtResultados.Rows.Count > 0 Then @@ -144,6 +187,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.CveOS = dr("CveOS").ToString.ToEntero cevent.CveOSDetalle = dr("CveOSDetalle").ToString.ToEntero cevent.CveUsuarioAtendio = dr("CveUsuarioAtendio").ToString.ToEntero + cevent.CveSubProyectoUsuarioAtendio = dr("CveSubProyectoUsuarioAtendio").ToString.ToEntero cevent.NombreAcercamiento = dr("NombreAcercamiento").ToString @@ -157,6 +201,11 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.backgroundColor = "#1BBC9B" End If + If CveOS = -2 Then + cevent.backgroundColor = DT_SubProyectos.FiltroPrimeroValor("backgroundColor", $" CveSubProyecto = {cevent.CveSubProyectoUsuarioAtendio } ") + cevent.backgroundColor = If(cevent.backgroundColor.Trim = "", "#1BBC9B", cevent.backgroundColor.Trim) + End If + 'VERIFICAMOS SI TIENE O NO RECURRENCIA If Not cevent.recurrenciatipo > 0 Then diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index a4b0f456c..8dec1d1af 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -5454,6 +5454,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + params.Add(New ReportParameter("Condiciones", dr("Condiciones").ToString)) + params.Add(New ReportParameter("FechaAtencion", If(dr("FechaInicio").ToString.Length > 0, dr("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy"), ""))) + params.Add(New ReportParameter("TecnicoAsignado", dr("UsuarioAtendio").ToString)) diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 128e2b9aa..af22a88cd 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -618,8 +618,9 @@ Partial Class Compras_ReembolsosComprobaciones IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero End If End If - Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString - CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False)) + Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 2).ToString + CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 2, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False)) + '8 'AGREGO PREPOLIZA IE BANCOS If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then MsgError = "Error al registrar detalle de concepto bancario" @@ -690,7 +691,7 @@ Partial Class Compras_ReembolsosComprobaciones CompraActual.CveTipoConceptoProveedor = gvr.DataKey("CveTipoConcepto").ToEntero CompraActual.CveProveedor = gvr.DataKey("CveProveedor").ToEntero CompraActual.CveMoneda = gvr.DataKey("CveMoneda").ToEntero - CompraActual.Fecha = gvr.DataKey("Fecha").ToDate + CompraActual.Fecha = gvr.DataKey("FechaCompra").ToDate CompraActual.SerieFolio = gvr.DataKey("SerieFolio").ToString CompraActual.ProveedorNombre = gvr.DataKey("Proveedor") CompraActual.TC = gvr.DataKey("TipoCambio").ToDecimal diff --git a/Contabilidad/PlantillasPolizasDetalle.aspx.vb b/Contabilidad/PlantillasPolizasDetalle.aspx.vb index 2b79f5b48..3d9238f6f 100644 --- a/Contabilidad/PlantillasPolizasDetalle.aspx.vb +++ b/Contabilidad/PlantillasPolizasDetalle.aspx.vb @@ -228,6 +228,16 @@ Partial Class Contabilidad_PlantillasPolizasDetalle Alert("Error al agregar la Plantilla Póliza y el Detalle.", TipoMensaje.MsgError) End If ObjPlantillaPoliza.Dispose() + + + If Not ErrorPlantilla Then + Using ObjContabilidad As New ClsContabilidad + If ObjContabilidad.GetConta_PlantillasPolizas(-1, -1) Then Application("GlobalDTContaPlantillasPolizas") = ObjContabilidad.DtResultados Else Application("GlobalDTContaPlantillasPolizas") = Nothing + If ObjContabilidad.GetConta_PlantillasPolizasDetalle(-1, -1) Then Application("GlobalDTContaPlantillasPolizasDetalle") = ObjContabilidad.DtResultados Else Application("GlobalDTContaPlantillasPolizasDetalle") = Nothing + End Using + End If + + End Sub Public Sub updatatos() diff --git a/Empresas/140/Formatos/OrdenServicio.rdlc b/Empresas/140/Formatos/OrdenServicio.rdlc index bf914db10..64ede27e0 100644 --- a/Empresas/140/Formatos/OrdenServicio.rdlc +++ b/Empresas/140/Formatos/OrdenServicio.rdlc @@ -1160,7 +1160,7 @@ 0.71688cm 5.3112cm 0.56825cm - 5.22521cm + 4.54835cm 12 - 4.83183cm + 5.18108cm 0.08599cm 0cm 20.21078cm @@ -1434,7 +1434,7 @@ Textbox18 1.36809cm 11.46032cm - 1.98807cm + 1.04858cm 8.7798cm 4 + + + + Condiciones: + + + + =Parameters!Condiciones.Value + + + + + @@ -1599,8 +1622,8 @@ Textbox2 1.007in 0.08599cm - 0.85363in - 4.40864in + 0.98905in + 3.84786in 5 + + true + true + + + + + Fecha de atención: + + + + =Parameters!FechaAtencion.Value + + + + + + + + + Ténico asignado: + + + + =Parameters!TecnicoAsignado.Value + + + + + + + + + + + + + + + + Textbox2 + 1.007in + 9.93011cm + 0.98905in + 3.84786in + 7 + + + 2pt + 2pt + 2pt + 2pt + + - 0.15873cm + 0.15872cm 0.08599cm 0cm 20.21078cm @@ -2033,6 +2142,24 @@ true ReportParameter1 + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + diff --git a/Empresas/72/Formatos/OrdenServicio.rdlc b/Empresas/72/Formatos/OrdenServicio.rdlc index 29e9ea5ef..0aa418493 100644 --- a/Empresas/72/Formatos/OrdenServicio.rdlc +++ b/Empresas/72/Formatos/OrdenServicio.rdlc @@ -2864,6 +2864,24 @@ Compuproveeores no se hace responsable por el resguardo de su equipo. true ReportParameter1 + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + diff --git a/Empresas/Grales/Formatos/OrdenServicio.rdlc b/Empresas/Grales/Formatos/OrdenServicio.rdlc index 28237868e..c3c84c4ef 100644 --- a/Empresas/Grales/Formatos/OrdenServicio.rdlc +++ b/Empresas/Grales/Formatos/OrdenServicio.rdlc @@ -2449,6 +2449,24 @@ true ReportParameter1 + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + Cm 40c94aad-a12a-44fb-ab0d-ea36a9656792 diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 76cec5493..045a6964e 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -2368,7 +2368,7 @@ Partial Class General_SaldosIniciales For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows - Dim Clasificacion As String = Regex.Replace(dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, ""), "[^\u0009\u000A\u000D\u0020-\u007E]", "") + Dim Clasificacion As String = dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") Dim Categoria As String = dRow("Categoria").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString().Trim.ToUpper.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString().Trim.Replace("-", "").Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "") diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index feebf894c..315963d80 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -2041,14 +2041,21 @@ Partial Class Inventarios_EntradasSalidas If Not ErrorAC And Not ErrorMovInv Then - If ChkEmitirTimbrado.Checked Then + + If Not DdlDireccionEnvio.SelectedValue.ToEntero > 0 Then + ErrorMovInv = True + Alert("La direccion destino es requerida.", TipoMensaje.MsgAdvertencia) + End If + + + If ChkEmitirTimbrado.Checked AndAlso Not ErrorMovInv Then Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL) Dim CveSubProyectoTimbre As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero Dim Fechallegada As DateTime = (TxtFechaLlegada.Text & " 23:59:59").ToDateTime - Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimiento, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, TxtFechaLlegada.Text.ToDate, "T", "", "", MinFecha, 1, 1, TxtDistancia.Text.ToEntero, - CveConfigAutoTransporte:=DdlConfigAuto.SelectedValue.ToEntero, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero) + Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, DdlDireccionEnvio.SelectedValue.ToEntero, CveMovimiento, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, TxtFechaLlegada.Text.ToDate, "T", "", "", MinFecha, 1, 1, TxtDistancia.Text.ToEntero, + CveConfigAutoTransporte:=DdlConfigAuto.SelectedValue.ToEntero, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero) If CveEntregaAlmacen > 0 Then CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked) @@ -2069,7 +2076,7 @@ Partial Class Inventarios_EntradasSalidas - If Not ErrorAC And Not ErrorMovInv Then + If Not ErrorAC And Not ErrorMovInv Then Dim Msg As New StringBuilder Msg.AppendFormat("
    El Movimiento se registro con el Folio: {0}", ObjInventario.Folio, CveMovimiento) Msg.AppendFormat("

    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs index ed0c5bdae..502e39065 100644 --- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs +++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs @@ -690,8 +690,8 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas else { //e.Row.Cells[11].Text = ""; - e.Row.Cells[12].Text = ""; - e.Row.Cells[13].Text = ""; + e.Row.Cells[14].Text = ""; + e.Row.Cells[15].Text = ""; } if (e.Row.DataKey("Estatus").ToEntero() == 2) diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index f358ae335..d7509a1d8 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -1218,38 +1218,54 @@ Partial Class OS_OrdenesServicios Dim Especificaciones As String = Row("Especificaciones").ToString Dim ComentarioTecnico As String = Row("ComentarioTecnico").ToString Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero - Dim Archivo As New System.IO.FileInfo(Row("Archivo").ToString) + + + + Dim fname As String = "" + + If File.Exists(Row("Archivo").ToString) Then + Dim Archivo As New System.IO.FileInfo("") + fname = Archivo.Name + End If + + Dim CveUsuarioEntrego As Integer = If(Entregar = True, UsuarioActual.CveUsuario, -1) Dim FechaEntrega As String = If(Entregar = True, Now.ToString("dd/MM/yyy"), "-1") Dim Consecutivo As Integer = Row("Consecutivo").ToString.ToEntero CveConsecutivo = Consecutivo If CveOSDetalle > 0 Then - If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalle(CvePS, Cantidad, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, ComentarioTecnico, CveCuentaEquipo, Archivo.Name, "-1", FechaEntrega, CveOSDetalle, CveOS) Then + If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalle(CvePS, Cantidad, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, ComentarioTecnico, CveCuentaEquipo, fname, "-1", FechaEntrega, CveOSDetalle, CveOS) Then Errores = True End If Else - CveOSDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(CveOS, CvePS, Cantidad, -1, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, CveCuentaEquipo, "-1", "-1", FechaEntrega, ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=Archivo.Name) + CveOSDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(CveOS, CvePS, Cantidad, -1, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, CveCuentaEquipo, "-1", "-1", FechaEntrega, ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=fname) If Not CveOSDetalle > 0 Then Errores = True End If - If Archivo.Name <> "-1" Then - 'Cambiar el nombre del archivo de CveUsuario-Consecutivo.ext a CveOS-Consecutivo.ext - Dim ArchivoFinal As New System.IO.FileInfo(String.Format("{0}OS\Archivos\OS{1}-{2}{3}", UsuarioActual.Empresa.Ruta, CveOS, Consecutivo, System.IO.Path.GetExtension(Archivo.Extension))) - If ArchivoFinal.Exists() Then - ArchivoFinal.Delete() - End If - 'Mover el archivo de los temporales a OS - System.IO.File.Move(UsuarioActual.Empresa.Ruta & "\OS\Temp\" & Archivo.Name, UsuarioActual.Empresa.Ruta & "\OS\Archivos\" & ArchivoFinal.Name) + If File.Exists(Row("Archivo").ToString) Then + Dim Archivo As New System.IO.FileInfo("") + If Archivo.Name <> "-1" Then + 'Cambiar el nombre del archivo de CveUsuario-Consecutivo.ext a CveOS-Consecutivo.ext + Dim ArchivoFinal As New System.IO.FileInfo(String.Format("{0}OS\Archivos\OS{1}-{2}{3}", UsuarioActual.Empresa.Ruta, CveOS, Consecutivo, System.IO.Path.GetExtension(Archivo.Extension))) - If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalleArchivo(ArchivoFinal.Name, ObjOrdenServicio.CveOSDetalle) Then - Errores = True + If ArchivoFinal.Exists() Then + ArchivoFinal.Delete() + End If + + 'Mover el archivo de los temporales a OS + System.IO.File.Move(UsuarioActual.Empresa.Ruta & "\OS\Temp\" & Archivo.Name, UsuarioActual.Empresa.Ruta & "\OS\Archivos\" & ArchivoFinal.Name) + + If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalleArchivo(ArchivoFinal.Name, ObjOrdenServicio.CveOSDetalle) Then + Errores = True + End If End If End If + If TmpDTCaracteristica.FiltraParametros(String.Format("CveConsecutivoDetalle = {0}", Consecutivo)).Rows.Count > 0 Then For Each RowE As DataRow In TmpDTCaracteristica.FiltraParametros(String.Format("CveConsecutivoDetalle = {0}", Consecutivo)).Rows @@ -1279,6 +1295,7 @@ Partial Class OS_OrdenesServicios Next End If End If + Next Else Errores = True diff --git a/OS/RepOrdenesServicios.aspx.vb b/OS/RepOrdenesServicios.aspx.vb index 0b97bc7ba..53c4d46b7 100644 --- a/OS/RepOrdenesServicios.aspx.vb +++ b/OS/RepOrdenesServicios.aspx.vb @@ -20,6 +20,8 @@ Partial Class OS_RepOrdenesServicios ViewState("CveUsuarioTecnico") = -1 End If + txtFechaI.Text = $"01/01/{Now.Year}" + CargaDatos() OrdenaDatos() End If @@ -59,7 +61,18 @@ Partial Class OS_RepOrdenesServicios FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") FechaTerminado = If(IsDate(TxtFechaTerminado.Text.Trim()), TxtFechaTerminado.Text.Trim(), "-1") - If ObjOrdenesServicios.GetRepOrdenesServicio(FechaI, FechaF, FechaTerminado, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlUsuarioRecibio.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + Dim Opcion As Integer = 1 + Dim CveUsuarioAsignado As Integer = UsuarioActual.CveUsuario + + If UsuarioActual.TienePermisoProceso(348) Then + Opcion = 2 + CveUsuarioAsignado = -1 + + End If + + + If ObjOrdenesServicios.GetRepOrdenesServicio(FechaI, FechaF, FechaTerminado, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlUsuarioRecibio.SelectedValue.ToEntero, + DdlTecnico.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion:=Opcion, CveUsuarioAsignado:=CveUsuarioAsignado) Then Dim Filtro As String = "" Select Case DdlFacturado.SelectedValue Case "1" diff --git a/OS/RepServicioDomicilio.aspx b/OS/RepServicioDomicilio.aspx index 8ed61ce93..7dacef905 100644 --- a/OS/RepServicioDomicilio.aspx +++ b/OS/RepServicioDomicilio.aspx @@ -111,6 +111,12 @@ .select2-container--open { z-index: 1000 !important; } + + + /* #C_DVModalAsignacion > div:nth-child(2) > div > div > span{ + margin-left:200px!important; + }*/ + @@ -469,17 +475,17 @@
    -
    +
    - + <%-- - - -
    @@ -550,6 +556,16 @@
    +
    +
    + <%--CONDICIONES--%> +
    + + +
    +
    +
    +
    @@ -575,7 +591,7 @@
    -
    +
    @@ -672,6 +688,7 @@ diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index 94319395a..825438e5c 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -280,6 +280,15 @@ Partial Class OS_RepServicioDomicilio cargaDropsModal() CargaClientePublicoGeneral() + If UsuarioActual.TienePermisoProceso(348) Then + DVModalAsignacion.Visible = True + End If + + + + 'RegistraScript(" PrimeraCargaCalendario = true;") + + End If End Sub @@ -595,7 +604,7 @@ Partial Class OS_RepServicioDomicilio End If 'DdlSubProyectoOS.Items.Clear() - CargarCentrosDeCosto(Nothing, DdlSubProyectoOS, Nothing, LblSubProyectoOS) + CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoOS) 'DdlModeloAuto.Items.Clear() Dim ObjGral As New ClsGenerales @@ -607,6 +616,7 @@ Partial Class OS_RepServicioDomicilio DdlModeloAuto.Items.Insert(0, New ListItem("Sin Asignar", "-1")) + End Sub Private Sub CargaClientes() @@ -623,7 +633,7 @@ Partial Class OS_RepServicioDomicilio TxtSolicito.Text = "" TxtDescripcion.Text = "" TxtFechaOS.Text = "" - DdlSubProyectoOS.SelectedValueExist("-1") + 'DdlSubProyectoOS.SelectedValueExist("-1") TxtDireccion.Text = "" TxtEmail.Text = "" TxtTelefono.Text = "" @@ -645,6 +655,9 @@ Partial Class OS_RepServicioDomicilio FechaInicioOriginal = DateTime.Now DVFolio.Visible = False + DvModalSubProyecto.Visible = False + + TxtCondiciones.Text = "" End Sub @@ -707,7 +720,7 @@ Partial Class OS_RepServicioDomicilio TxtDescripcion.Text = ObjOS.Descripcion TxtSolicito.Text = ObjOS.PersonaSolicito TxtFechaOS.Text = ObjOS.FechaRecepcion.ToString("dd/MM/yyyy") - DdlSubProyectoOS.SelectedValueExist(ObjOS.CveSubProyecto) + 'DdlSubProyectoOS.SelectedValueExist(ObjOS.CveSubProyecto) TxtDireccion.Text = ObjOS.DtResultados.Rows(0)("DireccionOS").ToString TxtEmail.Text = ObjOS.CorreoOS TxtTelefono.Text = ObjOS.Telefono @@ -718,6 +731,9 @@ Partial Class OS_RepServicioDomicilio DdlModeloAuto.SelectedValueExist(ObjOS.CveModeloAuto) TxtAnio.Text = ObjOS.Año + LblModalSubproyecto.Text = ObjOS.SubProyecto + + TxtCondiciones.Text = ObjOS.Condiciones If TipoAccion = OSModalTipoAccion.Actualizacion Then @@ -725,6 +741,7 @@ Partial Class OS_RepServicioDomicilio CveTecnicoAsignarOrioginal = ObjOS.CveUsuarioAtendio FechaInicioOriginal = ObjOS.FechaInicio TxtModalFechaOS.Text = ObjOS.FechaInicio.ToString.ToDate.ToString("dd/MM/yyyy hh:mm") + DvModalSubProyecto.Visible = True 'TSTimeSelector.Hour = If(ObjOS.FechaInicio.Hour > 12, ObjOS.FechaInicio.Hour - 12, ObjOS.FechaInicio.Hour) 'TSTimeSelector.Minute = ObjOS.FechaInicio.Minute 'TSTimeSelector.AmPm = If(ObjOS.FechaInicio.Hour > 12, MKB.TimePicker.TimeSelector.AmPmSpec.PM, MKB.TimePicker.TimeSelector.AmPmSpec.AM) @@ -786,6 +803,15 @@ Partial Class OS_RepServicioDomicilio Dim CveOS As Integer = HFCveOS.Value.ToEntero Dim CveOsDetalle As Integer = HFCveOsDetalle.Value.ToEntero + + Dim CveSubProyectoTecnico As Integer = If(DdlTecnicoAsignar.SelectedValue.ToEntero > 0, GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero, -1) + + + If TipoAccion = OSModalTipoAccion.Asignacion AndAlso Not CveSubProyectoTecnico > 0 Then + Alert("No se encontro el subproyecto o centro de costo del tecnico seleccionado.") + Exit Sub + End If + If Not CvePSDetalle > 0 Then Alert("No esta asiganado el producto del detalle a la funcionalidad.") Exit Sub @@ -822,9 +848,10 @@ Partial Class OS_RepServicioDomicilio CveEstatosOrdenNueva = CveEstatusAsiganada End If - If ObjOS.AddOrdenesServicios(CveCliente, DdlSubProyectoOS.SelectedValue.ToEntero, TxtSolicito.Text, TxtFechaOS.Text.ToDateTime, TxtDescripcion.Text, UsuarioActual.CveUsuario, CveEstatosOrdenNueva, - UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOrdenServicioTipo, CveClienteSucursal:=-1, - Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text, CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, Correo:=TxtEmail.Text) Then + If ObjOS.AddOrdenesServicios(CveCliente, CveSubProyectoTecnico, TxtSolicito.Text, TxtFechaOS.Text.ToDateTime, TxtDescripcion.Text, UsuarioActual.CveUsuario, CveEstatosOrdenNueva, + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOrdenServicioTipo, CveClienteSucursal:=-1, Direccion:=TxtDireccion.Text, + Telefono:=TxtTelefono.Text, CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, Correo:=TxtEmail.Text, + Condiciones:=TxtCondiciones.Text.Trim) Then CveOS = ObjOS.CveOS CveOsDetalle = ObjOS.AddOrdenesServiciosDetalle(CveOS, CvePSDetalle, 1, -1, -1, "", False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, "") @@ -854,8 +881,8 @@ Partial Class OS_RepServicioDomicilio If CveOS > 0 Then If Not ObjOS.UpdateOrdenesServicios(TxtSolicito.Text, TxtFechaOS.Text, TxtDescripcion.Text, UsuarioActual.CveUsuario, CveEstatusOrden, CveOS, UsuarioActual.CveUsuario, - -1, CveClienteSucursal:=-1, Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text, - CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, CveSubProyecto:=DdlSubProyectoOS.SelectedValue.ToEntero, Correo:=TxtEmail.Text) Then + -1, CveClienteSucursal:=-1, Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text, CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, + CveSubProyecto:=CveSubProyectoTecnico, Correo:=TxtEmail.Text, Condiciones:=TxtCondiciones.Text.Trim) Then TieneError = True End If @@ -876,21 +903,26 @@ Partial Class OS_RepServicioDomicilio - If ObjOS.GetSubProyectosEstatusInicial(DdlTecnicoAsignar.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then - Dim subProyectoDelTecnico As DataTable - subProyectoDelTecnico = ObjOS.DtResultados.FiltraParametros($"CveSubProyecto = {DdlSubProyectoOS.SelectedValue.ToEntero}") - - If subProyectoDelTecnico.Rows.Count > 0 Then - If Not ObjOS.UpdateOrdenesServiciosAsignadas(CveOsDetalle, DdlTecnicoAsignar.SelectedValue.ToEntero, TxtModalFechaOS.Text.ToDate, TxtModalFechaOS.Text.ToDateTime(), UsuarioActual.CveEmpresa) Then - TieneError = True - End If - Else - Alert("El técnico y la Orden de Servicio deben pertenecer al mismo subProyecto", TipoMensaje.MsgAdvertencia) - TieneError = True - End If + If Not ObjOS.UpdateOrdenesServiciosAsignadas(CveOsDetalle, DdlTecnicoAsignar.SelectedValue.ToEntero, TxtModalFechaOS.Text.ToDate, TxtModalFechaOS.Text.ToDateTime(), UsuarioActual.CveEmpresa) Then + TieneError = True End If + 'If ObjOS.GetSubProyectosEstatusInicial(DdlTecnicoAsignar.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then + ' Dim subProyectoDelTecnico As DataTable + ' subProyectoDelTecnico = ObjOS.DtResultados.FiltraParametros($"CveSubProyecto = {CveSubProyectoTecnico}") + + ' If subProyectoDelTecnico.Rows.Count > 0 Then + ' If Not ObjOS.UpdateOrdenesServiciosAsignadas(CveOsDetalle, DdlTecnicoAsignar.SelectedValue.ToEntero, TxtModalFechaOS.Text.ToDate, TxtModalFechaOS.Text.ToDateTime(), UsuarioActual.CveEmpresa) Then + ' TieneError = True + ' End If + ' Else + ' Alert("El técnico y la Orden de Servicio deben pertenecer al mismo subProyecto", TipoMensaje.MsgAdvertencia) + ' TieneError = True + ' End If + 'End If + + If Not TieneError Then @@ -916,7 +948,7 @@ Partial Class OS_RepServicioDomicilio Dim OIDescripcion As String = $"{DdlTecnicoAsignar.SelectedItem.Text} Orden de servicio {FolioAsignar} " If Not ObjEventos.AddEventoAgenda(2, DdlTecnicoAsignar.SelectedItem.Text, OIDescripcion, 2, TxtModalFechaOS.Text.ToDateTime(), TxtModalFechaOS.Text.ToDateTime().AddHours(1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=2, - Importe:=0, CveOS:=CveOS, CveSubProyecto:=DdlSubProyectoOS.SelectedValue.ToEntero) Then + Importe:=0, CveOS:=CveOS, CveSubProyecto:=CveSubProyectoTecnico, CveUsuarioPara:=DdlTecnicoAsignar.SelectedValue.ToEntero) Then TieneError = True End If End If @@ -942,6 +974,10 @@ Partial Class OS_RepServicioDomicilio MandaCorreOS(CveOSAsignar, CorreoAsignado) End If + If Not TieneError And TxtEmail.Text.Trim.Length > 0 AndAlso DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then + MandaCorreOS(CveOSAsignar, TxtEmail.Text, True) + End If + If Not TieneError Then ConsultaOrdenesServiciosNoAsignadas() @@ -961,7 +997,7 @@ Partial Class OS_RepServicioDomicilio End Sub - Private Sub MandaCorreOS(CveOS As Integer, CorreoUsuarioAsignado As String) + Private Sub MandaCorreOS(CveOS As Integer, CorreoUsuarioAsignado As String, Optional EsCliente As Boolean = False) @@ -1023,9 +1059,8 @@ Partial Class OS_RepServicioDomicilio params.Add(New ReportParameter("Solicito", dr("PersonaSolicito").ToString)) params.Add(New ReportParameter("Descripcion", dr("Descripcion").ToString)) params.Add(New ReportParameter("Recibio", UsuarioActual.Nombre)) - params.Add(New ReportParameter("FechaRecibido", dr("FechaRecepcion").ToString)) + params.Add(New ReportParameter("FechaRecibido", dr("FechaRecepcion").ToString.ToDate.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("FolioOS", dr("Folio").ToString)) - FolioOS = dr("Folio").ToString params.Add(New ReportParameter("ClienteTelefono", dr("Telefono").ToString)) params.Add(New ReportParameter("ClienteCalle", dr("Direccion").ToString)) params.Add(New ReportParameter("ClienteColonia", dr("Colonia").ToString)) @@ -1033,19 +1068,40 @@ Partial Class OS_RepServicioDomicilio params.Add(New ReportParameter("ClienteEstado", dr("Estado").ToString)) CveFolio = dr("Folio").ToString - If RutaReporte.Exists Then - params.Add(New ReportParameter("NoDeCliente", dr("CveCliente").ToString)) - params.Add(New ReportParameter("RFC", dr("RFC").ToString)) - params.Add(New ReportParameter("Vendedor", " ")) - params.Add(New ReportParameter("Correo", dr("Correo").ToString)) - params.Add(New ReportParameter("CodigoDeServicio", dr("CveOS").ToString)) - params.Add(New ReportParameter("Sucursal", dr("SubProyecto").ToString)) - params.Add(New ReportParameter("TipoServicio", dr("TipoServicio").ToString)) - params.Add(New ReportParameter("TipoEquipo", dr("TipoEquipo").ToString)) - params.Add(New ReportParameter("Descripcion", dr("Descripcion").ToString)) - params.Add(New ReportParameter("Copia", "Copia: Original")) - params.Add(New ReportParameter("Equipo", dr("Equipo").ToString)) - End If + 'If RutaReporte.Exists Then + params.Add(New ReportParameter("NoDeCliente", dr("CveCliente").ToString)) + params.Add(New ReportParameter("RFC", dr("RFC").ToString)) + params.Add(New ReportParameter("Vendedor", " ")) + params.Add(New ReportParameter("Correo", dr("Correo").ToString)) + params.Add(New ReportParameter("CodigoDeServicio", dr("CveOS").ToString)) + params.Add(New ReportParameter("Sucursal", dr("SubProyecto").ToString)) + params.Add(New ReportParameter("TipoServicio", dr("TipoServicio").ToString)) + params.Add(New ReportParameter("TipoEquipo", dr("TipoEquipo").ToString)) + 'params.Add(New ReportParameter("Descripcion", dr("Descripcion").ToString)) + params.Add(New ReportParameter("Copia", "Copia: Original")) + params.Add(New ReportParameter("Equipo", dr("Equipo").ToString)) + + params.Add(New ReportParameter("DireccionOS", dr("DireccionOS").ToString)) + params.Add(New ReportParameter("Telefono", dr("Telefono").ToString)) + params.Add(New ReportParameter("CorreoOS", dr("CorreoOS").ToString)) + + params.Add(New ReportParameter("ModeloMarca", dr("ModeloMarca").ToString)) + params.Add(New ReportParameter("Año", dr("Año").ToString)) + params.Add(New ReportParameter("TelefonoContacto", dr("TelefonoContacto").ToString)) + + params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy"))) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + params.Add(New ReportParameter("Condiciones", dr("Condiciones").ToString)) + params.Add(New ReportParameter("FechaAtencion", If(dr("FechaInicio").ToString.Length > 0, dr("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy"), ""))) + params.Add(New ReportParameter("TecnicoAsignado", dr("UsuarioAtendio").ToString)) + + + + + 'End If + + + End If End If @@ -1063,13 +1119,11 @@ Partial Class OS_RepServicioDomicilio End If - If ObjOS.GetOrdenesServiciosDetalle(CveOS) Then - TmpDTOS = ObjOS.DtResultados - End If - If ObjOS.GetDetalleMateriales(-1, CveOS) Then + If ObjOS.GetOrdenesServiciosDetalle(CveOS) Then TmpDTMaterialesOS = ObjOS.DtResultados End If + Dim lrds As New List(Of ReportDataSource) Dim rds As New ReportDataSource With {.Name = "DataSet2", .Value = TmpDTMaterialesOS} Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTOS} From ab65b91b62665deac7b60568214368550b3068b3 Mon Sep 17 00:00:00 2001 From: MLopez Date: Sat, 7 Jan 2023 19:40:38 -0700 Subject: [PATCH 21/25] E172 Rep Indicador Resumen: + Totales en Portlets, Promedio precio VxP, Fila totales Comp Productores y + info en grafica de pastel --- Compras/Proveedores.aspx.vb | 3 - General/RepIndicadorResumen.aspx | 198 +++++++++++++--------------- General/RepIndicadorResumen.aspx.vb | 80 ++++++++--- Site.master | 4 +- Styles/ReportePDF.html | 9 +- 5 files changed, 162 insertions(+), 132 deletions(-) diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 0fcad37ea..26a459684 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -3835,7 +3835,6 @@ Partial Class Compras_Proveedores Private Sub ImprimirReporteCxPCrystal(Optional Formato As String = "PDF") Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepProveedorCxP.rpt", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim DTCxPTempral As DataTable = Nothing @@ -4217,7 +4216,6 @@ Partial Class Compras_Proveedores params.Add(New ReportParameter("LimiteCredito", TxtLimiteCredito.Text)) params.Add(New ReportParameter("SaldoDisponible", (TxtLimiteCredito.Text.ToDouble - dr("Saldo").ToString.ToDouble).ToString.FormatoNumero)) params.Add(New ReportParameter("AgrupadoPor", $"Agrupado Por: {Proveedor}{FechaIn}{FechaFn}{FechVI}{FechVF}")) - params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) ImprimirPDF("Empresas/Grales/Formatos/RepProveedorCxP.rdlc", DTCxPTempral, params, "RepCxP") @@ -4225,7 +4223,6 @@ Partial Class Compras_Proveedores Alert("No se encontraron datos con los filtros especificados", TipoMensaje.MsgAdvertencia) End If - ElseIf rblreporte.SelectedValue = "anc" Then 'OBTENEMOS LOS DATOS diff --git a/General/RepIndicadorResumen.aspx b/General/RepIndicadorResumen.aspx index 31e334953..6b1c27c79 100644 --- a/General/RepIndicadorResumen.aspx +++ b/General/RepIndicadorResumen.aspx @@ -19,25 +19,27 @@ background-color: #95A5A6; color: white; } - .table-scrollable { margin-top: 0px !important; margin-bottom: 0px !important; } - .margenbound { margin-left: 15px; text-align: right; } - .amChartsAttribution { - margin-top: -2px; - margin-bottom: 8px; - visibility: hidden; - } div[id^=chartdiv] { width: 100%; height: 400px; } + .portlet-total { + float:right!important; + display:inline-block!important; + } + .abbr { + overflow: hidden; + text-overflow: ellipsis; + display:block!important; + } @@ -96,12 +98,6 @@
    - <%----%>
    @@ -111,15 +107,15 @@
    - Ventas por Productos -
    -
    -
    -
    + Ventas por Productos
    +
    + + +
    - + <%--TODO: Esto se puede meter en el stored procedured, pero me da cosa moverle :S--%> + + + <%--TODO: Esto puede tronar si el valor es DBNull --%> + <%# If(Convert.ToDecimal(Eval("Cantidad")) = 0, 0.ToString("C"), (Convert.ToDecimal(Eval("SubTotal")) / Convert.ToInt32(Eval("Cantidad"))).ToString("C")) %> + +
    @@ -143,11 +145,7 @@
    - Ventas por Productos - Gráfica -
    -
    -
    -
    + Ventas por Productos - Gráfica
    @@ -168,20 +166,20 @@
    - Compras Productores -
    -
    -
    -
    + Compras Productores
    +
    + + +
    + AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True"> @@ -190,6 +188,7 @@ +
    @@ -202,11 +201,7 @@
    - Compras Productores - Gráfica por Cantidad(Kg) -
    -
    -
    -
    + Compras Productores - Gráfica por Cantidad(Kg)
    @@ -227,15 +222,15 @@
    - Gastos -
    -
    -
    -
    + Gastos
    +
    + + +
    - Compras por clasificación - Gráfica -
    -
    -
    -
    + Compras por clasificación - Gráfica
    @@ -283,15 +274,15 @@
    - Cuentas por cobrar -
    -
    -
    -
    + Cuentas por cobrar
    +
    + + +
    - Cuentas por cobrar - Gráfica Saldo VS Recuperado -
    -
    -
    -
    + Cuentas por cobrar - Gráfica Saldo VS Recuperado
    @@ -330,30 +317,6 @@
    - -
    - - -
    -
    - - Cuentas por cobrar - Gráfica Recuperado -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    @@ -363,15 +326,15 @@
    - Cuentas por Pagar productores -
    -
    -
    -
    + Cuentas por Pagar productores
    +
    + + +
    - Cuentas por Pagar productores - Gráfica -
    -
    -
    -
    + Cuentas por Pagar productores - Gráfica
    @@ -418,15 +377,15 @@
    - Cuentas por Pagar no productores -
    -
    -
    -
    + Cuentas por Pagar no productores
    +
    + + +
    - Cuentas por Pagar no productores - Gráfica -
    -
    -
    -
    + Cuentas por Pagar no productores - Gráfica
    @@ -507,7 +462,17 @@ align: 'left' }, legend: { - enabled: false + enabled: false, + // esto es para la grafica de pie + layout: 'vertical', + align: 'right', + width: 220, + verticalAlign: 'middle', + borderWidth: 0, + useHTML: true, + labelFormatter: function () { + return '
    ' + this.name + '
    ' + '
    ' + this.y.toLocaleString() + this.unit + '' + '$' + this.y2.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + '
    '; + }, }, xAxis: { type: 'category' @@ -547,6 +512,10 @@ // }, // //footerFormat: '{point.key}' //}, + tooltip: { + //valuePrefix: '$', + valueSuffix: " " + '{point.unit}' + }, plotOptions: { series: { animation: true, @@ -577,9 +546,14 @@ } }, pie: { + allowPointSelect: true, + cursor: 'pointer', dataLabels: { - enabled: true - } + enabled: true, + distance: -30, + format: '{point.percentage:.1f} %' + }, + showInLegend: true } }, series: [ @@ -594,11 +568,11 @@ //AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, type: "serial", dataProvider: json["VxP"] }); // Ventas x Producto $('#' + "chartdiv_vxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["VxP"]) }] }) - $('#' + "chartdiv_compproductores").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], type: 'pie', data: customAccessor(json["CompProductores"]) }] }) + $('#' + "chartdiv_compproductores").highcharts({ ...chartconfig, chart: {}, legend: { ...chartconfig.legend, enabled: true }, series: [{ ...chartconfig.series[0], keys: ['name', 'y', 'y2', 'unit', 'unit2'], type: 'pie', data: customAccessorPie(json["CompProductores"]) }] }) $('#' + "chartdiv_compacreed").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CompAcreed"]) }] }) $('#' + "chartdiv_cxp192").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP192"]) }] }) $('#' + "chartdiv_cxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP"]) }] }) - $('#' + "chartdiv_cxc").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxC"]) }, { type: 'line', data: customAccessor(json["CxCR"]) }] }) + $('#' + "chartdiv_cxc").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxC"]) }, { ...chartconfig.series[0], type: 'line', data: customAccessor(json["CxCR"]) }] }) function customAccessor(data) { const newData = []; @@ -609,10 +583,18 @@ newData.push([point.Texto, point.Valor, point.Unidad]); } }); - //newData.sort(function (a, b) { - // return a[0] > b[0] ? 1 : -1; - //}); - //console.log(JSON.stringify(newData)) + return newData; + } + + function customAccessorPie(data) { + const newData = []; + data.forEach(function (point, index) { + if (point.Texto == "Otros") { + newData.push({ name: point.Texto, y: point.Cantidad, y2: point.Importe, unit: point.UnidadC, unit2:point.UnidadI, color: '#000000' }); + } else { + newData.push([point.Texto, point.Cantidad, point.Importe, point.UnidadC, point.UnidadI]); + } + }); return newData; } diff --git a/General/RepIndicadorResumen.aspx.vb b/General/RepIndicadorResumen.aspx.vb index 0566e31e4..b2bf87ec9 100644 --- a/General/RepIndicadorResumen.aspx.vb +++ b/General/RepIndicadorResumen.aspx.vb @@ -83,38 +83,51 @@ Partial Class General_RepIndicadorResumen GvCxC.HeaderRow.Cells(2).Text = "Recuperado" End If - 'Mostrar gráficos solo si hay datos en su respectiva tabla + 'Mostrar gráficos y totales en portlets solo si hay datos en su respectiva tabla If GvVxP.Rows.Count > 0 Then UPGraficaVxP.Visible = True + PLVxPTot.InnerHtml = "" + "Cantidad: " + "" + String.Format("{0:n} Kg", CType(GvVxP.DataSource, DataTable).SUM("Cantidad", "Orden IS NOT NULL")) _ + + "" + "Total: " + "" + String.Format("{0:c} MXN", CType(GvVxP.DataSource, DataTable).SUM("SubTotalMN", "Orden IS NOT NULL")) Else UPGraficaVxP.Visible = False + PLVxPTot.InnerHtml = Nothing End If If GvCompProductores.Rows.Count > 0 Then UPGraficaCompProductores.Visible = True + PLCompProductoresTot.InnerHtml = "" + "Cantidad: " + "" + String.Format("{0:n} Kg", CType(GvCompProductores.DataSource, DataTable).SUM("Cantidad", "")) Else UPGraficaCompProductores.Visible = False + PLCompProductoresTot.InnerHtml = Nothing End If If GvCompAcreed.Rows.Count > 0 Then UPGraficaCompAcreed.Visible = True + PLGastosTot.InnerHtml = "" + "Importe: " + "" + String.Format("{0:c} MXN", CType(GvCompAcreed.DataSource, DataTable).SUM("SubTotalMN", "CveClasificacion IS NOT NULL")) Else UPGraficaCompAcreed.Visible = False + PLGastosTot.InnerHtml = Nothing End If If GvCxC.Rows.Count > 0 Then UPGraficaCxC.Visible = True - 'UPGraficaCxCRec.Visible = True + PLCxCTot.InnerHtml = "" + "Saldo: " + "" + String.Format("{0:c} MXN", CType(GvCxC.DataSource, DataTable).SUM("SaldoMN", "CveCliente IS NOT NULL")) + Dim Recuper As Double = CType(GvCxC.DataSource, DataTable).SUM("RecuperadoMN", "CveCliente IS NOT NULL") + If (Recuper > 0) Then PLCxCTot.InnerHtml += "" + "Rec: " + "" + String.Format("{0:c} MXN", CType(GvCxC.DataSource, DataTable).SUM("RecuperadoMN", "CveCliente IS NOT NULL")) Else UPGraficaCxC.Visible = False - 'UPGraficaCxCRec.Visible = False + PLCxCTot.InnerHtml = Nothing End If If GvCxP192.Rows.Count > 0 Then UPGraficaCxP192.Visible = True + PLCxP192Tot.InnerHtml = "" + "Saldo: " + "" + String.Format("{0:c} MXN", CType(GvCxP192.DataSource, DataTable).SUM("SaldoMN", "CveProveedor IS NOT NULL")) Else UPGraficaCxP192.Visible = False + PLCxP192Tot.InnerHtml = Nothing End If If GvCxP.Rows.Count > 0 Then UPGraficaCxP.Visible = True + PLCxPTot.InnerHtml = "" + "Saldo: " + "" + String.Format("{0:c} MXN", CType(GvCxP.DataSource, DataTable).SUM("SaldoMN", "CveProveedor IS NOT NULL")) Else UPGraficaCxP.Visible = False + PLCxPTot.InnerHtml = Nothing End If 'Si no había datos en ninguna tabla no cargar función de gráficos @@ -149,6 +162,32 @@ Partial Class General_RepIndicadorResumen End If End If End Sub + Dim CompProductoresTotales As Decimal() = New Decimal(5 - 1) {} + Protected Sub GvCompProductores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompProductores.RowDataBound + 'Esto tambien se podría meter en el Stored Procedure + If e.Row.RowType = DataControlRowType.DataRow Then + CompProductoresTotales(0) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Cantidad"), 0)) + CompProductoresTotales(1) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "SubTotal"), 0)) + CompProductoresTotales(2) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "PUPromedioKG"), 0)) + CompProductoresTotales(3) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Saldo"), 0)) + CompProductoresTotales(4) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Abonado"), 0)) + ElseIf e.Row.RowType = DataControlRowType.Footer Then + 'Movemos el pie a la primera fila de la tabla + Dim footerRow As GridViewRow = e.Row + GvCompProductores.Controls(0).Controls.Remove(footerRow) + GvCompProductores.Controls(0).Controls.AddAt(1, footerRow) + 'Ahora se registran los datos + e.Row.Cells(0).Text = "Totales" + e.Row.Cells(1).Text = CompProductoresTotales(0).ToString("N") + e.Row.Cells(2).Text = CompProductoresTotales(1).ToString("C") + e.Row.Cells(3).Text = (CompProductoresTotales(2) / GvCompProductores.Rows.Count).ToString("C") 'Promedio + e.Row.Cells(4).Text = CompProductoresTotales(3).ToString("C") + e.Row.Cells(5).Text = CompProductoresTotales(4).ToString("C") + For i As Integer = 1 To e.Row.Cells.Count - 1 + e.Row.Cells(i).CssClass = "margenbound" + Next + End If + End Sub Protected Sub GvComprasAcreed_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompAcreed.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("CveClasificacion") = "" Then @@ -230,32 +269,40 @@ Partial Class General_RepIndicadorResumen 'Dim group_resto_vxp = From e In resto_vxp Group e By e.Texto Into gpo = Group 'Dim group_resto_vxp = resto_vxp.GroupBy(Function(e) New With {Key e.Texto, Key e.Valor, Key e.Color, Key e.Unidad}).ToList() - 'Compras ProveedorClasificacion=192 + 'Compras Productores ProveedorClasificacion=192 DtCompProductores.Reset() DtCompProductores.Columns.Add("Texto") - DtCompProductores.Columns.Add("Valor") - DtCompProductores.Columns.Add("Unidad") + DtCompProductores.Columns.Add("Cantidad") + DtCompProductores.Columns.Add("Importe") + DtCompProductores.Columns.Add("UnidadC") + DtCompProductores.Columns.Add("UnidadI") For Each Dr As DataRow In GvCompProductores.DataSource.Rows Dim Row = DtCompProductores.NewRow() Row("Texto") = Dr("RazonSocial").ToString - Row("Valor") = Dr("Cantidad").ToString.FormatoNumero - Row("Unidad") = "Kg" + Row("Cantidad") = Dr("Cantidad").ToString.FormatoNumero + Row("Importe") = Dr("SubTotal").ToString.FormatoNumero + Row("UnidadC") = "Kg" + Row("UnidadI") = "MXN" DtCompProductores.Rows.Add(Row) Next - Dim comp_productores = From s In DtCompProductores.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()} + Dim comp_productores = From s In DtCompProductores.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Cantidad = s("Cantidad").ToString().ToDouble(), .Importe = s("Importe").ToString().ToDouble(), .UnidadC = s("UnidadC").ToString(), .UnidadI = s("UnidadI").ToString()} Dim group_comp_productores = comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With { .Texto = g.Key, - .Valor = Math.Round(g.Sum(Function(x) x.Valor), 2), - .Unidad = "MXN" + .Cantidad = Math.Round(g.Sum(Function(x) x.Cantidad), 2), + .Importe = Math.Round(g.Sum(Function(x) x.Importe), 2), + .UnidadC = "Kg", + .UnidadI = "MXN" }).ToDataTable - Dim top_comp_productores = From s In group_comp_productores.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()} - Dim resto_comp_productores = From s In group_comp_productores.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()} + Dim top_comp_productores = From s In group_comp_productores.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Cantidad = s("Cantidad").ToString().ToDouble(), .Importe = s("Importe").ToString().ToDouble(), .UnidadC = s("UnidadC").ToString(), .UnidadI = s("UnidadI").ToString()} + Dim resto_comp_productores = From s In group_comp_productores.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Cantidad = s("Cantidad").ToString().ToDouble(), .Importe = s("Importe").ToString().ToDouble(), .UnidadC = s("UnidadC").ToString(), .UnidadI = s("UnidadI").ToString()} Dim group_resto_comp_productores = resto_comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With { .Texto = "Otros", - .Valor = Math.Round(g.Sum(Function(x) x.Valor), 2), - .Unidad = "MXN" + .Cantidad = Math.Round(g.Sum(Function(x) x.Cantidad), 2), + .Importe = Math.Round(g.Sum(Function(x) x.Importe), 2), + .UnidadC = "Kg", + .UnidadI = "MXN" }) - Dim query_comp_productores = top_comp_productores.Union(group_resto_comp_productores).OrderByDescending(Function(x) x.Valor) + Dim query_comp_productores = top_comp_productores.Union(group_resto_comp_productores).OrderByDescending(Function(x) x.Cantidad) 'Compras TipoProveedor=1 Acreedores (Gastos) DtCompAcreed.Reset() @@ -403,6 +450,7 @@ Partial Class General_RepIndicadorResumen }) Dim query_cxp = top_cxp.Union(group_resto_cxp).OrderByDescending(Function(x) x.Valor) + 'Serializar datos agrupándolos por su respectivo DataTable, todos en un solo JSON Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CompProductores = query_comp_productores, .CompAcreed = query_comp_acreed, .CxC = query_cxc, .CxCR = query_cxcr, .CxP192 = query_cxp192, .CxP = query_cxp}) 'Alert(json) diff --git a/Site.master b/Site.master index 5431b7312..0a9eac6db 100644 --- a/Site.master +++ b/Site.master @@ -15,8 +15,10 @@ <%: Scripts.Render("~/bundles/modernizr") %> <%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %> + + - + <%-- diff --git a/Styles/ReportePDF.html b/Styles/ReportePDF.html index 06a1f940c..f43adb8e4 100644 --- a/Styles/ReportePDF.html +++ b/Styles/ReportePDF.html @@ -1,16 +1,13 @@ - + \ No newline at end of file From cd996b15853d883f0efc5b37f19e0f7013e1951f Mon Sep 17 00:00:00 2001 From: MLopez Date: Tue, 10 Jan 2023 10:44:05 -0700 Subject: [PATCH 22/25] =?UTF-8?q?E141=20Rep=20Entradas=20salidas:=20Marca?= =?UTF-8?q?=20es=20ahora=20de=20selecci=C3=B3n=20m=C3=BAltiple=20Modificac?= =?UTF-8?q?iones=20en=20BD=20[SIG=5FResp=5FMLR]=20-=20PA=5FInv=5FReporteMo?= =?UTF-8?q?vimientos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 4 +- Inventarios/RepEntradasSalidas.aspx | 78 +++++++++++++------------- Inventarios/RepEntradasSalidas.aspx.vb | 3 +- 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 4dcd35be4..0ff33a38c 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1755,7 +1755,7 @@ Public Class ClsInventarios Public Function RepMovimientos(CveEmpresa As Integer, CveMoneda As Integer, FechaI As String, FechaF As String, CveConcepto As Integer, CveProveedor As Integer, Almacenes As String, - CveCategoria As Integer, CveClasificacion As Integer, CvePS As Integer, Tipo As Integer, Optional CveMarca As Integer = -1, Optional CvePersonal As Integer = -1, + CveCategoria As Integer, CveClasificacion As Integer, CvePS As Integer, Tipo As Integer, Optional CveMarca As String = "-1", Optional CvePersonal As Integer = -1, Optional CveClasificacion2 As Integer = -1, Optional CveTipoAlmacen As String = "-1", Optional Modalidad As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1774,7 +1774,7 @@ Public Class ClsInventarios ' .Add("@CveSubFamilia", SqlDbType.Int).Value = CveSubFamilia .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveMarca", SqlDbType.VarChar).Value = CveMarca .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2 .Add("@CveTipoAlmacen", SqlDbType.VarChar).Value = CveTipoAlmacen diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index b541aeccc..95766bb80 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -119,7 +119,7 @@
    Proveedor
    - +
    Categoría
    @@ -127,59 +127,59 @@
    Clasificación
    - -
    -
    -
    - -
    Producto
    -
    - - <%----%> -
    -
    -
    Marca
    -
    - -
    +
    -
    +
    + +
    Producto
    +
    + + <%----%> +
    Personal
    -
    Tipo Almacén:
    +
    +
    + +
    +
    Marca
    - +
    -
    Modalidad:
    -
    - - - - - -
    -
    Clasificación 2:
    -
    - - -
    +
    + +
    Tipo Almacén:
    +
    + +
    +
    Modalidad:
    +
    + + + + + +
    +
    Clasificación 2:
    +
    + + +
    - diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index c60cd06a3..32c24f006 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -226,6 +226,7 @@ Partial Class Inventarios_ReporteEntradasSalidas 'Dim fechaF As String = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1") FechaFinal = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") + Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM) Dim TipoAlmacen As String = If(DdlTipoAlmacen.GetSelectedValuesM = "", "-1", DdlTipoAlmacen.GetSelectedValuesM) Dim Almacenes As String = If(DdlAlmacen.GetSelectedValuesM = "", "-1", DdlAlmacen.GetSelectedValuesM) @@ -235,7 +236,7 @@ Partial Class Inventarios_ReporteEntradasSalidas If Reporte.RepMovimientos(UsuarioActual.CveEmpresa, DdlMoneda.SelectedValue.ToEntero, FechaInicial, FechaFinal, DdlTipoMovimiento.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, Almacenes, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, - DdlMovs.SelectedValue.ToEntero, CveMarca, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero, CveTipoAlmacen:=TipoAlmacen, + DdlMovs.SelectedValue.ToEntero, CveMarca:=Marcas, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero, CveTipoAlmacen:=TipoAlmacen, Modalidad:=DdlModalidadFiltro.SelectedValue.ToEntero) Then dt = Reporte.DtResultados From 0383dabcb97413383e873de06db2aef7e459d632 Mon Sep 17 00:00:00 2001 From: MLopez Date: Tue, 10 Jan 2023 18:29:08 -0700 Subject: [PATCH 23/25] =?UTF-8?q?Mod=20Extensiones:=20Funciones=20para=20G?= =?UTF-8?q?ridViews,=20hacer=20posible=20DataBind=20que=20incluya=20las=20?= =?UTF-8?q?columnas=20no=20visibles=20Razonamiento:=20Las=20columnas=20mar?= =?UTF-8?q?cadas=20como=20no=20visibles=20en=20un=20GridView=20no=20almace?= =?UTF-8?q?nan=20datos,=20antes=20de=20esto=20se=20ten=C3=ADa=20que=20pone?= =?UTF-8?q?r=20visible=20la=20columna=20y=20volver=20a=20realizar=20de=20n?= =?UTF-8?q?uevo=20la=20consulta=20a=20la=20DB=20para=20recuperar=20el=20da?= =?UTF-8?q?to,=20agotando=20recursos=20innecesarios.=20-=20Se=20extiende?= =?UTF-8?q?=20DataBind()=20con=20el=20param=C3=A9tro=20BindearCamposNoVisi?= =?UTF-8?q?bles=20=20=20Ejemplo:=20Para=20Bindear=20un=20GridView=20que=20?= =?UTF-8?q?tambien=20contemple=20los=20campos=20ocultos,=20se=20manda=20a?= =?UTF-8?q?=20llamar=20Gv.DataBind(True)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/modExtensiones.vb | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index ae5d47fc5..9685028a6 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -1628,6 +1628,66 @@ Namespace Extensiones Public Function FCRangeValidator(ByVal Row As GridViewRow, ByVal Control As String) As RangeValidator Return DirectCast(Row.FindControl(Control), RangeValidator) End Function + + + Public Function GetColumn(ByVal gv As GridView, ByVal name As String) As Integer + Dim index As Integer = 0 + Dim found As Boolean = False + + For Each c As DataControlField In gv.Columns + + If TypeOf c Is BoundField Then + Dim field As BoundField = CType(c, BoundField) + + If name = field.DataField OrElse name = field.SortExpression OrElse name = field.HeaderText Then + found = True + Exit For + End If + End If + + index += 1 + Next + + Return If(found, index, -1) + End Function + + + Public Function HiddenColumns(gv As GridView) As List(Of Integer) + Dim columns As New List(Of Integer) + + For i As Integer = 0 To gv.Columns.Count - 1 + If gv.Columns(i).Visible = False Then columns.Add(i) + Next + + Return columns + End Function + + + Public Sub ShowAllColumns(gv As GridView) + For i As Integer = 0 To gv.Columns.Count - 1 + gv.Columns(i).Visible = True + Next + End Sub + + + Public Sub HideColumns(gv As GridView, columns As List(Of Integer)) + For Each i As Integer In columns + gv.Columns(i).Visible = False + Next + End Sub + + + Public Sub DataBind(gv As GridView, BindearCamposNoVisibles As Boolean) + If BindearCamposNoVisibles Then + Dim NoVisibles As List(Of Integer) = gv.HiddenColumns() + gv.ShowAllColumns() + gv.DataBind() + gv.HideColumns(NoVisibles) + Else + gv.DataBind() + End If + End Sub + #End Region #Region "Excel PDF" From 782804b7a7daa013898639003976390acb18c9b3 Mon Sep 17 00:00:00 2001 From: MLopez Date: Tue, 10 Jan 2023 18:30:09 -0700 Subject: [PATCH 24/25] =?UTF-8?q?E141=20Rep=20Entradas=20y=20salidas:=20Op?= =?UTF-8?q?ci=C3=B3n=20para=20personalizar=20columnas,=20no=20recargar=20c?= =?UTF-8?q?onsulta=20al=20personalizar=20Grid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/RepEntradasSalidas.aspx | 41 +++++++++++++++------- Inventarios/RepEntradasSalidas.aspx.vb | 47 ++++++++++++++++++++------ 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index 95766bb80..82be31ee6 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -1,22 +1,37 @@ <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEntradasSalidas.aspx.vb" Inherits="Inventarios_ReporteEntradasSalidas" %> -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • -
  • - Generar Formato Inventario -
  • + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • -
  • - Personalizar Columnas -
  • - <%--
  • +
  • + Excel Personalizado +
  • + +
  • + Generar Formato Inventario +
  • + +
  • + Personalizar Columnas +
  • + <%--
  • Generar Inventarios HP
  • --%> +
    + + + + + + +
    - - - - -
  • - Generar PDF + + + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • + +
  • + Excel Personalizado +
  • + +
  • + +
  • -
  • - Generar Excel -
  • - -
  • - Excel Personalizado -
  • - -
  • -
  • - -
  • - Ver Dlls en pesos - -
  • - - -
  • - Programar Recursos - -
  • - -
    - - - - - -
    - +
  • + Ver Dlls en pesos + +
  • + + +
  • + Programar Recursos + +
  • + + + + + + + + +
    Reporte de CxP - Detalle @@ -216,18 +217,18 @@
    - -
    - - - -
    - - -
    - - - + +
    + + + +
    + + +
    + + +
    Comprobación:
    @@ -241,19 +242,19 @@
    -
    +
    Moneda:
    -
    - -
    +
    + +
    Aplica NC:
    -
    +
    - -
    + +
    @@ -264,7 +265,7 @@ - <%--0--%> diff --git a/Compras/RepCxPDetalle.aspx.vb b/Compras/RepCxPDetalle.aspx.vb index 22ed077f9..10ad64961 100644 --- a/Compras/RepCxPDetalle.aspx.vb +++ b/Compras/RepCxPDetalle.aspx.vb @@ -83,18 +83,6 @@ Partial Class RepCxPDetalle ViewState("FechaFin") = value End Set End Property - - - Private Property Personalizo As Integer - Get - Return ViewState("Personalizo").ToString.ToEntero - End Get - - Set(value As Integer) - ViewState("Personalizo") = value - End Set - End Property - Public Property FechaVInicio() As String Get @@ -205,7 +193,6 @@ Partial Class RepCxPDetalle Private Property TCEspecifico As Double - Public Property DTCuentasContables() As DataTable Get If ViewState("DTCuentasContables") Is Nothing Then @@ -218,20 +205,14 @@ Partial Class RepCxPDetalle Set(value As DataTable) ViewState("DTCuentasContables") = value End Set - End Property - - - + End Property #End Region - - 'pRivate ReadOnly Property ColumnasVisibles As - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - Personalizo = 0 - + 'Private ReadOnly Property ColumnasVisibles As + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then ViewState("Opcion") = IfNull(Request("Op"), "S") - MostrarOcultarColumnas() + MostrarOcultarColumnas(False) CargaCombos() If Request("Op") IsNot Nothing Then CargaDatos() @@ -274,7 +255,6 @@ Partial Class RepCxPDetalle DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1")) DdlUsuarioRegistro.SelectedValueExist(UsuarioRegistro) - Dim CveSucursal As Integer = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero 'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) @@ -309,7 +289,6 @@ Partial Class RepCxPDetalle FechaCorte = IfNull(Request("FechaCorte"), Now.ToDate.ToString).ToString txtCorteA.Text = $"31/12/{Now.Year}" - If Request("FechaI") <> "-1" AndAlso IsDate(Request("FechaI")) Then txtFechaI.Text = Request("FechaI") If Request("FechaF") <> "-1" AndAlso IsDate(Request("FechaF")) Then txtFechaF.Text = Request("FechaF") If Request("FechaVI") <> "-1" AndAlso IsDate(Request("FechaVI")) Then txtFechaVI.Text = Request("FechaVI") @@ -349,8 +328,6 @@ Partial Class RepCxPDetalle GvDatos.Columns(11).Visible = (UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0) - - For Each lItem As ListItem In DdlGrupo.Items If lItem.Value.ToEntero = 9 Then @@ -358,7 +335,6 @@ Partial Class RepCxPDetalle End If Next - End Sub Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged @@ -544,11 +520,8 @@ Partial Class RepCxPDetalle End If End If - - End If - If e.Row.DBCampo("CveCompra") = "" Then e.Row.FCLabel("LblMoneda").Text = "" End If @@ -595,7 +568,7 @@ Partial Class RepCxPDetalle #End Region #Region "PERSONALIZAR" - Protected Sub MostrarOcultarColumnas() + Protected Sub MostrarOcultarColumnas(Optional Personalizo As Boolean = True) If ChkTipoDocto.Checked Then GvDatos.Columns(0).Visible = True @@ -639,15 +612,12 @@ Partial Class RepCxPDetalle GvDatos.Columns(7).Visible = False End If - If ChkMoneda.Checked Then GvDatos.Columns(8).Visible = True Else GvDatos.Columns(8).Visible = False End If - - If ChkSaldo.Checked Then GvDatos.Columns(9).Visible = True Else @@ -692,12 +662,12 @@ Partial Class RepCxPDetalle GvDatos.Columns(16).Visible = ChkDescripcion.Checked - Personalizo = 1 - If Personalizo = 1 Then + If Personalizo Then ImgExcelPersonalizado.Visible = True Else ImgExcelPersonalizado.Visible = False - End If + End If + UPAcciones.Update() UPDatos.Update() End Sub diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index 82be31ee6..a6f392e96 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -227,7 +227,7 @@ <%--0--%> - + <%--1--%> <%--2--%> diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index a11433761..72404a554 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -54,21 +54,11 @@ Partial Class Inventarios_ReporteEntradasSalidas Return (UsuarioActual.CveEmpresa.Contiene(72, 80)) End Get End Property - Private Property Personalizo As Integer - Get - Return ViewState("Personalizo").ToString.ToEntero - End Get - - Set(value As Integer) - ViewState("Personalizo") = value - End Set - End Property #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - Personalizo = 0 If UsuarioActual.CveEmpresa.Contiene(119) Then LnkFormatoInventario.Visible = True @@ -435,7 +425,7 @@ Partial Class Inventarios_ReporteEntradasSalidas #End Region #Region "PERSONALIZAR" - Private Sub MostrarOcultarColumnas() + Private Sub MostrarOcultarColumnas(Optional Personalizo As Boolean = True) GvM.Columns(1).Visible = ChkCodigoAlterno.Checked GvM.Columns(2).Visible = ChkCodigoBarras.Checked GvM.Columns(3).Visible = ChkClasificacion2.Checked @@ -510,12 +500,12 @@ Partial Class Inventarios_ReporteEntradasSalidas dvCan.Style.Add("width", "21%") End If - Personalizo = 1 - If Personalizo = 1 Then + If Personalizo Then LnkExcelPersonalizado.Visible = True Else LnkExcelPersonalizado.Visible = False End If + UPAcciones.Update() UpEncabezado.Update() UPPMov.Update() @@ -524,7 +514,6 @@ Partial Class Inventarios_ReporteEntradasSalidas Private Sub BtnPersonalizar_Click(sender As Object, e As EventArgs) Handles BtnPersonalizar.Click MostrarOcultarColumnas() RegistraScript("$('#DivPersonalizar').modal('hide')") - UPAcciones.Update() 'CargaDatos() End Sub