From 5312d055ba4a40b48673dec83b02932f6c8ad0bb Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 12 Jun 2020 21:26:22 -0700 Subject: [PATCH 01/54] Pago Electronico Grupos --- Bancos/PagoElectronico.aspx.vb | 9 +++++++-- Bancos/PagoElectronicoGrupos.aspx.vb | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index ed0b9df3c..355150d54 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -2756,10 +2756,15 @@ Partial Class Bancos_PagoElectronico params.Add(New ReportParameter("LogoPath", "")) End If - params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Direccion", UsuarioActual.Empresa.Direccion)) params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC)) - params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) + params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) + + + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout")) + ImprimirPDF("Empresas/Grales/Formatos/LayoutPagoProveedor.rdlc", DtPago, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2") End If diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 9529708ac..61f4e36a0 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -2491,7 +2491,7 @@ Partial Class Bancos_PagoElectronicoGrupos params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout")) + params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout Grupos")) ImprimirPDF("Empresas/Grales/Formatos/LayoutPagoProveedor.rdlc", DT_PagosReporte, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2") End If From ac1235240d0f3bb14cf7f8fe3453f9dc95584f8a Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Tue, 16 Jun 2020 11:47:41 -0700 Subject: [PATCH 02/54] Pago Electronico Grupos --- Bancos/IE.aspx.vb | 6 +- Bancos/PagoElectronicoGrupos.aspx.vb | 130 ++++++++++++++++++--------- 2 files changed, 92 insertions(+), 44 deletions(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index c8a70dd0d..9dea8b176 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -4642,7 +4642,7 @@ Partial Class Bancos_IE Dim Dep As New ClsGenerales If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCliente:=CveCliente, CvePersonal:=CvePersonal) Then - If DdlTipoTransaccion.SelectedValue = "9" Then + If DdlTipoTransaccion.SelectedValue = "9" And CveIE = Nothing Then DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") @@ -4653,7 +4653,7 @@ Partial Class Bancos_IE Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) End If - ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + ElseIf DdlTipoTransaccion.SelectedValue = "17" And CveIE = Nothing Then If Dep.DtResultados.Rows.Count > 0 Then @@ -4685,7 +4685,7 @@ Partial Class Bancos_IE Else - If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") And CveIE = Nothing Then BtnGuardar.Enabled = False Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 61f4e36a0..8b8bbf24e 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -216,6 +216,62 @@ Partial Class Bancos_PagoElectronicoGrupos End Property + Property CveIEPagoActual As Integer + Get + If ViewState("CveIEPagoActual") Is Nothing Then + Return -1 + Else + Return ViewState("CveIEPagoActual").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveIEPagoActual") = value + End Set + End Property + + Property CveLayoutEnvioDetalleActual As Integer + Get + If ViewState("CveLayoutEnvioDetalleActual") Is Nothing Then + Return -1 + Else + Return ViewState("CveLayoutEnvioDetalleActual").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveLayoutEnvioDetalleActual") = value + End Set + End Property + + Property GvIndexActual As Integer + Get + If ViewState("GvIndexActual") Is Nothing Then + Return -1 + Else + Return ViewState("GvIndexActual").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("GvIndexActual") = value + End Set + + End Property + + + Property DTFoliosPrefijos As DataTable + Get + If ViewState("DTFoliosPrefijos") Is Nothing Then + Return Crate_DTFoliosPrefijos() + Else + Return DirectCast(ViewState("DTFoliosPrefijos"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTFoliosPrefijos") = value + End Set + + End Property + + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -244,6 +300,18 @@ Partial Class Bancos_PagoElectronicoGrupos End Sub + Private Function Crate_DTFoliosPrefijos() As DataTable + + Dim DTFolios As New DataTable + DTFolios.Columns.Add("CveIE", GetType(Integer)) + DTFolios.Columns.Add("Folio", GetType(String)) + DTFolios.AcceptChanges() + + Return DTFolios + + End Function + + #Region " C A R G A - D A T O S " Private Sub CargaCuentas() DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1") @@ -2626,44 +2694,6 @@ Partial Class Bancos_PagoElectronicoGrupos End Sub - Property CveIEPagoActual As Integer - Get - If ViewState("CveIEPagoActual") Is Nothing Then - Return -1 - Else - Return ViewState("CveIEPagoActual").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("CveIEPagoActual") = value - End Set - End Property - - Property CveLayoutEnvioDetalleActual As Integer - Get - If ViewState("CveLayoutEnvioDetalleActual") Is Nothing Then - Return -1 - Else - Return ViewState("CveLayoutEnvioDetalleActual").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("CveLayoutEnvioDetalleActual") = value - End Set - End Property - - Property GvIndexActual As Integer - Get - If ViewState("GvIndexActual") Is Nothing Then - Return -1 - Else - Return ViewState("GvIndexActual").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("GvIndexActual") = value - End Set - End Property @@ -2770,9 +2800,24 @@ Partial Class Bancos_PagoElectronicoGrupos If Not ObjBanco.UpdateLayoutEnviosDetalle(CveLayoutEnvioDetalle, CveLayoutEnvio, CveIE, CveProveedor, 2, "", True) Then ErrorProceso = True + + End If + DTFoliosPrefijos.Clear() + For Each RowGV As GridViewRow In GvEnviadas.Rows + + Dim nRow As DataRow = DTFoliosPrefijos.NewRow + + nRow("CveIE") = RowGV.DataKey("CveIE").ToEntero + nRow("Folio") = RowGV.FCTextBox("TxtFolio").Text.Trim + + DTFoliosPrefijos.Rows.Add(nRow) + + Next + DTFoliosPrefijos.AcceptChanges() + If NuevoFolio <> "-1" Or Comprobante <> "-1" And Not ErrorProceso Then If Not ObjBanco.UpdateBancos_IEFolio(CveIE, NuevoFolio, Comprobante) Then ErrorProceso = True @@ -2797,11 +2842,9 @@ Partial Class Bancos_PagoElectronicoGrupos ErrorProceso = True Alert("Error al guardar comprobante.", TipoMensaje.MsgError) End Try - End If - If ErrorProceso Then ObjBanco.RollBack() Else @@ -2811,8 +2854,13 @@ Partial Class Bancos_PagoElectronicoGrupos CargaEnviados() - End If + For Each RowGV As GridViewRow In GvEnviadas.Rows + RowGV.FCTextBox("TxtFolio").Text = DTFoliosPrefijos.FiltroPrimeroValor("Folio", $"CveIE = {RowGV.DataKey("CveIE").ToEntero}") + Next + UpEnviados.Update() + + End If ObjBanco.Dispose() From d2846cf2d491723b7f33577c9f56112af299161b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 16 Jun 2020 16:23:00 -0700 Subject: [PATCH 03/54] Correcion al generar cotizacion de factura --- Ventas/Ventas.aspx.vb | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ae5e7372b..29a9887a9 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2306,9 +2306,9 @@ Partial Class Ventas ViewState("CveRemision") = IfNull(Request("CveRemision").ToEntero(), 0) ViewState("CveCotizacion") = IfNull(Request("CveCotizacion").ToEntero(), 0) - If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then - EsCreaApartirDe = True - End If + 'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then + ' EsCreaApartirDe = True + 'End If If ViewState("CveRemision").ToString().ToEntero() > 0 Or ViewState("CveCotizacion").ToString().ToEntero() > 0 Then 'ViewState("CveRemision") = Request("CveRemision") @@ -2346,6 +2346,20 @@ Partial Class Ventas 'CargaDetalle de Almacen InventarioMov() + + If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then + + CargaCotizaciones() + + If DtCotizaciones IsNot Nothing Then + For Each Row As DataRow In DtCotizaciones.Select($"CveVenta={ViewState("CveCotizacion").ToString().ToEntero()}") + Row("Aplicado") = True + Next + End If + + CargarCotizacionesAFacturar() + End If + End If If Not ExFolioFactura Then SetPermisos() @@ -16239,6 +16253,11 @@ Partial Class Ventas If Not OcurrioError Then OcurrioError = Not GeneroMovimientoAlmacen End If + + If OcurrioError Then + Exit For + End If + End If End If @@ -16250,6 +16269,10 @@ Partial Class Ventas Exit For End If End If + + If OcurrioError Then + Exit For + End If Next @@ -23598,6 +23621,15 @@ Partial Class Ventas 'MARCA LAS SELECCIONADAS VerificaCotizaciones(DtCotizaciones) + + CargarCotizacionesAFacturar() + + RegistraScript("$('#DivCotizaciones').modal('hide');") + + End Sub + + Private Sub CargarCotizacionesAFacturar() + Dim DTSeleccionadas = DtCotizaciones.FiltraParametros("Aplicado = True") If DTSeleccionadas.Rows.Count = 0 Then @@ -23684,9 +23716,6 @@ Partial Class Ventas UpFacturar.Update() UpPS.Update() UpParametros.Update() - - RegistraScript("$('#DivCotizaciones').modal('hide');") - End Sub Private Sub VerificaCotizaciones(ByRef dt As DataTable) If ChkCotProductos.Checked Then From 2768aece090e42b36961180c01060919892d64ac Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 16 Jun 2020 16:23:36 -0700 Subject: [PATCH 04/54] Limpiar tabla al generar movimiento --- Inventarios/EntregaAlmacen.aspx.vb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index e16e212d4..0190cc9f0 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -822,11 +822,10 @@ Partial Class Inventarios_EntregaAlmacen If AplicaSeccion Then GvDatos.Columns(7).Visible = True If AplicaLote Then GvDatos.Columns(8).Visible = True - If AplicaCaducidad Then GvDatos.Columns(9).Visible = True - - GvDatos.DataSource = DtDatos + If AplicaCaducidad Then GvDatos.Columns(9).Visible = True + End If - + GvDatos.DataSource = DtDatos GvDatos.DataBind() UpDatos.Update() @@ -3253,6 +3252,8 @@ Partial Class Inventarios_EntregaAlmacen TimmerRefresh.Enabled = True UpGenerales.Update() CargaGvDatos() + + UpDatos.Update() End Sub #End Region From ce15f1dd07cda4934a6bf08966109fd0d67562e0 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 16 Jun 2020 16:24:04 -0700 Subject: [PATCH 05/54] correcion de "SerieLote" a "Serie" --- Ventas/PV.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 427b7f4f4..927c6b1ad 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -3837,7 +3837,7 @@ Partial Class PV TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("CveTipoPS", GetType(Integer)) TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer)) - TmpDT.Columns.Add("SerieLote", GetType(String)) + TmpDT.Columns.Add("Serie", GetType(String)) TmpDT.Columns.Add("CuentaPredial", GetType(String)) TmpDT.Columns.Add("Obs", GetType(String)) TmpDT.Columns.Add("TiempoEntrega", GetType(String)) From 0240d5c7d6195516939de4814fe30521345f2493 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 16 Jun 2020 17:39:12 -0700 Subject: [PATCH 06/54] correcciones en reportes --- Compras/PopUpVerFactura.aspx.vb | 3 ++- Compras/ProveedoresAuxiliar.aspx.vb | 5 ++++- Ventas/AuxiliarCliente.aspx.vb | 32 +++++++++++++++++++---------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 0ae95cb69..35aee5510 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -2673,9 +2673,10 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) + Dim ArchivoRuta As New System.IO.FileInfo(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta)) Dim Archivo As String = $"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntradaSalidaUniforme.rdlc" - If Not File.Exists($"{Server.MapPath("~")}/{Archivo}") Then + If Not ArchivoRuta.Exists Then Archivo = "Empresas/Grales/Formatos/EntradaSalidaUniforme.rdlc" End If diff --git a/Compras/ProveedoresAuxiliar.aspx.vb b/Compras/ProveedoresAuxiliar.aspx.vb index 926764dfe..26f320e35 100644 --- a/Compras/ProveedoresAuxiliar.aspx.vb +++ b/Compras/ProveedoresAuxiliar.aspx.vb @@ -115,6 +115,9 @@ Partial Class Compras_ProveedoresAuxiliar If txtFechaI.Text = "" Then FechaIn = "" If txtFechaF.Text = "" Then FechaFn = "" Dim Proveedor = If(DdlProveeedores.SelectedValue = "-1", "", $" Proveedor: {DdlProveeedores.SelectedText}") + Dim OpcionP = If(DdlOpcion.SelectedValue = "-1", "", $" Opción: {DdlOpcion.SelectedItem.Text}") + Dim TipoProv = If(DdlTipoProveedor.SelectedValue = "-1", "", $" Tipo Proveedor: {DdlTipoProveedor.SelectedItem.Text}") + Dim ContaP = If(DdlOpcionContabilizable.SelectedValue = "-1", "", $" Contabilizable: {DdlOpcionContabilizable.SelectedItem.Text}") If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) @@ -122,7 +125,7 @@ Partial Class Compras_ProveedoresAuxiliar params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToString)) - params.Add(New ReportParameter("Filtros", $"Filtros: {Proveedor}{FechaIn}{FechaFn}")) + params.Add(New ReportParameter("Filtros", $"Filtros: {Proveedor}{FechaIn}{FechaFn}{OpcionP}{TipoProv}{ContaP}")) If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", logouri)) Else diff --git a/Ventas/AuxiliarCliente.aspx.vb b/Ventas/AuxiliarCliente.aspx.vb index 1b76d465a..f942475e2 100644 --- a/Ventas/AuxiliarCliente.aspx.vb +++ b/Ventas/AuxiliarCliente.aspx.vb @@ -121,7 +121,7 @@ Partial Class Ventas_AuxiliarCliente ' Next 'End If - worksheet.Rows.InsertEmpty(0, 6) + worksheet.Rows.InsertEmpty(0, 7) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Usuario.CveEmpresa) @@ -149,12 +149,20 @@ Partial Class Ventas_AuxiliarCliente RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + Dim FiltroCliente = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex) + FiltroCliente.Merged = True + FiltroCliente.Value = String.Format("Cliente: {0} Fecha Inicio: {1} Fecha Fin: {2} Opción: {3}", DdlClientes.SelectedText, txtFechaI.Text, txtFechaF.Text, DdlOpcion.SelectedItem.Text) + FiltroCliente.Style.Font.Size = 12 * 20 + FiltroCliente.Style.Font.Name = "Calibri Light" + FiltroCliente.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left + FiltroCliente.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - worksheet.Rows(6).Cells(i).Style.Font.Size = 12 * 20 - worksheet.Rows(6).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - worksheet.Rows(6).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - worksheet.Rows(6).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - worksheet.Rows(6).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) + worksheet.Rows(7).Cells(i).Style.Font.Size = 12 * 20 + worksheet.Rows(7).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + worksheet.Rows(7).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + worksheet.Rows(7).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) + worksheet.Rows(7).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) 'If i > 0 Then ' Try ' worksheet.Columns(i).AutoFit(1) @@ -164,13 +172,15 @@ Partial Class Ventas_AuxiliarCliente Next - Dim IndexEndTable As Integer = Gv.Rows.Count + 8 + Dim IndexEndTable As Integer = Gv.Rows.Count + 9 - worksheet.Rows(IndexEndTable).Cells(2).Value = "Usuario Imprimió" - worksheet.Rows(IndexEndTable + 1).Cells(2).Value = Usuario.Nombre + worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió:" + worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre - worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión" - worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy") + worksheet.Rows(IndexEndTable).Cells(4).Value = "Fecha Impresión: " + worksheet.Rows(IndexEndTable + 1).Cells(4).Value = DateTime.Now.ToString() + + worksheet.Rows(IndexEndTable).Cells(8).Value = "Impreso en SIG" End If End Using From 5d01d5bea37f3a029500be53298c44e25de69506 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 17 Jun 2020 08:47:15 -0700 Subject: [PATCH 07/54] cuando se registra una NC de dev, y se registra el movimiento de almacen, en el mismo registro, no genera el mov del concepto 68 de prepolizas, referenciado al movimeinto --- Compras/Compras.aspx.vb | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 3eb5a8958..3a56568cf 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4402,6 +4402,8 @@ Partial Class Compras_Compras Dim IVA As Decimal = 1.16D Dim ListaMovimientosAlmacen As New List(Of Integer) + Dim Devolucion As MMensajeDevolucion = Nothing + Dim ErrorCreditoCapitalIntres As Boolean = False Dim ErrorCredito As Boolean = False @@ -4572,7 +4574,9 @@ Partial Class Compras_Compras ViewState("CveCompra") = ObjCompras.CveCompra If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then - ErrorMovDev = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate) + Devolucion = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate) + + TieneError = Devolucion.TieneError End If Dim ErrorDetalles As Boolean = False ' Dim IDPoliza As Integer @@ -6649,6 +6653,13 @@ Partial Class Compras_Compras importeMN = importeMovimiento * tipoCambioActual * Multiplicador Dim ConceptoContabilizacionNC = 225 + Dim CveMovimientoDevolucion As Integer = -1 + + 'CUANDO NO SE RECIBE LA MERCANCIA EN COMPRAS, SE REGISTRA EL 225, SI SE ESTA REGISTRANDO LA DEVOLUCION EN ALMACEN, SE REGISTRA EL 68 + If Devolucion IsNot Nothing AndAlso Devolucion.DebeRealizarDevolucion AndAlso Devolucion.CveMovimiento > 0 Then + ConceptoContabilizacionNC = 68 + CveMovimientoDevolucion = Devolucion.CveMovimiento + End If If ObjConta.GetRetCuenta(ConceptoContabilizacionNC, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then @@ -6666,7 +6677,7 @@ Partial Class Compras_Compras idCuentaContabilizacion = 0 End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If @@ -13925,13 +13936,15 @@ Partial Class Compras_Compras '*se envia true si hubo un error*' - Private Function guardardevolucion(ObjInventario As ClsInventarios, CveCompra As Integer, subtotal As Double, Fecha As Date) As Boolean + Private Function guardardevolucion(ObjInventario As ClsInventarios, CveCompra As Integer, subtotal As Double, Fecha As Date) As MMensajeDevolucion Dim ErrorMovInv As Boolean = False Dim CveAlmacen As Integer = DdlAlmacenDevolucion.SelectedValue.ToEntero() Dim subtotaldevolucion As Double = 0 Dim realizadevolucion As Boolean = False + Dim CveMovimientoEntrada As Integer = -1 'Calculo los subtotales para comparar con la NC Dim cantidad As Double = 0.0 + For Each Dr As GridViewRow In GVDevolucion.Rows 'CveAlmacen = Dr.DataKey("CveAlmacen").ToString.ToEntero cantidad = Dr.FCTextBox("TxtCantidad").Text.ToDouble @@ -13946,7 +13959,7 @@ Partial Class Compras_Compras 'si el subtotal es iwal a la nc lo guardo si no marco error If subtotal > subtotaldevolucion - 1 AndAlso subtotal < subtotaldevolucion + 1 Then - Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 13, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G") + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 13, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G") If CveMovimientoEntrada <= 0 Then ErrorMovInv = True Else @@ -13964,9 +13977,14 @@ Partial Class Compras_Compras Alert("El Total de la NC debe ser igual al total de la devolucion", TipoMensaje.MsgAdvertencia) End If End If - Return ErrorMovInv - End Function + Return New MMensajeDevolucion() With + { + .CveMovimiento = CveMovimientoEntrada, + .DebeRealizarDevolucion = realizadevolucion, + .TieneError = ErrorMovInv + } + End Function Private Sub cargaddldevoluciones(CveProveedor As Integer, SubTotal As Double) Dim objcompras As New ClsCompras() @@ -19887,4 +19905,10 @@ Partial Class Compras_Compras End If End Sub +End Class + +Public Class MMensajeDevolucion + Public Property CveMovimiento As Integer + Public Property TieneError As Boolean + Public Property DebeRealizarDevolucion As Boolean End Class \ No newline at end of file From 03f0726425ca35d086d24e3acc3fdc90e9365f87 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 17 Jun 2020 21:17:47 -0700 Subject: [PATCH 08/54] tarea web terminada, falta cargar la imagen de la entrega --- TareasProgramadas/Tareas72.ashx | 134 ++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 TareasProgramadas/Tareas72.ashx diff --git a/TareasProgramadas/Tareas72.ashx b/TareasProgramadas/Tareas72.ashx new file mode 100644 index 000000000..1edc5d88a --- /dev/null +++ b/TareasProgramadas/Tareas72.ashx @@ -0,0 +1,134 @@ +<%@ WebHandler Language="C#" Class="Tareas72" %> + +using System; +using System.Web; +using System.Data; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Extensiones; +using System.IO; +using Microsoft.Reporting.WebForms; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using System.Text; +public class Tareas72 : IHttpHandler +{ + + public void ProcessRequest(HttpContext context) + { + context.Response.ContentType = "text/plain"; + context.Response.Write("Hello World"); + + bool retorno = false; + string Metodo = context.Request["Metodo"] == null ? "" : context.Request["Metodo"]; + switch (Metodo) + { + case "ActualizarProcesoPaqueterias": + retorno = ActualizarProcesoPaqueterias(); + break; + } + + context.Response.Write(retorno); + context.Response.End(); + } + + private bool ActualizarProcesoPaqueterias() + { + bool retorno = true; + ClsGenerales ObjGenerales = new ClsGenerales(); + ClsClientes ObjClientes = new ClsClientes(); + ClsVentas ObjVentas = new ClsVentas(); + ClsVtaVendedores ObjVendedores = new ClsVtaVendedores(); + ClsSisMail Correo = new ClsSisMail(); + + ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas(); + Empresa Empresa = new Empresa(); + if (ObjEmpresa.GetEmpresas(72, "-1", "-1", "-1", "-1")) + { + Empresa = ObjEmpresa.Empresa; + } + try + { + if (ObjGenerales.GetPaqueteriasGuias(-1, -1, 7, 1, -1, 72, "-1", "01/01/1990", "01/01/2100")) + { + DataRowCollection GuiasPendientes = ObjGenerales.DtResultados.Rows; + foreach (DataRow Guia in GuiasPendientes) + { + int CvePaqueteriaGuia = Guia["CvePaqueteriaGuia"].ToString().ToEntero(); + string GuiaConsultar = Guia["Guia"].ToString(); + + //CONSULTAMOS CADA GUIA EN LA SIGUIENTE API + string uriConsultaGuia = string.Format("https://cc.paquetexpress.com.mx/ptxws/rest/api/v2/guia/historico/ultimoevento/{0}/@1@2@3@4@5", GuiaConsultar); + HttpClient Client = new HttpClient(); + HttpResponseMessage ResponseMessage = Client.GetAsync(uriConsultaGuia).Result; + string JsonString = ResponseMessage.Content.ReadAsStringAsync().Result; + string JsonStringFormat = JsonString.Replace("Resultado(", "{\"Resultado\":").Replace(")", "}"); + DataSet dataSet = JsonConvert.DeserializeObject(JsonStringFormat); + DataTable dataTable = dataSet.Tables["Resultado"]; + if (dataTable.Rows[0]["eventoId"].ToString() == "Hdc") + { + int EstatusEntregado = 3; + + //MANDAMOS A ACTUALIZAR CON ESTATUS DE ENTREGADO + if (ObjGenerales.UpdatePaqueteriasGuias(CvePaqueteriaGuia, -1, -1, -1, EstatusEntregado, "-1", "", "", -1, -1, "-1", "-1", "")) + { + #region 'MANDAR CORREOS' + int CveCliente = Guia["CveCliente"].ToString().ToEntero(); + int CveVenta = Guia["CveAgrupador"].ToString().ToEntero(); + StringBuilder correos = new StringBuilder(""); + + if (ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1)) + { + if (ObjClientes.DtResultados.Rows.Count > 0) + { + DataRow DatosCliente = ObjClientes.DtResultados.Rows[0]; + if (DatosCliente["CorreoEntregaCompras"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosCliente["CorreoEntregaCompras"].ToString())); + if (DatosCliente["CorreoEntregaAlmacen"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosCliente["CorreoEntregaAlmacen"].ToString())); + } + } + + if (ObjVentas.GetVenta(CveVenta, 72)) + { + if (ObjVentas.DtResultados.Rows.Count > 0) + { + int CveVendedor = ObjVentas.DtResultados.Rows[0]["CveVendedor"].ToEntero(); + if (ObjVendedores.GetVendedores(72)) + { + DataRow DatosVendedor = ObjVendedores.DtResultados.FiltroPrimero(string.Format("CveVendedor = {0}", CveVendedor)); + if (DatosVendedor["Correo"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosVendedor["Correo"].ToString())); + if (DatosVendedor["CorreoAdicionalNotificaciones"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosVendedor["CorreoAdicionalNotificaciones"].ToString())); + } + } + } + string CorreosString = correos.ToString(); + if (CorreosString.Length > 0) + { + Correo.SendMail(Empresa, correos.ToString(), "Actualización de paqueterias entregadas", ""); + } + #endregion + } + } + } + } + } + catch (Exception e) + { + ModExtensiones.GuardaLogAD(string.Format("{3} CveEmpresa={0} cveTareaProgramada={1} CveTareaProgramadaHistorial={2}", 72, "", "", e.Message), "Tareas Programadas"); + retorno = false; + } + + ObjGenerales.Dispose(); + ObjClientes.Dispose(); + ObjVentas.Dispose(); + ObjVendedores.Dispose(); + ObjEmpresa.Dispose(); + return false; + } + + public bool IsReusable + { + get { return false; } + } + +} \ No newline at end of file From 1c5f96ab4a7e5a071fec07220a746741d639bc9a Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 18 Jun 2020 11:10:38 -0700 Subject: [PATCH 09/54] campos fijos en los reportes --- AC/Reportes/RepEstadoActividades.rdlc | 13 ++++++++++++- AC/Reportes/RepSituacionFinanciera.rdlc | 13 ++++++++++++- App_Code/ClsPaginas.vb | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/AC/Reportes/RepEstadoActividades.rdlc b/AC/Reportes/RepEstadoActividades.rdlc index 931f42736..de0652b3b 100644 --- a/AC/Reportes/RepEstadoActividades.rdlc +++ b/AC/Reportes/RepEstadoActividades.rdlc @@ -1008,7 +1008,18 @@ - =Parameters!pFirma1.Value + C.P Vera Guadalupe Tarazon Moreno + + + + + + Director Administrativo + + + + + Director Administrativo - - - - - - Textbox8 - - - - - - - - - #bbd915 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Folio - - - - - - - Textbox1 - - - - - - - - - #bbd915 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Fecha - - - - - - - Textbox3 - - - - Black - - 1pt - - - Black - - 1pt - - #bbd915 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Nombre - - - - - - - - - - - - - - - - Textbox7 - - - - Black - - 1pt - - - Black - - 1pt - - #bbd915 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Contacto - - - - - - - Textbox5 - - - - Black - - 1pt - - - Black - - 1pt - - #bbd915 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.4095cm - - - - - true - true - - - - - =Fields!Num.Value - - - - - - - Num - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - - - - - =Fields!serieFolio.Value - - - - - - - serieFolio - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - - - - - =Fields!fecha.Value - - - - - - - fecha - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - - - - - =Fields!nombre.Value - - - - - - - nombre - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - true - true - true - - - - - =Fields!contacto.Value - - - - - - - contacto - - - Bottom - 2pt - 2pt - =IIf(rownumber(nothing) = 1, "2pt", "0pt") - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsInventarios - 0.07056cm - 0.03488cm - 0.92264cm - 20.29479cm - - - - - - true - true - - - - - Recibido por: - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 1.22221in - - - - - - - Textbox2 - 0.19477cm - 2.55499cm - 1.1027cm - 15.46868cm - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Logo1 - FitProportional - 0.07668in - 0cm - 0.86392in - 1.0059in - 1 - - - - - - true - true - - - - - ENTREGAS POR REALIZAR - - - - - - - Textbox4 - 1.40331cm - 7.12631cm - 0.98582cm - 6.32604cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha: - - - - - - - - =Parameters!Fecha.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Asignado a: - - - - - - - - =Parameters!AsignadoA.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - 0.87489cm - true - true - - - true - true - - - - - Usuario: - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - =Now - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox35 - 0.24341cm - 17.71971cm - 0.41981cm - 2.5cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - 0.06702cm - 0.05952cm - 0cm - 20.27015cm - 3 - - - - - - - - - - 25cm - 21.59cm - 0.5cm - 0.5cm - 0.5cm - 0.5cm - 0.13cm - + + + + + + Textbox8 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Folio + + + + + + + Textbox1 + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Fecha + + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Nombre + + + + + + + + + + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Contacto + + + + + + + Textbox5 + + + + Black + + 1pt + + + Black + + 1pt + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.4095cm + + + + + true + true + + + + + =Fields!Num.Value + + + + + + + Num + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!serieFolio.Value + + + + + + + serieFolio + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!fecha.Value + + + + + + + fecha + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!nombre.Value + + + + + + + nombre + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + true + + + + + =Fields!contacto.Value + + + + + + + contacto + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsInventarios + 0.07056cm + 0.03488cm + 0.92264cm + 20.29479cm + + + + + + true + true + + + + + Recibido por: + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 1.22221in + + + + + + + Textbox2 + 0.19477cm + 2.55499cm + 1.1027cm + 15.46868cm + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 0.07668in + 0cm + 0.86392in + 1.0059in + 1 + + + + + + true + true + + + + + ENTREGAS POR REALIZAR + + + + + + + Textbox4 + 1.40331cm + 7.12631cm + 0.98582cm + 6.32604cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha: + + + + + + + + =Parameters!Fecha.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Asignado a: + + + + + + + + =Parameters!AsignadoA.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.87489cm + true + true + + + true + true + + + + + Usuario: + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + =Now + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.24341cm + 17.71971cm + 0.41981cm + 2.5cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.06702cm + 0.05952cm + 0cm + 20.27015cm + 3 + + + + + + + + + + 25cm + 21.59cm + 0.5cm + 0.5cm + 0.5cm + 0.5cm + 0.13cm +