Compras ajuste de IEPS, si la compra trae IEPS y los productos asigandos no aplican IEPS y existe ajuste ajustar en primer producto.

This commit is contained in:
rakcsle
2022-03-16 11:49:00 -07:00
parent 5640db51b0
commit 4af1707636
2 changed files with 51 additions and 363 deletions

View File

@@ -8690,6 +8690,8 @@ Partial Class Compras_Compras
Dim DTConsultaIEPSPS As New DataTable
DTConsultaIEPSPS = TmpDT.FiltraParametros(" AplicaIEPS = 'True'")
Dim IndiceContador As Integer = 0
Dim IndicePrimero As Integer = 0
@@ -8703,17 +8705,14 @@ Partial Class Compras_Compras
If DiferenciaIEPSPS.RoundAD(2) <> 0 Then
If DTConsultaIEPSPS.Rows.Count > 0 Then
'Ajusta IPES en primer registro que aplique IEPS
TmpDT.Rows(IndicePrimero)("IEPSPS") = TmpDT.Rows(IndicePrimero)("IEPSPS").ToString.ToDecimal + DiferenciaIEPSPS
TmpDT.AcceptChanges()
Else
Respuesta = False
Alert(String.Format("Los productos especificados en el listado no tienen asigando impuesto IEPS, favor de realizar la corrección en el producto que aplique el impuesto. ({0}-{1})", IEPSPSDetalles, TxtIEPS.Text.ToDecimal), TipoMensaje.MsgAdvertencia)
End If
TmpDT.Rows(IndicePrimero)("IEPSPS") = TmpDT.Rows(IndicePrimero)("IEPSPS").ToString.ToDecimal + DiferenciaIEPSPS
TmpDT.AcceptChanges()
End If
For Each dRow As DataRow In TmpDT.Rows
If dRow("IEPSPSPorcentaje").ToString.ToDecimal > 0 AndAlso dRow("IEPSPS").ToString.ToDecimal = 0 Then

View File

@@ -7546,23 +7546,52 @@ Partial Class Clientes
End If
End Sub
Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Adjunto As String = GvRow.DataKey("Adjunto")
Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero()
Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato")
Dim stringDescargaDocumento As String = ""
DescarFormato(DocumentacionFormato)
Dim asdasd = GvRow.DataKey("Documentacion")
If GvRow.DataKey("Documentacion").ToUpper = "Pagaré".ToUpper AndAlso UsuarioActual.CveEmpresa = 140 Then
stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx"
linkDescargaPagare = stringDescargaDocumento
TxtDireccionAval.Text = ""
TxtAval.Text = ""
TxtCiudadAval.Text = ""
TxtTelefonoAval.Text = ""
RegistraScript("$('#ModalDivPagare').modal('show')")
Else
Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero()
Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato")
DescarFormato(DocumentacionFormato)
End If
End Sub
Public Sub DescarFormato(documento As String)
Dim PathRoot As String = Server.MapPath("/")
Dim PathSource As String
Dim pathDesti As String
Dim fname As String = ""
Dim fname As String = ""
PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
pathDesti = PathRoot & "Temp\" & CveCliente & documento
@@ -7611,350 +7640,10 @@ Partial Class Clientes
End If
End Sub
'Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos)
' Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
' If CvePersonal <> -1 Then
' Dim objRH As New ClsRH
' If objRH.PersonalReclutamientoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
' ListaTagsDocumentost.Add(New TagsDocumentos("{Nombres}", objRH.DtResultados(0)("Nombres").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{APaterno}", objRH.DtResultados(0)("APaterno").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{AMaterno}", objRH.DtResultados(0)("AMaterno").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{RFC}", objRH.DtResultados(0)("RFC").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", Cliente))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Estatura}", objRH.DtResultados(0)("Estatura").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Peso}", objRH.DtResultados(0)("Peso").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{LugarNacimiento}", objRH.DtResultados(0)("LugarNacimiento").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", objRH.DtResultados(0)("Edad").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreTelEmergencia}", objRH.DtResultados(0)("NombreTelEmergencia").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{TipoSangre}", objRH.DtResultados(0)("TipoSangre").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Vivienda}", objRH.DtResultados(0)("Vivienda").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{ViviendaDueno}", objRH.DtResultados(0)("ViviendaDueno").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{CreditoInfonavit}", objRH.DtResultados(0)("CreditoInfonavit").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{RentaMensual}", objRH.DtResultados(0)("RentaMensual").ToString().ToDecimal().ToString("###,###,###.00")))
' ListaTagsDocumentost.Add(New TagsDocumentos("{TransportePublico}", objRH.DtResultados(0)("TransportePublico").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormente}", objRH.DtResultados(0)("TrabajadoAnteriormente").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormenteObservaciones}", objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{ParientesEmpresa}", objRH.DtResultados(0)("ParientesEmpresa").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelito}", objRH.DtResultados(0)("AcusadoDelito").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelitoObservaciones}", objRH.DtResultados(0)("AcusadoDelitoObservaciones").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Calle}", objRH.DtResultados(0)("Calle").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Colonia}", objRH.DtResultados(0)("Colonia").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{CP}", objRH.DtResultados(0)("CP").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Telefono}", objRH.DtResultados(0)("Telefono").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Celular}", objRH.DtResultados(0)("Celular").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Correo}", objRH.DtResultados(0)("Correo").ToString()))
' 'If Not IsDBNull(objRH.DtResultados(0)("CveSucursal")) Then
' ' ListaTagsDocumentost.Add(New TagsDocumentos("{CveSucursal}", DDLSucursal4.Text))
' 'End If
' ListaTagsDocumentost.Add(New TagsDocumentos("{NumeroSS}", objRH.DtResultados(0)("NumeroSS").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Licencia}", objRH.DtResultados(0)("Licencia").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{CartillaMilitar}", objRH.DtResultados(0)("CartillaMilitar").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{CURP}", objRH.DtResultados(0)("CURP").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{AutorizaAntidoping}", objRH.DtResultados(0)("AutorizaAntidoping").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Observaciones}", objRH.DtResultados(0)("Observaciones").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaIngreso}", objRH.DtResultados(0)("FechaIngreso").ToString().ToDate().ToShortDateString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString().ToDate().ToShortDateString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Puesto}", objRH.DtResultados(0)("Puesto").ToString()))
' ListaTagsDocumentost.Add(New TagsDocumentos("{CUIP}", ""))
' ListaTagsDocumentost.Add(New TagsDocumentos("{Denominacion}", ""))
' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaNacimiento}", objRH.DtResultados(0)("FechaNacimiento").ToString().ToDate().ToString("dd/MM/yyyy")))
' Dim fechaActual As String = " " & Now.Day & " del mes " & Now.Month & " del año " & Now.Year
' Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
' End If
' objRH.Dispose()
' End If
' Return ListaTagsDocumentost
'End Function
''Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos)
'' Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
'' If CvePersonal <> -1 Then
'' Dim objRH As New ClsRH
'' If objRH.PersonalReclutamientoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
'' If Not IsDBNull(objRH.DtResultados(0)("Nombres")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{Nombres}", objRH.DtResultados(0)("Nombres").ToString()))
'' End If
'' If Not objRH.DtResultados(0)("APaterno") Is Nothing Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{APaterno}", objRH.DtResultados(0)("APaterno").ToString()))
'' End If
'' If Not objRH.DtResultados(0)("AMaterno") Is Nothing Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{AMaterno}", objRH.DtResultados(0)("AMaterno").ToString()))
'' End If
'' If Not objRH.DtResultados(0)("NombreCompleto") Is Nothing Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", objRH.DtResultados(0)("NombreCompleto").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("Estatura")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{Estatura}", objRH.DtResultados(0)("Estatura").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("Peso")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{Peso}", objRH.DtResultados(0)("Peso").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("LugarNacimiento")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{LugarNacimiento}", objRH.DtResultados(0)("LugarNacimiento").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("Edad")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", objRH.DtResultados(0)("Edad").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("NombreTelEmergencia")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreTelEmergencia}", objRH.DtResultados(0)("NombreTelEmergencia").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("TipoSangre")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{TipoSangre}", objRH.DtResultados(0)("TipoSangre").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("Vivienda")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Vivienda}", objRH.DtResultados(0)("Vivienda").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("ViviendaDueno")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{ViviendaDueno}", objRH.DtResultados(0)("ViviendaDueno").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("CreditoInfonavit")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CreditoInfonavit}", objRH.DtResultados(0)("CreditoInfonavit").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("RentaMensual")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{RentaMensual}", objRH.DtResultados(0)("RentaMensual").ToString().ToDecimal().ToString("###,###,###.00")))
'' If Not IsDBNull(objRH.DtResultados(0)("TransportePublico")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TransportePublico}", objRH.DtResultados(0)("TransportePublico").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormente")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormente}", objRH.DtResultados(0)("TrabajadoAnteriormente").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormenteObservaciones}", objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("ParientesEmpresa")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{ParientesEmpresa}", objRH.DtResultados(0)("ParientesEmpresa").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelito")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelito}", objRH.DtResultados(0)("AcusadoDelito").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelitoObservaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelitoObservaciones}", objRH.DtResultados(0)("AcusadoDelitoObservaciones").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Direccion")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Calle")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Calle}", objRH.DtResultados(0)("Calle").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Colonia")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Colonia}", objRH.DtResultados(0)("Colonia").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("CP")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CP}", objRH.DtResultados(0)("CP").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Telefono")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Telefono}", objRH.DtResultados(0)("Telefono").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Celular")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Celular}", objRH.DtResultados(0)("Celular").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Correo")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Correo}", objRH.DtResultados(0)("Correo").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("CveSucursal")) Then
'' ' ListaTagsDocumentost.Add(New TagsDocumentos("{CveSucursal}", DDLSucursal4.Text))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("NumeroSS")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{NumeroSS}", objRH.DtResultados(0)("NumeroSS").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Licencia")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Licencia}", objRH.DtResultados(0)("Licencia").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("CartillaMilitar")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CartillaMilitar}", objRH.DtResultados(0)("CartillaMilitar").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("CURP")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CURP}", objRH.DtResultados(0)("CURP").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("AutorizaAntidoping")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AutorizaAntidoping}", objRH.DtResultados(0)("AutorizaAntidoping").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Observaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Observaciones}", objRH.DtResultados(0)("Observaciones").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("CredencialElector")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CredencialElector}", objRH.DtResultados(0)("CredencialElector").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Sucursal")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Sucursal}", objRH.DtResultados(0)("Sucursal").ToString()))
'' If Not IsDBNull(objRH.DtResultados(0)("Puesto")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Puesto}", objRH.DtResultados(0)("Puesto").ToString()))
'' 'If Not IsDBNull(objRH.DtResultados(0)("InformacionFidedigno")) Then chkFidedigna4.Checked = objRH.DtResultados(0)("InformacionFidedigno")
'' ListaTagsDocumentost.Add(New TagsDocumentos("{InformacionFidedigno}", objRH.DtResultados(0)("InformacionFidedigno").ToString()))
'' End If
'' If Not IsDBNull(objRH.DtResultados(0)("FechaNacimiento")) Then
'' ListaTagsDocumentost.Add(New TagsDocumentos("{InformacionFidedigno}", objRH.DtResultados(0)("FechaNacimiento").ToString().ToDate().ToString("dd/MM/yyyy")))
'' End If
'' Dim fechaActual As String = " " & Now.Day & " del mes " & Now.Month & " del año " & Now.Year
'' Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
'' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
'' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
'' objRH.Dispose()
'' End If
'' Return ListaTagsDocumentost
''End Function
End Sub
Private Sub RegistraDescargaJavaScript(baseUrl As String)
RegistraScript("Download('" & baseUrl & "')")
@@ -8714,12 +8403,12 @@ Partial Class Clientes
ObjVentas.Dispose()
GvComportamientoVenta.DataBind()
UpDatosComportamientoVenta.Update()
End Sub
End Sub
#End Region
#Region "DISPOSITIVOS"
Protected Sub LnkMoverDispositivo_Click(sender As Object, e As EventArgs)
Dim CveDispositivo As Integer = HdnCveDispositivoMover.Value.ToEntero()
Dim CveCliente As Integer = DdlClienteDispositivo.SelectedValue.ToEntero()