cambios de extensiones .SUM de double a decimal
This commit is contained in:
212
Ashx/E119.ashx
212
Ashx/E119.ashx
@@ -142,9 +142,12 @@ Public Class E119 : Implements IHttpHandler
|
||||
|
||||
Catch ex As Exception
|
||||
context.Response.ContentType = "text/html"
|
||||
retorno = ex.ToString()
|
||||
ex.GuardaLog(ex.ToString())
|
||||
|
||||
Dim respuesta As New AuthMessage
|
||||
respuesta.ErrorMessage = New ResponseMsgError() With {.message = "La solicitud no se pudo procesar."}
|
||||
respuesta.IsSucces = False
|
||||
respuesta.StatusCode = 200
|
||||
retorno = JsonConvert.SerializeObject(respuesta.ErrorMessage)
|
||||
context.Response.Write(retorno)
|
||||
End Try
|
||||
End Sub
|
||||
@@ -343,154 +346,141 @@ Public Class E119 : Implements IHttpHandler
|
||||
If JsonRequest Is Nothing Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
RespuestaError.message = "No se pudo procesar la solicitud - Formato mal formado"
|
||||
context.Response.StatusCode = 200
|
||||
Return JsonConvert.SerializeObject("xx")
|
||||
Return JsonConvert.SerializeObject(RespuestaError)
|
||||
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
|
||||
Dim ObjFactura As Modelos.Factura
|
||||
Dim ObjFactura As Modelos.Factura = Nothing
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
If Usuario IsNot Nothing Then
|
||||
|
||||
End If
|
||||
|
||||
Dim ObjClientes As New ClsClientes()
|
||||
Dim ObjInventario As New ClsInventarios(ObjClientes.IniciaTransacSQL())
|
||||
|
||||
Dim CveSubProyecto, CveCliente, CveMoneda, CvePS As Integer
|
||||
Dim Cantidad, PU, Descuento As Decimal
|
||||
Dim Obs As String = ""
|
||||
CveSubProyecto = 12659 ' fijo Ecommerce
|
||||
CveCliente = 0
|
||||
CveMoneda = 1
|
||||
Descuento = 0
|
||||
Dim RFC As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString())
|
||||
Dim NombreCliente As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString() & " " & JsonRequest("billing")("last_name").ToString())
|
||||
'BUSCAR SI ESTÁ REGISTRADO EL CLIENTE
|
||||
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
'Resp.TieneError = False
|
||||
CveCliente = ObjClientes.CveCliente
|
||||
'Resp.Mensajes.Add("El RFC ya existe en el sistema")
|
||||
Dim ObjClientes As New ClsClientes()
|
||||
Dim ObjInventario As New ClsInventarios(ObjClientes.IniciaTransacSQL())
|
||||
Dim CveSubProyecto, CveCliente, CveMoneda, CvePS As Integer
|
||||
Dim Cantidad, PU, Descuento As Decimal
|
||||
Dim Obs As String = ""
|
||||
CveSubProyecto = 12659 ' fijo Ecommerce
|
||||
CveCliente = 0
|
||||
CveMoneda = 1
|
||||
Descuento = 0
|
||||
Dim RFC As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString())
|
||||
Dim NombreCliente As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString() & " " & JsonRequest("billing")("last_name").ToString())
|
||||
'BUSCAR SI ESTÁ REGISTRADO EL CLIENTE
|
||||
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
'Resp.TieneError = False
|
||||
CveCliente = ObjClientes.CveCliente
|
||||
'Resp.Mensajes.Add("El RFC ya existe en el sistema")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If CveCliente = 0 Then
|
||||
' 'DATOS DE BILLING
|
||||
If JsonRequest("billing") IsNot Nothing Then
|
||||
Dim CveEstado As Integer = -1
|
||||
Dim Direccion As String = If(JsonRequest("billing")("address_1") Is Nothing, "", JsonRequest("billing")("address_1").ToString())
|
||||
Dim NumExt As String = ""
|
||||
Dim NumInt As String = ""
|
||||
Dim Colonia As String = ""
|
||||
Dim Ciudad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
|
||||
Dim Localidad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
|
||||
Dim CP As String = If(JsonRequest("billing")("postcode") Is Nothing, "", JsonRequest("billing")("postcode").ToString())
|
||||
Dim Telefono As String = If(JsonRequest("billing")("phone") Is Nothing, "", JsonRequest("billing")("phone").ToString())
|
||||
Dim Correo As String = If(JsonRequest("billing")("email") Is Nothing, "", JsonRequest("billing")("email").ToString())
|
||||
Dim Estado As String = If(JsonRequest("billing")("state") Is Nothing, "", JsonRequest("billing")("state").ToString())
|
||||
If Not String.IsNullOrEmpty(Estado) Then
|
||||
CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
|
||||
If CveEstado <= 0 Then 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
|
||||
If CveCliente = 0 Then
|
||||
' 'DATOS DE BILLING
|
||||
If JsonRequest("billing") IsNot Nothing Then
|
||||
Dim CveEstado As Integer = -1
|
||||
Dim Direccion As String = If(JsonRequest("billing")("address_1") Is Nothing, "", JsonRequest("billing")("address_1").ToString())
|
||||
Dim NumExt As String = ""
|
||||
Dim NumInt As String = ""
|
||||
Dim Colonia As String = ""
|
||||
Dim Ciudad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
|
||||
Dim Localidad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
|
||||
Dim CP As String = If(JsonRequest("billing")("postcode") Is Nothing, "", JsonRequest("billing")("postcode").ToString())
|
||||
Dim Telefono As String = If(JsonRequest("billing")("phone") Is Nothing, "", JsonRequest("billing")("phone").ToString())
|
||||
Dim Correo As String = If(JsonRequest("billing")("email") Is Nothing, "", JsonRequest("billing")("email").ToString())
|
||||
Dim Estado As String = If(JsonRequest("billing")("state") Is Nothing, "", JsonRequest("billing")("state").ToString())
|
||||
If Not String.IsNullOrEmpty(Estado) Then
|
||||
CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
|
||||
If CveEstado <= 0 Then 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
|
||||
CveEstado = 26
|
||||
End If
|
||||
Else
|
||||
CveEstado = 26
|
||||
End If
|
||||
Else
|
||||
CveEstado = 26
|
||||
End If
|
||||
If ObjClientes.AgregarClienteNoFrecuente(NombreCliente, Direccion, NumExt, NumInt, Colonia, Localidad, Ciudad, CveEstado, RFC, CP, Telefono, Correo, CveSubProyecto, CveUsuario, CveEmpresa, "", -1, -1) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
CveCliente = ObjClientes.DtResultados(0)("CveCliente").ToString().ToEntero()
|
||||
If ObjClientes.AgregarClienteNoFrecuente(NombreCliente, Direccion, NumExt, NumInt, Colonia, Localidad, Ciudad, CveEstado, RFC, CP, Telefono, Correo, CveSubProyecto, CveUsuario, CveEmpresa, "", -1, -1) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
CveCliente = ObjClientes.DtResultados(0)("CveCliente").ToString().ToEntero()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
Try
|
||||
|
||||
Try
|
||||
ObjFactura = Modelos.Factura.CrearVentaNueva(Usuario, CveSubProyecto, CveCliente, CveMoneda, "Rem")
|
||||
Dim ListaPS As JArray = JArray.Parse(JsonRequest("line_items").ToString())
|
||||
Dim Consec As Integer = 1
|
||||
For Each JsonPS As JObject In ListaPS
|
||||
Cantidad = JsonPS("quantity").ToString.ToDecimal()
|
||||
PU = JsonPS("price").ToString.ToDecimal()
|
||||
CvePS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa, Codigo:=JsonPS("sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
|
||||
|
||||
ObjFactura = Modelos.Factura.CrearVentaNueva(Usuario, CveSubProyecto, CveCliente, CveMoneda, "Rem")
|
||||
Dim ListaPS As JArray = JArray.Parse(JsonRequest("line_items").ToString())
|
||||
Dim Consec As Integer = 1
|
||||
For Each JsonPS As JObject In ListaPS
|
||||
Cantidad = JsonPS("quantity").ToString.ToDecimal()
|
||||
PU = JsonPS("price").ToString.ToDecimal()
|
||||
CvePS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa, Codigo:=JsonPS("sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
|
||||
ObjFactura.AgregarPS(CvePS, Cantidad, PU, Descuento, Obs, CveSubProyecto:=CveSubProyecto)
|
||||
|
||||
ObjFactura.AgregarPS(CvePS, Cantidad, PU, Descuento, Obs, CveSubProyecto:=CveSubProyecto)
|
||||
|
||||
''VALIDAR QUE SEA EL MISMO PRODUCTO
|
||||
If CvePS <= 0 Then
|
||||
TieneError = True
|
||||
'Retorno.Mensajes.Add(String.Format("No se encontró el producto: {0}", JsonPS("name").ToString()))
|
||||
Exit For
|
||||
End If
|
||||
|
||||
''VALIDA EXISTENCIA ANTES DE GENERAR LA FACTURA
|
||||
'If ObjFactura.TipoDocto = "Ing" AndAlso DrPS("CveTipoPS").ToString() = "2" Then
|
||||
' Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(DrPS("CvePS").ToString.ToEntero, DrPS("CveUnidadMedida").ToString.ToEntero, UsuarioActual.CveEmpresa, ObjFactura.CveAlmacen, CveSubProyecto:=ObjFactura.CveSubProyecto, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
||||
|
||||
' If Cantidad > Existencia Then
|
||||
' Retorno.TieneError = True
|
||||
' Retorno.Mensajes.Add(String.Format("No hay existencia suficiente para este producto: {0}, cuenta con : {1}", DrPS("PSCodigo").ToString(), Existencia))
|
||||
' Exit For
|
||||
' End If
|
||||
'End If
|
||||
Consec += 1
|
||||
Next
|
||||
''VALIDAR QUE SEA EL MISMO PRODUCTO
|
||||
If CvePS <= 0 Then
|
||||
TieneError = True
|
||||
'Retorno.Mensajes.Add(String.Format("No se encontró el producto: {0}", JsonPS("name").ToString()))
|
||||
Exit For
|
||||
End If
|
||||
Consec += 1
|
||||
Next
|
||||
|
||||
|
||||
ObjFactura.CalculaTotales()
|
||||
ObjFactura.CalculaTotales()
|
||||
|
||||
If ObjFactura IsNot Nothing Then
|
||||
Resp = ObjFactura.EmitirFactura(False, Transac:=ObjClientes.IniciaTransacSQL())
|
||||
If ObjFactura IsNot Nothing Then
|
||||
Resp = ObjFactura.EmitirFactura(False, Transac:=ObjClientes.IniciaTransacSQL())
|
||||
|
||||
If Resp.CveVenta > 0 Then
|
||||
Respuesta.status = "success"
|
||||
Respuesta.data = Resp.SerieFolio
|
||||
If Resp.CveVenta > 0 Then
|
||||
Respuesta.status = "success"
|
||||
Respuesta.data = Resp.SerieFolio
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
Dim sb As New StringBuilder()
|
||||
For Each msg As String In Resp.Mensajes
|
||||
sb.AppendFormat("{0}. ", msg)
|
||||
Next
|
||||
RespuestaError.message = sb.ToString()
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
Dim sb As New StringBuilder()
|
||||
For Each msg As String In Resp.Mensajes
|
||||
sb.AppendFormat("{0}. ", msg)
|
||||
Next
|
||||
RespuestaError.message = sb.ToString()
|
||||
End If
|
||||
Else
|
||||
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
Dim sb As New StringBuilder()
|
||||
For Each msg As String In Resp.Mensajes
|
||||
sb.AppendFormat("{0}. ", msg)
|
||||
Next
|
||||
RespuestaError.message = sb.ToString()
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjClientes.RollBack()
|
||||
ObjClientes.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
Else
|
||||
ObjClientes.Commit()
|
||||
ObjClientes.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjClientes.RollBack()
|
||||
ObjClientes.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
Else
|
||||
ObjClientes.Commit()
|
||||
ObjClientes.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
|
||||
If ObjFactura IsNot Nothing Then ObjFactura.Dispose()
|
||||
End If
|
||||
|
||||
If ObjFactura IsNot Nothing Then ObjFactura.Dispose()
|
||||
'End If
|
||||
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
|
||||
@@ -63,7 +63,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
'EnviarCorreoFactura(New Modelos.Factura(Usuario, 844966, 1, context.ModExtensiones.DirectorioBaseEmpresas), Usuario)
|
||||
|
||||
If String.IsNullOrEmpty(pFechaI) AndAlso String.IsNullOrEmpty(pFechaF) Then
|
||||
Dim FechaReferencia = ClsPaginas.NowADS()
|
||||
Dim FechaReferencia As Date = ClsPaginas.NowADS()
|
||||
If FechaReferencia.DayOfWeek = DayOfWeek.Sunday Then
|
||||
Dim Sabado = FechaReferencia.AddDays(-1)
|
||||
Dim DomingoAnterior = FechaReferencia.AddDays(-7)
|
||||
@@ -273,7 +273,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
|
||||
Dim ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
Dim ObjFactura As New Modelos.Factura(UsuarioActual)
|
||||
ObjFactura.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.TextoLimpio
|
||||
ObjFactura.Serie = Serie
|
||||
ObjFactura.Folio = Folio.ToEntero()
|
||||
@@ -361,12 +361,12 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
ObjFactura.DtRemisionesPS = DTRemisionesPS
|
||||
|
||||
Dim TotalImporte As Decimal = ObjFactura.DtDetalle.SUM("TotalImporte").ToDecimal()
|
||||
Dim ImporteIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteIVA").ToDecimal()
|
||||
Dim ImporteRetIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetIVA").ToDecimal()
|
||||
Dim ImporteRetISR As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetISR").ToDecimal()
|
||||
Dim ImporteIEPS As Decimal = ObjFactura.DtDetalle.SUM("ImporteIEPS").ToDecimal()
|
||||
Dim Descuento As Decimal = ObjFactura.DtDetalle.SUM("Descuento").ToDecimal()
|
||||
Dim TotalImporte As Decimal = ObjFactura.DtDetalle.SUM("TotalImporte")
|
||||
Dim ImporteIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteIVA")
|
||||
Dim ImporteRetIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetIVA")
|
||||
Dim ImporteRetISR As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetISR")
|
||||
Dim ImporteIEPS As Decimal = ObjFactura.DtDetalle.SUM("ImporteIEPS")
|
||||
Dim Descuento As Decimal = ObjFactura.DtDetalle.SUM("Descuento")
|
||||
Dim Amortizacion As Decimal = 0
|
||||
|
||||
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
|
||||
@@ -530,7 +530,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
Return Timbre
|
||||
End Function
|
||||
Private Function CreaDTDetalle(ByRef Retorno As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DtRemisionesPS As DataTable) As DataTable
|
||||
Dim TmpDT = New DataTable
|
||||
Dim TmpDT As New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
@@ -770,9 +770,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||
Dim File As Byte() = Nothing
|
||||
Try
|
||||
Using httpClient = New HttpClient()
|
||||
Using httpClient As New HttpClient()
|
||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
||||
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||
Using request As New HttpRequestMessage(HttpMethod.Get, Url)
|
||||
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
|
||||
Dim response = httpClient.SendAsync(request).Result
|
||||
If response.StatusCode = Net.HttpStatusCode.OK Then
|
||||
@@ -795,8 +795,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim Mail As String = ""
|
||||
Dim MailCC As String = ""
|
||||
|
||||
Dim ArchivoXML = ""
|
||||
Dim ArchivoPDF = ""
|
||||
Dim ArchivoXML As String = ""
|
||||
Dim ArchivoPDF As String = ""
|
||||
Dim ArchivoPDFBytes As Byte() = Nothing
|
||||
Dim ExistePDF As Boolean = False
|
||||
Try
|
||||
@@ -812,7 +812,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
If ObjFactura.CveClienteSucursal > 0 Then
|
||||
If ObjCliente.GetSucursales(ObjFactura.CveCliente, ObjFactura.CveClienteSucursal) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
Dim Correo = ObjCliente.DtResultados.Rows(0)("Correo").ToString
|
||||
Dim Correo As String = ObjCliente.DtResultados.Rows(0)("Correo").ToString
|
||||
If Correo.Trim.Length > 0 Then
|
||||
Mail = Correo
|
||||
End If
|
||||
@@ -839,7 +839,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim Cuerpo As String = String.Empty
|
||||
Dim ResultadoMail As Integer = 0
|
||||
|
||||
Dim TipoComprobante = ""
|
||||
Dim TipoComprobante As String = ""
|
||||
|
||||
If ObjFactura.TipoDocto = "Ing" Then TipoComprobante = "Factura"
|
||||
If ObjFactura.TipoDocto = "Egs" Then TipoComprobante = "Nota de Crédito"
|
||||
|
||||
@@ -106,7 +106,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
|
||||
If DTCicloComercial IsNot Nothing Then
|
||||
For Each RowEmpresa As DataRow In DTCicloComercial.FiltraParametros("", DistinctColumns:={"CveEmpresa"}).Rows
|
||||
Dim CveEmpresa As Integer = RowEmpresa("CveEmpresa").ToString().ToEntero()
|
||||
Dim UsuarioActual = ValidaUsuarioSistema(CveEmpresa)
|
||||
Dim UsuarioActual As Usuario = ValidaUsuarioSistema(CveEmpresa)
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
Retorno = EjecutarFacturacionMasiva(UsuarioActual, DTCicloComercial.FiltraParametros($"CveEmpresa = {CveEmpresa}"))
|
||||
End If
|
||||
@@ -158,7 +158,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
|
||||
Private Function EmitirImprimir(UsuarioActual As Usuario, RowCiclo As DataRow) As Modelos.Factura.MMensajeFactura
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
|
||||
Dim ObjFactura = CreaObjetosVenta(UsuarioActual, RowCiclo)
|
||||
Dim ObjFactura As Modelos.Factura = CreaObjetosVenta(UsuarioActual, RowCiclo)
|
||||
|
||||
If ObjFactura Is Nothing Then
|
||||
Resp.Mensajes.Add("Ocurrió un error al procesar los datos de la Venta ")
|
||||
@@ -181,7 +181,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
|
||||
|
||||
#Region "P R E P A R A - V E N T A"
|
||||
Private Function CreaDTVentas() As DataTable
|
||||
Dim TmpDT = New DataTable
|
||||
Dim TmpDT As New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
@@ -218,7 +218,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
|
||||
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Total", GetType(Decimal))
|
||||
'Para uso del módulo contable
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
@@ -270,7 +270,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
|
||||
Return TmpDT
|
||||
End Function
|
||||
Private Function CreaObjetosVenta(UsuarioActual As Usuario, DR As DataRow) As Modelos.Factura
|
||||
Dim ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
Dim ObjFactura As New Modelos.Factura(UsuarioActual)
|
||||
Try
|
||||
ObjFactura.DirectorioServidor = HttpContext.Current.Server.MapPath("/")
|
||||
|
||||
@@ -350,11 +350,11 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
|
||||
objContratos.Dispose()
|
||||
|
||||
Dim DtR As DataRow
|
||||
ObjFactura.SubTotal = SUM(DtDetalle, "Total").ToDecimal
|
||||
ObjFactura.IVA = SUM(DtDetalle, "ImporteIVA").ToDecimal
|
||||
ObjFactura.RetIVA = SUM(DtDetalle, "ImporteRetIVA").ToDecimal
|
||||
ObjFactura.RetISR = SUM(DtDetalle, "ImporteRetISR").ToDecimal
|
||||
ObjFactura.IEPS = SUM(DtDetalle, "ImporteIEPS").ToDecimal
|
||||
ObjFactura.SubTotal = SUM(DtDetalle, "Total")
|
||||
ObjFactura.IVA = SUM(DtDetalle, "ImporteIVA")
|
||||
ObjFactura.RetIVA = SUM(DtDetalle, "ImporteRetIVA")
|
||||
ObjFactura.RetISR = SUM(DtDetalle, "ImporteRetISR")
|
||||
ObjFactura.IEPS = SUM(DtDetalle, "ImporteIEPS")
|
||||
ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA + ObjFactura.IEPS - (ObjFactura.RetIVA + ObjFactura.RetISR)
|
||||
|
||||
For Each row As DataRow In DtDetalle.Rows
|
||||
|
||||
Reference in New Issue
Block a user