This commit is contained in:
HECTOR RODRIGUEZ
2021-03-31 12:03:49 -07:00
9 changed files with 258 additions and 27 deletions

View File

@@ -442,7 +442,13 @@ Public Class E141 : Implements IHttpHandler
End Using
End If
If Not TieneError AndAlso Not String.IsNullOrEmpty(JsonRequest("rfc").ToString().Trim()) Then
If TieneError Then
RespuestaError.message = "Ocurrió un error al obtener el cuerpo de los parametros"
context.Response.StatusCode = 200
Return JsonConvert.SerializeObject(RespuestaError)
End If
If Not TieneError AndAlso Not String.IsNullOrEmpty(If(JsonRequest("rfc") Is Nothing, "", JsonRequest("rfc").ToString().Trim())) Then
Dim data As New JArray
Dim Nombre As String = "-1"
@@ -493,8 +499,11 @@ Public Class E141 : Implements IHttpHandler
TieneError = True
End If
If data.Count > 0 Then
Respuesta.data = data
Respuesta.data = data
Else
If String.IsNullOrEmpty(If(JsonRequest("rfc") Is Nothing, "", JsonRequest("rfc").ToString().Trim())) Then
TieneError = True
RespuestaError.message = "Debe ingresar un RFC"
End If
End If
@@ -527,6 +536,12 @@ Public Class E141 : Implements IHttpHandler
End Using
End If
If TieneError Then
RespuestaError.message = "Ocurrió un error al obtener el cuerpo de los parametros"
context.Response.StatusCode = 200
Return JsonConvert.SerializeObject(RespuestaError)
End If
Dim data As New JArray
Dim DtSucursalesExistencias As DataTable = Nothing
@@ -556,6 +571,11 @@ Public Class E141 : Implements IHttpHandler
)
data.Add(objSucursal)
Next
If DtSucursalesExistencias.Rows.Count = 0 Then
Respuesta.message = "No se encontraron resultados"
End If
Catch ex As Exception
TieneError = True
RespuestaError.message = "Ocurrió un error al obtener la sucursales"
@@ -565,9 +585,7 @@ Public Class E141 : Implements IHttpHandler
TieneError = True
End If
If data.Count > 0 Then
Respuesta.data = data
End If
Respuesta.data = data
If TieneError Then
context.Response.StatusCode = 200
@@ -599,6 +617,12 @@ Public Class E141 : Implements IHttpHandler
End Using
End If
If TieneError Then
RespuestaError.message = "Ocurrió un error al obtener el cuerpo de los parametros"
context.Response.StatusCode = 200
Return JsonConvert.SerializeObject(RespuestaError)
End If
If Not TieneError Then
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
If Usuario IsNot Nothing Then
@@ -1373,6 +1397,12 @@ Public Class E141 : Implements IHttpHandler
End Using
End If
If TieneError Then
RespuestaError.message = "Ocurrió un error al obtener el cuerpo de los parametros"
context.Response.StatusCode = 200
Return JsonConvert.SerializeObject(RespuestaError)
End If
If Not TieneError Then
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
If Usuario IsNot Nothing Then
@@ -1471,9 +1501,7 @@ Public Class E141 : Implements IHttpHandler
TieneError = True
End If
If data.Count > 0 Then
Respuesta.data = data
End If
Respuesta.data = data
If TieneError Then
context.Response.StatusCode = 200
@@ -2088,6 +2116,9 @@ Public Class E141 : Implements IHttpHandler
End Function
Private Class FidelityAppsResponse
Sub New()
status = "success"
End Sub
Public Property status As String
Public Property data As Object
Public Property message As String

View File

@@ -551,7 +551,7 @@
<Columns>
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="15%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="center" />
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha Reporte" ItemStyle-HorizontalAlign="center" />
<asp:TemplateField ItemStyle-Width="30%" HeaderText="Dirección" ItemStyle-HorizontalAlign="center">
<asp:TemplateField ItemStyle-Width="30%" HeaderText="Dirección" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal runat="server" Text="Haga click para ver Dirección" ID="ltlDireccion"></asp:Literal>
</ItemTemplate>
@@ -1796,7 +1796,7 @@
var largo;
var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&lat=' + lat + '&lon=' + lng;
if ($("#HdnOpcion").val() === 'All' || $("#HdnOpcion").val() === 'TPS') { largo = 37 } else { largo = 74 }
if ($("#HdnOpcion").val() === 'All' || $("#HdnOpcion").val() === 'TPS') { largo = 150 } else { largo = 150 }
if ($())
$.getJSON(url, function (data) {
if (typeof (data.error) === 'undefined') {
@@ -1880,7 +1880,7 @@
if (indice > -1) {
if (data.display_name.length > 74) {
if (typeof (tr) !== 'undefined') {
tr.cells[2].innerHTML = data.display_name.substring(0, 74) + '...'
tr.cells[2].innerHTML = data.display_name.substring(0, 150) + '...'
}
} else {
if (typeof (tr) !== 'undefined') {

View File

@@ -1599,9 +1599,9 @@ Partial Class GPS_Rastreo
End If
ElseIf Opcion = "Last" AndAlso Format = "EXCEL" Then
GenerarReporteUltimaPosicionExcel("UltimaPosicion.xlsx")
ElseIf Opcion = "All" Then
ElseIf Opcion = "All" AndAlso Format = "PDF" Then
If GvBarra.Rows.Count > 0 Then
RutaReporte = "Empresas/Grales/ReportesProgramados/RPTHistorico.rdlc"
RutaReporte = ""
NombreReporte = "ReporteHistorico"
Try
ImprimirCrystal(NombreReporte, Format)
@@ -1610,6 +1610,19 @@ Partial Class GPS_Rastreo
End Try
Else
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
End If
ElseIf Opcion = "All" AndAlso Format = "EXCEL" Then
If GvBarra.Rows.Count > 0 Then
RutaReporte = ""
NombreReporte = "ReporteHistorico"
Try
ImprimirExcelGembox("Reporte Historico", NombreReporte, txtFechaI.Text, txtFechaF.Text)
Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
Else
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
End If
ElseIf Opcion = "Speed" Then
RutaReporte = "Empresas/Grales/ReportesProgramados/RPVelocidad.rdlc"
@@ -1889,6 +1902,157 @@ Partial Class GPS_Rastreo
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/ReportesProgramados/RPTHistorico.rpt"), DtDatos, RptParametro, NombreReporte, Format), NombreReporte, Format)
DtDatos.Clear()
End Sub
Private Sub ImprimirExcelGembox(Titulo As String, NombreReporte As String, FechaI As String, FechaF As String)
Dim DtDatos As New DataTable()
DtDatos.Columns.Add("Vehiculo", GetType(String))
DtDatos.Columns.Add("Fecha", GetType(String))
DtDatos.Columns.Add("Direccion", GetType(String))
DtDatos.Columns.Add("TiempoDetenido", GetType(String))
DtDatos.Columns.Add("Conductor", GetType(String))
DtDatos.Columns.Add("Velocidad", GetType(String))
DtDatos.Columns.Add("Evento", GetType(String))
DtDatos.Columns.Add("LatLng", GetType(String))
Try
Dim Direcciones As JArray = ConsultarDirecciones(DtPosiciones)
For Each row As DataRow In DtPosiciones.Rows
Dim DrNew = DtDatos.NewRow()
DrNew("Vehiculo") = row("Vehiculo")
DrNew("Fecha") = row("Fecha")
DrNew("TiempoDetenido") = row("TiempoDetenido")
DrNew("Evento") = row("Evento")
DrNew("Velocidad") = row("Velocidad")
DrNew("Direccion") = "Dirección no encontrada"
DrNew("LatLng") = row("Posicion").ToString.Replace("{", "").Replace("}", "")
DtDatos.Rows.Add(DrNew)
Next
For Each Dir As JObject In Direcciones
DtDatos.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
Next
Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
Dim DtExcel As DataTable = DtDatos.Copy()
If DtExcel.Rows.Count < 1 Then
Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DtExcel.TableName = "Historico"
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim Divisor As Integer = 1
Dim FileExcel As New ExcelFile()
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0,
.StartColumn = 0
})
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=UsuarioActual.CveCliente).FiltroPrimeroValor("Nombre")
RangoNombreEmpresa.Style.Font.Size = 18 * 20
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
RangoTitulo.Style.Font.Name = "Calibri Light"
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
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
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
worksheet.Rows(8).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(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
If i > 0 Then
Try
worksheet.Columns(i).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
Dim IndexEndTable As Integer = DtExcel.Rows.Count + TotalRowHeader + TotalRowFooter
worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió"
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = UsuarioActual.Nombre
worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión"
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
If Imagen.Exists Then
Dim Ruta As String = String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)
Using sr As New StreamReader(Ruta)
Dim ms As New MemoryStream()
sr.BaseStream.CopyTo(ms)
worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", 100, 100, LengthUnit.Pixel)
End Using
End If
For I As Integer = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
If I > 0 Then
If Divisor = 1 Then
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
Else
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
End If
Try
worksheet.Columns(I).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
FileExcel.Save(Response, $"{NombreReporte}.xlsx", SaveOptions.XlsxDefault)
End Sub
Private Sub ImprimirRDLC(NombreReporte As String, Format As String, RutaReporte As String)
Dim RptParametro As New List(Of ReportParameter)
@@ -2240,6 +2404,7 @@ Partial Class GPS_Rastreo
Using wc As New HttpClient()
Try
wc.Timeout = New TimeSpan(0, 6, 0)
Dim Url = New Uri(String.Format("{0}nominatim/reverseMultiple.php", ClsPaginas.UrlDirecciones))
Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")

View File

@@ -576,12 +576,18 @@ Partial Class Sistemas_PopUpAddUsuario
Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados.FiltraParametros("ProveedoresResponsables > 0")
End If
ObjUsuarios.Dispose()
End Sub
End Sub
#Region "MANDAR CORREOS"
Private Function EnviaCorreo(Liga As String, LigaActivar As String) As String
Dim Retorno As String = ""
Try
Dim URL As String = UrlSitio
If UsuarioActual.Empresa.CvePlataforma = 3 Then
URL = "https://gps.signalsgps.com/"
End If
Dim Para = TxtEmail.Text.Trim
Dim Asunto = ""
If CveCliente > 0 Then
@@ -621,7 +627,7 @@ Partial Class Sistemas_PopUpAddUsuario
SBBody.Append("<div Class='nota'>")
SBBody.Append("Nota Favor de NO responder este correo. ")
SBBody.Append("</div><br/><br/>")
SBBody.AppendFormat("<div class='logo'><img src='{0}Imagenes/LogoSinFondo.png' style='width:30px;'/>ADSistemas </div>", UrlSitio)
SBBody.AppendFormat("<div class='logo'><img src='{0}Imagenes/LogoSinFondo.png' style='width:30px;'/>ADSistemas </div>", URL)
SBBody.Append("</div>")
SBBody.Append("</div>")
'Termino Cuerpo del correo

View File

@@ -788,7 +788,7 @@ Partial Class Clientes
UpAccionesCRM.Update()
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(309) Then
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.CveRol = 1280 Then
DeshabilitarDatosClienteCajas()
End If
@@ -943,6 +943,10 @@ Partial Class Clientes
TxtCorreoEntregaAlmacen.Enabled = False
ChkCargoUsado.Enabled = False
ChkBonificacionUsado.Enabled = False
If Not ChkEsDistribuidor.Checked Then
BtnGuardar.Visible = PermiteEditar()
End If
End Sub

View File

@@ -1229,7 +1229,7 @@
<div class="row">
<div class="col-md-6">
</div>
<label class="col-md-2">Cambio:</label>
<label id="lblCambio" class="col-md-2">Cambio:</label>
<div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
@@ -3483,9 +3483,15 @@
var totalVenta = ToDouble($get('TxtTotal').value);
if (total > totalVenta) {
lblCambio.innerHTML = "Cambio:"
$get("TxtCambio").value = FormatoNumero(total - totalVenta);
} else {
$get("TxtCambio").value = "0.00";
if ('<%= UsuarioActual.Empresa.Funcionalidad(531) %>' == '1') {
lblCambio.innerHTML = "Faltante:"
$get("TxtCambio").value = FormatoNumero(total - totalVenta);
} else {
$get("TxtCambio").value = "$0.00"
}
}
$get("TxtImporteContado").value = total;

View File

@@ -3266,10 +3266,10 @@ Partial Class PV
If ObjAcum.GetGarantiasDetalle(Retorno.CveVenta) Then
Dim RowGarantia As DataRow = ObjAcum.DtResultados.FiltroPrimero("")
If RowGarantia IsNot Nothing Then
SbAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF Ajuste</a></li></ul><br/>", Encripta(String.Format("OP=AJUSTE&CVEGARANTIADETALLE={0}", RowGarantia("CveGarantiaDetalle"))))
SbAlert.AppendFormat("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF Ajuste</a></li></ul><br/>", Encripta(String.Format("OP=AJUSTE&CVEGARANTIADETALLE={0}", RowGarantia("CveGarantiaDetalle"))))
'AUTO DESCARGAR PDF AJUSTE
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AJUSTE&CVEGARANTIADETALLE={0}", RowGarantia("CveGarantiaDetalle")))}'", "Imprimir")
RegistraScript($"window.open('/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AJUSTE&CVEGARANTIADETALLE={0}", RowGarantia("CveGarantiaDetalle")))}', '_blank');", "Imprimir")
End If
End If
End Using

View File

@@ -3366,7 +3366,7 @@
<div class="row">
<div class="col-md-6">
</div>
<label class="col-md-2">Cambio:</label>
<label id="lblCambio" class="col-md-2">Cambio:</label>
<div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
@@ -7827,12 +7827,18 @@
var totalVenta = ToDouble($get('TxtTotal').value);
if (total > totalVenta) {
lblCambio.innerHTML = "Cambio:"
$get("TxtCambio").value = FormatoNumero(total - totalVenta);
} else {
$get("TxtCambio").value = "0.00";
if ('<%= UsuarioActual.Empresa.Funcionalidad(531) %>' == '1') {
lblCambio.innerHTML = "Faltante:"
$get("TxtCambio").value = FormatoNumero(total - totalVenta, 2);
} else {
$get("TxtCambio").value = "$0.00"
}
}
$get("TxtImporteContado").value = total - totalRNC - totalAmortizado - totalProntoPago;
$get("TxtImporteContado").value = FormatoNumero(total - totalRNC - totalAmortizado - totalProntoPago,2);
}
// ****************************************************************************************************************************************************************************

View File

@@ -16743,7 +16743,16 @@ Partial Class Ventas
Row("SubProyecto") = SubProyecto
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1
If Modalidad = "U" Then
Row("Orden") = Index
Else
Dim ConsecutivoActual As Integer = TmpDT.MAX("Consec").ToEntero()
If ConsecutivoActual < 0 Then
ConsecutivoActual = 0
End If
Row("Orden") = ConsecutivoActual + 1
End If
Row("Cantidad") = Cantidad
Row("CveUM") = CveUM
Row("UM") = UM
@@ -16823,7 +16832,11 @@ Partial Class Ventas
If Modalidad = "U" Then
Row("Consec") = Index
Else
Row("Consec") = TmpDT.Rows.Count + 1
Dim ConsecutivoActual As Integer = TmpDT.MAX("Consec").ToEntero()
If ConsecutivoActual < 0 Then
ConsecutivoActual = 0
End If
Row("Consec") = ConsecutivoActual + 1
End If
Row("PS") = DrPS("PS")