From 5c6f77e0a79d7f6f3295f72b796d93606e4aea42 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 21 Apr 2021 18:06:25 -0700 Subject: [PATCH] Cambios en los reportes --- GPS/Rastreo.aspx.vb | 24 +++++++++++++++++------- Inventarios/TraspasoAlmacen.aspx.vb | 2 +- OC/OC.aspx.vb | 22 +++++++++++++++++++--- Ventas/ActualizarPrecios.aspx.vb | 21 ++++++++++++++++++++- Ventas/Clientes.aspx | 3 +++ Ventas/Clientes.aspx.vb | 2 +- Ventas/PV.aspx.vb | 2 +- vwd.webinfo | 6 ++++++ 8 files changed, 68 insertions(+), 14 deletions(-) diff --git a/GPS/Rastreo.aspx.vb b/GPS/Rastreo.aspx.vb index 9200f00dd..c6c79fd7c 100644 --- a/GPS/Rastreo.aspx.vb +++ b/GPS/Rastreo.aspx.vb @@ -2091,6 +2091,8 @@ Partial Class GPS_Rastreo DtDatos.Columns.Add("Evento", GetType(String)) DtDatos.Columns.Add("LatLng", GetType(String)) + Dim KMRecorridos = DtPosiciones.SUM("KMRecorridos").ToString + Try Dim Direcciones As JArray = ConsultarDirecciones(DtPosiciones) For Each row As DataRow In DtPosiciones.Rows @@ -2107,6 +2109,12 @@ Partial Class GPS_Rastreo For Each Dir As JObject In Direcciones DtDatos.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() Next + + + DtDatos.Columns("Vehiculo").ColumnName = "Vehículo" + DtDatos.Columns("TiempoDetenido").ColumnName = "Tiempo Detenido" + DtDatos.Columns("Direccion").ColumnName = "Dirección" + Catch ex As Exception GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) End Try @@ -2159,15 +2167,17 @@ Partial Class GPS_Rastreo If FechaI.Length > 0 And FechaF.Length > 0 Then - Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex) - RangoFechas.Merged = True - RangoFechas.Value = $"Fechas: {FechaI} a {FechaF}" - RangoFechas.Style.Font.Size = 15 * 20 - RangoFechas.Style.Font.Name = "Calibri Light" - RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + End If + Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex) + RangoFechas.Merged = True + RangoFechas.Value = $"Distancia: {KMRecorridos:N2} KM {If(FechaI.Length > 0 And FechaF.Length > 0, $"Fechas: {FechaI} a {FechaF}", "")}" + RangoFechas.Style.Font.Size = 15 * 20 + RangoFechas.Style.Font.Name = "Calibri Light" + RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 7027576d3..17e5e4a07 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -3071,7 +3071,7 @@ Partial Class Inventarios_TraspasoAlmacen ElseIf DrAlmO("CveTipoAlmacen").ToString.ToEntero = 22 Then 'Recepcion de Usados - DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (22) AND Estatus = 'Activo'") + DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (21,22) AND Estatus = 'Activo'") DdlAlmacenDestino.DataBind() DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) Else diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 78a0390c4..cfc7a3a4c 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -5351,13 +5351,29 @@ Partial Class OC Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal Dim PU As Decimal = Row("Importe").ToString.ToDecimal() + (Row("Importe").ToString.ToDecimal() * PorcentajeGanancia) - Dim IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal - Dim ImporteIEPS As Decimal = ((Cantidad * PU) * IEPSPS).RoundSQL(2) - If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalleCotizacion").ToString.ToEntero, CvePS, Cantidad, PU, ImporteIEPS, "", UsuarioActual.CveUsuario) Then + + Dim TotalCalculableImpuestos = (Cantidad * (PU)) + Dim TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal) + + Dim PorcentajeIEPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal + + Dim PorcentajeIVA As Decimal = 0D + + If DrPS("IVA").ToString().Contiene("-1", "") Then + PorcentajeIVA = Row("IVAPorcentaje") + Else + PorcentajeIVA = DrPS("IVA") + End If + + Dim ImporteIEPS As Decimal = (TotalCalculableImpuestos * PorcentajeIEPS).RoundSQL(2) + Dim ImporteIVA As Decimal = (TotalCalculableImpuestosIVA * PorcentajeIVA).RoundSQL(2) + + If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalleCotizacion").ToString.ToEntero, CvePS, Cantidad, PU, ImporteIEPS, PorcentajeIEPS, ImporteIVA, PorcentajeIVA, "", UsuarioActual.CveUsuario) Then OcurrioError = True Exit For End If + Next Catch ex As Exception OcurrioError = True diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index 03e1642c5..b26f69ee9 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -316,7 +316,26 @@ Partial Class Ventas_ActualizarPrecios Exit Sub End If - DtExcel.TableName = DdlPrecioLista.SelectedItem.Text + + If DdlPrecioLista.SelectedItem IsNot Nothing Then + Dim worksheetName As String = DdlPrecioLista.SelectedItem.Text + + Const invalidCharsRegex As String = "[/\\*'?[\]:]+" + Const maxLength As Integer = 31 + Dim safeName As String = Regex.Replace(worksheetName, invalidCharsRegex, " ").Replace(" ", " ").Trim() + + If String.IsNullOrEmpty(safeName) Then + safeName = "Precios" ' cannot be empty + ElseIf safeName.Length > maxLength Then + safeName = safeName.Substring(0, maxLength) + End If + + DtExcel.TableName = safeName + Else + DtExcel.TableName = "Precios" + End If + + DtExcel.Columns("Codigo").ColumnName = "Código" DtExcel.Columns("PS").ColumnName = "Producto / Servicio" SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index faf56b64c..1cbd418f1 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -5037,6 +5037,9 @@ + + + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 2097ade7e..444381642 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1763,7 +1763,7 @@ Partial Class Clientes DivPortletSucursales.Visible = False DivPortletDireccionEnvio.Visible = False DivPortletAsignaciones.Visible = False - DivPortletBitacora.Visible = False + 'DivPortletBitacora.Visible = False BtnEliminar.Visible = False DivProtletRegistrar.Visible = True diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index e481299ef..d03fdcbe8 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1867,7 +1867,7 @@ Partial Class PV For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero() If CveVentaDetalle > 0 Then - If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then + If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then OcurrioError = True Exit For End If diff --git a/vwd.webinfo b/vwd.webinfo index 67035e8a8..f85b08e11 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -214,6 +214,12 @@ + + + + + +