diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index eb913f8b8..124d7ce1e 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -438,7 +438,26 @@ Partial Class Boletos Return Retorno End If - If Not ObjFactura.AgregarPS(CvePSBoleto, 1, Importe, 0, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=0, CveViajePasajero:=Dr("CveViajePasajero").ToString().ToEntero()) Then + Dim PorcentajeIVA As Decimal = 0 + + Dim DrPS As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSBoleto).FiltroPrimero("") ' Estado = -1 + + If DrPS Is Nothing Then + Retorno.Mensajes.Add("No se pudo agregar el producto") + Return Retorno + End If + + If DrPS("IVA").ToString().Contiene("-1", "") Then + PorcentajeIVA = ObjFactura.SubProyecto.IVA + Else + PorcentajeIVA = DrPS("IVA").ToString().ToDecimal() + End If + + If PorcentajeIVA > 0 Then + Importe = (Importe / (1D + PorcentajeIVA)).RoundSQL(6) + End If + + If Not ObjFactura.AgregarPS(CvePSBoleto, 1D, Importe, 0D, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=PorcentajeIVA, CveViajePasajero:=Dr("CveViajePasajero").ToString().ToEntero()) Then Retorno.Mensajes.Add("No se pudo agregar el producto") Return Retorno End If