-option explicit
This commit is contained in:
@@ -1898,7 +1898,7 @@ Public Class ClsInventarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function RepNotasSinAlmacen(Opcion As Integer, CveClienteProveedor As Integer, FechaIni As Date, FechaFin As Date, TipoDocumento As String, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
Public Function RepNotasSinAlmacen(Opcion As Integer, CveClienteProveedor As Integer, FechaIni As Date, FechaFin As Date, TipoDocumento As String, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Inv_RepNotasSinAlmacen")
|
DataAdapter("PA_Inv_RepNotasSinAlmacen")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
@@ -2213,7 +2213,7 @@ Public Class ClsInventarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function GetExistenciasPSXML(XML As String, CveAlmacen As Integer, Fecha As String, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, ExcluyeApartados As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetExistenciasPSXML(XML As String, CveAlmacen As Integer, Fecha As String, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, ExcluyeApartados As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
If Fecha = "-1" Then
|
If Fecha = "-1" Then
|
||||||
Fecha = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd"))
|
Fecha = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd"))
|
||||||
@@ -3440,7 +3440,7 @@ Public Class ClsInventarios
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function VentaDetallePadreGet(CveVentaDetallePadre As Integer) As Integer
|
Public Function VentaDetallePadreGet(CveVentaDetallePadre As Integer) As Integer
|
||||||
Dim Retorno = -1
|
Dim Retorno As Integer = -1
|
||||||
DataAdapter("PA_Inv_VentaDetallePadreGet")
|
DataAdapter("PA_Inv_VentaDetallePadreGet")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre
|
.Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre
|
||||||
@@ -3455,7 +3455,7 @@ Public Class ClsInventarios
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function GetPendietePorSurtirVenta(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, Optional Tipo As Integer = -1) As Boolean
|
Public Function GetPendientePorSurtirVenta(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, Optional Tipo As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_Inv_VentasPendientesPorSurtirGet")
|
DataAdapter("PA_Inv_VentasPendientesPorSurtirGet")
|
||||||
@@ -4387,7 +4387,7 @@ Public Class ClsInventarios
|
|||||||
#Region " INVENTARIOS - SOLICITUD DE TRASPASOS "
|
#Region " INVENTARIOS - SOLICITUD DE TRASPASOS "
|
||||||
Public Function AddTrasladoSolicitud(Observaciones As String, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, CveMovimientoAlmacen As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
|
Public Function AddTrasladoSolicitud(Observaciones As String, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, CveMovimientoAlmacen As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
|
||||||
Optional CveContrato As Integer = -1, Optional Guia As String = "", Optional CvePaqueteria As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional CveOS As Integer = -1, Optional EstatusAlmacen As Integer = -1) As Integer
|
Optional CveContrato As Integer = -1, Optional Guia As String = "", Optional CvePaqueteria As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional CveOS As Integer = -1, Optional EstatusAlmacen As Integer = -1) As Integer
|
||||||
Dim Retorno = -1
|
Dim Retorno As Integer = -1
|
||||||
DataAdapter("PA_Inv_TraspasoSolicitudAdd")
|
DataAdapter("PA_Inv_TraspasoSolicitudAdd")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ Namespace Modelos
|
|||||||
Timbre = New CFDITimbre
|
Timbre = New CFDITimbre
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SetTotales(dtVentas As DataTable, ObjVentas As ClsVentas)
|
Private Sub SetTotales(dtVentas As DataTable, ObjVentas As ClsVentas)
|
||||||
Dim TmpDTImpuestos = New DataTable
|
Dim TmpDTImpuestos As New DataTable
|
||||||
TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
|
TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
|
||||||
TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
|
TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
|
||||||
TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
|
TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
|
||||||
@@ -530,7 +530,7 @@ Namespace Modelos
|
|||||||
Dim dtImpuesto As DataTable = ObjVentas.DtResultados
|
Dim dtImpuesto As DataTable = ObjVentas.DtResultados
|
||||||
If dtImpuesto.Rows.Count > 0 Then
|
If dtImpuesto.Rows.Count > 0 Then
|
||||||
For Each Row As DataRow In dtImpuesto.Rows
|
For Each Row As DataRow In dtImpuesto.Rows
|
||||||
Dim Orden = 80
|
Dim Orden As Integer = 80
|
||||||
If Row("Importe").ToString.ToDouble <> 0 Then
|
If Row("Importe").ToString.ToDouble <> 0 Then
|
||||||
DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
|
DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
|
||||||
DR("Importe") = Row("Importe").ToString.ToDouble
|
DR("Importe") = Row("Importe").ToString.ToDouble
|
||||||
@@ -819,7 +819,7 @@ Namespace Modelos
|
|||||||
Dim ObjDocCliente As New ClsEdocumentacion(ObjVentas.IniciaTransacSQL())
|
Dim ObjDocCliente As New ClsEdocumentacion(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL())
|
Dim ObjGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
||||||
Dim MensajeAlert = New StringBuilder
|
Dim MensajeAlert As New StringBuilder
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|
||||||
@@ -1031,7 +1031,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
Dim SeTimbro As Boolean = False
|
Dim SeTimbro As Boolean = False
|
||||||
Dim SeTimbroNC As Boolean = False
|
Dim SeTimbroNC As Boolean = False
|
||||||
Dim EstatusSMS = 0
|
Dim EstatusSMS As Integer = 0
|
||||||
|
|
||||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||||
If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "Cot", "Ped", "DPe", "PA", "Pd2")) Then
|
If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "Cot", "Ped", "DPe", "PA", "Pd2")) Then
|
||||||
@@ -1054,7 +1054,7 @@ Namespace Modelos
|
|||||||
'DOCUMENTO ACTUAL
|
'DOCUMENTO ACTUAL
|
||||||
If DebeTimbrar Then
|
If DebeTimbrar Then
|
||||||
If Me.EmitirCartaPorte AndAlso CveTimbreCartaPorte > 0 Then
|
If Me.EmitirCartaPorte AndAlso CveTimbreCartaPorte > 0 Then
|
||||||
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
Dim RespCartaPorte As Timbres.MMensajeCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
||||||
If Not RespCartaPorte.TieneError Then
|
If Not RespCartaPorte.TieneError Then
|
||||||
Me.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
Me.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
||||||
Else
|
Else
|
||||||
@@ -1129,7 +1129,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
|
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
|
||||||
If SeTimbro Then
|
If SeTimbro Then
|
||||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, Me.TipoDocto, Me.SerieFolio)
|
Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, Me.TipoDocto, Me.SerieFolio)
|
||||||
If File.Exists(ArchivoXML) Then
|
If File.Exists(ArchivoXML) Then
|
||||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", Me.SerieFolio, Me.TipoDocto)))
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", Me.SerieFolio, Me.TipoDocto)))
|
||||||
End If
|
End If
|
||||||
@@ -1775,7 +1775,7 @@ Namespace Modelos
|
|||||||
tPS = tPS.Replace("|", " ")
|
tPS = tPS.Replace("|", " ")
|
||||||
|
|
||||||
If tPS.Length >= 1000 Then
|
If tPS.Length >= 1000 Then
|
||||||
Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999)
|
Dim tPSRecortado As String = tPS.Remove(999, tPS.Length - 999)
|
||||||
tPS = tPSRecortado
|
tPS = tPSRecortado
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1840,14 +1840,14 @@ Namespace Modelos
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
|
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
|
||||||
Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
Dim Url As New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||||
Dim File As Byte() = Nothing
|
Dim File As Byte() = Nothing
|
||||||
Try
|
Try
|
||||||
Using httpClient = New HttpClient()
|
Using httpClient As New HttpClient()
|
||||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
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}", CveEmpresa, DateTime.UtcNow.Ticks)))
|
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}", CveEmpresa, DateTime.UtcNow.Ticks)))
|
||||||
Dim response = httpClient.SendAsync(request).Result
|
Dim response As HttpResponseMessage = httpClient.SendAsync(request).Result
|
||||||
If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then
|
If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then
|
||||||
File = response.Content.ReadAsByteArrayAsync().Result
|
File = response.Content.ReadAsByteArrayAsync().Result
|
||||||
End If
|
End If
|
||||||
@@ -2023,10 +2023,10 @@ Namespace Modelos
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Function EnviarSMSTimbrado(ByRef ObjEventos As ClsOIEventos) As Integer
|
Private Function EnviarSMSTimbrado(ByRef ObjEventos As ClsOIEventos) As Integer
|
||||||
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
Dim Mensaje As String = UsuarioActual.Empresa.Funcionalidad(152)
|
||||||
If Mensaje = "" Then Return 0
|
If Mensaje = "" Then Return 0
|
||||||
|
|
||||||
Dim Celular = Me.Cliente.CobranzaTelefono
|
Dim Celular As String = Me.Cliente.CobranzaTelefono
|
||||||
If Celular.Length <> 10 Then Return 3
|
If Celular.Length <> 10 Then Return 3
|
||||||
|
|
||||||
'ARMA MENSAJE
|
'ARMA MENSAJE
|
||||||
@@ -2315,7 +2315,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
'BONIFICACION USADOS
|
'BONIFICACION USADOS
|
||||||
If UsadosBonificacion IsNot Nothing AndAlso UsadosBonificacion.Count > 0 AndAlso TipoBonificacion > 0 Then
|
If UsadosBonificacion IsNot Nothing AndAlso UsadosBonificacion.Count > 0 AndAlso TipoBonificacion > 0 Then
|
||||||
For Each CveMovto In UsadosBonificacion
|
For Each CveMovto As Integer In UsadosBonificacion
|
||||||
If Not ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, TipoBonificacion, CveVenta) Then
|
If Not ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, TipoBonificacion, CveVenta) Then
|
||||||
ErrorList.Add("Ocurrió un error al actualizar el distribuidor.")
|
ErrorList.Add("Ocurrió un error al actualizar el distribuidor.")
|
||||||
End If
|
End If
|
||||||
@@ -2765,7 +2765,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Dr = DtVentasNC.NewRow
|
Dim Dr As DataRow = DtVentasNC.NewRow
|
||||||
Dr("CveVenta") = pCveVenta
|
Dr("CveVenta") = pCveVenta
|
||||||
Dr("Importe") = Importe
|
Dr("Importe") = Importe
|
||||||
Dr("FolioFiscal") = FolioFiscal
|
Dr("FolioFiscal") = FolioFiscal
|
||||||
@@ -2963,8 +2963,8 @@ Namespace Modelos
|
|||||||
|
|
||||||
If GenerarPrePoliza AndAlso CveMovimiento > 0 Then
|
If GenerarPrePoliza AndAlso CveMovimiento > 0 Then
|
||||||
Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio
|
Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio
|
||||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
Dim tCveSubProyecto = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
Dim tCveSubProyecto As Integer = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
||||||
Dim tCveConcepto As Integer = 278
|
Dim tCveConcepto As Integer = 278
|
||||||
Dim ValorInventario As Decimal = 0
|
Dim ValorInventario As Decimal = 0
|
||||||
Dim MovAlmacen As Boolean = False 'debe quedar como el anterior, pero negativo
|
Dim MovAlmacen As Boolean = False 'debe quedar como el anterior, pero negativo
|
||||||
@@ -3647,7 +3647,7 @@ Namespace Modelos
|
|||||||
importeMovimiento = 0
|
importeMovimiento = 0
|
||||||
|
|
||||||
Case 91 'Amortizacion Nota de Credito
|
Case 91 'Amortizacion Nota de Credito
|
||||||
Dim Contabilizable = If(UsuarioActual.CveEmpresa = 119, False, True)
|
Dim Contabilizable As Boolean = If(UsuarioActual.CveEmpresa = 119, False, True)
|
||||||
|
|
||||||
If ValorMultiplicador = -1 Then
|
If ValorMultiplicador = -1 Then
|
||||||
Dim TipoCambioNC As Decimal = 1
|
Dim TipoCambioNC As Decimal = 1
|
||||||
@@ -3834,9 +3834,9 @@ Namespace Modelos
|
|||||||
Else
|
Else
|
||||||
If Not ObjFactura.TipoDocto.Contiene("Rem", "Ant", "Egs", "Dev", "RNC") Then
|
If Not ObjFactura.TipoDocto.Contiene("Rem", "Ant", "Egs", "Dev", "RNC") Then
|
||||||
|
|
||||||
Dim ConceptoContableAplicar = 4
|
Dim ConceptoContableAplicar As Integer = 4
|
||||||
Dim CveVentaAplicar = ObjFactura.CveVenta
|
Dim CveVentaAplicar As Integer = ObjFactura.CveVenta
|
||||||
Dim CveVentaAmortizacionAplicar = -1
|
Dim CveVentaAmortizacionAplicar As Integer = -1
|
||||||
|
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs") And ObjFactura.TipoDocto = "Ant" And CveDevolucion > 0 And NuevaFactura = 1 Then
|
If ObjFactura.TipoDocto.Contiene("Egs") And ObjFactura.TipoDocto = "Ant" And CveDevolucion > 0 And NuevaFactura = 1 Then
|
||||||
ConceptoContableAplicar = 11
|
ConceptoContableAplicar = 11
|
||||||
@@ -3871,9 +3871,9 @@ Namespace Modelos
|
|||||||
Case 150 'Descuento sobre ventas
|
Case 150 'Descuento sobre ventas
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then
|
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then
|
||||||
|
|
||||||
Dim ConceptoContableAplicar = 150
|
Dim ConceptoContableAplicar As Integer = 150
|
||||||
Dim CveVentaAplicar = ObjFactura.CveVenta
|
Dim CveVentaAplicar As Integer = ObjFactura.CveVenta
|
||||||
Dim CveVentaAmortizacionAplicar = -1
|
Dim CveVentaAmortizacionAplicar As Integer = -1
|
||||||
|
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs") And ObjFactura.CveAnticipo > 0 Then
|
If ObjFactura.TipoDocto.Contiene("Egs") And ObjFactura.CveAnticipo > 0 Then
|
||||||
ConceptoContableAplicar = 11
|
ConceptoContableAplicar = 11
|
||||||
@@ -4547,9 +4547,9 @@ Namespace Modelos
|
|||||||
'Agregamos los detalles
|
'Agregamos los detalles
|
||||||
For Each MovDet As DataRow In DtMovDetalle.Rows
|
For Each MovDet As DataRow In DtMovDetalle.Rows
|
||||||
|
|
||||||
Dim Cantidad = 0.0
|
Dim Cantidad As Decimal = 0
|
||||||
Dim CantidadRemision = DtRemisiones.FiltroPrimeroValor("Cantidad", $"CveVentaDetalleRemision={MovDet("CveVentaDetalle").ToString}").ToDouble
|
Dim CantidadRemision As Decimal = DtRemisiones.FiltroPrimeroValor("Cantidad", $"CveVentaDetalleRemision={MovDet("CveVentaDetalle").ToString}").ToDecimal
|
||||||
Dim CantidadInventario = MovDet("Cantidad").ToString.ToDecimal
|
Dim CantidadInventario As Decimal = MovDet("Cantidad").ToString.ToDecimal
|
||||||
|
|
||||||
If RemisionesLista.Count > 0 AndAlso CantidadInventario >= CantidadRemision Then
|
If RemisionesLista.Count > 0 AndAlso CantidadInventario >= CantidadRemision Then
|
||||||
Cantidad = CantidadRemision
|
Cantidad = CantidadRemision
|
||||||
@@ -4596,12 +4596,12 @@ Namespace Modelos
|
|||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
If MovimientoPrePoliza AndAlso CveMovimientoInventario > 0 Then
|
If MovimientoPrePoliza AndAlso CveMovimientoInventario > 0 Then
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||||
Dim DtCostos = ObjInventario.DtResultados.Copy
|
Dim DtCostos As DataTable = ObjInventario.DtResultados.Copy
|
||||||
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
|
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
Dim ValorInventario As Decimal
|
Dim ValorInventario As Decimal
|
||||||
|
|
||||||
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
||||||
ValorInventario = DtCostos.SUM("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).ToString.ToDecimal
|
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion")))
|
||||||
Try
|
Try
|
||||||
If ValorInventario <> 0 Then
|
If ValorInventario <> 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, False, ValorInventario, ValorInventario, 69, Me.SerieFolio, Me.SerieFolio, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=Me.CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, False, ValorInventario, ValorInventario, 69, Me.SerieFolio, Me.SerieFolio, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=Me.CveSubProyecto) Then
|
||||||
@@ -5309,7 +5309,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'CUANDO SE CANCELA, Y TIENE RELACIONADA UNA REMISIÓN, Y ESTA NO SE CANCELARÁ. DEBE DE HACER EN AUTOMÁTICO LOS MOVIMIENTOS AL ALMACEN DE ENTREGA POR ADELANTADO
|
'CUANDO SE CANCELA, Y TIENE RELACIONADA UNA REMISIÓN, Y ESTA NO SE CANCELARÁ. DEBE DE HACER EN AUTOMÁTICO LOS MOVIMIENTOS AL ALMACEN DE ENTREGA POR ADELANTADO
|
||||||
Dim RevivirRemisiones = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count))
|
Dim RevivirRemisiones As Boolean = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count))
|
||||||
|
|
||||||
'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN
|
'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN
|
||||||
If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen <> 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not RealizarDevolucionAlmacen And RevivirRemisiones = False Then
|
If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen <> 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not RealizarDevolucionAlmacen And RevivirRemisiones = False Then
|
||||||
@@ -5418,11 +5418,11 @@ Namespace Modelos
|
|||||||
|
|
||||||
'VERIFICA EN EL SERVICIO SI SE CANCELO
|
'VERIFICA EN EL SERVICIO SI SE CANCELO
|
||||||
Try
|
Try
|
||||||
Dim solicitud = New WSGF.Service1SoapClient()
|
Dim solicitud As New WSGF.Service1SoapClient()
|
||||||
Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal)
|
Dim acuse As WSGF.StructXml = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal)
|
||||||
|
|
||||||
If acuse.Estado = 0 Then
|
If acuse.Estado = 0 Then
|
||||||
Dim xmlAcuse = New System.Xml.XmlDocument()
|
Dim xmlAcuse As New System.Xml.XmlDocument()
|
||||||
xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64))
|
xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64))
|
||||||
CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText
|
CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText
|
||||||
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate()
|
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate()
|
||||||
@@ -5685,7 +5685,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
'CUANDO SE VAYA A REALIZAR LA DEVOLUCION AQUI DEBE MARCALA PARA NO SOLICITARLA DE NUEVO, SI NO LA SOLICITARA
|
'CUANDO SE VAYA A REALIZAR LA DEVOLUCION AQUI DEBE MARCALA PARA NO SOLICITARLA DE NUEVO, SI NO LA SOLICITARA
|
||||||
If ObjFactura.EsDevolucionVenta = 0 Then
|
If ObjFactura.EsDevolucionVenta = 0 Then
|
||||||
Dim EstatusDevolucion = 1
|
Dim EstatusDevolucion As Integer = 1
|
||||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then
|
If Not ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Ocurrió un error al solicitar la devolución de almacen."
|
MensajeError = "Ocurrió un error al solicitar la devolución de almacen."
|
||||||
@@ -5907,7 +5907,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
'AGREGA BITACORA A VENTA
|
'AGREGA BITACORA A VENTA
|
||||||
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then
|
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then
|
||||||
Dim MensajeBitacora = "Devuelta"
|
Dim MensajeBitacora As String = "Devuelta"
|
||||||
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
|
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
|
||||||
MensajeError = "Ocurrió un error al agregar la bitacora."
|
MensajeError = "Ocurrió un error al agregar la bitacora."
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
@@ -6316,7 +6316,7 @@ Namespace Modelos
|
|||||||
If SeCancelaRemisionProceso Then
|
If SeCancelaRemisionProceso Then
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
For Each CveRemisionCancelar In ListaRemisionesCancelar
|
For Each CveRemisionCancelar As Integer In ListaRemisionesCancelar
|
||||||
If Not ObjVentas.AddRemisionesXCancelar(CveVenta, CveRemisionCancelar) Then
|
If Not ObjVentas.AddRemisionesXCancelar(CveVenta, CveRemisionCancelar) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Ocurrió un error al guardar la remisión x cancelar."
|
MensajeError = "Ocurrió un error al guardar la remisión x cancelar."
|
||||||
@@ -6332,7 +6332,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
For Each CveRemisionCancelar In ListaRemisionesCancelar
|
For Each CveRemisionCancelar As Integer In ListaRemisionesCancelar
|
||||||
If Not ObjVentas.UpdateEstatusFactura(12, "", "", CancelacionFecha, CveRemisionCancelar) Then
|
If Not ObjVentas.UpdateEstatusFactura(12, "", "", CancelacionFecha, CveRemisionCancelar) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Ocurrió un error al guardar el estatus de cancelación de la remisión."
|
MensajeError = "Ocurrió un error al guardar el estatus de cancelación de la remisión."
|
||||||
@@ -7335,7 +7335,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
Public ReadOnly Property FormaPagoText As String
|
Public ReadOnly Property FormaPagoText As String
|
||||||
Get
|
Get
|
||||||
Dim retorno = ""
|
Dim retorno As String = ""
|
||||||
Select Case FormaPago
|
Select Case FormaPago
|
||||||
Case 0
|
Case 0
|
||||||
retorno = "PAGO EN UNA SOLA EXHIBICIÓN"
|
retorno = "PAGO EN UNA SOLA EXHIBICIÓN"
|
||||||
@@ -7350,7 +7350,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
Public ReadOnly Property CondicionesPagoText As String
|
Public ReadOnly Property CondicionesPagoText As String
|
||||||
Get
|
Get
|
||||||
Dim retorno = ""
|
Dim retorno As String = ""
|
||||||
Select Case CondicionesPago
|
Select Case CondicionesPago
|
||||||
Case 0
|
Case 0
|
||||||
retorno = "contado"
|
retorno = "contado"
|
||||||
@@ -7793,7 +7793,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
Public ReadOnly Property LugarExp As String
|
Public ReadOnly Property LugarExp As String
|
||||||
Get
|
Get
|
||||||
Dim arr = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP}
|
Dim arr As Array = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP}
|
||||||
Return String.Join(",", arr)
|
Return String.Join(",", arr)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
@@ -7862,7 +7862,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
Public ReadOnly Property LugarExp As String
|
Public ReadOnly Property LugarExp As String
|
||||||
Get
|
Get
|
||||||
Dim arr = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP, SubProyecto}
|
Dim arr As Array = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP, SubProyecto}
|
||||||
Return String.Join(",", arr)
|
Return String.Join(",", arr)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
@@ -8036,7 +8036,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
Public ReadOnly Property LugarExp As String
|
Public ReadOnly Property LugarExp As String
|
||||||
Get
|
Get
|
||||||
Dim arr = {EnvioDireccion, EnvioColonia, EnvioCiudad, EnvioEstado, EnvioCP, EnvioTel}
|
Dim arr As Array = {EnvioDireccion, EnvioColonia, EnvioCiudad, EnvioEstado, EnvioCP, EnvioTel}
|
||||||
Return String.Join(",", arr)
|
Return String.Join(",", arr)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|||||||
@@ -851,7 +851,7 @@ Public Class Timbrado
|
|||||||
Private Function EnviarInformacionCancelacionPADESOAP(ByVal url As String, UsuarioServicio As String, PassServicio As String, contrato As String, rfcEmisor As String, rfcReceptor As String,
|
Private Function EnviarInformacionCancelacionPADESOAP(ByVal url As String, UsuarioServicio As String, PassServicio As String, contrato As String, rfcEmisor As String, rfcReceptor As String,
|
||||||
certBase64 As String, keyBase64 As String, keyPass As String, arregloUUID As String, Total As Decimal, TimbraProduccion As Boolean,
|
certBase64 As String, keyBase64 As String, keyPass As String, arregloUUID As String, Total As Decimal, TimbraProduccion As Boolean,
|
||||||
Optional MotivoCancelacion As String = "", Optional FolioSustitucion As String = "") As String
|
Optional MotivoCancelacion As String = "", Optional FolioSustitucion As String = "") As String
|
||||||
Dim retorno = ""
|
Dim retorno As String = ""
|
||||||
Try
|
Try
|
||||||
|
|
||||||
Dim request As HttpWebRequest = CType(WebRequest.Create($"{url}"), HttpWebRequest)
|
Dim request As HttpWebRequest = CType(WebRequest.Create($"{url}"), HttpWebRequest)
|
||||||
@@ -895,7 +895,7 @@ Public Class Timbrado
|
|||||||
End Using
|
End Using
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(response) Then
|
If Not String.IsNullOrEmpty(response) Then
|
||||||
Dim xmlRetorno = New XmlDocument()
|
Dim xmlRetorno As New XmlDocument()
|
||||||
xmlRetorno.LoadXml(response)
|
xmlRetorno.LoadXml(response)
|
||||||
Dim elemList As XmlNodeList = xmlRetorno.GetElementsByTagName("return")
|
Dim elemList As XmlNodeList = xmlRetorno.GetElementsByTagName("return")
|
||||||
|
|
||||||
@@ -1270,13 +1270,13 @@ Public Class Timbrado
|
|||||||
Private Function EnviarInformacionPADE(url As String, payload As String, tokenAuth As String) As String
|
Private Function EnviarInformacionPADE(url As String, payload As String, tokenAuth As String) As String
|
||||||
Dim Retorno As String = ""
|
Dim Retorno As String = ""
|
||||||
Try
|
Try
|
||||||
Using httpClient = New HttpClient()
|
Using httpClient As New HttpClient()
|
||||||
httpClient.Timeout = New TimeSpan(0, 1, 0)
|
httpClient.Timeout = New TimeSpan(0, 1, 0)
|
||||||
Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url))
|
Using request As New HttpRequestMessage(HttpMethod.Post, New Uri(url))
|
||||||
request.Headers.Add("Authorization", $"Basic {tokenAuth}")
|
request.Headers.Add("Authorization", $"Basic {tokenAuth}")
|
||||||
Using content = New StringContent(payload, Encoding.UTF8, "application/json")
|
Using content As New StringContent(payload, Encoding.UTF8, "application/json")
|
||||||
request.Content = content
|
request.Content = content
|
||||||
Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result
|
Dim response As HttpResponseMessage = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result
|
||||||
|
|
||||||
Retorno = response.Content.ReadAsStringAsync().Result
|
Retorno = response.Content.ReadAsStringAsync().Result
|
||||||
End Using
|
End Using
|
||||||
@@ -1569,7 +1569,7 @@ Public Class Timbrado
|
|||||||
|
|
||||||
Dim w As Integer = 0
|
Dim w As Integer = 0
|
||||||
|
|
||||||
For Each Ret In ObjCFDITimbre.Retenciones
|
For Each Ret As CFDIRetenciones In ObjCFDITimbre.Retenciones
|
||||||
comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI40.ComprobanteImpuestosRetencion()
|
comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI40.ComprobanteImpuestosRetencion()
|
||||||
comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto
|
comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto
|
||||||
comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe
|
comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe
|
||||||
@@ -1624,7 +1624,7 @@ Public Class Timbrado
|
|||||||
If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
|
If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
|
||||||
|
|
||||||
'DATOS GENERALES
|
'DATOS GENERALES
|
||||||
Dim ComExt = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExterior()
|
Dim ComExt As New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExterior()
|
||||||
ComExt.Version = "1.1"
|
ComExt.Version = "1.1"
|
||||||
ComExt.MotivoTrasladoSpecified = True
|
ComExt.MotivoTrasladoSpecified = True
|
||||||
ComExt.MotivoTraslado = ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado
|
ComExt.MotivoTraslado = ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado
|
||||||
|
|||||||
Reference in New Issue
Block a user