This commit is contained in:
2020-02-06 20:00:45 -07:00
30 changed files with 2776 additions and 2081 deletions

View File

@@ -1063,25 +1063,27 @@ Public Class ClsContPAQi
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
StrSQL.Clear() StrSQL.Clear()
StrSQL.Append(" SELECT mp.id, mp.IdPoliza, mp.NumMovto, mp.IdCuenta , mp.IdCuenta as CveCuenta, c.CODIGO, c.NOMBRE as Cuenta , T.Codigo as CodigoTipoPoliza, T.Nombre AS TipoPoliza, mp.Folio, mp.Importe, mp.Concepto, mp.Referencia, mp.SIGReferencia, mp.Fecha, mp.IdSegNeg, p.IdUsuario, s.Nombre AS SegNeg, p.Fecha AS FechaPol, p.Cargos, p.Abonos, p.Concepto AS ConceptoPoliza, ") StrSQL.AppendLine(" SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; ")
StrSQL.Append(" CASE WHEN ISNUMERIC(c.Codigo) = 1 THEN FORMAT(CAST (c.Codigo AS FLOAT),(SELECT REPLACE(Mascarilla,'X','0') FROM Parametros)) ELSE c.Codigo END + ' - ' + c.Nombre + ' ' AS CtaCodigo, ") 'Roberto 8/Nov/2014 StrSQL.AppendLine(" ")
StrSQL.Append(" SUM (CASE WHEN mp.TipoMovto = 0 THEN mp.Importe ELSE 0 END) AS Cargo, SUM (CASE WHEN mp.TipoMovto = 1 THEN mp.Importe ELSE 0 END) AS Abono, ") StrSQL.AppendLine(" SELECT mp.id, mp.IdPoliza, mp.NumMovto, mp.IdCuenta , mp.IdCuenta as CveCuenta, c.CODIGO, c.NOMBRE as Cuenta , T.Codigo as CodigoTipoPoliza, T.Nombre AS TipoPoliza, mp.Folio, mp.Importe, mp.Concepto, mp.Referencia, mp.SIGReferencia, mp.Fecha, mp.IdSegNeg, p.IdUsuario, s.Nombre AS SegNeg, p.Fecha AS FechaPol, p.Cargos, p.Abonos, p.Concepto AS ConceptoPoliza, ")
StrSQL.Append(" SUM (CASE WHEN mp.TipoMovto = 0 THEN mp.ImporteME ELSE 0 END) AS CargoME, SUM (CASE WHEN mp.TipoMovto = 1 THEN mp.ImporteME ELSE 0 END) AS AbonoME, ") StrSQL.AppendLine(" CASE WHEN ISNUMERIC(c.Codigo) = 1 THEN FORMAT(CAST (c.Codigo AS FLOAT),(SELECT REPLACE(Mascarilla,'X','0') FROM Parametros)) ELSE c.Codigo END + ' - ' + c.Nombre + ' ' AS CtaCodigo, ") 'Roberto 8/Nov/2014
StrSQL.Append(" mp.TipoMovto, CASE WHEN ISNUMERIC(c.CODIGO) = 1 THEN FORMAT(CAST (c.CODIGO AS FLOAT),(SELECT REPLACE(Mascarilla,'X','0') FROM Parametros)) ELSE c.CODIGO END CuentaFormato, '' as Estado,MAX(U.Nombre) AS UsuarioRegistro ") StrSQL.AppendLine(" SUM (CASE WHEN mp.TipoMovto = 0 THEN mp.Importe ELSE 0 END) AS Cargo, SUM (CASE WHEN mp.TipoMovto = 1 THEN mp.Importe ELSE 0 END) AS Abono, ")
StrSQL.Append(" FROM MovimientosPoliza mp ") StrSQL.AppendLine(" SUM (CASE WHEN mp.TipoMovto = 0 THEN mp.ImporteME ELSE 0 END) AS CargoME, SUM (CASE WHEN mp.TipoMovto = 1 THEN mp.ImporteME ELSE 0 END) AS AbonoME, ")
StrSQL.Append(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ") StrSQL.AppendLine(" mp.TipoMovto, CASE WHEN ISNUMERIC(c.CODIGO) = 1 THEN FORMAT(CAST (c.CODIGO AS FLOAT),(SELECT REPLACE(Mascarilla,'X','0') FROM Parametros)) ELSE c.CODIGO END CuentaFormato, '' as Estado,MAX(U.Nombre) AS UsuarioRegistro ")
StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ") StrSQL.AppendLine(" FROM MovimientosPoliza mp ")
StrSQL.Append(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ") StrSQL.AppendLine(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ")
StrSQL.Append(" LEFT JOIN SERVIDOR.Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ") StrSQL.AppendLine(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ")
StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ") StrSQL.AppendLine(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ")
StrSQL.Append(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ") StrSQL.AppendLine(" LEFT JOIN SIG_Resp_OIC.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
StrSQL.Append(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ") StrSQL.AppendLine(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ")
StrSQL.Append(" AND (@Periodo = -1 OR mp.Periodo = @Periodo) ") StrSQL.AppendLine(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ")
StrSQL.Append(" AND (@TipoPol = -1 OR mp.TipoPol = @TipoPol) ") StrSQL.AppendLine(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ")
StrSQL.Append(" AND (@NumPol = -1 OR mp.Folio = @NumPol) ") StrSQL.AppendLine(" AND (@Periodo = -1 OR mp.Periodo = @Periodo) ")
StrSQL.Append(" ") StrSQL.AppendLine(" AND (@TipoPol = -1 OR mp.TipoPol = @TipoPol) ")
StrSQL.Append(" GROUP BY mp.id, mp.IdPoliza, mp.NumMovto, mp.IdCuenta, mp.TipoMovto, c.CODIGO, c.NOMBRE, T.Codigo, T.Nombre, mp.Folio, mp.Importe, mp.Concepto, mp.Referencia, mp.SIGReferencia, mp.Fecha, mp.IdSegNeg, p.IdUsuario, s.Nombre, p.Fecha, p.Cargos, p.Abonos, p.Concepto, Afectable ") 'Roberto 8/Nov/2014 campo Afectable StrSQL.AppendLine(" AND (@NumPol = -1 OR mp.Folio = @NumPol) ")
StrSQL.Append(" ORDER BY mp.IdPoliza, mp.NumMovto ") StrSQL.AppendLine(" ")
StrSQL.AppendLine(" GROUP BY mp.id, mp.IdPoliza, mp.NumMovto, mp.IdCuenta, mp.TipoMovto, c.CODIGO, c.NOMBRE, T.Codigo, T.Nombre, mp.Folio, mp.Importe, mp.Concepto, mp.Referencia, mp.SIGReferencia, mp.Fecha, mp.IdSegNeg, p.IdUsuario, s.Nombre, p.Fecha, p.Cargos, p.Abonos, p.Concepto, Afectable ") 'Roberto 8/Nov/2014 campo Afectable
StrSQL.AppendLine(" ORDER BY mp.IdPoliza, mp.NumMovto ")
SqlDataAdapter(StrSQL.ToString, CommandType.Text) SqlDataAdapter(StrSQL.ToString, CommandType.Text)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters

View File

@@ -388,7 +388,7 @@ Public Class ClsContabilidad
Public Function GetProveedoresAuxiliar(CveProveedor As Integer, CveConceptoContable As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Public Function GetProveedoresAuxiliar(CveProveedor As Integer, CveConceptoContable As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer,
Optional Opcion As Integer = 1, Optional CveTipoProveedor As Integer = -1) As Boolean Optional Opcion As Integer = 1, Optional CveTipoProveedor As Integer = -1, Optional Contabilizable As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Conta_ProveedoresAuxiliar") DataAdapter("PA_Conta_ProveedoresAuxiliar")
@@ -402,6 +402,7 @@ Public Class ClsContabilidad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
.Add("@Contabilizable", SqlDbType.Int).Value = Contabilizable
End With End With
Try Try

View File

@@ -116,6 +116,7 @@
</div> </div>
<div class="col-md-1" id="tsubprocto" style="padding-right: 2px; padding-left: 2px; display: none;"> <div class="col-md-1" id="tsubprocto" style="padding-right: 2px; padding-left: 2px; display: none;">
Proyecto: Proyecto:
</div> </div>
<div class="col-md-1" runat="server" id="Div1">Aplica NC:</div> <div class="col-md-1" runat="server" id="Div1">Aplica NC:</div>
<div class="col-md-1" id="ds" style="width: 120px;"> <div class="col-md-1" id="ds" style="width: 120px;">
@@ -124,7 +125,7 @@
<asp:ListItem Text="Si" Value="1"></asp:ListItem> <asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem> <asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<%-- <asp:CheckBox ID="ChkAplicaNotaCredito" CssClass="make-switchsd" runat="server" />--%> <%-- <asp:CheckBox ID="ChkAplicaNotaCredito" CssClass="make-switchsd" runat="server" />--%>
</div> </div>
<div class="col-md-4" id="subproyecto" style="margin-top: 3px; margin-left: -20px"> <div class="col-md-4" id="subproyecto" style="margin-top: 3px; margin-left: -20px">
@@ -463,6 +464,16 @@
<asp:Literal ID="LtlFV" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}")%>'></asp:Literal> <asp:Literal ID="LtlFV" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="false">
<%-- <HeaderTemplate>
<div>
<asp:Literal ID="LtlAlm" runat="server" Text="Almacen"></asp:Literal>
</div>
</HeaderTemplate>--%>
<ItemTemplate>
<asp:Label data-toggle="tooltip" data-html="true" Text='' ID="LbEstatusInv" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
<div> <div>
@@ -502,6 +513,7 @@
<HeaderTemplate> <HeaderTemplate>
<div> <div>
Sel Sel
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="Chk" runat="server" /><asp:Label ID="LblPor" runat="server" Text="" Visible="False" Font-Size="6pt"></asp:Label> <asp:CheckBox ID="Chk" runat="server" /><asp:Label ID="LblPor" runat="server" Text="" Visible="False" Font-Size="6pt"></asp:Label>

View File

@@ -344,6 +344,8 @@ Partial Class Bancos_RepProgramarRecursos
LblAcumulado.Text = String.Format("$ {0}", DtDatos.MAX("TotalProgramado", "CveCompra > 0").ToString.FormatoNumero()) LblAcumulado.Text = String.Format("$ {0}", DtDatos.MAX("TotalProgramado", "CveCompra > 0").ToString.FormatoNumero())
End If End If
Gv.Columns(6).Visible = (UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0)
Mov.Dispose() Mov.Dispose()
CargaGrid(Orden) CargaGrid(Orden)
UPDatos.Update() UPDatos.Update()
@@ -447,6 +449,28 @@ Partial Class Bancos_RepProgramarRecursos
' e.Row.FCDropDownList("DdlMov").DataBind() ' e.Row.FCDropDownList("DdlMov").DataBind()
'End If 'End If
If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("Importe Almacen: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteAlmacen").FormatoNumero, e.Row.DBCampo("ImporteAlmacenPorcentaje"))
If e.Row.DBCampo("ImporteServicios").ToDouble > 0 Then Str.AppendFormat("Importe Servicios: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteServicios").FormatoNumero, e.Row.DBCampo("ImporteServiciosPorcentaje"))
If e.Row.DBCampo("ImporteDevolucion").ToDouble > 0 Then Str.AppendFormat("Importe Devuelto: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteDevolucion").FormatoNumero, e.Row.DBCampo("ImporteDevolucionPorcentaje"))
Str.AppendFormat(" <i> Importes <b> SIN</b> IVA</i>")
e.Row.FCLabel("LbEstatusInv").Attributes.Add("title", Str.ToString)
Select Case e.Row.DBCampo("EstatusInventario").ToEntero
Case 1
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
Case 2
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-checkered' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.DarkOrange
Case 3
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Green
End Select
End If
End If End If
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(1).ForeColor = Drawing.Color.Red If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(1).ForeColor = Drawing.Color.Red

View File

@@ -7904,6 +7904,7 @@ Partial Class Compras_Compras
'AJUSTA POLIZA 'AJUSTA POLIZA
If IdPoliza > 0 Then If IdPoliza > 0 Then
PolizaFolio = ObjContaAC.Folio
ObjContaAC.AjustaPoliza(IdPoliza) ObjContaAC.AjustaPoliza(IdPoliza)
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza) Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
End If End If
@@ -7914,12 +7915,15 @@ Partial Class Compras_Compras
Msg.AppendFormat("</br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Entrada Almacen</a>", TempParametros) Msg.AppendFormat("</br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Entrada Almacen</a>", TempParametros)
End If End If
ObjCompras.UpdateCompraPrePoliza(TxtFecha.Text.ToDate, PolizaFolio.ToString, IdPoliza, CvePrePoliza, CveCompra, 0) If Not ObjCompras.UpdateCompraPrePoliza(TxtFecha.Text.ToDate, PolizaFolio.ToString, IdPoliza, CvePrePoliza, CveCompra, 0) Then
TieneError = True
End If
If EntregaDirecta Then If EntregaDirecta Then
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Inventarios/RecepcionAlmacen.aspx?CveCompra={CveCompra}&ED=1"">Recibir mercancía de entrega directa.</a>") Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Inventarios/RecepcionAlmacen.aspx?CveCompra={CveCompra}&ED=1"">Recibir mercancía de entrega directa.</a>")
End If End If
If Not TieneError Then
ObjCompras.Commit() ObjCompras.Commit()
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit() If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
@@ -7944,6 +7948,11 @@ Partial Class Compras_Compras
Msg.Append("¿Desea realizar una evaluacion al proveedor?") Msg.Append("¿Desea realizar una evaluacion al proveedor?")
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>") Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
End If End If
Else
ObjCompras.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar) Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)

View File

@@ -1068,18 +1068,30 @@ Partial Class PopUpVerFactura
ObjVentas.DtResultados.Columns.Add("Importe", GetType(Decimal)) ObjVentas.DtResultados.Columns.Add("Importe", GetType(Decimal))
ObjVentas.DtResultados.Rows(0)("Importe") = ObjVentas.DtResultados.Rows(0)("Total") ObjVentas.DtResultados.Rows(0)("Importe") = ObjVentas.DtResultados.Rows(0)("Total")
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL") Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
End If
End If
End If End If
End If End If
Else Else
If dtVentas(0)("TipoDocto").ToString.Contiene("Ing", "Ant", "Rem") Then 'If dtVentas(0)("TipoDocto").ToString.Contiene("Ing", "Ant", "Rem") Then
'carga as notas de credito vinculadas ' 'carga as notas de credito vinculadas
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then ' If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL") ' Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
End If ' End If
End If 'End If
If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL") Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Dev") Then If Vta.TipoDocto.Contiene("Dev") Then
@@ -1092,11 +1104,14 @@ Partial Class PopUpVerFactura
End If End If
'End If 'End If
If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then 'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then ' 'If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados ' ' Vta.DtNCVinculadas = ObjVentas.DtResultados
End If ' 'End If
End If ' If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
' Vta.DtNCVinculadas = ObjVentas.DtResultados
' End If
'End If
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()

View File

@@ -131,6 +131,14 @@
<asp:ListItem Text="Acreedor" Value="2"></asp:ListItem> <asp:ListItem Text="Acreedor" Value="2"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Contabilizable:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlOpcionContabilizable" CssClass="form-control input-sm select2me" Width="260px" runat="server">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Contabilizable" Value="0"></asp:ListItem>
<asp:ListItem Text="No contabilizable" Value="1"></asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -81,7 +81,7 @@ Partial Class Compras_ProveedoresAuxiliar
'Falta PA 'Falta PA
If ObjConta.GetProveedoresAuxiliar(DdlProveeedores.SelectedValue.ToEntero, -1, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, If ObjConta.GetProveedoresAuxiliar(DdlProveeedores.SelectedValue.ToEntero, -1, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa,
DdlOpcion.SelectedValue.ToEntero, DdlTipoProveedor.SelectedValue.ToEntero) Then DdlOpcion.SelectedValue.ToEntero, DdlTipoProveedor.SelectedValue.ToEntero, DdlOpcionContabilizable.SelectedValue.ToEntero) Then
If DdlOpcion.SelectedValue.ToEntero = 2 Then If DdlOpcion.SelectedValue.ToEntero = 2 Then
GvP.DataSource = ObjConta.DtResultados.FiltraParametros($" IIF(ISNULL(CveConceptoContable,0) = 5 AND Importe >= 0,0,1) = 1 ") GvP.DataSource = ObjConta.DtResultados.FiltraParametros($" IIF(ISNULL(CveConceptoContable,0) = 5 AND Importe >= 0,0,1) = 1 ")
Else Else

View File

@@ -816,8 +816,15 @@
<FontWeight>Normal</FontWeight> <FontWeight>Normal</FontWeight>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun> <TextRun>
<Value>=Parameters!RFC.Value</Value> <Value>GOTE811117236</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
@@ -832,7 +839,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox4</rd:DefaultName> <rd:DefaultName>Textbox4</rd:DefaultName>
<Left>1.78362in</Left> <Left>1.78362in</Left>
<Height>0.46414in</Height> <Height>0.56136in</Height>
<Width>3.96172in</Width> <Width>3.96172in</Width>
<ZIndex>5</ZIndex> <ZIndex>5</ZIndex>
<Style> <Style>
@@ -1121,7 +1128,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Parameters!DomicilioExpedicion.Value</Value> <Value>=Parameters!DomicilioSucursal.Value</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
@@ -1135,9 +1142,9 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox10</rd:DefaultName> <rd:DefaultName>Textbox10</rd:DefaultName>
<Top>0.46414in</Top> <Top>0.58914in</Top>
<Left>1.87861in</Left> <Left>1.87861in</Left>
<Height>0.69679in</Height> <Height>0.6374in</Height>
<Width>1.65152in</Width> <Width>1.65152in</Width>
<ZIndex>13</ZIndex> <ZIndex>13</ZIndex>
<Style> <Style>
@@ -1172,7 +1179,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Parameters!DomicilioExpedicion.Value</Value> <Value>=Parameters!DomicilioSucursal.Value</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily> <FontFamily>Calibri</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
@@ -1186,9 +1193,9 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox10</rd:DefaultName> <rd:DefaultName>Textbox10</rd:DefaultName>
<Top>0.46414in</Top> <Top>0.58914in</Top>
<Left>3.84822in</Left> <Left>3.84822in</Left>
<Height>0.69679in</Height> <Height>0.6374in</Height>
<Width>1.786in</Width> <Width>1.786in</Width>
<ZIndex>14</ZIndex> <ZIndex>14</ZIndex>
<Style> <Style>
@@ -1219,8 +1226,9 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName> <rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.28209in</Top> <Top>1.28209in</Top>
<Left>0.13897cm</Left>
<Height>0.23611in</Height> <Height>0.23611in</Height>
<Width>0.89901in</Width> <Width>0.85202in</Width>
<ZIndex>15</ZIndex> <ZIndex>15</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -1294,7 +1302,6 @@
<TextRun> <TextRun>
<Value>Dirección</Value> <Value>Dirección</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
@@ -1304,7 +1311,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName> <rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.53208in</Top> <Top>1.53208in</Top>
<Left>0.04514in</Left> <Left>0.05471in</Left>
<Height>0.23611in</Height> <Height>0.23611in</Height>
<Width>0.85387in</Width> <Width>0.85387in</Width>
<ZIndex>17</ZIndex> <ZIndex>17</ZIndex>
@@ -1379,9 +1386,8 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Cuidad</Value> <Value>Ciudad</Value>
<Style> <Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
@@ -1391,7 +1397,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox19</rd:DefaultName> <rd:DefaultName>Textbox19</rd:DefaultName>
<Top>1.7682in</Top> <Top>1.7682in</Top>
<Left>0.04514in</Left> <Left>0.05471in</Left>
<Height>0.25in</Height> <Height>0.25in</Height>
<Width>0.85387in</Width> <Width>0.85387in</Width>
<ZIndex>19</ZIndex> <ZIndex>19</ZIndex>
@@ -4153,11 +4159,25 @@
<TextAlign>Right</TextAlign> <TextAlign>Right</TextAlign>
</Style> </Style>
</Paragraph> </Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Sucursal:</Value>
<Style>
<FontSize>9pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName> <rd:DefaultName>Textbox1</rd:DefaultName>
<Top>11.66812cm</Top> <Top>11.66812cm</Top>
<Left>0.10722cm</Left> <Left>0.10722cm</Left>
<Height>2.31759cm</Height> <Height>2.54689cm</Height>
<Width>3.426cm</Width> <Width>3.426cm</Width>
<ZIndex>54</ZIndex> <ZIndex>54</ZIndex>
<Style> <Style>
@@ -4229,11 +4249,22 @@
</TextRuns> </TextRuns>
<Style /> <Style />
</Paragraph> </Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>7007</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName> <rd:DefaultName>Textbox2</rd:DefaultName>
<Top>11.66812cm</Top> <Top>11.66812cm</Top>
<Left>3.65968cm</Left> <Left>3.65968cm</Left>
<Height>2.31759cm</Height> <Height>2.54689cm</Height>
<Width>6.20467cm</Width> <Width>6.20467cm</Width>
<ZIndex>55</ZIndex> <ZIndex>55</ZIndex>
<Style> <Style>

View File

@@ -56,28 +56,28 @@
<Width>2.54731cm</Width> <Width>2.54731cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.73227cm</Width> <Width>0.70704cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.66702cm</Width> <Width>1.66702cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.26144cm</Width> <Width>1.99686cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.46086cm</Width> <Width>1.96369cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.09776cm</Width> <Width>1.75246cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.57396cm</Width> <Width>0.85958cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.37522cm</Width> <Width>1.6398cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.23062cm</Width> <Width>1.77947cm</Width>
</TablixColumn> </TablixColumn>
</TablixColumns> </TablixColumns>
<TablixRows> <TablixRows>
@@ -95,7 +95,7 @@
<TextRun> <TextRun>
<Value>=Fields!Fecha.Value</Value> <Value>=Fields!Fecha.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
<Format>dd/MM/yyy</Format> <Format>dd/MM/yyy</Format>
</Style> </Style>
</TextRun> </TextRun>
@@ -130,7 +130,7 @@
<TextRun> <TextRun>
<Value>=Fields!ConceptoContable.Value</Value> <Value>=Fields!ConceptoContable.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -164,7 +164,7 @@
<TextRun> <TextRun>
<Value>=Fields!TipoDocto.Value</Value> <Value>=Fields!TipoDocto.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -198,7 +198,7 @@
<TextRun> <TextRun>
<Value>=Fields!SerieFolio.Value</Value> <Value>=Fields!SerieFolio.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -232,7 +232,7 @@
<TextRun> <TextRun>
<Value>=Fields!FolioReferencia.Value</Value> <Value>=Fields!FolioReferencia.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -266,7 +266,7 @@
<TextRun> <TextRun>
<Value>=Fields!Cargo.Value</Value> <Value>=Fields!Cargo.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
<Format>#,0.00</Format> <Format>#,0.00</Format>
</Style> </Style>
</TextRun> </TextRun>
@@ -301,7 +301,7 @@
<TextRun> <TextRun>
<Value>=Fields!Abono.Value</Value> <Value>=Fields!Abono.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
<Format>#,0.00</Format> <Format>#,0.00</Format>
</Style> </Style>
</TextRun> </TextRun>
@@ -336,7 +336,7 @@
<TextRun> <TextRun>
<Value>=Fields!Abreviatura.Value</Value> <Value>=Fields!Abreviatura.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -370,7 +370,8 @@
<TextRun> <TextRun>
<Value>=Fields!CargoMN.Value</Value> <Value>=Fields!CargoMN.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -404,7 +405,8 @@
<TextRun> <TextRun>
<Value>=Fields!AbonoMN.Value</Value> <Value>=Fields!AbonoMN.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -435,7 +437,7 @@
<TablixMembers> <TablixMembers>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox40"> <Textbox Name="Textbox40">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -473,7 +475,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox42"> <Textbox Name="Textbox42">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -511,7 +513,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox44"> <Textbox Name="Textbox44">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -549,7 +551,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox49"> <Textbox Name="Textbox49">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -587,7 +589,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox51"> <Textbox Name="Textbox51">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -625,7 +627,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox47"> <Textbox Name="Textbox47">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -663,7 +665,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox4"> <Textbox Name="Textbox4">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -701,7 +703,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox6"> <Textbox Name="Textbox6">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -710,7 +712,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Moneda</Value> <Value>Mon.</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
</Style> </Style>
@@ -739,7 +741,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox5"> <Textbox Name="Textbox5">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -777,7 +779,7 @@
</TablixMember> </TablixMember>
<TablixMember> <TablixMember>
<TablixHeader> <TablixHeader>
<Size>0.8593cm</Size> <Size>0.59472cm</Size>
<CellContents> <CellContents>
<Textbox Name="Textbox13"> <Textbox Name="Textbox13">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
@@ -831,7 +833,7 @@
<TextRun> <TextRun>
<Value>=Fields!RazonSocial.Value</Value> <Value>=Fields!RazonSocial.Value</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>7pt</FontSize>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -860,8 +862,8 @@
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>0.75875cm</Top> <Top>0.75875cm</Top>
<Left>0.06614cm</Left> <Left>0.06614cm</Left>
<Height>1.4593cm</Height> <Height>1.19472cm</Height>
<Width>19.58715cm</Width> <Width>19.55393cm</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>

View File

@@ -2017,7 +2017,7 @@
</Style> </Style>
</TextRun> </TextRun>
<TextRun> <TextRun>
<Value>Contralor </Value> <Value>Contador</Value>
<MarkupType>HTML</MarkupType> <MarkupType>HTML</MarkupType>
<Style> <Style>
<FontWeight>Bold</FontWeight> <FontWeight>Bold</FontWeight>

View File

@@ -255,7 +255,7 @@
<li> <li>
<asp:UpdatePanel runat="server" UpdateMode="conditional"> <asp:UpdatePanel runat="server" UpdateMode="conditional">
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkDibujo" OnClientClick="PreparaDibujado();" CommandArgument="KM" Text="<i class='fa fa-pencil-square-o'></i><span>Dibujar GeoReferencia</span>" runat="server"> <asp:LinkButton ID="LnkDibujo" OnClientClick="PreparaDibujado();" CommandArgument="KM" Text="<i class='fa fa-pencil-square-o'></i><span>Dibujar GeoReferencia/Punto de Interés</span>" runat="server">
</asp:LinkButton> </asp:LinkButton>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -274,6 +274,7 @@
<asp:HiddenField ID="GeoRutaHistorico" runat="server" ClientIDMode="Static" /> <asp:HiddenField ID="GeoRutaHistorico" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="HdnOpcion" ClientIDMode="static" runat="server" /> <asp:HiddenField ID="HdnOpcion" ClientIDMode="static" runat="server" />
<asp:HiddenField ID="HdnDirecciones" ClientIDMode="static" runat="server" /> <asp:HiddenField ID="HdnDirecciones" ClientIDMode="static" runat="server" />
<asp:HiddenField ID="HdnGrupo" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosMapa" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatosMapa" runat="server" UpdateMode="Conditional">
@@ -404,7 +405,7 @@
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<label>Trazar Geocercas: </label> <label>Trazar Geocercas: </label>
<br /> <br />
<asp:CheckBox ID="ChkTrazarGeocercas" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox> <asp:CheckBox ID="ChkTrazarGeocercas" AutoPostBack="true" OnCheckedChanged="ChkTrazarGeocercas_CheckedChanged" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
</div> </div>
</div> </div>
<div class="col-md-3" runat="server" visible="False" id="dvTrazoRutas"> <div class="col-md-3" runat="server" visible="False" id="dvTrazoRutas">
@@ -414,7 +415,14 @@
<asp:CheckBox ID="ChkTrazarGeorutas" AutoPostBack="true" Text=" " runat="server" CssClass="chksino" Width="250px" OnCheckedChanged="ChkTrazarGeorutas_CheckedChanged"></asp:CheckBox> <asp:CheckBox ID="ChkTrazarGeorutas" AutoPostBack="true" Text=" " runat="server" CssClass="chksino" Width="250px" OnCheckedChanged="ChkTrazarGeorutas_CheckedChanged"></asp:CheckBox>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-3" runat="server" visible="False" id="dvTrazoPI">
<div class="form-group form-md-line-input input-iconright">
<label>Trazar P. de Interés: </label>
<br />
<asp:CheckBox ID="ChkTrazarPuntosInteres" AutoPostBack="true" Text=" " runat="server" CssClass="chksino" Width="250px" OnCheckedChanged="ChkTrazarPI_CheckedChanged"></asp:CheckBox>
</div>
</div>
<div class="col-md-3">
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -819,6 +827,49 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<div id="DivGeoCercas" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpGeoCercas" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="H3" runat="server">Trazar GeoCercas</h4>
</div>
<div class="modal-body">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusquedaGeo" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaGeo','{0}')", GvGeoCercas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvGeorutas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GvGeoCercas" runat="server" GridLines="None" data-height="200" DataKeyNames="Coordenadas,GeoReferencia,Color" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%" ItemStyle-CssClass="NoClick">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickGeo" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkGeo" CssClass="ChkAllEvtGeo" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="GeoReferencia" ItemStyle-Width="20%" HeaderText="Geocerca" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Color" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="imgColor" HeaderText="Color" runat="server" Style="height: 20px;" Enabled="false" CausesValidation="False" CssClass="btn btn-circle btn-sm green" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default">Cerrar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="DivGeoRutas" class="modal ADS fade" role="dialog"> <div id="DivGeoRutas" class="modal ADS fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<asp:UpdatePanel ID="UpGeorutas" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpGeorutas" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
@@ -836,14 +887,16 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvGeorutas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvGeorutas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
</div> </div>
<asp:GridView ID="GvGeorutas" runat="server" GridLines="None" data-height="200" DataKeyNames="Coordenadas,CveGeoReferencia,GeoReferencia, CveDispositivo,Tipo,Color,Estatus,FechaInicio,FechaFin,AplicaLunes,AplicaMartes,AplicaMiercoles,AplicaJueves,AplicaViernes,AplicaSabado,AplicaDomingo, HoraInicio, HoraFin, Tolerancia" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros"> <asp:GridView ID="GvGeorutas" runat="server" GridLines="None" data-height="200" DataKeyNames="Coordenadas,GeoReferencia,Color" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns> <Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%"> <asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%" ItemStyle-CssClass="NoClick">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickRuta" />
</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox runat="server" ID="ChkRutas" /> <asp:CheckBox runat="server" ID="ChkRutas" CssClass="ChkAllEvtRuta" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Tipo" ItemStyle-Width="20%" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="GeoReferencia" ItemStyle-Width="20%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="GeoReferencia" ItemStyle-Width="20%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Color" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Color" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
@@ -860,6 +913,87 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<div id="DivMostrarPI" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpMostarPI" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="H2" runat="server">Trazar Puntos de Interés</h4>
</div>
<div class="modal-body">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusquedaPI" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaPI','{0}')", GvGeorutas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvGeorutas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GVPuntosInteres" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="150" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%" ItemStyle-CssClass="NoClick">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickPI" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkPI" CssClass="ChkAllEvtPI" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="30%" HeaderText="PuntoDeInteres" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" ItemStyle-Width="30%" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default">Cerrar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="DivAgregarPuntoInteres" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpAgregarPuntoInteres" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Agregar Punto(s) de interés</h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombrePI" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombrePI" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombrePI" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPuntoInteres"></asp:RequiredFieldValidator>
<label id="lblPuntos" for="<%= TxtNombrePI.ClientID.ToString()%>">Nombre Punto De Interés:</label>
</div>
<div class="form-group form-md-line-input input-iconright" style="width: 80%; margin-bottom: 20px;">
<asp:TextBox ID="TxtDescripcion" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDescripcion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripcion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPuntoInteres"></asp:RequiredFieldValidator>
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripción:</label>
</div>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtGVGrupo" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtGVGrupo','{0}')", GvGrupos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtGVGrupo','{0}')", GvGrupos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GvGrupos" runat="server" GridLines="None" DataKeyNames="CvePuntoDeInteresGrupo,PuntoDeInteresGrupo,Descripcion" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="150" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns>
<asp:BoundField DataField="PuntoDeInteresGrupo" ItemStyle-Width="45%" HeaderText="Agregar a Grupo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" ItemStyle-Width="45%" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<asp:LinkButton ID="BtnAgregarPunto" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpPuntoInteres"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
<button class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar </button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div runat="server" class="row" style="margin: 0px 0px 10px 0px; display: none"> <div runat="server" class="row" style="margin: 0px 0px 10px 0px; display: none">
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="btnImprimir" CommandArgument="PDF" ToolTip="Imprimir en PDF" CssClass="btn btn-circle mysmallbtn grey" Text="<i class='fa fa-print' aria-hidden='true'></i>"></asp:Button> <asp:Button runat="server" OnClick="btnImprimir_Click" ID="btnImprimir" CommandArgument="PDF" ToolTip="Imprimir en PDF" CssClass="btn btn-circle mysmallbtn grey" Text="<i class='fa fa-print' aria-hidden='true'></i>"></asp:Button>
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="BtnImprimirEX" CommandArgument="EXCEL" ToolTip="Imprimir en EXCEL" CssClass="btn btn-circle btn-xs mysmallbtn green" Text="<i class='fa fa-file-excel-o' aria-hidden='true'></i>"></asp:Button> <asp:Button runat="server" OnClick="btnImprimir_Click" ID="BtnImprimirEX" CommandArgument="EXCEL" ToolTip="Imprimir en EXCEL" CssClass="btn btn-circle btn-xs mysmallbtn green" Text="<i class='fa fa-file-excel-o' aria-hidden='true'></i>"></asp:Button>
@@ -906,6 +1040,11 @@
var retorno; var retorno;
$('body').on('click', '.ChkAllClick input', function () { $(".ChkAllEvt input").not(this).prop('checked', $('.ChkAllClick input').is(':checked')); }); $('body').on('click', '.ChkAllClick input', function () { $(".ChkAllEvt input").not(this).prop('checked', $('.ChkAllClick input').is(':checked')); });
$('body').on('click', '.ChkAllClick2 input', function () { $(".ChkAllEvt input").not(this).prop('checked', $('.ChkAllClick2 input').is(':checked')); }); $('body').on('click', '.ChkAllClick2 input', function () { $(".ChkAllEvt input").not(this).prop('checked', $('.ChkAllClick2 input').is(':checked')); });
$('body').on('click', '.ChkAllClickGeo input', function () { $(".ChkAllEvtGeo input").not(this).prop('checked', $('.ChkAllClickGeo input').is(':checked')); });
$('body').on('click', '.ChkAllClickRuta input', function () { $(".ChkAllEvtRuta input").not(this).prop('checked', $('.ChkAllClickRuta input').is(':checked')); });
$('body').on('click', '.ChkAllClickPI input', function () { $(".ChkAllEvtPI input").not(this).prop('checked', $('.ChkAllClickPI input').is(':checked')); });
function initMap() { function initMap() {
map = new google.maps.Map(document.getElementById('map'), { map = new google.maps.Map(document.getElementById('map'), {
center: { lat: 24.6345, lng: -102.5528 }, center: { lat: 24.6345, lng: -102.5528 },
@@ -915,23 +1054,20 @@
var ShowDiv1 = document.createElement('div'); var ShowDiv1 = document.createElement('div');
var ShowDivControl = new ShowDiv(ShowDiv1, map); var ShowDivControl = new ShowDiv(ShowDiv1, map);
ShowDiv1.index = 1; ShowDiv1.index = 1;
ShowDiv1.id = "showdiv1" ShowDiv1.id = "showdiv1"
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1); map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
var upControlDiv = document.createElement('div'); var upControlDiv = document.createElement('div');
var upControl = new ControlLabels(upControlDiv, map); var upControl = new ControlLabels(upControlDiv, map);
upControlDiv.index = 1; upControlDiv.index = 1;
map.controls[google.maps.ControlPosition.TOP_LEFT].push(upControlDiv); map.controls[google.maps.ControlPosition.TOP_LEFT].push(upControlDiv);
var upGeoDiv = document.createElement('div'); initGeocercas();
var upGeo = new ControlGeocercas(upGeoDiv, map); initGeoRutas();
initPI();
map.controls[google.maps.ControlPosition.TOP_LEFT].push(upGeoDiv);
geocoder = new google.maps.Geocoder(); geocoder = new google.maps.Geocoder();
@@ -2135,6 +2271,7 @@
SelectControlDiv.index = 1; SelectControlDiv.index = 1;
map.controls[google.maps.ControlPosition.TOP_LEFT].push(SelectControlDiv); map.controls[google.maps.ControlPosition.TOP_LEFT].push(SelectControlDiv);
map.addListener('click', addLatLng); map.addListener('click', addLatLng);
CambiaTipo("Geocerca");
} }
if ($("#DvGuardar").length <= 0) { if ($("#DvGuardar").length <= 0) {
@@ -2147,6 +2284,16 @@
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(routeControlDiv); map.controls[google.maps.ControlPosition.TOP_RIGHT].push(routeControlDiv);
} }
if ($("#DvGuardarPI").length <= 0) {
var routeControlDiv = document.createElement('div');
var routeControl = new ControlGuardarPuntoInteres(routeControlDiv, map);
routeControlDiv.id = "DvGuardarPI"
if (typeof (index) !== 'undefined') {
routeControlDiv.index = index + 1;
}
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(routeControlDiv);
}
} }
function PreparaDibujadoHistorico() { function PreparaDibujadoHistorico() {
if ($("#DvGuardarHistorico").length <= 0) { if ($("#DvGuardarHistorico").length <= 0) {
@@ -2216,7 +2363,7 @@
controlUI.style.cursor = 'pointer'; controlUI.style.cursor = 'pointer';
// controlUI.style.position = 'absolute'; // controlUI.style.position = 'absolute';
controlUI.style.left = "0px"; controlUI.style.left = "0px";
controlUI.style.width = "150px"; controlUI.style.width = "400px";
controlUI.style.marginTop = "10px" controlUI.style.marginTop = "10px"
controlUI.style.top = "0px"; controlUI.style.top = "0px";
controlUI.className = 'gmnoprint'; controlUI.className = 'gmnoprint';
@@ -2244,7 +2391,7 @@
ControlSub2.style.minWidth = '28px' ControlSub2.style.minWidth = '28px'
ControlSub2.style.fontWeight = '500' ControlSub2.style.fontWeight = '500'
ControlSub2.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)'; ControlSub2.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
ControlSub2.innerHTML = 'Geocerca' ControlSub2.innerHTML = 'Dibujar Geocerca'
ControlSub1.appendChild(ControlSub2) ControlSub1.appendChild(ControlSub2)
var ControlSub3 = document.createElement('div') var ControlSub3 = document.createElement('div')
@@ -2269,11 +2416,39 @@
ControlSub4.style.fontWeight = '500' ControlSub4.style.fontWeight = '500'
ControlSub4.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)'; ControlSub4.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
ControlSub4.style.borderLeft = '0px;' ControlSub4.style.borderLeft = '0px;'
ControlSub4.innerHTML = 'Georuta' ControlSub4.innerHTML = 'Dibujar Georuta'
ControlSub3.appendChild(ControlSub4) ControlSub3.appendChild(ControlSub4)
var ControlSub5 = document.createElement('div')
ControlSub5.style.float = 'left';
ControlSub5.className = 'gm-style-mtc'
controlUI.appendChild(ControlSub5)
var ControlSub6 = document.createElement('div')
ControlSub6.style.direction = 'ltr';
ControlSub6.style.overflow = 'hidden';
ControlSub6.style.textAlign = 'center';
ControlSub6.id = "PuntoInteres"
ControlSub6.style.position = 'relative';
ControlSub6.style.color = 'rgb(86,86,86)';
ControlSub6.style.fontFamily = ' "Open Sans", sans-serif; ';
ControlSub6.style.msUserSelect = 'none;';
ControlSub6.style.fontSize = '11px'
ControlSub6.style.backgroundColor = 'rgb(255,255,255)'
ControlSub6.style.padding = '11px'
ControlSub6.style.backgroundClip = 'padding-box'
ControlSub6.style.minWidth = '38px'
ControlSub6.style.fontWeight = '500'
ControlSub6.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
ControlSub6.style.borderLeft = '0px;'
ControlSub6.innerHTML = 'Dibujar Punto de Interés'
ControlSub5.appendChild(ControlSub6)
// Setup the click event listeners: simply set the map to Chicago. // Setup the click event listeners: simply set the map to Chicago.
ControlSub5.addEventListener('click', function () {
CambiaTipo('PuntoInteres');
});
ControlSub3.addEventListener('click', function () { ControlSub3.addEventListener('click', function () {
CambiaTipo('Georuta'); CambiaTipo('Georuta');
}); });
@@ -2371,6 +2546,7 @@
}); });
} }
function CargaVehiculosHistoricos() { function CargaVehiculosHistoricos() {
var data = []; var data = [];
for (var i = 0; i < geoRutasHistoricas.length; i++) { for (var i = 0; i < geoRutasHistoricas.length; i++) {
@@ -2444,22 +2620,96 @@
} }
function ControlGuardarPuntoInteres(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('div');
controlUI.id = "btnGuardarPuntoInteres"
controlUI.style.display = 'none';
controlUI.style.backgroundColor = '#4B77BE';
controlUI.style.color = "#fff";
controlUI.style.borderRadius = '3px';
controlUI.style.width = '165px'
controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';
controlUI.style.cursor = 'pointer';
controlUI.style.marginRight = '5px';
controlUI.style.marginTop = '5px';
controlUI.style.marginBottom = '22px';
controlUI.style.textAlign = 'center';
controlUI.title = 'Guardar el punto de interés';
controlDiv.appendChild(controlUI);
// Set CSS for the control interior.
var controlText = document.createElement('div');
controlText.style.color = '#fff';
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
controlText.style.fontSize = '14px';
controlText.style.lineHeight = '38px';
controlText.style.paddingLeft = '5px';
controlText.style.paddingRight = '5px';
controlText.innerHTML = 'Guardar Punto de Interés';
controlUI.appendChild(controlText);
// Setup the click event listeners: simply set the map to Chicago.
controlUI.addEventListener('click', function () {
$("#C_TxtNombrePI").val("")
$("#C_TxtDescripcion").val("")
$("#HdnGrupo").val("-1");
$("#GeoCerca").val("");
if (markersg.length > 0) {
var punto = "(" + markersg[0].position.lng() + ' ' + markersg[0].position.lat() + ")";
$("#GeoCerca").val(punto);
$("#DivAgregarPuntoInteres").modal({ backdrop: 'static', keyboard: false });
} else {
alert("No hay puntos de interés en el mapa");
}
});
}
var indiceAnteriorPI = 0;
function CargaDatosSeleccionadosPI(indice, valor) {
var columnaSeleccionada = 2 + indice;
$('#HdnGrupo').val(valor);
$('#C_GvGrupos tr').filter(':nth-child(' + indiceAnterior + ')').css('background-color', 'initial');
$('#C_GvGrupos tr').filter(':nth-child(' + columnaSeleccionada + ')').css('background-color', '#F5B27A');
indiceAnteriorPI = columnaSeleccionada;
}
function CambiaTipo(Tipo) { function CambiaTipo(Tipo) {
DeleteMarkersG(); DeleteMarkersG();
if (Tipo === 'Geocerca') { if (Tipo === 'Geocerca') {
$("#HdnTipo").val('Geocerca') $("#HdnTipo").val('Geocerca')
$("#Geocerca").css("font-weight", "bold") SelectBoton("Geocerca");
$("#Georuta").css("font-weight", "normal") DeselectBoton("Georuta");
DeselectBoton("PuntoInteres");
} else if (Tipo === 'Georuta') { } else if (Tipo === 'Georuta') {
$("#HdnTipo").val('Georuta') $("#HdnTipo").val('Georuta')
$("#Geocerca").css("font-weight", "normal") SelectBoton("Georuta");
$("#Georuta").css("font-weight", "bold") DeselectBoton("Geocerca");
DeselectBoton("PuntoInteres");
} else if (Tipo === 'PuntoInteres') {
$("#HdnTipo").val('PuntoInteres')
SelectBoton("PuntoInteres");
DeselectBoton("Geocerca");
DeselectBoton("Georuta");
} }
} }
function SelectBoton(boton) {
$("#" + boton).css("background-color", "#3598DC");
$("#" + boton).css("color", "white");
}
function DeselectBoton(boton) {
$("#" + boton).css("background-color", "rgb(255, 255, 255)");
$("#" + boton).css("color", "black");
}
function addLatLng(event) { function addLatLng(event) {
// var path = poly.getPath(); //SOLO SE PUEDE AGREGAR UN PUNTO DE INTERES A LA VEZ
// path.push(event.latLng); if (markersg.length >= 1 && $("#HdnTipo").val() === 'PuntoInteres') {
$("#btnGuardarPuntoInteres").css("display", "")
return;
}
var lat = event.latLng.lat(); var lat = event.latLng.lat();
var lng = event.latLng.lng(); var lng = event.latLng.lng();
mcoords.push(event.latLng) mcoords.push(event.latLng)
@@ -2477,6 +2727,7 @@
marker.addListener('click', function () { marker.addListener('click', function () {
info.open(map, marker); info.open(map, marker);
}); });
if ($("#HdnTipo").val() === 'Georuta') { if ($("#HdnTipo").val() === 'Georuta') {
if (markersg.length > 1) { if (markersg.length > 1) {
CreaRuta(); CreaRuta();
@@ -2496,6 +2747,10 @@
var path = polygon.getPath(); var path = polygon.getPath();
path.push(event.latLng) path.push(event.latLng)
} }
} else if ($("#HdnTipo").val() === 'PuntoInteres') {
if (markersg.length > 0) {
$("#btnGuardarPuntoInteres").css("display", "")
}
} }
} }
@@ -2558,12 +2813,12 @@
markersg[markersg.length - 1].setMap(null) markersg[markersg.length - 1].setMap(null)
markersg.splice((markersg.length - 1), 1); markersg.splice((markersg.length - 1), 1);
mcoords.splice((mcoords.length - 1), 1); mcoords.splice((mcoords.length - 1), 1);
if ($("#HdnTipo").val() === 'Georuta') { if ($("#HdnTipo").val() === 'Georuta') {
if (markersg.length >= 2) { if (markersg.length >= 2) {
CreaRuta(); CreaRuta();
} else { directionsDisplay.setMap(null); $("#btnGuardarRuta").css("display", "none"); } } else { directionsDisplay.setMap(null); $("#btnGuardarRuta").css("display", "none"); }
} } else if ($("#HdnTipo").val() === 'Geocerca') {
else if ($("#HdnTipo").val() === 'Geocerca') {
if (typeof polygon != 'undefined') { if (typeof polygon != 'undefined') {
polygon.setMap(null); polygon.setMap(null);
if (markersg.length >= 3) { if (markersg.length >= 3) {
@@ -2583,6 +2838,10 @@
$('#CommandArg').val(lng + " " + lat) $('#CommandArg').val(lng + " " + lat)
} }
} }
} else if ($("#HdnTipo").val() === 'PuntoInteres') {
if (markersg.length <= 0) {
$("#btnGuardarPuntoInteres").css("display", "none")
}
} }
} }
} }
@@ -2598,7 +2857,8 @@
if (typeof polygon != 'undefined') { if (typeof polygon != 'undefined') {
polygon.setMap(null); polygon.setMap(null);
} }
$("#btnGuardarRuta").css("display", "none") $("#btnGuardarRuta").css("display", "none");
$("#btnGuardarPuntoInteres").css("display", "none");
} }
function CambiaColor() { function CambiaColor() {
@@ -2671,53 +2931,6 @@
}); });
} }
function ControlGeocercas(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('div');
controlUI.style.marginLeft = '10px';
controlUI.style.zIndex = '0';
controlUI.style.cursor = 'pointer';
// controlUI.style.position = 'absolute';
controlUI.style.left = "0px";
controlUI.style.width = "150px";
controlUI.style.marginTop = "10px"
controlUI.style.top = "0px";
controlUI.className = 'gmnoprint';
controlDiv.appendChild(controlUI);
var ControlSub1 = document.createElement('div')
ControlSub1.style.float = 'left';
ControlSub1.className = 'gm-style-mtc'
controlUI.appendChild(ControlSub1)
var ControlSub2 = document.createElement('div')
ControlSub2.style.direction = 'ltr';
ControlSub2.style.overflow = 'hidden';
ControlSub2.id = "LnkMostarGeocercas"
ControlSub2.style.textAlign = 'center';
ControlSub2.style.position = 'relative';
ControlSub2.style.color = 'rgb(0,0,0)';
ControlSub2.style.fontFamily = ' "Open Sans", sans-serif; ';
ControlSub2.style.msUserSelect = 'none;';
ControlSub2.style.fontSize = '11px'
ControlSub2.style.display = 'none'
ControlSub2.style.backgroundColor = 'rgb(255,255,255)'
ControlSub2.style.padding = '11px'
ControlSub2.style.backgroundClip = 'padding-box'
ControlSub2.style.minWidth = '28px'
ControlSub2.style.fontWeight = '500'
ControlSub2.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
ControlSub2.innerHTML = 'Mostrar Geocercas'
ControlSub1.appendChild(ControlSub2)
ControlSub1.addEventListener('click', function () {
VerGeocercas();
});
}
var visible = false var visible = false
function EscondeLabels() { function EscondeLabels() {
@@ -2749,85 +2962,6 @@
//END REGION //END REGION
//REGION GEOCERCAS
var polygonsGeocercas = [];
var markersGeo = [];
var IsGeoVisibles = false;
function VerGeocercas() {
if (IsGeoVisibles) {
HideGeocercas();
IsGeoVisibles = false;
} else {
CargaGeocercas();
IsGeoVisibles = true;
}
}
function CargaGeocercas() {
for (var i = 0; i < polygonsGeocercas.length; i++) {
polygonsGeocercas[i].setMap(map);
}
for (var j = 0; j < markersGeo.length; j++) {
markersGeo[j].setMap(map);
}
}
function DeleteGeocercas() {
for (var i = 0; i < polygonsGeocercas.length; i++) {
polygonsGeocercas[i].setMap(null);
}
for (var j = 0; j < markersGeo.length; j++) {
markersGeo[j].setMap(null);
}
polygonsGeocercas = [];
markersGeo = [];
}
function HideGeocercas() {
for (var i = 0; i < polygonsGeocercas.length; i++) {
polygonsGeocercas[i].setMap(null);
}
for (var j = 0; j < markersGeo.length; j++) {
markersGeo[j].setMap(null);
}
}
function creaPoligonoGeocerca(coords, color, Geocerca) {
var polygon = new google.maps.Polygon({
paths: coords,
strokeColor: color,
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: color,
fillOpacity: 0.35
});
polygonsGeocercas.push(polygon);
CreaMarcadorPoligonoGeocerca(coords, Geocerca);
}
function CreaMarcadorPoligonoGeocerca(coords, GeoCerca) {
var bounds = new google.maps.LatLngBounds();
for (i = 0; i < coords.length; i++) {
bounds.extend(coords[i]);
}
var marker = new google.maps.Marker({
position: bounds.getCenter(),
title: GeoCerca
});
var infowindow = new google.maps.InfoWindow({
content: '<h4><b>' + GeoCerca + '</b></h4>'
});
marker.addListener('click', function () {
closeLastOpenedInfoWindow();
infowindow.open(map, marker);
lastOpenedInfoWindow = infowindow;
});
markersGeo.push(marker);
}
//END REGION
//REGION PARADAS //REGION PARADAS
var polygonsParadas = []; var polygonsParadas = [];
var markersParadas = []; var markersParadas = [];
@@ -3002,5 +3136,7 @@
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script> <script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script> <script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
<script src="Rastreo/JS/GeoRutas.js"></script> <script src="Rastreo/JS/GeoRutas.js"></script>
<script src="Rastreo/JS/PuntosDeInteres.js"></script>
<script src="Rastreo/JS/Geocercas.js"></script>
</asp:Content> </asp:Content>

View File

@@ -127,6 +127,7 @@ Partial Class GPS_Rastreo
CargaDispositivos() CargaDispositivos()
CargaEventos() CargaEventos()
CargaGrupos() CargaGrupos()
CargaGruposPI()
CreaTmpDTDetalle() CreaTmpDTDetalle()
IndiceGV = 0 IndiceGV = 0
End If End If
@@ -144,6 +145,16 @@ Partial Class GPS_Rastreo
RegistraScript("$('#C_GvDispositivos_chkSelectAll').click(function () { $("".ChkAllEvt input"").not(this).prop('checked',$(this).is(':checked')); });", "1") RegistraScript("$('#C_GvDispositivos_chkSelectAll').click(function () { $("".ChkAllEvt input"").not(this).prop('checked',$(this).is(':checked')); });", "1")
End Sub End Sub
Private Sub CargaGruposPI()
Dim ObjGPS As New ClsGPS
If ObjGPS.PuntoDeInteresGrupoGet(-1, 1) Then
GvGrupos.DataSource = ObjGPS.DtResultados
End If
ObjGPS.Dispose()
GvGrupos.DataBind()
UpAgregarPuntoInteres.Update()
End Sub
Private Sub CargaEventos() Private Sub CargaEventos()
Dim GPS As New ClsGPS Dim GPS As New ClsGPS
@@ -326,40 +337,32 @@ Partial Class GPS_Rastreo
End If End If
End If End If
ElseIf Opcion = "All" Then
'Dim CveDispositivo = GVRow.DataKey("CveDispositivo").ToEntero
'Dim RowDispositivo As DataRow = GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimero($"CveDispositivo = {CveDispositivo}")
'Dim json As JObject = GPS.GetPosicionEquipoJson(CveDispositivo, FechaI, FechaF, RowDispositivo("Icono").ToString, RowDispositivo("ColorTrazo").ToString, GVRow.DataKey("NombreVehiculo").ToString, UsuarioActual.TienePermisoProceso(200))
'HdnJSScript.Value = json.ToString()
'DtPosiciones = GPS.DtPosicionesResultados '.AsEnumerable().Take(1000).CopyToDataTable()
'UpDatosMapa.Update()
'RegistraScript($"CargaHistorico(); PreparaDibujadoHistorico();PreparaDibujado(3);")
If ChkTrazarGeocercas.Checked Then If ChkTrazarGeocercas.Checked Then
Dim DtGeocercas As DataTable = Nothing MostrarGeoCercas()
If GPS.GetReferenciaDetalle(-1, -1, GVRow.DataKey("CveDispositivo").ToEntero, UsuarioActual.CveCliente) Then
DtGeocercas = GPS.DtResultados.FiltraParametros("EsParada = False And Tipo='Geocerca' AND Estatus = 1")
End If End If
'SI TIENE GEOREFERENCIAS LAS MOSTRAMOS If ChkTrazarGeorutas.Checked Then
If DtGeocercas IsNot Nothing Then MostrarGeoRutas()
Dim SbJS As New StringBuilder
SbJS.Append("$('#LnkMostarGeocercas').css('display', 'block'); setTimeout(function(){ ")
For Each Dr As DataRow In DtGeocercas.Rows
Dim CoordsParada = SQLToGmapsJArray(Dr("Coordenadas").ToString, "POLYGON")
SbJS.AppendFormat(" creaPoligonoGeocerca({0},'{1}','{2}'); ", CoordsParada.ToString, Dr("Color").ToString, Dr("GeoReferencia").ToString)
Next
SbJS.Append(" VerGeocercas(); },1000);")
RegistraScript(SbJS.ToString)
End If
Else
RegistraScript("$('#LnkMostarGeocercas').css('display', 'none');")
End If End If
If ChkTrazarPuntosInteres.Checked Then
MostrarPuntosDeInteres()
End If
ElseIf Opcion = "All" Then
If ChkTrazarGeocercas.Checked Then
MostrarGeoCercas()
End If
If ChkTrazarGeorutas.Checked Then
MostrarGeoRutas()
End If
If ChkTrazarPuntosInteres.Checked Then
MostrarPuntosDeInteres()
End If
If GPS.GetPosicionEquipo(GVRow.DataKey("CveDispositivo").ToEntero, FechaI, FechaF) Then If GPS.GetPosicionEquipo(GVRow.DataKey("CveDispositivo").ToEntero, FechaI, FechaF) Then
If GPS.DtResultados.Rows.Count > 0 Then If GPS.DtResultados.Rows.Count > 0 Then
@@ -573,6 +576,19 @@ Partial Class GPS_Rastreo
RegistraScript($"CreaMarcador({Coord},'{row("NombreVehiculo")}', '{Info}', '{Icono}');", row("CveDispositivo").ToString) RegistraScript($"CreaMarcador({Coord},'{row("NombreVehiculo")}', '{Info}', '{Icono}');", row("CveDispositivo").ToString)
AddRowPosiciones(Vehiculo, Coord, row("SPD").ToString.ToDouble, Fecha, row("CveDispositivo").ToString.ToEntero, row("TiempoDetenido").ToString.ToDouble) AddRowPosiciones(Vehiculo, Coord, row("SPD").ToString.ToDouble, Fecha, row("CveDispositivo").ToString.ToEntero, row("TiempoDetenido").ToString.ToDouble)
Next Next
If ChkTrazarGeocercas.Checked Then
MostrarGeoCercas()
End If
If ChkTrazarGeorutas.Checked Then
MostrarGeoRutas()
End If
If ChkTrazarPuntosInteres.Checked Then
MostrarPuntosDeInteres()
End If
Else Else
Alert($"No se encontraron resultados") Alert($"No se encontraron resultados")
End If End If
@@ -619,15 +635,16 @@ Partial Class GPS_Rastreo
Next Next
If ChkTrazarGeocercas.Checked Then If ChkTrazarGeocercas.Checked Then
Dim Dispositivos As String = Equipos.Replace(";", ",").Remove(Equipos.Length - 1, 1) MostrarGeoCercas()
CargaGeocercas(Dispositivos)
End If End If
If ChkTrazarGeorutas.Checked Then If ChkTrazarGeorutas.Checked Then
MostarGeoRutas() MostrarGeoRutas()
End If End If
RegistraScript("setTimeout(function(){ $('#LnkMostarGeocercas').css('display', 'block'); },1000);") If ChkTrazarPuntosInteres.Checked Then
MostrarPuntosDeInteres()
End If
Else Else
Alert($"No se encontraron resultados", TipoMensaje.MsgAdvertencia) Alert($"No se encontraron resultados", TipoMensaje.MsgAdvertencia)
End If End If
@@ -702,6 +719,7 @@ Partial Class GPS_Rastreo
GPS.Dispose() GPS.Dispose()
End Sub End Sub
Private Sub CargaGeocercas(Dispositivos As String) Private Sub CargaGeocercas(Dispositivos As String)
Try
Dim DtGeocercas As DataTable = Nothing Dim DtGeocercas As DataTable = Nothing
Dim ObjGPSGeo As New ClsGPS Dim ObjGPSGeo As New ClsGPS
@@ -712,19 +730,36 @@ Partial Class GPS_Rastreo
'SI TIENE GEOREFERENCIAS LAS MOSTRAMOS 'SI TIENE GEOREFERENCIAS LAS MOSTRAMOS
If DtGeocercas IsNot Nothing Then If DtGeocercas IsNot Nothing Then
Dim DtParadasDispositivo = DtGeocercas.FiltraParametros($"CveDispositivo IN({Dispositivos})", "", {"Color", "GeoReferencia", "Coordenadas"}) Dim DtParadasDispositivo = DtGeocercas.FiltraParametros($"CveDispositivo IN({Dispositivos})", DistinctColumns:={"GeoReferencia", "Coordenadas", "Color"})
Dim SbJS As New StringBuilder
SbJS.Append("$('#LnkMostarGeocercas').css('display', 'block'); setTimeout(function(){ ") GvGeoCercas.DataSource = DtParadasDispositivo
For Each Dr As DataRow In DtParadasDispositivo.Rows GvGeoCercas.DataBind()
SbJS.AppendFormat(" creaPoligonoGeocerca({0},'{1}','{2}'); ", SQLToGmapsJArray(Dr("Coordenadas").ToString, "POLYGON"), Dr("Color").ToString, Dr("GeoReferencia").ToString)
Next
SbJS.Append(" VerGeocercas(); },1000);")
RegistraScript(SbJS.ToString)
End If End If
Catch ex As Exception
OnError("Ocurrió un error al consultar las geocercas", ex)
End Try
UpGeoCercas.Update()
End Sub End Sub
Private Sub MostarGeoRutas() Private Sub MostrarGeoCercas()
Dim count = 0 Dim count = 0
RegistraScript($"initGeoRutas();", count.ToString()) Try
RegistraScript($"NuevaConsultaGeoCercas();", count.ToString())
For Each GvRow As GridViewRow In GvGeoCercas.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkGeo").Checked Then
count += 1
RegistraScript(String.Format("creaPoligonoGeocerca({0},'{1}','{2}'); ", SQLToGmapsJArray(GvRow.DataKey("Coordenadas"), "POLYGON"), GvRow.DataKey("Color"), GvRow.DataKey("GeoReferencia")), count.ToString())
End If
End If
Next
RegistraScript("VerGeocercas();", (count + 1).ToString())
Catch ex As Exception
OnError("Ocurrió un error al consultar las geocercas", ex)
End Try
End Sub
Private Sub MostrarGeoRutas()
Dim count = 0
RegistraScript($"NuevaConsultaGeoRutas();", count.ToString())
For Each GvRow As GridViewRow In GvGeorutas.Rows For Each GvRow As GridViewRow In GvGeorutas.Rows
If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.RowType = DataControlRowType.DataRow Then
@@ -736,6 +771,20 @@ Partial Class GPS_Rastreo
End If End If
Next Next
End Sub
Private Sub MostrarPuntosDeInteres()
RegistraScript($"NuevaConsultaPI();", "0")
For Each GvRow As GridViewRow In GVPuntosInteres.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkPI").Checked Then
Dim coords = SQLToGmaps(GvRow.DataKey("Punto"), "POINT")
RegistraScript($"CreaMarcadorPI({coords}, '{GvRow.DataKey("PuntoDeInteres").ToString}')", GvRow.RowIndex.ToString())
End If
End If
Next
End Sub End Sub
Protected Sub TimmerRefresh_Tick(sender As Object, e As EventArgs) Protected Sub TimmerRefresh_Tick(sender As Object, e As EventArgs)
@@ -778,7 +827,6 @@ Partial Class GPS_Rastreo
End If End If
End If End If
If chkTrazarLinea.Checked Then If chkTrazarLinea.Checked Then
TrazarLineaContinuo = True TrazarLineaContinuo = True
CreaDTCoordenadas() CreaDTCoordenadas()
@@ -1146,8 +1194,16 @@ Partial Class GPS_Rastreo
TimmerRefresh.Enabled = False TimmerRefresh.Enabled = False
HdnOpcion.Value = opcion HdnOpcion.Value = opcion
chkTrazarLinea.Visible = False dvTrazo.Visible = False
ChkTrazarGeocercas.Visible = False dvTrazoGeo.Visible = False
dvTrazoRutas.Visible = False
dvTrazoPI.Visible = False
chkTrazarLinea.Checked = False
ChkTrazarGeocercas.Checked = False
ChkTrazarGeorutas.Checked = False
ChkTrazarPuntosInteres.Checked = False
DvPaginacion.Visible = False DvPaginacion.Visible = False
rowImpresionesKM.Visible = False rowImpresionesKM.Visible = False
If opcion = "All" Then If opcion = "All" Then
@@ -1158,6 +1214,7 @@ Partial Class GPS_Rastreo
dvTrazo.Visible = False dvTrazo.Visible = False
dvTrazoGeo.Visible = True dvTrazoGeo.Visible = True
dvTrazoRutas.Visible = True dvTrazoRutas.Visible = True
dvTrazoPI.Visible = True
ChkTrazarGeocercas.Visible = True ChkTrazarGeocercas.Visible = True
dvMinutos.Visible = False dvMinutos.Visible = False
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();") RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
@@ -1172,6 +1229,7 @@ Partial Class GPS_Rastreo
dvTrazo.Visible = False dvTrazo.Visible = False
dvTrazoGeo.Visible = False dvTrazoGeo.Visible = False
dvTrazoRutas.Visible = False dvTrazoRutas.Visible = False
dvTrazoPI.Visible = False
dvMinutos.Visible = False dvMinutos.Visible = False
BtnRastrear.ValidationGroup = "GrpFechas" BtnRastrear.ValidationGroup = "GrpFechas"
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();") RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
@@ -1184,6 +1242,7 @@ Partial Class GPS_Rastreo
dvTrazo.Visible = False dvTrazo.Visible = False
dvTrazoGeo.Visible = False dvTrazoGeo.Visible = False
dvTrazoRutas.Visible = False dvTrazoRutas.Visible = False
dvTrazoPI.Visible = False
dvDispositivos.Visible = True dvDispositivos.Visible = True
dvMinutos.Visible = False dvMinutos.Visible = False
GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1 AND LimiteVelocidad = 1") GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1 AND LimiteVelocidad = 1")
@@ -1201,6 +1260,7 @@ Partial Class GPS_Rastreo
dvTrazo.Visible = False dvTrazo.Visible = False
dvTrazoGeo.Visible = False dvTrazoGeo.Visible = False
dvTrazoRutas.Visible = False dvTrazoRutas.Visible = False
dvTrazoPI.Visible = False
dvMinutos.Visible = True dvMinutos.Visible = True
dvEventos.Visible = False dvEventos.Visible = False
BtnRastrear.ValidationGroup = "GrpFechas" BtnRastrear.ValidationGroup = "GrpFechas"
@@ -1214,6 +1274,7 @@ Partial Class GPS_Rastreo
dvTrazo.Visible = False dvTrazo.Visible = False
dvTrazoGeo.Visible = False dvTrazoGeo.Visible = False
dvTrazoRutas.Visible = False dvTrazoRutas.Visible = False
dvTrazoPI.Visible = False
dvMinutos.Visible = False dvMinutos.Visible = False
dvEventos.Visible = False dvEventos.Visible = False
BtnRastrear.ValidationGroup = "GrpFechas" BtnRastrear.ValidationGroup = "GrpFechas"
@@ -1223,8 +1284,9 @@ Partial Class GPS_Rastreo
dvFechas.Visible = False dvFechas.Visible = False
dvDispositivos.Visible = True dvDispositivos.Visible = True
dvTrazo.Visible = False dvTrazo.Visible = False
dvTrazoGeo.Visible = False dvTrazoGeo.Visible = True
dvTrazoRutas.Visible = False dvTrazoRutas.Visible = True
dvTrazoPI.Visible = True
dvMinutos.Visible = False dvMinutos.Visible = False
dvEventos.Visible = False dvEventos.Visible = False
BtnRastrear.ValidationGroup = "xx" BtnRastrear.ValidationGroup = "xx"
@@ -1236,23 +1298,13 @@ Partial Class GPS_Rastreo
dvTrazo.Visible = True dvTrazo.Visible = True
dvTrazoGeo.Visible = True dvTrazoGeo.Visible = True
dvTrazoRutas.Visible = True dvTrazoRutas.Visible = True
dvTrazoPI.Visible = True
dvEventos.Visible = False dvEventos.Visible = False
BtnRastrear.ValidationGroup = "xx" BtnRastrear.ValidationGroup = "xx"
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();") RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
myModalLabel2.InnerHtml = "Rastreo Continuo" myModalLabel2.InnerHtml = "Rastreo Continuo"
chkTrazarLinea.Visible = True chkTrazarLinea.Visible = True
ChkTrazarGeocercas.Visible = True ChkTrazarGeocercas.Visible = True
ElseIf opcion = "Watch" Then
dvFechas.Visible = False
dvDispositivos.Visible = True
dvMinutos.Visible = False
dvTrazo.Visible = True
dvTrazoGeo.Visible = True
dvTrazoRutas.Visible = True
dvEventos.Visible = False
BtnRastrear.ValidationGroup = "xx"
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
myModalLabel2.InnerHtml = "Rastreo Continuo"
ElseIf opcion = "KM" Then ElseIf opcion = "KM" Then
dvFechas.Visible = True dvFechas.Visible = True
dvDispositivos.Visible = False dvDispositivos.Visible = False
@@ -1260,6 +1312,7 @@ Partial Class GPS_Rastreo
dvTrazo.Visible = False dvTrazo.Visible = False
dvTrazoGeo.Visible = False dvTrazoGeo.Visible = False
dvTrazoRutas.Visible = False dvTrazoRutas.Visible = False
dvTrazoPI.Visible = False
dvEventos.Visible = False dvEventos.Visible = False
BtnRastrear.ValidationGroup = "xx" BtnRastrear.ValidationGroup = "xx"
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();") RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
@@ -1268,6 +1321,10 @@ Partial Class GPS_Rastreo
dvFechas.Visible = False dvFechas.Visible = False
dvDispositivos.Visible = True dvDispositivos.Visible = True
dvMinutos.Visible = False dvMinutos.Visible = False
dvTrazo.Visible = False
dvTrazoGeo.Visible = False
dvTrazoRutas.Visible = False
dvTrazoPI.Visible = False
DivFechasGVBarra.Visible = False DivFechasGVBarra.Visible = False
GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("CveModelo = 17") GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("CveModelo = 17")
GvDispositivos.DataBind() GvDispositivos.DataBind()
@@ -1276,23 +1333,34 @@ Partial Class GPS_Rastreo
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();") RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
myModalLabel2.InnerHtml = "Contador de pasajeros" myModalLabel2.InnerHtml = "Contador de pasajeros"
End If End If
If Not dvTrazoGeo.Visible Then
RegistraScript("$('#LnkMostarGeocercas').css('display', 'none');")
End If
If dvTrazoRutas.Visible Then If dvTrazoRutas.Visible Then
CargaGeoRutas() CargaGeoRutas()
Else Else
RegistraScript("$('#LnkMostarGeoRutas').css('display', 'none');") RegistraScript("$('#LnkMostarGeoRutas').css('display', 'none');")
End If End If
If dvTrazoPI.Visible Then
CargaPI()
Else
RegistraScript("$('#LnkMostarPI').css('display', 'none');")
End If
If opcion <> "Speed" AndAlso opcion <> "TPS" AndAlso Filtrado Then If opcion <> "Speed" AndAlso opcion <> "TPS" AndAlso Filtrado Then
CargaDispositivos() CargaDispositivos()
Filtrado = False Filtrado = False
End If End If
RegistraScript("$(""#h"").modal('hide'); RegistraScript("$(""#h"").modal('hide');
$(""#ShowDiv3"").css(""line-height"", ""20px""); $(""#ShowDiv3"").css(""line-height"", ""20px"");
open = false; open = false;
$(""#ShowDiv3"").html('<i class=""fa fa-angle-up"" aria-hidden=""True""></i>');", "HideDiv") $(""#ShowDiv3"").html('<i class=""fa fa-angle-up"" aria-hidden=""True""></i>');", "HideDiv")
RegistraScript("$(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', false);$('#C_GvDispositivos_chkSelectAll').click(function () { $(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', this.checked); });", "chkGV") RegistraScript("$(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', false);$('#C_GvDispositivos_chkSelectAll').click(function () { $(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', this.checked); });", "chkGV")
UPConsulta.Update() UPConsulta.Update()
End Sub End Sub
@@ -2158,12 +2226,39 @@ Partial Class GPS_Rastreo
End Using End Using
Return retorno Return retorno
End Function End Function
#Region "G E O R U T A S" #Region "G E O R E F E R E N C I A S"
Protected Sub ChkTrazarGeocercas_CheckedChanged(sender As Object, e As EventArgs)
If ChkTrazarGeocercas.Checked Then
Dim CountEquipos As Integer = 0
Dim Equipos As New StringBuilder()
For Each row As GridViewRow In GvDispositivos.Rows
If row.FCCheckBox("chkDis").Checked Then
CountEquipos += 1
Equipos.Append($"{row.DataKey("CveDispositivo")};")
End If
Next
If CountEquipos > 0 Then
Dim Dispositivos As String = Equipos.Replace(";", ",").Remove(Equipos.Length - 1, 1).ToString()
CargaGeocercas(Dispositivos)
RegistraScript("$('#DivGeoCercas').modal('show');")
Else
Alert("No hay equipos seleccionados", TipoMensaje.MsgAdvertencia)
End If
End If
End Sub
Protected Sub ChkTrazarGeorutas_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkTrazarGeorutas_CheckedChanged(sender As Object, e As EventArgs)
If ChkTrazarGeorutas.Checked Then If ChkTrazarGeorutas.Checked Then
RegistraScript("$('#DivGeoRutas').modal('show');") RegistraScript("$('#DivGeoRutas').modal('show');")
End If End If
End Sub End Sub
Protected Sub ChkTrazarPI_CheckedChanged(sender As Object, e As EventArgs)
If ChkTrazarPuntosInteres.Checked Then
RegistraScript("$('#DivMostrarPI').modal('show');")
End If
End Sub
Private Sub CargaGeoRutas() Private Sub CargaGeoRutas()
Dim ObjGPS As New ClsGPS Dim ObjGPS As New ClsGPS
@@ -2175,6 +2270,49 @@ Partial Class GPS_Rastreo
UpGeorutas.Update() UpGeorutas.Update()
End Sub End Sub
Private Sub CargaPI()
Dim ObjGPS As New ClsGPS
If ObjGPS.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
GVPuntosInteres.DataSource = ObjGPS.DtResultados
End If
ObjGPS.Dispose()
GVPuntosInteres.DataBind()
UpMostarPI.Update()
End Sub
#End Region #End Region
Protected Sub GvGrupos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvGrupos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes.Add("onClick", $"CargaDatosSeleccionadosPI({e.Row.RowIndex}, '{e.Row.DBCampo("CvePuntoDeInteresGrupo").ToString}');")
End If
End Sub
Protected Sub BtnAgregarPunto_Click(sender As Object, e As EventArgs) Handles BtnAgregarPunto.Click
Dim HuboError = False
Dim ObjGPS As New ClsGPS
ObjGPS.IniciaTransacSQL()
Try
Dim GEOM As String = $"POINT{GeoCerca.Value}"
If Not ObjGPS.PuntoDeInteresAdd(TxtNombrePI.Text, UsuarioActual.CveCliente, GEOM, True, TxtDescripcion.Text, HdnGrupo.Value.ToEntero) Then
HuboError = True
End If
Catch ex As Exception
HuboError = True
OnError("Ocurrió un error al agregar el punto de interés", ex)
End Try
If HuboError Then
ObjGPS.RollBack()
Else
ObjGPS.Commit()
TxtDescripcion.Text = ""
TxtNombre.Text = ""
Alert("El punto de interés se agregó correctamente", TipoMensaje.MsgInformacion)
RegistraScript("$('#DivAgregarPuntoInteres').modal('hide');DeleteMarkersG();", "1")
End If
UpAgregarPuntoInteres.Update()
End Sub
End Class End Class

View File

@@ -4,7 +4,7 @@ var polylinesGeoRutas = [];
var polybounds = []; var polybounds = [];
function initGeoRutas() { function initGeoRutas() {
NuevaConsultaGeoRutas(); //NuevaConsultaGeoRutas();
var upRutasDiv = document.createElement('div'); var upRutasDiv = document.createElement('div');
var upRutas = new ControlGeoRutas(upRutasDiv, map); var upRutas = new ControlGeoRutas(upRutasDiv, map);
@@ -65,6 +65,8 @@ function NuevaConsultaGeoRutas() {
polylinesGeoRutas = []; polylinesGeoRutas = [];
polybounds = []; polybounds = [];
markersRutas = []; markersRutas = [];
$("#LnkMostarGeoRutas").css("display", "block");
} }
function ControlGeoRutas(controlDiv, map) { function ControlGeoRutas(controlDiv, map) {
@@ -98,7 +100,7 @@ function ControlGeoRutas(controlDiv, map) {
ControlSub2.style.fontFamily = ' "Open Sans", sans-serif; '; ControlSub2.style.fontFamily = ' "Open Sans", sans-serif; ';
ControlSub2.style.msUserSelect = 'none;'; ControlSub2.style.msUserSelect = 'none;';
ControlSub2.style.fontSize = '11px' ControlSub2.style.fontSize = '11px'
ControlSub2.style.display = 'block' ControlSub2.style.display = 'none'
ControlSub2.style.backgroundColor = 'rgb(255,255,255)' ControlSub2.style.backgroundColor = 'rgb(255,255,255)'
ControlSub2.style.padding = '11px' ControlSub2.style.padding = '11px'
ControlSub2.style.backgroundClip = 'padding-box' ControlSub2.style.backgroundClip = 'padding-box'

139
GPS/Rastreo/JS/Geocercas.js Normal file
View File

@@ -0,0 +1,139 @@
//REGION GEOCERCAS
var polygonsGeocercas = [];
var markersGeo = [];
var IsGeoVisibles = false;
function initGeocercas() {
//NuevaConsultaGeoCercas();
var upGeoDiv = document.createElement('div');
var upGeo = new ControlGeocercas(upGeoDiv, map);
map.controls[google.maps.ControlPosition.TOP_LEFT].push(upGeoDiv);
}
function NuevaConsultaGeoCercas() {
HideGeocercas();
DeleteGeocercas();
$("#LnkMostarGeocercas").css("display", "block");
}
function VerGeocercas() {
if (IsGeoVisibles) {
HideGeocercas();
IsGeoVisibles = false;
} else {
CargaGeocercas();
IsGeoVisibles = true;
}
}
function CargaGeocercas() {
for (var i = 0; i < polygonsGeocercas.length; i++) {
polygonsGeocercas[i].setMap(map);
}
for (var j = 0; j < markersGeo.length; j++) {
markersGeo[j].setMap(map);
}
}
function DeleteGeocercas() {
for (var i = 0; i < polygonsGeocercas.length; i++) {
polygonsGeocercas[i].setMap(null);
}
for (var j = 0; j < markersGeo.length; j++) {
markersGeo[j].setMap(null);
}
polygonsGeocercas = [];
markersGeo = [];
}
function HideGeocercas() {
for (var i = 0; i < polygonsGeocercas.length; i++) {
polygonsGeocercas[i].setMap(null);
}
for (var j = 0; j < markersGeo.length; j++) {
markersGeo[j].setMap(null);
}
}
function creaPoligonoGeocerca(coords, color, Geocerca) {
var polygon = new google.maps.Polygon({
paths: coords,
strokeColor: color,
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: color,
fillOpacity: 0.35
});
polygonsGeocercas.push(polygon);
CreaMarcadorPoligonoGeocerca(coords, Geocerca);
}
function CreaMarcadorPoligonoGeocerca(coords, GeoCerca) {
var bounds = new google.maps.LatLngBounds();
for (i = 0; i < coords.length; i++) {
bounds.extend(coords[i]);
}
var marker = new google.maps.Marker({
position: bounds.getCenter(),
title: GeoCerca
});
var infowindow = new google.maps.InfoWindow({
content: '<h4><b>' + GeoCerca + '</b></h4>'
});
marker.addListener('click', function () {
closeLastOpenedInfoWindow();
infowindow.open(map, marker);
lastOpenedInfoWindow = infowindow;
});
markersGeo.push(marker);
}
function ControlGeocercas(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('div');
controlUI.style.marginLeft = '10px';
controlUI.style.zIndex = '0';
controlUI.style.cursor = 'pointer';
// controlUI.style.position = 'absolute';
controlUI.style.left = "0px";
controlUI.style.width = "150px";
controlUI.style.marginTop = "10px"
controlUI.style.top = "0px";
controlUI.className = 'gmnoprint';
controlDiv.appendChild(controlUI);
var ControlSub1 = document.createElement('div')
ControlSub1.style.float = 'left';
ControlSub1.className = 'gm-style-mtc'
controlUI.appendChild(ControlSub1)
var ControlSub2 = document.createElement('div')
ControlSub2.style.direction = 'ltr';
ControlSub2.style.overflow = 'hidden';
ControlSub2.id = "LnkMostarGeocercas"
ControlSub2.style.textAlign = 'center';
ControlSub2.style.position = 'relative';
ControlSub2.style.color = 'rgb(0,0,0)';
ControlSub2.style.fontFamily = ' "Open Sans", sans-serif; ';
ControlSub2.style.msUserSelect = 'none;';
ControlSub2.style.fontSize = '11px'
ControlSub2.style.display = 'none'
ControlSub2.style.backgroundColor = 'rgb(255,255,255)'
ControlSub2.style.padding = '11px'
ControlSub2.style.backgroundClip = 'padding-box'
ControlSub2.style.minWidth = '28px'
ControlSub2.style.fontWeight = '500'
ControlSub2.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
ControlSub2.innerHTML = 'Mostrar Geocercas'
ControlSub1.appendChild(ControlSub2)
ControlSub1.addEventListener('click', function () {
VerGeocercas();
});
}
//END REGION

View File

@@ -0,0 +1,108 @@
//REGION PUNTOS DE INTERES
var markersPI = [];
function initPI() {
//NuevaConsultaPI();
var upRutasDiv = document.createElement('div');
var upRutas = new ControlPI(upRutasDiv, map);
map.controls[google.maps.ControlPosition.TOP_LEFT].push(upRutasDiv);
}
function CreaMarcadorPI(coords, nomEquipo) {
var marker = new google.maps.Marker({
position: coords,
title: nomEquipo,
map: map
});
var infowindow = new google.maps.InfoWindow({
content: '<h4><b>' + nomEquipo + '</b></h4>'
});
marker.addListener('click', function () {
closeLastOpenedInfoWindow();
infowindow.open(map, marker);
lastOpenedInfoWindow = infowindow;
});
markersPI.push(marker);
}
function NuevaConsultaPI() {
for (var j = 0; j < markersPI.length; j++) {
markersPI[j].setMap(null);
}
markersPI = [];
$("#LnkMostarPI").css("display", "block");
}
function ControlPI(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('div');
controlUI.style.marginLeft = '10px';
controlUI.style.zIndex = '0';
controlUI.style.cursor = 'pointer';
// controlUI.style.position = 'absolute';
controlUI.style.left = "0px";
controlUI.style.width = "150px";
controlUI.style.marginTop = "10px"
controlUI.style.top = "0px";
controlUI.className = 'gmnoprint';
controlDiv.appendChild(controlUI);
var ControlSub1 = document.createElement('div')
ControlSub1.style.float = 'left';
ControlSub1.className = 'gm-style-mtc'
controlUI.appendChild(ControlSub1)
var ControlSub2 = document.createElement('div')
ControlSub2.style.direction = 'ltr';
ControlSub2.style.overflow = 'hidden';
ControlSub2.id = "LnkMostarPI"
ControlSub2.style.textAlign = 'center';
ControlSub2.style.position = 'relative';
ControlSub2.style.color = 'rgb(0,0,0)';
ControlSub2.style.fontFamily = ' "Open Sans", sans-serif; ';
ControlSub2.style.msUserSelect = 'none;';
ControlSub2.style.fontSize = '11px'
ControlSub2.style.display = 'none'
ControlSub2.style.backgroundColor = 'rgb(255,255,255)'
ControlSub2.style.padding = '11px'
ControlSub2.style.backgroundClip = 'padding-box'
ControlSub2.style.minWidth = '28px'
ControlSub2.style.fontWeight = '500'
ControlSub2.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
ControlSub2.innerHTML = 'Mostrar Puntos de Interés'
ControlSub1.appendChild(ControlSub2)
ControlSub1.addEventListener('click', function () {
VerPI();
});
}
var IsPIVisible = false;
function VerPI() {
if (IsPIVisible) {
HidePI();
IsPIVisible = false;
} else {
CargaPI();
IsPIVisible = true;
}
}
function HidePI() {
for (var j = 0; j < markersPI.length; j++) {
markersPI[j].setMap(null);
}
}
function CargaPI() {
for (var i = 0; i < markersPI.length; i++) {
markersPI[i].setMap(map);
}
}

View File

@@ -584,10 +584,12 @@
function ValidarCantidad(i) { function ValidarCantidad(i) {
var Cant = $("#C_Tab_TabLiberacion_GvMLiberacion_TxtCantidad_" + i).val(); var Cant = $("#C_Tab_TabLiberacion_GvMLiberacion_TxtCantidad_" + i).val();
var CantDisp = $("#C_Tab_TabLiberacion_GvMLiberacion_LblCantidad_" + i).text(); var CantDisp = $("#C_Tab_TabLiberacion_GvMLiberacion_LblCantidad_" + i).text();
if (Cant > CantDisp) {
if (parseFloat(Cant) > parseFloat(CantDisp)) {
$("#C_Tab_TabLiberacion_GvMLiberacion_TxtCantidad_" + i).val(formato_numero(CantDisp, 2, '.', ',')); $("#C_Tab_TabLiberacion_GvMLiberacion_TxtCantidad_" + i).val(formato_numero(CantDisp, 2, '.', ','));
} }
} }
function formato_numero(numero, decimales, separador_decimal, separador_miles) { function formato_numero(numero, decimales, separador_decimal, separador_miles) {
numero = parseFloat(numero); numero = parseFloat(numero);
if (isNaN(numero)) { if (isNaN(numero)) {

View File

@@ -470,7 +470,7 @@
<br /> <br />
<asp:UpdatePanel runat="server"> <asp:UpdatePanel ID="UpNuevoRealizar" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row" style="text-align: center;"> <div class="row" style="text-align: center;">
<div class="col-md-12"> <div class="col-md-12">

View File

@@ -930,6 +930,24 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
End If End If
End If End If
Else
If Not ErrorMovInv Then
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, TxtObservaciones.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUM("Total").ToDecimal
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida) Then
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida) Then
ErrorMovInv = True
End If
End If
End If
End If End If
@@ -993,7 +1011,7 @@ Partial Class Inventarios_TraspasoAlmacen
If ErrorExistencia Then If ErrorExistencia Then
CargaGvDatos() CargaGvDatos()
End If End If
ObjConta.Dispose()
ObjInventario.Dispose() ObjInventario.Dispose()
End Sub End Sub
@@ -1577,6 +1595,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Folio = 0 Dim Folio = 0
Dim ErrorMovInv As Boolean = False Dim ErrorMovInv As Boolean = False
Dim TextoError = "" Dim TextoError = ""
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
'' verifica que no se halla recibido previamente, si ya se recibió da salida '' verifica que no se halla recibido previamente, si ya se recibió da salida
If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then
@@ -1648,7 +1667,23 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
Cont += 1 Cont += 1
Next Next
If Not ErrorMovInv Then
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, TxtObservacionesRecepcion.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUM("Total").ToDecimal
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida) Then
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida) Then
ErrorMovInv = True
End If
End If
End If
End If End If
@@ -1777,6 +1812,7 @@ Partial Class Inventarios_TraspasoAlmacen
Alert(TextoError, TipoMensaje.MsgError) Alert(TextoError, TipoMensaje.MsgError)
End If End If
ObjInventario.Dispose() ObjInventario.Dispose()
ObjConta.Dispose()
CargaRecepcion() CargaRecepcion()
Else Else
Alert("No hay movimientos para el traspaso", TipoMensaje.MsgAdvertencia) Alert("No hay movimientos para el traspaso", TipoMensaje.MsgAdvertencia)

View File

@@ -591,7 +591,7 @@
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="Ddlcliente" OnSelectedIndexChanged="Ddlcliente_SelectedIndexChanged" AppendDataBoundItems="true" AutoPostBack="true" CssClass="select2me" Width="100%" DataTextField="Nombre" DataValueField="CveCliente" runat="server"></asp:DropDownList> <asp:DropDownList ID="Ddlcliente" OnSelectedIndexChanged="Ddlcliente_SelectedIndexChanged" AppendDataBoundItems="true" AutoPostBack="true" CssClass="select2me" Width="100%" DataTextField="CodigoNombre" DataValueField="CveCliente" runat="server"></asp:DropDownList>
<%-- <asp:RangeValidator ID="RVCliente" CssClass="form-control" runat="server" ControlToValidate="Ddlcliente" Display="None" Type="Integer" MinimumValue="1" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RangeValidator> <%-- <asp:RangeValidator ID="RVCliente" CssClass="form-control" runat="server" ControlToValidate="Ddlcliente" Display="None" Type="Integer" MinimumValue="1" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECliente" runat="server" HighlightCssClass="vco" TargetControlID="RVCliente" Width="300px"></ajax:ValidatorCalloutExtender>--%> <ajax:ValidatorCalloutExtender ID="VCECliente" runat="server" HighlightCssClass="vco" TargetControlID="RVCliente" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div> </div>

View File

@@ -9197,12 +9197,17 @@ Partial Class Clientes
AgregarProductoServicio(1, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Clientes/Usados", SubTotal, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero, AgregarProductoServicio(1, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Clientes/Usados", SubTotal, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero,
DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA) DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA)
Dim Folio As Integer = 0 Dim Folio As Integer = -1
Dim Serie As String = "" Dim Serie As String = ""
If FolioNotaCredito(Tipo) Then 'If FolioNotaCredito(Tipo) Then
Folio = FolioNotaAcumulador ' Folio = FolioNotaAcumulador
Serie = SerieNotaAcumulador ' Serie = SerieNotaAcumulador
'End If
If ObjFactura IsNot Nothing Then
ObjFactura.Dispose()
ObjFactura = Nothing
End If End If
ObjFactura = New Modelos.Factura(UsuarioActual) ObjFactura = New Modelos.Factura(UsuarioActual)

View File

@@ -346,7 +346,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Generar NC" Visible="false" > <asp:TemplateField HeaderText="Generar NC" Visible="false" >
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="ChkGenerarNC" CssClass="chkgv" runat="server" Visible="false"></asp:CheckBox> <asp:CheckBox ID="ChkGenerarNC" CssClass="chkgv" runat="server" Visible="false" Enabled="false"></asp:CheckBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="300px"> <asp:TemplateField ItemStyle-Width="300px">
@@ -501,7 +501,7 @@
var Ventas = ''; var Ventas = '';
function FnSuma(t, txt, importe) { function FnSuma(t, txt, importe) {
debugger;
var chkPesosBancos = $get("ChkPagarPesos"); var chkPesosBancos = $get("ChkPagarPesos");
var chkDolaresBancos = $get("ChkPagarDolares"); var chkDolaresBancos = $get("ChkPagarDolares");
@@ -526,7 +526,7 @@
} }
function SumaValores(pagoMultiple, monedaPago) { function SumaValores(pagoMultiple, monedaPago) {
debugger;
var Importe = 0; var Importe = 0;
var Comision = 0.00; var Comision = 0.00;
var topLevelElem = document.getElementById("form1"); var topLevelElem = document.getElementById("form1");
@@ -614,8 +614,6 @@
} }
function FnCambia(chk, txt, saldo, op, pagoMultiple, monedaPago) { function FnCambia(chk, txt, saldo, op, pagoMultiple, monedaPago) {
debugger;
if (op == 1) { if (op == 1) {
if (txt.value != '') { if (txt.value != '') {
chk.checked = true; chk.checked = true;
@@ -650,9 +648,20 @@
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaConversion, 2) + ' MXN'; $get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaConversion, 2) + ' MXN';
} }
} }
function FnSeleccionaNC(chk, chkNC)
{
if (chk.checked) {
chkNC.disabled = false;
chkNC.click();
} else {
chkNC.disabled = true;
if (chkNC.checked) {
chkNC.click();
}
}
}
function FnLimites(chk, txt, limiteInferior, limiteSuperior) { function FnLimites(chk, txt, limiteInferior, limiteSuperior) {
debugger;
if (ToDouble(txt.value) < limiteInferior) { if (ToDouble(txt.value) < limiteInferior) {
txt.value = limiteInferior; txt.value = limiteInferior;
alert("El Importe no debe de exceder a el saldo"); alert("El Importe no debe de exceder a el saldo");
@@ -674,11 +683,8 @@
} }
function CambiaPesosDolares() { function CambiaPesosDolares() {
debugger;
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2); $get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2)) $('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
debugger;
if ($("#LbImporteME").length) { if ($("#LbImporteME").length) {
$get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' USD'; $get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' USD';
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value) * ToDouble($get('TxtTC').value), 2); $get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value) * ToDouble($get('TxtTC').value), 2);
@@ -691,12 +697,12 @@
} }
function CambiaDolaresPesos() { function CambiaDolaresPesos() {
debugger;
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2); $get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2)) $('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
debugger;
if ($("#LbImporteMN").length) { if ($("#LbImporteMN").length) {
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' MXN'; $get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' MXN';
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTCDolares').value), 2); $get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTCDolares').value), 2);
@@ -743,7 +749,7 @@
for (var i = 0; i < textBoxes.length; i++) { for (var i = 0; i < textBoxes.length; i++) {
if (textBoxes[i].type == "checkbox") { if (textBoxes[i].type == "checkbox") {
debugger;
if (textBoxes[i].id == "ChkAll") { if (textBoxes[i].id == "ChkAll") {
check = !textBoxes[i].checked; check = !textBoxes[i].checked;

View File

@@ -615,8 +615,11 @@ Partial Class Ventas_ClientesAbonar
End Select End Select
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnSeleccionaNC({5},{6});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("ChkGenerarNC").ClientID))
Else
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda)) e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda))
End If
If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then
If e.Row.DBCampo("TipoDocto") = "Rem" Then If e.Row.DBCampo("TipoDocto") = "Rem" Then
@@ -1585,6 +1588,7 @@ Partial Class Ventas_ClientesAbonar
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If MsgError = "" Then If MsgError = "" Then
If ListaFacturasGenerarNC.Count > 0 Then
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaFacturasGenerarNC) Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaFacturasGenerarNC)
If Resp.CveVenta > 0 Then If Resp.CveVenta > 0 Then
NCGeneradas.Add(Resp) NCGeneradas.Add(Resp)
@@ -1593,6 +1597,7 @@ Partial Class Ventas_ClientesAbonar
End If End If
End If End If
End If End If
End If
If MsgError = "" Then If MsgError = "" Then
'se agregan las pólizas de Armonización Contable 'se agregan las pólizas de Armonización Contable
@@ -1911,7 +1916,7 @@ Partial Class Ventas_ClientesAbonar
ObjFacturaDevolucion.DtVentasNC = DtVentasNC ObjFacturaDevolucion.DtVentasNC = DtVentasNC
ObjFacturaDevolucion.GenerarPDFFactura = True ObjFacturaDevolucion.GenerarPDFFactura = True
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Trasac:=Trasac, ObjContPaqTransac:=ObjConta) Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=Trasac, ObjContPaqTransac:=ObjConta)
Return Resp Return Resp
End Function End Function

View File

@@ -2333,7 +2333,6 @@
<div id="DivNumeroCPCliente" runat="server" visible="false" class="row" style="padding-left: 16px;"> <div id="DivNumeroCPCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-4"> <div class="form-group form-md-line-input input-iconright col-xs-4">
<asp:TextBox ID="TxtCPCliente" CssClass="form-control " runat="server" MaxLength="5" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtCPCliente" CssClass="form-control " runat="server" MaxLength="5" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="TxtCPCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código Postal''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtCPCliente.ClientID.ToString()%>">Código Postal:</label> <label for="<%= TxtCPCliente.ClientID.ToString()%>">Código Postal:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright col-xs-4"> <div class="form-group form-md-line-input input-iconright col-xs-4">
@@ -2354,7 +2353,6 @@
</div> </div>
<div class="form-group form-md-line-input input-iconright col-xs-6"> <div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTelefonoCliente" runat="server" ControlToValidate="TxtTelefonoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label> <label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label>
</div> </div>
</div> </div>
@@ -2385,8 +2383,6 @@
<div id="DivCorreoCuentaCliente" runat="server" visible="false" class="row" style="padding-left: 16px;"> <div id="DivCorreoCuentaCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-6"> <div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:TextBox ID="TxtCorreoCliente" CssClass="form-control" runat="server" MaxLength="300" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtCorreoCliente" CssClass="form-control" runat="server" MaxLength="300" CausesValidation="true"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtCorreoCliente" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardarCliente"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtCorreoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtCorreoCliente.ClientID.ToString()%>">Email: </label> <label for="<%= TxtCorreoCliente.ClientID.ToString()%>">Email: </label>
<i></i> <i></i>
</div> </div>

View File

@@ -5323,7 +5323,7 @@ Partial Class PV
TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}." TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}."
TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero
TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero 'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero
Else Else
Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia) Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia)
'cuando no está registrada, no da ajuste 'cuando no está registrada, no da ajuste

View File

@@ -117,6 +117,7 @@
<asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />--%> <asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:BoundField HeaderText="Comisión $" DataField="ComisionGanancia" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Comisión $" DataField="ComisionGanancia" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Importe Cobrado" DataField="Cobrado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Importe Cobrado" DataField="Cobrado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Comisión Cobrada $" DataField="ComisionCobrada" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Pendiente x Cobrar" DataField="Pendiente" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Pendiente x Cobrar" DataField="Pendiente" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Total al Dia" DataField="PendienteXDia" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Total al Dia" DataField="PendienteXDia" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns> </Columns>
@@ -191,11 +192,12 @@
<div class="modal-body"> <div class="modal-body">
<asp:UpdatePanel ID="UpPorcentajeComisiones" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpPorcentajeComisiones" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row"> <%-- <div class="row">
<label class="col-md-2 truncate">Vendedor:</label> <label class="col-md-2 truncate">Vendedor:</label>
<div class="col-md-5"> <div class="col-md-5">
<asp:DropDownList ID="DdlVendedorPorcentaje" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DdlVendedorPorcentaje_SelectedIndexChanged" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%"> <asp:DropDownList ID="DdlVendedorPorcentaje" AutoPostBack="true" AppendDataBoundItems="true" runat="server" OnSelectedIndexChanged="DdlVendedorPorcentaje_SelectedIndexChanged" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Todos" Value="-2"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPorcentajeVendedor" runat="server" ControlToValidate="DdlVendedorPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpPorcentajeComision"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVPorcentajeVendedor" runat="server" ControlToValidate="DdlVendedorPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpPorcentajeComision"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeVendedor" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEPorcentajeVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeVendedor" Width="350px"></ajax:ValidatorCalloutExtender>
@@ -208,11 +210,11 @@
<asp:RequiredFieldValidator ID="RFVPorcentajeComision" runat="server" ControlToValidate="TxtPorcentajeComision" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje''</b> es necesario. Por favor seleccione uno." InitialValue="" ValidationGroup="GrpPorcentajeComision"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVPorcentajeComision" runat="server" ControlToValidate="TxtPorcentajeComision" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje''</b> es necesario. Por favor seleccione uno." InitialValue="" ValidationGroup="GrpPorcentajeComision"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeComision" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeComision" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEPorcentajeComision" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeComision" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>--%>
<div class="row"> <div class="row">
<label class="col-md-2 truncate">Mes:</label> <label class="col-md-2 truncate">Mes:</label>
<div class="col-md-5"> <div class="col-md-5">
<asp:DropDownList ID="DdlMes" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlMes_SelectedIndexChanged" CssClass="select2me" Width="100%"> <asp:DropDownList ID="DdlMes" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem> <asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem> <asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem> <asp:ListItem Text="Marzo" Value="3"></asp:ListItem>

View File

@@ -35,8 +35,8 @@ Partial Class Ventas_RepComisiones
DdlVendedorAjuste.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedorAjuste.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedorAjuste.DataBind() DdlVendedorAjuste.DataBind()
DdlVendedorPorcentaje.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) 'DdlVendedorPorcentaje.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedorPorcentaje.DataBind() 'DdlVendedorPorcentaje.DataBind()
End Sub End Sub
@@ -205,65 +205,59 @@ Partial Class Ventas_RepComisiones
#End Region #End Region
Protected Sub BtnGuardarPorcentajeComision_Click(sender As Object, e As EventArgs) Protected Sub BtnGuardarPorcentajeComision_Click(sender As Object, e As EventArgs)
Dim CveVendedor As Integer = DdlVendedorPorcentaje.SelectedValue.ToEntero() Dim RowCierre As DataRow = Nothing
Dim TieneError As Boolean = False
Dim ObjVentas As New ClsVentas
Try
ObjVentas.IniciaTransacSQL()
Dim Mes As Integer = DdlMes.SelectedValue.ToEntero() Dim Mes As Integer = DdlMes.SelectedValue.ToEntero()
Dim Anio As Integer = TxtAnio.Text.ToEntero() Dim Anio As Integer = TxtAnio.Text.ToEntero()
Dim Porcentaje As Decimal = TxtPorcentajeComision.Text.ToDecimal() / 100 For Each GvRow As GridViewRow In GvDatos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Dim RowCierre As DataRow = Nothing If GvRow.DataKey("CveVendedor").ToEntero() > 0 Then
Dim ObjVentas As New ClsVentas Dim Porcentaje As Decimal = GvRow.DataKey("Comision").ToDecimal() / 100
Try
If ObjVentas.GetCierreComisionVendedor(CveVendedor, Mes, Anio, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.GetCierreComisionVendedor(GvRow.DataKey("CveVendedor").ToEntero(), Mes, Anio, UsuarioActual.CveEmpresa) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
RowCierre = ObjVentas.DtResultados.Rows(0) RowCierre = ObjVentas.DtResultados.Rows(0)
End If End If
Else
TieneError = True
End If
If RowCierre IsNot Nothing Then If RowCierre IsNot Nothing Then
If ObjVentas.UpdateCierreComisionVendedor(CveVendedor, Mes, Anio, Porcentaje) Then TieneError = Not ObjVentas.UpdateCierreComisionVendedor(GvRow.DataKey("CveVendedor").ToEntero(), Mes, Anio, Porcentaje)
Alert("El porcentaje de comisiones se guardo correctamente.", TipoMensaje.MsgInformacion)
Else Else
Alert("Ocurrió un error al guardar el porcentaje de comisiones.", TipoMensaje.MsgError) TieneError = Not ObjVentas.AddCierreComisionVendedor(GvRow.DataKey("CveVendedor").ToEntero(), Mes, Anio, Porcentaje)
End If End If
Else
If ObjVentas.AddCierreComisionVendedor(CveVendedor, Mes, Anio, Porcentaje) Then If TieneError Then
Alert("El porcentaje de comisiones se guardo correctamente.", TipoMensaje.MsgInformacion) Exit For
Else
Alert("Ocurrió un error al guardar el porcentaje de comisiones.", TipoMensaje.MsgError)
End If End If
End If End If
RowCierre = Nothing
End If
Next
Catch ex As Exception Catch ex As Exception
TieneError = True
OnError("Ocurrió un error al asginar el porcentaje de la comisión", ex) OnError("Ocurrió un error al asginar el porcentaje de la comisión", ex)
End Try End Try
ObjVentas.Dispose() If TieneError Then
ObjVentas.RollBack()
UpPorcentajeComisiones.Update() Alert("Ocurrió un error al guardar el porcentaje de comisiones.", TipoMensaje.MsgError)
End Sub
Protected Sub DdlVendedorPorcentaje_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPorcentajeComisiones()
End Sub
Protected Sub DdlMes_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPorcentajeComisiones()
End Sub
Protected Sub CargaPorcentajeComisiones()
Dim CveVendedor As Integer = DdlVendedorPorcentaje.SelectedValue.ToEntero()
Dim Mes As Integer = DdlMes.SelectedValue.ToEntero()
Dim Anio As Integer = TxtAnio.Text.ToEntero()
Dim RowCierre As DataRow = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetCierreComisionVendedor(CveVendedor, Mes, Anio, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
RowCierre = ObjVentas.DtResultados.Rows(0)
End If
ObjVentas.Dispose()
If RowCierre IsNot Nothing Then
TxtPorcentajeComision.Text = (RowCierre("PorcentajeComision").ToString().ToDecimal() * 100).FormatoNumero(0)
Else Else
TxtPorcentajeComision.Text = "0" ObjVentas.Commit()
Alert("El porcentaje de comisiones se guardó correctamente.", TipoMensaje.MsgInformacion)
End If End If
ObjVentas.Dispose()
CargaDatos()
UPDatos.Update()
UpPorcentajeComisiones.Update() UpPorcentajeComisiones.Update()
End Sub End Sub
End Class End Class

View File

@@ -126,6 +126,9 @@
<asp:HyperLink ID="HLGanancia" Target="_blank" Text='<%# Eval("ComisionGanancia", "{0:N2}") %>' runat="server" /> <asp:HyperLink ID="HLGanancia" Target="_blank" Text='<%# Eval("ComisionGanancia", "{0:N2}") %>' runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Porcentaje Pagado %" DataField="PorcentajePagado" DataFormatString="{0:N2}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Comision Cobrada %" DataField="PorcentajeComision" DataFormatString="{0:N2}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Comision Cobrada" DataField="ComisionCobrada" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<%--<asp:BoundField HeaderText="Comision Ganancia" DataField="ComisionGanancia" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />--%> <%--<asp:BoundField HeaderText="Comision Ganancia" DataField="ComisionGanancia" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />--%>
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -1304,7 +1304,7 @@
<ContentTemplate> <ContentTemplate>
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvCodigosUnicos" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" <asp:GridView ID="GvCodigosUnicos" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False"
DataKeyNames="CvePolizaVirtual,SerieLote,IdProductoPolizaVirtual,Total,Descuento,AnioVehiculo,FechaUsado,IdModeloAuto,IdMarcaAuto,IdBCI,TipoServicio,TipoPoliza,TieneUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None"> DataKeyNames="CvePolizaVirtual,SerieLote,IdProductoPolizaVirtual,Total,Descuento,AnioVehiculo,FechaUsado,IdModeloAuto,IdMarcaAuto,IdBCI,TipoServicio,TipoPoliza,TieneUsado,IdMarcaUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Código Único"> <asp:TemplateField HeaderText="Código Único">
<ItemTemplate> <ItemTemplate>

View File

@@ -9217,9 +9217,13 @@ Partial Class Ventas
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False), DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble) Then Kilometraje:=TxtKilometraje.Text.ToDouble) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev") Or DtVentasNC IsNot Nothing Then
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
End If
End If
End If End If
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then
@@ -17025,7 +17029,19 @@ Partial Class Ventas
Dim total As Decimal = TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal + TxtImporteTransferencia.Text.ToDecimal Dim total As Decimal = TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal + TxtImporteTransferencia.Text.ToDecimal
DtPagos = Nothing DtPagos = Nothing
InicializaCondicionesPago()
DtPagos = New DataTable
DtPagos.Columns.Add("CveTipoMovimiento", GetType(String))
DtPagos.Columns.Add("TipoMovimiento", GetType(String))
DtPagos.Columns.Add("CveCuenta", GetType(String))
DtPagos.Columns.Add("Cuenta", GetType(String))
DtPagos.Columns.Add("Folio", GetType(String))
DtPagos.Columns.Add("Importe", GetType(Decimal))
DtPagos.Columns.Add("Observaciones", GetType(String))
DtPagos.Columns.Add("Tipo", GetType(String))
DtPagos.Columns.Add("CveMetodoPago", GetType(Integer))
DtPagos.Columns.Add("MesesSinIntereses", GetType(Integer))
If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub
@@ -21164,7 +21180,7 @@ Partial Class Ventas
Into x = Group Into x = Group
Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal), Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal),
ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal), ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal),
ImporteIVA = x.Sum(Function(s) Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)), ' Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA, ImporteIVA = x.Sum(Function(s) (s("ImporteIVA").ToString.ToDecimal)).RoundSQL(2), ' Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA,
ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImporteRetIVA").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA, ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImporteRetIVA").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA,
ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImporteRetISR").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR, ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImporteRetISR").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR,
ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImporteIEPS").ToString.ToDecimal, 2)), 'Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS, ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImporteIEPS").ToString.ToDecimal, 2)), 'Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS,
@@ -21302,6 +21318,7 @@ Partial Class Ventas
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100 Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
Dim FiltroStr As String = "" Dim FiltroStr As String = ""
Dim importePuTemp As Decimal = 0 Dim importePuTemp As Decimal = 0
For Each Dr As DataRow In DtImpuestosLocal.Rows For Each Dr As DataRow In DtImpuestosLocal.Rows
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto")) FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto"))
importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr))).ToDecimal importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr))).ToDecimal
@@ -21320,6 +21337,8 @@ Partial Class Ventas
'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2) 'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2)
Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal.RoundSQL(2) '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal.RoundSQL(2) '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal)
Next Next
'codigo para ajuste de centavo, si el importe total no cuadra con los totales 'codigo para ajuste de centavo, si el importe total no cuadra con los totales
Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR")) Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR"))
If Math.Abs(difTmp) >= 0.01 Then If Math.Abs(difTmp) >= 0.01 Then
@@ -24074,7 +24093,7 @@ Partial Class Ventas
If obj.used_product Then If obj.used_product Then
Dim FechaUsado As DateTime = Row.DataKey("FechaUsado").ToString().ToDateTime() Dim FechaUsado As DateTime = Row.DataKey("FechaUsado").ToString().ToDateTime()
obj.used_brand = Row.DataKey("IdModelo").ToString().Trim() 'MARCAR DEL USADO obj.used_brand = Row.DataKey("IdMarcaUsado").ToString().Trim() 'MARCAR DEL USADO
obj.used_bci = Row.DataKey("IdBCI").ToString().Trim() 'VALOR DEL BCI obj.used_bci = Row.DataKey("IdBCI").ToString().Trim() 'VALOR DEL BCI
obj.used_month = FechaUsado.Month obj.used_month = FechaUsado.Month
obj.used_year = FechaUsado.Year obj.used_year = FechaUsado.Year