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