This commit is contained in:
2021-02-11 15:33:54 -07:00
23 changed files with 723 additions and 106 deletions

View File

@@ -385,12 +385,13 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div style="overflow-y: auto; height: 400px; width: 1200px;" runat="server"> <div style="overflow-y: auto; height: 400px; width: 1200px;" runat="server">
<asp:GridView ID="GvGarantiasDetalle" runat="server" AutoGenerateColumns="false" Width="100%" EmptyDataText="No se encontraron datos" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None"> <asp:GridView ID="GvGarantiasDetalle" runat="server" AutoGenerateColumns="false" Width="100%" EmptyDataText="No se encontraron datos" CssClass="table table-striped table-hover Widthall"
DataKeyNames="Consecutivo,CodigoCliente,CodigoProducto,CodigoTipoUso,CodigoTipoDefecto,CodigoEnsamble,CodigoLinea,CodigoInspeccion,FechaVenta,FechaReclamacion,TipoComprobante,Comprobante,Autorizo,Comentarios,ClaveAutorizacion" BorderColor="#D3D3D3" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="Consecutivo" HeaderText="Consecutivo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" /> <asp:BoundField DataField="Consecutivo" HeaderText="Consecutivo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="FolioFactura" HeaderText="Factura" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" /> <asp:BoundField DataField="FolioFactura" HeaderText="Factura" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" /> <asp:BoundField DataField="Cliente" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" /> <asp:BoundField DataField="CodigoProducto" HeaderText="Código" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="PS" HeaderText="Producto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" /> <asp:BoundField DataField="PS" HeaderText="Producto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:BoundField DataField="TipoUso" HeaderText="Tipo Uso" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" /> <asp:BoundField DataField="TipoUso" HeaderText="Tipo Uso" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="CodigoEnsamble" HeaderText="Código Ensamble" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" /> <asp:BoundField DataField="CodigoEnsamble" HeaderText="Código Ensamble" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
@@ -408,9 +409,13 @@
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnGenerarTxt" Text="Generar Archivo" CssClass="btn btn-primary" runat="server" OnClick="BtnGenerarTxt_Click" />
<asp:Button ID="BtnExportarExcel" Text="Generar Excel" CssClass="btn btn-success" runat="server" OnClick="BtnExportarExcel_Click" /> <asp:Button ID="BtnExportarExcel" Text="Generar Excel" CssClass="btn btn-success" runat="server" OnClick="BtnExportarExcel_Click" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate> </ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnGenerarTxt" />
</Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>

View File

@@ -255,4 +255,54 @@ Partial Class Acumuladores_CatFoliosGarantia
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub End Sub
Protected Sub BtnGenerarTxt_Click(sender As Object, e As EventArgs)
Dim SbTxt As New StringBuilder
For Each GvRow As GridViewRow In GvGarantiasDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
'1.- Consecutivo Partida-->1
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Consecutivo"))
'2.- Cliente-->100407
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoCliente"))
'3. Codigo De Articulo --> 171402
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoProducto"))
'4. Tipo De Uso --> A
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoUso"))
'5. Defecto --> P
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoTipoDefecto"))
'6. Codigo De Ensamble --> 1X
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoEnsamble"))
'7. Codigo De Linea/Termico --> 9000
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoLinea"))
'8. Codigo De Inspeccion --> J8K
SbTxt.AppendFormat("{0}@", GvRow.DataKey("CodigoInspeccion"))
'9. Fecha De Venta --> 05/09/2009
SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaVenta").ToDateTime().ToString("dd/MM/yyyy"))
'10. Fecha De Reclamacion --> 05/07/2010
SbTxt.AppendFormat("{0}@", GvRow.DataKey("FechaReclamacion").ToDateTime().ToString("dd/MM/yyyy"))
'11. TipoComprobante --> 1
SbTxt.AppendFormat("{0}@", GvRow.DataKey("TipoComprobante"))
'12. Comprobante --> N/A
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comprobante"))
'13. Autorizo --> STAN7490
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Autorizo"))
'14. Comentarios --> Cliente 100407
SbTxt.AppendFormat("{0}@", GvRow.DataKey("Comentarios"))
'15. Clave De Autorizacion / Codigo Error --> P05TRBGX
SbTxt.AppendFormat("{0}", GvRow.DataKey("ClaveAutorizacion"))
SbTxt.Append(vbCrLf)
End If
Next
Dim text As String = SbTxt.ToString
Response.Clear()
Response.ClearHeaders()
Response.AddHeader("Content-Length", text.Length.ToString)
Response.ContentType = "text/plain"
Response.AppendHeader("content-disposition", $"attachment;filename=""{LblFolio.Text}.txt""")
Response.Write(text)
Response.End()
End Sub
End Class End Class

View File

@@ -365,6 +365,11 @@ Public Class CFDINominaOtrosPagos
Public Property Concepto As String Public Property Concepto As String
Public Property Importe As Decimal Public Property Importe As Decimal
Public Property Subsidiocausado As Decimal Public Property Subsidiocausado As Decimal
Public Property RemanenteSalFav As Decimal
Public Property ejercicio As Integer
Public Property SaldoAFavor As Integer
End Class End Class

View File

@@ -36,6 +36,8 @@ Public Class ClsPaginas
Public Shared Property EmpresaNotificaciones() As Empresa Public Shared Property EmpresaNotificaciones() As Empresa
Public Shared Property EmpresaNotificacionesGPS() As Empresa
Public ReadOnly Property EsProduccion As Boolean Public ReadOnly Property EsProduccion As Boolean

View File

@@ -221,7 +221,7 @@ Public Class ClsSisNotificaciones
Try Try
Dim ResultadoMail As Integer = 0 Dim ResultadoMail As Integer = 0
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then
ObjNotificacion.UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1) ObjNotificacion.UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If End If
Catch ex As Exception Catch ex As Exception

View File

@@ -4202,13 +4202,14 @@ Public Class ClsVentas
Return retorno Return retorno
End Function End Function
Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer) As Boolean Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer, CvePrePoliza As Integer) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
DataAdapter("PA_Vta_TraspasaVentasAplicadasAnt", CommandType.StoredProcedure) DataAdapter("PA_Vta_TraspasaVentasAplicadasAnt", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva .Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva
.Add("@CveVentaAnterior", SqlDbType.Int).Value = CveVentaAnterior .Add("@CveVentaAnterior", SqlDbType.Int).Value = CveVentaAnterior
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -145,8 +145,17 @@ Public Class LogicNominas
If continuar AndAlso objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then If continuar AndAlso objNomina.GetNom_NominasDetalles(CveNomina, CvePersonal, CvePeriodo, "-1") Then
If objNomina.DtResultados.Rows.Count > 0 Then If objNomina.DtResultados.Rows.Count > 0 Then
DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 AND SoloVisible =0") DtPercepciones = objNomina.DtResultados.FiltraParametros("Tipo = 'P' AND EsPadre = 1 AND SoloVisible =0")
DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0") DtDeducciones = objNomina.DtResultados.FiltraParametros("Tipo = 'D' AND EsPadre = 1 AND SoloVisible =0 AND (TipoConceptoSAT<>'O' OR TipoConceptoSAT IS NULL)")
DtOtrosPagos = objNomina.DtResultados.FiltraParametros(" TipoConceptoSAT='O'") DtOtrosPagos = objNomina.DtResultados.FiltraParametros(" TipoConceptoSAT='O'")
Dim disrcomp As DataRow = DtOtrosPagos.FiltroPrimero("Codigo ='D999'")
For Each drow As DataRow In DtDeducciones.Rows
If drow("Codigo").ToString() = "D038" Then
End If
Next
TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal() TotalPercepciones = DtPercepciones.SUM("Importe").ToString().ToDecimal()
TotalDeducciones = DtDeducciones.SUM("Importe").ToString().ToDecimal() TotalDeducciones = DtDeducciones.SUM("Importe").ToString().ToDecimal()
Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal) Total = CType((Total + DtPercepciones.SUM("Importe")), Decimal)
@@ -230,7 +239,7 @@ Public Class LogicNominas
.ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()}) .ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()})
End If End If
'RMF, falta poner el numero de horas pagadas 'RMF, falta poner el numero de horas pagadas
If Row("CveSATConcepto").ToString().ToEntero() = 19 AndAlso DtHorasExtras IsNot Nothing Then 'cuando son horas extras If Row("SATCveConcepto").ToString().ToEntero() = 19 AndAlso DtHorasExtras IsNot Nothing Then 'cuando son horas extras
'Obtengo el desglose de horas extras 'Obtengo el desglose de horas extras
Dim dr As DataRow = DtHorasExtras.FiltroPrimero("") Dim dr As DataRow = DtHorasExtras.FiltroPrimero("")
If dr IsNot Nothing Then If dr IsNot Nothing Then
@@ -256,7 +265,7 @@ Public Class LogicNominas
ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), ObjPercepciones.Add(New CFDINominaPercepciones With {.TipoPercepcion = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()}) .ImporteGravado = Row("ImporteGravado").ToString().ToDecimal(), .ImporteExento = Row("ImporteExento").ToString().ToDecimal()})
ElseIf Row("Importe").ToString().ToDecimal() < 0 AndAlso Row("Concepto").ToString() = "Ajuste al neto" Then ElseIf Row("Importe").ToString().ToDecimal() < 0 AndAlso Row("Concepto").ToString() = "Ajuste al neto" Then ' corregir
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "999", .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "999", .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal() * -1}) .Importe = Row("Importe").ToString().ToDecimal() * -1})
Else Else
@@ -279,12 +288,14 @@ Public Class LogicNominas
If DtOtrosPagos IsNot Nothing AndAlso DtOtrosPagos.Rows.Count > 0 Then If DtOtrosPagos IsNot Nothing AndAlso DtOtrosPagos.Rows.Count > 0 Then
For Each Row As DataRow In DtOtrosPagos.Rows For Each Row As DataRow In DtOtrosPagos.Rows
If (Row("Importe").ToString().ToDecimal() > 0) OrElse (Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 2 AndAlso Row("Importe").ToString().ToDecimal() < 0) Then If (Row("Importe").ToString().ToDecimal() > 0) OrElse
(Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 2 AndAlso (CveRegimenContratacion.ToEntero() = 2 OrElse Row("Importe").ToString().ToDecimal() <> 0)) OrElse
(Row("SATCveConcepto").ToString().ToEntero().ToEntero().Contiene(2, 4) AndAlso Row("Importe").ToString().ToDecimal() < 0) Then
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
Dim otrp = New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteGravado").ToString().ToDecimal().Abs()}
.Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteGravado").ToString().ToDecimal().Abs()}) ObjOtrosPagos.Add(otrp)
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 7 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 7 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio

View File

@@ -2652,7 +2652,7 @@ Namespace Modelos
Case 11 'Anticipo Case 11 'Anticipo
'[IPP] SI ES REFACTURACION LOS ANTICIPOS NO LOS DEBE APLICAR EN EL INGRESO REFACTURADO (VIEJO) '[IPP] SI ES REFACTURACION LOS ANTICIPOS NO LOS DEBE APLICAR EN EL INGRESO REFACTURADO (VIEJO)
If NuevaFactura = 1 And ObjFactura.CveVenta = CveDevolucion Then If CveEstatusRefacturacion > 0 Then
Exit Select Exit Select
End If End If
@@ -4458,6 +4458,10 @@ Namespace Modelos
Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion) Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion)
If Not EsRefacturacion Then
CveEstatusRefacturacion = 0
End If
Dim CancelacionFecha As Date Dim CancelacionFecha As Date
Dim FolioFiscal As String = ObjFactura.FolioFiscal Dim FolioFiscal As String = ObjFactura.FolioFiscal
Dim CancelacionAcuse As String = "" Dim CancelacionAcuse As String = ""
@@ -4485,7 +4489,7 @@ Namespace Modelos
If CveEstatusFacturaAsignado <= 0 Then If CveEstatusFacturaAsignado <= 0 Then
Try Try
If ObjFactura.FolioFiscal <> "" Then If ObjFactura.FolioFiscal <> "" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then
'VERIFICA SI DEBE VALIDAR ANTE EL SAT 'VERIFICA SI DEBE VALIDAR ANTE EL SAT

View File

@@ -1987,7 +1987,7 @@ Public Class Timbrado
'cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd") 'cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd")
cfdi.Nomina12(ObjCFDITimbre.Nomina.TipoNomina, ObjCFDITimbre.Nomina.FechaPago.ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaInicio.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaFin.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.NumDiasPagados, If(ObjCFDITimbre.Nomina.Percepciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Percepciones.Count > 0, ObjCFDITimbre.Nomina.TotalPercepciones, 0), If(ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0, ObjCFDITimbre.Nomina.TotalDeducciones, 0), If(ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing AndAlso ObjCFDITimbre.Nomina.OtrosPagos.Count > 0, ObjCFDITimbre.Nomina.TotalOtrosPagos, 0)) cfdi.Nomina12(ObjCFDITimbre.Nomina.TipoNomina, ObjCFDITimbre.Nomina.FechaPago.ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaInicio.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaFin.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.NumDiasPagados, If(ObjCFDITimbre.Nomina.Percepciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Percepciones.Count > 0, ObjCFDITimbre.Nomina.TotalPercepciones, 0), If(ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0, ObjCFDITimbre.Nomina.TotalDeducciones, 0), If(ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing AndAlso ObjCFDITimbre.Nomina.OtrosPagos.Count > 0, ObjCFDITimbre.Nomina.TotalOtrosPagos, 0))
cfdi.Nomina12Emisor(ObjCFDITimbre.Emisor.CURP, If(ObjCFDITimbre.Nomina.Receptor.TipoContrato = "99", "", ObjCFDITimbre.Emisor.RegistroPatronal), ObjCFDITimbre.Emisor.RFC) cfdi.Nomina12Emisor(ObjCFDITimbre.Emisor.CURP, If(ObjCFDITimbre.Nomina.Receptor.TipoContrato.Contiene("09", "10", "99"), "", ObjCFDITimbre.Emisor.RegistroPatronal), ObjCFDITimbre.Emisor.RFC)
If UsuarioActual.Empresa.UsaAC Then cfdi.Nomina12EntidadSNCF("IF", 90) If UsuarioActual.Empresa.UsaAC Then cfdi.Nomina12EntidadSNCF("IF", 90)
@@ -2029,6 +2029,11 @@ Public Class Timbrado
Next Next
End If End If
If ObjCFDITimbre.Nomina.HorasExtras IsNot Nothing AndAlso ObjCFDITimbre.Nomina.HorasExtras.Count > 0 Then
For Each HoraExtra As CFDINominaHorasExtras In ObjCFDITimbre.Nomina.HorasExtras
cfdi.Nomina12HorasExtra(HoraExtra.Dias.ToEntero, HoraExtra.TipoHoras, HoraExtra.HorasExtra, HoraExtra.ImportePagado)
Next
End If
'deducciones al final 'deducciones al final
If ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0 Then If ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0 Then
cfdi.Nomina12Deducciones(ObjCFDITimbre.Nomina.TotalDeduccionesOtras, Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos, 2)) cfdi.Nomina12Deducciones(ObjCFDITimbre.Nomina.TotalDeduccionesOtras, Math.Round(ObjCFDITimbre.Nomina.TotalDeduccionesImpuestosRetenidos, 2))
@@ -2037,11 +2042,6 @@ Public Class Timbrado
Next Next
End If End If
If ObjCFDITimbre.Nomina.HorasExtras IsNot Nothing AndAlso ObjCFDITimbre.Nomina.HorasExtras.Count > 0 Then
For Each HoraExtra As CFDINominaHorasExtras In ObjCFDITimbre.Nomina.HorasExtras
cfdi.Nomina12HorasExtra(HoraExtra.Dias.ToEntero, HoraExtra.TipoHoras, HoraExtra.HorasExtra, HoraExtra.ImportePagado)
Next
End If
If ObjCFDITimbre.Nomina.Incapacidades IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Incapacidades.Count > 0 Then If ObjCFDITimbre.Nomina.Incapacidades IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Incapacidades.Count > 0 Then
For Each Incap As CFDINominaIncapacidades In ObjCFDITimbre.Nomina.Incapacidades For Each Incap As CFDINominaIncapacidades In ObjCFDITimbre.Nomina.Incapacidades
@@ -2059,6 +2059,12 @@ Public Class Timbrado
cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado) cfdi.Nomina12SubsidioAlEmpleo(otpag.Subsidiocausado)
End If End If
If otpag.TipoOtroPago = "004" AndAlso otpag.Importe > 0 Then
If otpag.ejercicio > 0 Then
cfdi.CompensacionSaldosAFavor(otpag.Importe, otpag.ejercicio, otpag.RemanenteSalFav) 'otpag.SaldoAFavor
End If
End If
Next Next
End If End If
End If End If

View File

@@ -231,6 +231,15 @@
<asp:Literal ID="LtlTotalIngreso" runat="server" Text='<%# Eval("TotalIngresos", "{0:N2}") %>'></asp:Literal> <asp:Literal ID="LtlTotalIngreso" runat="server" Text='<%# Eval("TotalIngresos", "{0:N2}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Label Text="Devoluciones" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlDevoluciones" runat="server" Text='<%# Eval("Devoluciones", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate> <HeaderTemplate>
<asp:Label Text="Total Caja" runat="server" CausesValidation="false"> </asp:Label> <asp:Label Text="Total Caja" runat="server" CausesValidation="false"> </asp:Label>

View File

@@ -7083,10 +7083,10 @@ Partial Class Compras_Compras
End If End If
End If End If
If CveCompraRefacturacion > 0 Then 'If CveCompraRefacturacion > 0 Then
importeMovimiento = 0 ' importeMovimiento = 0
importeMN = 0 ' importeMN = 0
End If ' End If
Case 59 'Documentos Case 59 'Documentos

View File

@@ -1327,7 +1327,7 @@ Partial Class PopUpVerFactura
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO 'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero() CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero()
If CveConcepto.Contiene(2, 3, 26, 27) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then If CveConcepto.Contiene(2, 3, 26, 27) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual") FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
@@ -1361,7 +1361,7 @@ Partial Class PopUpVerFactura
If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
DtMovimientos = ObjInventarios.DtResultados.Copy() DtMovimientos = ObjInventarios.DtResultados.Copy()
CantidadProductos = DtMovimientos.SUM("Cantidad").ToDecimal() CantidadProductos = DtMovimientos.SUM("Cantidad").ToDecimal()
If UsuarioActual.CveEmpresa = 140 AndAlso CveMovimientoRelacionado > 0 Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveMovimientoRelacionado > 0 Then
If ObjInventarios.GetMovimientos(CveMovimientoRelacionado, -1, -1, UsuarioActual.CveEmpresa) Then If ObjInventarios.GetMovimientos(CveMovimientoRelacionado, -1, -1, UsuarioActual.CveEmpresa) Then
Dim CveAlmacenRelacionado As Integer = ObjInventarios.CveAlmacen Dim CveAlmacenRelacionado As Integer = ObjInventarios.CveAlmacen
Dim CveTipoAlmacenRelacionado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenRelacionado}").ToString.ToEntero Dim CveTipoAlmacenRelacionado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenRelacionado}").ToString.ToEntero
@@ -1393,7 +1393,7 @@ Partial Class PopUpVerFactura
End If End If
End If End If
If UsuarioActual.CveEmpresa = 140 AndAlso CveCompra > 0 Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCompra > 0 Then
If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0") Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0")
If DtFaltante.Rows.Count > 0 Then If DtFaltante.Rows.Count > 0 Then

View File

@@ -3,6 +3,7 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<link href="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.css" rel="stylesheet" />
<style> <style>
html, body { html, body {
width: 100%; width: 100%;
@@ -26,6 +27,138 @@
.pac-container.pac-logo { .pac-container.pac-logo {
z-index: 100000; z-index: 100000;
} }
#showdiv1 {
left: 0 !important;
width: 100% !important;
}
#ShowDiv3:hover {
line-height: 34px !important;
-webkit-transition: line-height ease 1s;
-moz-transition: line-height ease 1s;
-o-transition: line-height ease 1s;
transition: line-height ease 1s;
}
.ADScroller-body {
max-height: 400px;
}
.pac-container.pac-logo {
z-index: 100000;
}
#iw-container {
margin-bottom: 10px;
}
#iw-container .iw-title {
font-family: 'Open Sans Condensed', sans-serif;
font-size: 22px;
font-weight: 400;
padding: 10px;
background-color: #48b5e9;
color: white;
margin: 0;
border-radius: 2px 2px 0 0;
}
#iw-container .iw-content {
font-size: 13px;
line-height: 18px;
font-weight: 400;
margin-right: 1px;
padding: 15px 5px 20px 15px;
max-height: 140px;
overflow-y: auto;
overflow-x: hidden;
}
.iw-content img {
float: right;
margin: 0 5px 5px 10px;
}
.iw-subTitle {
font-size: 16px;
font-weight: 700;
padding: 5px 0;
}
.iw-bottom-gradient {
position: absolute;
width: 326px;
height: 25px;
bottom: 10px;
right: 18px;
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
}
.modal.fade:not(.in).left .modal-dialog {
-webkit-transform: translate3d(-25%, 0, 0);
transform: translate3d(-25%, 0, 0);
}
.modal.fade:not(.in).right .modal-dialog {
-webkit-transform: translate3d(25%, 0, 0);
transform: translate3d(25%, 0, 0);
}
.modal.fade:not(.in).bottom .modal-dialog {
-webkit-transform: translate3d(0, 25%, 0);
transform: translate3d(0, 25%, 0);
}
/* Alternative Angles */
.modal.fade:not(.in).top-left .modal-dialog {
-webkit-transform: translate3d(-25%, -25%, 0);
transform: translate3d(-25%, -25%, 0);
}
.modal.fade:not(.in).top-right .modal-dialog {
-webkit-transform: translate3d(25%, -25%, 0);
transform: translate3d(25%, -25%, 0);
}
.modal.fade:not(.in).bottom-left .modal-dialog {
-webkit-transform: translate3d(-25%, 25%, 0);
transform: translate3d(-25%, 25%, 0);
}
.modal.fade:not(.in).bottom-right .modal-dialog {
-webkit-transform: translate3d(25%, 25%, 0);
transform: translate3d(25%, 25%, 0);
}
.minicolors {
position: relative;
MARGIN-TOP: 10PX;
WIDTH: 20%;
}
table.dataTable,
table.dataTable th,
table.dataTable td {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.dataTables_scrollBody > .dataTable > thead {
display: none !important;
}
tr td:nth-child(4) {
text-align: center;
}
.form-horizontal .control-label {
text-align: left;
}
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
@@ -66,8 +199,11 @@
<asp:GridView ID="GvPuntos" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres,CvePuntoDeInteres" 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"> <asp:GridView ID="GvPuntos" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres,CvePuntoDeInteres" 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> <Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%"> <asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickGR" />
</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox runat="server" ID="chkGR" /> <asp:CheckBox runat="server" ID="chkGR" CssClass="ChkAllGR" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="45%" HeaderText="Punto De Interés" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="45%" HeaderText="Punto De Interés" ItemStyle-HorizontalAlign="Left" />
@@ -83,8 +219,11 @@
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="800" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros"> <asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="800" 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%">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickDisp" />
</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox runat="server" ID="chkDis" /> <asp:CheckBox runat="server" ID="chkDis" CssClass="ChkAllDisp" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
@@ -148,6 +287,43 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="modal fade bottom in" style="bottom: unset; z-index: 539" id="h">
<div class="modal-dialog" style="position: fixed; bottom: 0; margin: 0px,0px,0px,0px; width: 100%; padding: 0px, 0px, 0px, 0px; border-style: solid; border-color: rgb(68, 77, 88); z-index: 539;">
<div class="modal-content">
<div class="modal-body" style="padding: 5px;">
<asp:UpdatePanel runat="server" ID="UPGV" UpdateMode="Conditional">
<ContentTemplate>
<div runat="server" id="rowImpresiones" class="row" style="margin: 0px 10px 10px 0px; text-align: right;">
<a onclick="doScaledCLick('#C_btnImprimir');;" class="btn btn-circle btn-sm grey"><i class='fa fa-print' aria-hidden='true'></i></a>
<a onclick="doScaledCLick('#C_BtnImprimirEX');" class="btn btn-circle btn-sm green"><i class='fa fa-file-excel-o' aria-hidden='true'></i></a>
</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="TxtBusquedaBarra" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GvBarra" runat="server" GridLines="None" PageSize="1000" AllowPaging="true" AllowCustomPaging="true" CssClass="table table-striped table-advance table-hover Widthall" data-sort="true" data-height="150px;" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns>
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="30%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="30%" HeaderText="Punto De Interes" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Visitas" ItemStyle-Width="20%" DataFormatString="{0} Visitas" HeaderText="Visitas" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="UltimaVisita" ItemStyle-Width="20%" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ultima Visita" ItemStyle-HorizontalAlign="Center" />
</Columns>
<PagerSettings Mode="NextPrevious" Visible="true" Position="Top" />
</asp:GridView>
<asp:HiddenField ID="HdnIndexGvBarra" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnTextFilter" runat="server" ClientIDMode="Static" Value="" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<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 btn-sm 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-sm green" Text="<i class='fa fa-file-excel-o' aria-hidden='true'></i>"></asp:Button>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server">
<li> <li>
@@ -158,18 +334,36 @@
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
<script> <script>
function doScaledCLick(boton) {
setTimeout(function () {
$(boton).click();
}, 250);
}
var markers = []; var markers = [];
var lastOpenedInfoWindow; var lastOpenedInfoWindow;
var geocoder; var geocoder;
var map; var map;
var circles = []; var circles = [];
$('body').on('click', '.ChkAllClickGR input', function () { $(".ChkAllGR input").not(this).prop('checked', $('.ChkAllClickGR input').is(':checked')); });
$('body').on('click', '.ChkAllClickDisp input', function () { $(".ChkAllDisp input").not(this).prop('checked', $('.ChkAllClickDisp 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: 19.4326, lng: -99.13329 }, center: { lat: 19.4326, lng: -99.13329 },
zoom: 8 zoom: 8
}); });
var ShowDiv1 = document.createElement('div');
var ShowDivControl = new ShowDiv(ShowDiv1, map);
ShowDiv1.index = 1;
ShowDiv1.id = "showdiv1"
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
if (navigator.geolocation) { if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) { navigator.geolocation.getCurrentPosition(function (position) {
var pos = { var pos = {
@@ -201,6 +395,178 @@
//service = new google.maps.DistanceMatrixService; //service = new google.maps.DistanceMatrixService;
// map.addListener('click', addLatLng); // map.addListener('click', addLatLng);
} }
//$(document).ready(function () {
// GvBarraPaginator();
// initMap();
// Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
// function EndRequestHandler(sender, args) {
// $("#C_GvBarra_filter > div > input").on("keypress", function (e) {
// HdnTextFilter.value = $(this).val() + String.fromCharCode(e.which);
// });
// }
//});
function GvBarraPaginator() {
$('.table.PaginarGV').each(function () {
var Tthis = $(this);
if (!$.fn.DataTable.isDataTable(Tthis) && Tthis.find("th").length > 0) {
Tthis.prepend(("<thead></thead>"));
Tthis.find('thead').append($("#C_GvBarra").find("tr:first"));
var table = Tthis.DataTable({
//data: datasource,
//columns: [
// { title: "Vehiculo" },
// { title: "Fecha" },
// { title: "TiempoDetenido" },
// { title: "Extn." },
// { title: "Start date" },
// { title: "Salary" }
//],
deferRender: true,
deferLoading: 100,
scrollY: 130,
scrollCollapse: true,
scroller: {
displayBuffer: 20
},
ordering: true
});
var tkeys = new $.fn.dataTable.KeyTable(table, {
// options
});
var parent = Tthis.parent().parent().parent();
$('.dataTables_scrollHeadInner > .table.ADScrollPaginator2').find('th').addClass('importantth');
parent.find(".dataTables_paginate").css("display", "none");
parent.find(".dataTables_length").css("display", "none");
}
});
}
function ShowDiv(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('div');
controlUI.style.backgroundColor = '#444d58';
controlUI.style.border = '2px solid #444d58';
controlUI.style.borderRadius = '3px';
controlUI.style.width = '100%'
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 = '0px';
controlUI.style.textAlign = 'center';
// controlUI.title = 'Click para borrar el último punto dibujado';
controlDiv.appendChild(controlUI);
// Set CSS for the control interior.
var controlText = document.createElement('div');
controlText.style.color = '#ebebeb';
controlText.id = "ShowDiv3"
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
controlText.style.fontSize = '14px';
controlText.style.lineHeight = '20px';
controlText.style.paddingLeft = '5px';
controlText.style.paddingRight = '5px';
controlText.innerHTML = '<i class="fa fa-angle-up" aria-hidden="true"></i>';
controlUI.appendChild(controlText);
// Setup the click event listeners: simply set the map to Chicago.
controlUI.addEventListener('click', function () {
FNShowDiv();
});
}
function FNShowDiv() {
if (open === false) {
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
$("#h").modal()
$("#ShowDiv3").css("line-height", "34px")
open = true
$("#ShowDiv3").html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
setTimeout(function () {
$('.table.ADScrollPaginator2').DataTable().draw();
}, 150);
if ($("#HdnOpcion").val() === 'All' || $("#HdnOpcion").val() === 'Idle' || $("#HdnOpcion").val() === 'Ralenti') {
$('#btnPlay').css('display', '');
$('#btnPrintExcel').css('display', '');
$('#btnPrintPDF').css('display', '');
$("#btnPlay").click(function () {
pause = !pause;
if (pause) {
stopTimeout();
} else {
if (startPlay) {
startPlay = false;
Play();
} else {
Play();
}
}
if ($('#btnPlay > i').hasClass("fa-pause")) {
$('#btnPlay > i').removeClass("fa-pause").addClass("fa-play");
} else if ($('#btnPlay > i').hasClass("fa-play")) {
$('#btnPlay > i').removeClass("fa-play").addClass("fa-pause");
}
});
$("#btnPrintExcel").click(function () {
var s;
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_BtnImprimirEX")
});
$("#btnPrintPDF").click(function () {
var s = "";
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_btnImprimir")
});
} else if ($("#HdnOpcion").val() === 'Speed') {
$('#btnPrintExcel').css('display', '');
$('#btnPrintPDF').css('display', '');
$("#btnPrintExcel").click(function () {
var s;
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_BtnImprimirEX")
});
$("#btnPrintPDF").click(function () {
var s = "";
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_btnImprimir")
});
} else if ($("#HdnOpcion").val() === 'Last') {
$('#btnPrintExcel').css('display', '');
$("#btnPrintExcel").click(function () {
var s;
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_BtnImprimirEX");
});
}
} else {
$("#h").modal('hide')
$("#ShowDiv3").css("line-height", "20px")
open = false
$("#ShowDiv3").html('<i class="fa fa-angle-up" aria-hidden="true"></i>')
}
}
function CargaDivs(Tipo) { function CargaDivs(Tipo) {
if (Tipo === "PointGroup") { if (Tipo === "PointGroup") {
$("#C_TxtNombre").val("") $("#C_TxtNombre").val("")
@@ -356,6 +722,8 @@
} }
</script> </script>
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script> <script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", "AIzaSyDsZ4ATb_hVSEpRbBSlS46ZHEOn-0bNIFI") %>"></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>
</asp:Content> </asp:Content>

View File

@@ -2,6 +2,8 @@
Imports Extensiones Imports Extensiones
Imports System.Data Imports System.Data
Imports Microsoft.Reporting.WebForms
Partial Class GPS_RepPuntosDeInteres Partial Class GPS_RepPuntosDeInteres
Inherits ClsPaginas Inherits ClsPaginas
@@ -14,6 +16,14 @@ Partial Class GPS_RepPuntosDeInteres
ViewState("DispositivosLista") = value ViewState("DispositivosLista") = value
End Set End Set
End Property End Property
Private Property DtDatosReporte As DataTable
Get
Return If(IsNothing(ViewState("DtDatosReporte")), Nothing, CType(ViewState("DtDatosReporte"), DataTable))
End Get
Set(value As DataTable)
ViewState("DtDatosReporte") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -22,20 +32,17 @@ Partial Class GPS_RepPuntosDeInteres
End If End If
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
txtFechaI.Text = Now.AddDays(-7).ToString("dd/MM/yyyy")
CargaDispositivos() CargaDispositivos()
Dim gps As New ClsGPS Dim ObjGPS As New ClsGPS
'If gps.PuntoDeInteresGrupoGet(-1, 1) Then If ObjGPS.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
' GvGrupos.DataSource = gps.DtResultados GvPuntos.DataSource = ObjGPS.DtResultados
'Else
' GvGrupos.DataSource = Nothing
'End If
If gps.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
GvPuntos.DataSource = gps.DtResultados
Else Else
GvPuntos.DataSource = Nothing GvPuntos.DataSource = Nothing
End If End If
gps.Dispose() ObjGPS.Dispose()
'GvGrupos.DataBind()
GvPuntos.DataBind() GvPuntos.DataBind()
End Sub End Sub
@@ -59,7 +66,7 @@ Partial Class GPS_RepPuntosDeInteres
End Sub End Sub
Private Sub ReportePuntos(Dispositivos As String) Private Sub ReportePuntos(Dispositivos As String)
Dim GPS As New ClsGPS
Dim FechaI, FechaF As Date Dim FechaI, FechaF As Date
Dim SBBody As New StringBuilder Dim SBBody As New StringBuilder
Dim CoordsPoligono = "" Dim CoordsPoligono = ""
@@ -71,34 +78,47 @@ Partial Class GPS_RepPuntosDeInteres
Dim Color = "" Dim Color = ""
FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate) FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate)
FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate) FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate)
For Each row As GridViewRow In GvPuntos.Rows
SBBody.Clear()
If row.FCCheckBox("chkGR").Checked Then
If GPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT")
SBBody.Append($"<div>")
SBBody.Append($"<div><h5><b> Punto: {row.DataKey("PuntoDeInteres")}</b></h5></div>")
If GPS.DtResultados.Rows.Count > 0 Then Dim ObjGPS As New ClsGPS
Color = "#26C281" Try
SBBody.Append($"<div><table>") For Each row As GridViewRow In GvPuntos.Rows
For Each Cve As String In DispositivosLista SBBody.Clear()
If GPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then If row.FCCheckBox("chkGR").Checked Then
SBBody.Append($"<tr><td><b>{GPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}:</b> <a onclick=""CargaGV({Cve}, {row.DataKey("CvePuntoDeInteres")} )"">{GPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas<a></td></tr>") If ObjGPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
SBBody.Append($"<tr><td>Última Visita: {GPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}</td></tr>")
End If DtDatosReporte = ObjGPS.DtResultados.Copy()
Next GvBarra.DataSource = DtDatosReporte
SBBody.Append($"</table></div>")
Else Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT")
Color = "#e82929" SBBody.Append($"<div>")
SBBody.Append($"<tr><td><b>Este punto de interés no fue visitado en las fechas seleccionadas.</b></td></tr>") SBBody.Append($"<div><h5><b> Punto: {row.DataKey("PuntoDeInteres")}</b></h5></div>")
If ObjGPS.DtResultados.Rows.Count > 0 Then
Color = "#26C281"
SBBody.Append($"<div><table>")
For Each Cve As String In DispositivosLista
If ObjGPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then
SBBody.Append($"<tr><td><b>{ObjGPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}:</b> <a onclick=""CargaGV({Cve}, {row.DataKey("CvePuntoDeInteres")} )"">{ObjGPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas<a></td></tr>")
SBBody.Append($"<tr><td>Última Visita: {ObjGPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}</td></tr>")
End If
Next
SBBody.Append($"</table></div>")
Else
Color = "#e82929"
SBBody.Append($"<tr><td><b>Este punto de interés no fue visitado en las fechas seleccionadas.</b></td></tr>")
End If
SBBody.Append($"</div>")
RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres"))
End If End If
SBBody.Append($"</div>")
RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres"))
End If End If
End If Next
Next Catch ex As Exception
GPS.Dispose() OnError("Ocurrió un error al consultar los puntos de interes", ex)
End Try
ObjGPS.Dispose()
GvBarra.DataBind()
UPGV.Update()
End Sub End Sub
'If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then 'If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then
@@ -153,4 +173,40 @@ Partial Class GPS_RepPuntosDeInteres
UpdatePanel3.Update() UpdatePanel3.Update()
RegistraScript("$('#dvHistorico').modal()") RegistraScript("$('#dvHistorico').modal()")
End Sub End Sub
'Protected Sub GvBarra_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBarra.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' Dim RowID As String = $"row{e.Row.RowIndex}"
' e.Row.Attributes("id") = RowID
' Dim IndexGvBarra As Integer = If(String.IsNullOrEmpty(HdnIndexGvBarra.Value), -1, HdnIndexGvBarra.Value.ToEntero)
' RegistraScript($"GetDireccionesGV({e.Row.DBCampo("Posicion").ToString}, {e.Row.RowIndex}, 1);", $"{RowID}")
' End If
'End Sub
Protected Sub btnImprimir_Click(sender As Object, e As EventArgs)
Dim Btn As Button = CType(sender, Button)
Dim Format = Btn.CommandArgument
EnviarReporteProgramado(Format)
End Sub
Public Sub EnviarReporteProgramado(Format As String)
Dim RutaReporte = "Empresas/Grales/ReportesProgramados/RPTPuntosInteres.rdlc"
Dim NombreReporte = "ReportePuntosInteres"
Try
Dim RptParametro As New List(Of ReportParameter)
RptParametro.Add(New ReportParameter("FechaInicio", txtFechaI.Text))
RptParametro.Add(New ReportParameter("FechaFin", txtFechaF.Text))
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
Dim retorno = StreamPDF(RutaReporte, DtDatosReporte, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format)
Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
End Sub
End Class End Class

View File

@@ -620,6 +620,9 @@
Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587} Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587}
ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones
Dim EmpresaNotificacionesGPS As New Empresa With {.SendMail = "ALERTAS@SIGNALSGPS.com", .SendMailPassword = "STJ180705IV42021ad", .SendMailServer = "mail.signalsgps.com", .SendMailPuerto = 587}
ClsPaginas.EmpresaNotificacionesGPS = EmpresaNotificacionesGPS
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'I M P U E S T O S L O C A L E S 'I M P U E S T O S L O C A L E S

View File

@@ -934,7 +934,7 @@ Partial Class Inventarios_TraspasoAlmacen
If Not ErrorMovInv Then If Not ErrorMovInv Then
'VIRTUAL ENTRADA 'VIRTUAL ENTRADA
If RealizarMovimientoVirtual Then If RealizarMovimientoVirtual AndAlso CveAlmacenVirtualEntrada > 0 Then
Dim dtvirtual As DataTable = Nothing Dim dtvirtual As DataTable = Nothing
@@ -963,6 +963,7 @@ Partial Class Inventarios_TraspasoAlmacen
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If
Dim Concepto As String = TxtObservaciones.Text Dim Concepto As String = TxtObservaciones.Text
If Concepto = "" Then Concepto = "Traspaso" If Concepto = "" Then Concepto = "Traspaso"
'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO: 'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO:
@@ -1743,7 +1744,7 @@ Partial Class Inventarios_TraspasoAlmacen
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso" TextoError = "Ocurrió un error al cancelar el traspaso"
End If End If
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, 'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
@@ -1925,10 +1926,10 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
ErrorMovInv = True ErrorMovInv = True
End If
End If End If
End If End If
End If
End If End If
@@ -2857,7 +2858,7 @@ Partial Class Inventarios_TraspasoAlmacen
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) Dim excelFile As ExcelFile = excelFile.Load(flatFilePath)
Dim unnamed As Integer = 0 Dim unnamed As Integer = 0
Dim cols As Integer Dim cols As Integer
@@ -2967,7 +2968,7 @@ Partial Class Inventarios_TraspasoAlmacen
Else Else
Str = String.Format(" AND CveSubProyecto = {0} ", DrAlmO("CveSubProyecto")) Str = String.Format(" AND CveSubProyecto = {0} ", DrAlmO("CveSubProyecto"))
End If End If
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,28) AND Estatus = 'Activo' {0} ", Str)) DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,25,28) AND Estatus = 'Activo' {0} ", Str))
DdlAlmacenDestino.DataBind() DdlAlmacenDestino.DataBind()
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))

View File

@@ -22,7 +22,8 @@ Partial Class PopUpSeleccionarEmpresa
If Dt IsNot Nothing Then If Dt IsNot Nothing Then
If Dt.Rows.Count > 0 Then If Dt.Rows.Count > 0 Then
Dim NumRegistros As Integer = 0 Dim NumRegistros As Integer = 0
GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa") GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa", {"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"})
'GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa")
NumRegistros += DirectCast(GvEmpresas.DataSource, System.Data.DataTable).Rows.Count NumRegistros += DirectCast(GvEmpresas.DataSource, System.Data.DataTable).Rows.Count
GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa") GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")

View File

@@ -22,7 +22,7 @@
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron Motivo de Baja Registrados" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;width:100%" GridLines="None"> <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;width:100%" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText ="Vendedor" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText ="Vendedor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>

View File

@@ -42,13 +42,14 @@ Partial Class CatMetasVendedores
DdlMarcas.DataBind() DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todos", "-1")) DdlMarcas.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacionSup.DataBind() DdlClasificacionSup.DataBind()
DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1")) DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificacion.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click
@@ -100,8 +101,10 @@ Partial Class CatMetasVendedores
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor") DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
TxtFechaI.Text = GvRow.DataKey("MesAño") TxtFechaI.Text = GvRow.DataKey("MesAño")
DdlClasificacionSup.SelectedValue = GvRow.DataKey("CveClasificacionSup")
DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion") DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca") DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad") TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad")
TxtMetaImporte.Text = GvRow.DataKey("MetaImporte") TxtMetaImporte.Text = GvRow.DataKey("MetaImporte")

View File

@@ -154,6 +154,11 @@
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes").ToString() %>'> </asp:Label> <asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Real Mes %" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Venta Mes Año Anterior" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Venta Mes Año Anterior" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA").ToString() %>'> </asp:Label> <asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA").ToString() %>'> </asp:Label>
@@ -164,14 +169,24 @@
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes").ToString() %>'> </asp:Label> <asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Var Mes A.A" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Var Mes Obj" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Real Acumulado" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Real Acumulado" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado").ToString() %>'> </asp:Label> <asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Real Mes Porcentaje" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Real Acumulado %" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label> <asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="A. Ant. Acumulado" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="A. Ant. Acumulado" ItemStyle-HorizontalAlign="Center">
@@ -184,11 +199,11 @@
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado").ToString() %>'> </asp:Label> <asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center"> <%-- <asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblVarVSAAPerc" runat="server" Target="_blank" Text='<%# Eval("VarVSAAPerc").ToString() %>'> </asp:Label> <asp:Label ID="lblVarVSAAPerc" runat="server" Target="_blank" Text='<%# Eval("VarVSAAPerc").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>--%>
<asp:TemplateField HeaderText="Var vs AA" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Var vs AA" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA").ToString() %>'> </asp:Label> <asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA").ToString() %>'> </asp:Label>

View File

@@ -47,7 +47,7 @@ Partial Class MetasVendedores
DdlClasificaciones.DataBind() DdlClasificaciones.DataBind()
DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1")) DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificacion2.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion2.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
DdlClasificacion2.DataBind() DdlClasificacion2.DataBind()
DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1")) DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -76,7 +76,9 @@ Partial Class MetasVendedores
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCLabel("lblRealMesPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealMesPorcentaje").Text, "%") e.Row.FCLabel("lblRealMesPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealMesPorcentaje").Text, "%")
e.Row.FCLabel("lblVarVSAAPerc").Text = String.Format("{0}{1}", e.Row.FCLabel("lblVarVSAAPerc").Text, "%") e.Row.FCLabel("lblRealAcumuladoPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealAcumuladoPorcentaje").Text, "%")
'e.Row.FCLabel("lblVarVSAAPerc").Text = String.Format("{0}{1}", e.Row.FCLabel("lblVarVSAAPerc").Text, "%")
Select Case e.Row.DataKey("Etiqueta") Select Case e.Row.DataKey("Etiqueta")
Case "GrupoSuperior" Case "GrupoSuperior"
e.Row.CssClass = "GrupoSuperior" e.Row.CssClass = "GrupoSuperior"

View File

@@ -3493,9 +3493,8 @@
</tr> </tr>
<tr align="left" id="TrKilometraje" runat="server" visible="false"> <tr align="left" id="TrKilometraje" runat="server" visible="false">
<td>Kilometraje&nbsp; <td>Kilometraje&nbsp;
<asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm" MaxLength="7" ></asp:TextBox> <asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm" MaxLength="6" CausesValidation="true" Text="000000"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftkm" runat="server" TargetControlID="TxtKilometraje" FilterType="Custom, Numbers" ValidChars="+-.," /> <ajax:MaskedEditExtender ID="MEEKilometraje" runat="server" TargetControlID="TxtKilometraje" ClearMaskOnLostFocus="false" MaskType="Number" Mask="999999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
</td> </td>
</tr> </tr>
<tr align="left" id="trCorreoNotif1" runat="server" visible="false"> <tr align="left" id="trCorreoNotif1" runat="server" visible="false">

View File

@@ -1290,6 +1290,15 @@ Partial Class Ventas
End Set End Set
End Property End Property
Private Property CveVentaUsadoDevolucionEfectivo As Integer
Get
Return If(IsNothing(ViewState("CveVentaUsadoDevolucionEfectivo")), 0, CType(ViewState("CveVentaUsadoDevolucionEfectivo"), Integer))
End Get
Set(value As Integer)
ViewState("CveVentaUsadoDevolucionEfectivo") = value
End Set
End Property
#End Region #End Region
#Region "Propiedades PuntoVenta" #Region "Propiedades PuntoVenta"
@@ -7236,6 +7245,13 @@ Partial Class Ventas
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 AndAlso TrKilometraje.Visible Then
If TxtKilometraje.Text.Length < 6 Then
Alert("El kilometraje debe tener 6 digitos.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO 'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then
DdlTipoComprobante.SelectedValue = "Ing" DdlTipoComprobante.SelectedValue = "Ing"
@@ -10774,6 +10790,13 @@ Partial Class Ventas
Me.AplicaRelacionManual = False Me.AplicaRelacionManual = False
End If End If
'SI SE SELECCIONO UNA FACTURA PARA DEVOLUCION DE EFECTIVO DEBE ASOCIARLA A LA NOTA DE CREDITO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" AndAlso Me.CveVentaUsadoDevolucionEfectivo > 0 Then
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVentaUsadoDevolucionEfectivo) Then
ErrorList.Add("Ocurrió un error al relacionar la venta de devolución de efectivo entre si.")
End If
End If
If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" And Not factura.TipoDocto.Contiene("Rem", "Ped") Then If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" And Not factura.TipoDocto.Contiene("Rem", "Ped") Then
NotificarPaqueteria() NotificarPaqueteria()
End If End If
@@ -12728,7 +12751,7 @@ Partial Class Ventas
'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO 'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO
If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then
If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa) Then If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa, ObjFactura.CvePrePoliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
@@ -19123,7 +19146,7 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
Dim sb As New StringBuilder() Dim sb As New StringBuilder()
If Not String.IsNullOrEmpty(FolioFiscal) Then If Not String.IsNullOrEmpty(FolioFiscal) AndAlso Not (UsuarioActual.Empresa.Funcionalidad(529) = "1") Then
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>") sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
@@ -24675,9 +24698,14 @@ Partial Class Ventas
End If End If
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR 'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
If UsuarioActual.CveEmpresa = 140 Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;") If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
Else
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
End If
Else Else
AplicarNotaCreditoDesdeVenta() AplicarNotaCreditoDesdeVenta()
End If End If
@@ -24694,6 +24722,8 @@ Partial Class Ventas
Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False) Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC") RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
CveVentaUsadoDevolucionEfectivo = -1
DdlTipoComprobante.SelectedValue = "Egs" DdlTipoComprobante.SelectedValue = "Egs"
Dim AplicaImpuestosLocales As Boolean = False Dim AplicaImpuestosLocales As Boolean = False
@@ -24722,6 +24752,11 @@ Partial Class Ventas
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
'SI SE SELECCIONO UNA FACTURA PARA DEVOLUCION DE EFECTIVO DEBE ASOCIARLA A LA NOTA DE CREDITO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso AplicaNuevoDocumento AndAlso DdlVentaUsado.SelectedValue.ToEntero() > 0 AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
CveVentaUsadoDevolucionEfectivo = DdlVentaUsado.SelectedValue.ToEntero()
End If
AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento, AplicoNCFacturaActual:=True) AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento, AplicoNCFacturaActual:=True)
End Sub End Sub
@@ -26625,6 +26660,7 @@ Partial Class Ventas
If Not DtCotizaciones.Columns.Contains("Aplicado") Then If Not DtCotizaciones.Columns.Contains("Aplicado") Then
DtCotizaciones.Columns.Add("Aplicado", Type.GetType("System.Boolean")) DtCotizaciones.Columns.Add("Aplicado", Type.GetType("System.Boolean"))
End If End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0 AND EsAcumulador = False") GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0 AND EsAcumulador = False")
Else Else
@@ -26687,6 +26723,9 @@ Partial Class Ventas
Dim Cves As New StringBuilder Dim Cves As New StringBuilder
Dim CveMetodoPago As Integer = -1 Dim CveMetodoPago As Integer = -1
Dim MetodoPagoDif As Boolean = False Dim MetodoPagoDif As Boolean = False
Dim ListaVentaDetalleCotizacion As List(Of MVentaDetalleCotizacion) = Nothing
If ChkCotProductos.Checked Then If ChkCotProductos.Checked Then
For Each row As DataRow In DTSeleccionadas.Rows For Each row As DataRow In DTSeleccionadas.Rows
If CveMetodoPago <> -1 And row("CveMetodoPago33").ToString().ToEntero() <> CveMetodoPago Then If CveMetodoPago <> -1 And row("CveMetodoPago33").ToString().ToEntero() <> CveMetodoPago Then
@@ -26699,8 +26738,9 @@ Partial Class Ventas
CotizacionesLista.Add(row("CveVenta").ToString().ToEntero()) CotizacionesLista.Add(row("CveVenta").ToString().ToEntero())
Next Next
'CARGA LOS USADOS RELACIONADOS A LOS PRODUCTOS SELECCIONADOS DE LA COTIZACION
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones) ListaVentaDetalleCotizacion = CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones)
End If End If
Else Else
@@ -26726,6 +26766,18 @@ Partial Class Ventas
ObjClientes.Dispose() ObjClientes.Dispose()
Cves.Clear() Cves.Clear()
'SI SE CALCULARON USADOS LA CANTIDAD DEBE ASIGNARSE A PARTIR DEL CALCULO
If ListaVentaDetalleCotizacion IsNot Nothing AndAlso ListaVentaDetalleCotizacion.Count > 0 Then
For Each Dr As DataRow In DtCotizacionesPS.Rows
Dim VentaDetalle = ListaVentaDetalleCotizacion.FirstOrDefault(Function(cot) cot.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero())
If VentaDetalle IsNot Nothing Then
Dr("Cantidad") = VentaDetalle.Cantidad
End If
Next
End If
If Not AgregaPSCotizacion() Then If Not AgregaPSCotizacion() Then
Alert("Ocurrió un error validar las partidas de las cotizaciones seleccionadas. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Alert("Ocurrió un error validar las partidas de las cotizaciones seleccionadas. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -26747,14 +26799,29 @@ Partial Class Ventas
UpPS.Update() UpPS.Update()
UpParametros.Update() UpParametros.Update()
End Sub End Sub
Private Class MVentaDetalleCotizacion
Public Property CveVentaDetalle As Integer
Public Property Cantidad As Decimal
End Class
Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of MVentaDetalleCotizacion)
Dim Retorno As New List(Of MVentaDetalleCotizacion)
Private Sub CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable)
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then
Dim DTTamanios As DataTable = GlobalDTAcumTamaños() Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"}) Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
For Each Dr As DataRow In DTSeleccionadas.Rows
Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
Dr("Cantidad") = tCantidad
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad})
Next
Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray() Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray()
Dim DTPSTemp As New DataTable '= TmpDT.Clone Dim DTPSTemp As New DataTable '= TmpDT.Clone
@@ -26810,11 +26877,15 @@ Partial Class Ventas
Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero() Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado) SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado)
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()})
End If End If
Next Next
End If End If
End Sub
Return Retorno
End Function
Private Sub VerificaCotizaciones(ByRef dt As DataTable) Private Sub VerificaCotizaciones(ByRef dt As DataTable)
If ChkCotProductos.Checked Then If ChkCotProductos.Checked Then
For Each Gvr As GridViewRow In GvCotPS.Rows For Each Gvr As GridViewRow In GvCotPS.Rows
@@ -26860,7 +26931,12 @@ Partial Class Ventas
If DtCotizacionesPS IsNot Nothing Then If DtCotizacionesPS IsNot Nothing Then
Dim tCantidad As Decimal = 0 Dim tCantidad As Decimal = 0
For Each Dr As DataRow In DtCotizacionesPS.Select() For Each Dr As DataRow In DtCotizacionesPS.Select()
tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
tCantidad = Dr("Cantidad").ToString().ToDecimal()
Else
tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
End If
AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(), AgregarProductoServicio(tCantidad, Dr("CveUM").ToString().ToEntero(), Dr("UM").ToString(), Dr("CveClasificacion").ToString().ToEntero(), Dr("Clasificacion").ToString(),
Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal, Dr("CvePS").ToString().ToEntero(), Dr("PS").ToString(), Dr("Obs").ToString(), Dr("PU").ToString().ToDecimal, Dr("Descuento").ToString().ToDecimal,
Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(), Dr("CveProyecto").ToString().ToEntero(), Dr("Proyecto").ToString(), Dr("CveSubProyecto").ToString().ToEntero(), Dr("SubProyecto").ToString(),