-- cambios en registro de kiosko
This commit is contained in:
@@ -178,7 +178,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveSubProyecto As String = "11790"
|
||||
Dim JsonRequest As JObject = Nothing
|
||||
|
||||
Dim Bitac As New StringBuilder
|
||||
If context.Request.InputStream IsNot Nothing Then
|
||||
Using reader As New StreamReader(context.Request.InputStream)
|
||||
Dim json = reader.ReadToEnd
|
||||
@@ -190,7 +190,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
Bitac.AppendLine("Inicio Pago ")
|
||||
Dim UsuarioActual As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
|
||||
Dim data As New JArray
|
||||
Dim dtt As New DataTable
|
||||
@@ -204,7 +204,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim pCveVenta As Integer = JsonRequest("cveventa").ToString.ToEntero
|
||||
Dim Referencia As String = ""
|
||||
'validaciones
|
||||
|
||||
Bitac.AppendLine("Validaciones Pago 1.0")
|
||||
Dim ObjVenta As New ClsVentas()
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjVenta.GetVenta(pCveVenta, CveEmpresa) Then
|
||||
@@ -228,6 +228,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
VentaRemision.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
|
||||
VentaRemision.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
Bitac.AppendLine("Crear Nueva 1.0")
|
||||
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, VentaRemision.CveSubProyecto, VentaRemision.CveCliente, VentaRemision.CveMoneda, "Ing")
|
||||
ObjFactura.CveMoneda = VentaRemision.CveMoneda
|
||||
ObjFactura.CveVendedor = dr("CveVendedor").ToString.ToEntero
|
||||
@@ -258,15 +259,15 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
If CvePrePoliza > 0 Then
|
||||
'registro de venta y pago
|
||||
|
||||
Bitac.AppendLine("Emitir 1.0")
|
||||
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
|
||||
Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
|
||||
Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Kiosko140/GuardarVenta", MostrarURL:=True)
|
||||
Retorno.Factura = ObjFactura
|
||||
|
||||
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
|
||||
VentaRemision.CveVenta = ObjFactura.CveVenta
|
||||
'Respuesta.data = Retorno.SerieFolio
|
||||
|
||||
Bitac.AppendLine("Venta Registada")
|
||||
If TieneError Then
|
||||
Dim sb As New StringBuilder()
|
||||
For Each msg As String In Retorno.Mensajes
|
||||
@@ -274,6 +275,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
Next
|
||||
RespuestaError.message = sb.ToString()
|
||||
End If
|
||||
Bitac.AppendLine("Inicia Registro IE")
|
||||
'11- tdd, 12-tdc
|
||||
Dim CveIE As Integer = ObjIE.AddBancos_IE(CveCuentaBancaria, CveTipoTransaccion, FechaPago, "-1", "", ImportePago, VentaRemision.CveMoneda,
|
||||
VentaRemision.TC, "", "", False, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
@@ -288,20 +290,25 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
Pago.ImportePago = ImportePago
|
||||
Pago.ImportePagoVenta = ImportePago
|
||||
Pago.Referencia = Referencia
|
||||
|
||||
Bitac.AppendLine("IE Registrado")
|
||||
If MsgError = "" AndAlso ClsPaginas.AplicaPrePolizaPagoVenta(VentaRemision, Pago, CvePrePoliza, ObjConta) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
Else
|
||||
MsgError = "No se pudo insertar el pago"
|
||||
Bitac.AppendLine("IE NO Registrado")
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
MsgError = "Falta información para completar la venta."
|
||||
Bitac.AppendLine("Venta NO Registrado - ")
|
||||
Bitac.AppendLine(Retorno.Mensajes(0))
|
||||
End If
|
||||
End If
|
||||
Bitac.AppendLine("Registrados")
|
||||
|
||||
If Not TieneError Then
|
||||
Dim bytesPDF As Byte() = DescargarFactura(ObjFactura.SerieFolio, CveEmpresa, ObjFactura.CveVenta) 'ClsPaginas.PdfFactura(ObjFactura, AplicaPagare:="0", Guardar:=True, RegenerarQR:=True, EsTicket:=False)
|
||||
Dim bytesPDF As Byte() = Nothing ' DescargarFactura(ObjFactura.SerieFolio, CveEmpresa, ObjFactura.CveVenta) 'ClsPaginas.PdfFactura(ObjFactura, AplicaPagare:="0", Guardar:=True, RegenerarQR:=True, EsTicket:=False)
|
||||
|
||||
'generar el pdf y mandarlo
|
||||
Dim objretorno As New JObject(
|
||||
@@ -313,12 +320,15 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
Respuesta.data = data
|
||||
ObjConta.RollBack()
|
||||
'ObjConta.Commit()
|
||||
Bitac.AppendLine("Completado.")
|
||||
Else
|
||||
ObjConta.RollBack()
|
||||
Bitac.AppendLine("NO Completado.")
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
ObjIE.Dispose()
|
||||
End If
|
||||
Bitac.ToString.GuardaLog
|
||||
End If
|
||||
ObjVenta.Dispose()
|
||||
ObjClientes.Dispose()
|
||||
|
||||
Reference in New Issue
Block a user