diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index a9d79c531..8dad34b1f 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -381,7 +381,7 @@ Partial Class AF_AF
CargaEstatusActivoFijo()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, lblProyecto, LblSubProyecto)
RowProyecto.Visible = DdlProyecto.Visible
- CargaCliente()
+ 'CargaCliente()
CargaGrupos()
CargaMarcas()
CargaTiposAgenda()
@@ -471,10 +471,10 @@ Partial Class AF_AF
DdlEstadoActivoFijo.DataSource = GlobalDTEstadoActivoFijo
DdlEstadoActivoFijo.DataBind()
End Sub
- Private Sub CargaCliente()
- DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
- DdlClientes.DataBind()
- End Sub
+ 'Private Sub CargaCliente()
+ ' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
+ ' DdlClientes.DataBind()
+ 'End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto()
@@ -667,8 +667,11 @@ Partial Class AF_AF
DdlResponsable.SelectedValue = ObjActivoFijo.DtResultados.Rows(0)("CvePersonaResponsable").ToString
DdlProyecto.SelectedValue = ObjActivoFijo.CveProyecto.ToString
CargaSubProyecto()
- DdlSubProyecto.SelectedValue = ObjActivoFijo.DtResultados.Rows(0)("CveSubProyecto").ToString
- DdlClientes.SelectedValueExist(ObjActivoFijo.CveCliente)
+ DdlSubProyecto.SelectedValue = ObjActivoFijo.DtResultados.Rows(0)("CveSubProyecto").ToString
+ Ddlclientes.SelectedValue = ObjActivoFijo.CveCliente.ToString
+ If ObjActivoFijo.CveCliente > 0 Then
+ Ddlclientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=ObjActivoFijo.CveCliente).FiltroPrimeroValor("NombreComercial")
+ End If
DdlMarcas.SelectedValueExist(ObjActivoFijo.CveMarcaActivoFijo)
CargaModelos(DdlMarcas.SelectedValue.ToEntero)
DdlModelos.SelectedValueExist(ObjActivoFijo.CveModeloActivoFijo)
@@ -971,10 +974,10 @@ Partial Class AF_AF
UpDatos.Update()
End Sub
Private Sub CargaProveedor()
- DdlProveedor.Items.Clear()
- DdlProveedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
- DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
- DdlProveedor.DataBind()
+ 'DdlProveedor.Items.Clear()
+ 'DdlProveedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ 'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
+ 'DdlProveedor.DataBind()
UpAddPolizas.Update()
End Sub
@@ -1009,7 +1012,7 @@ Partial Class AF_AF
UpDatos.Update()
BtnAgregarPoliza.Text = "Agregar"
LabelPolizas.InnerText = "Agregar Póliza de seguro"
- DdlProveedor.SelectedIndex = 0
+ 'DdlProveedor.SelectedIndex = 0
TxtPolizaSeguro.Text = ""
TxtFechaExpPoliza.Text = ""
TxtFechaVenPoliza.Text = ""
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 728d1d200..5615d03b2 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -6229,30 +6229,6 @@ Public Class ClsContabilidad
#End Region
-#Region "IDisposable Support"
- ' IDisposable
- Protected Overridable Sub Dispose(disposing As Boolean)
- If Not Me.disposedValue Then
- If disposing Then
-
- If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
- If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
- If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
- If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
- If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
- If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
- If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
-
- End If
- End If
- Me.disposedValue = True
- End Sub
- Public Sub Dispose() Implements IDisposable.Dispose
- ConexionClose()
- Dispose(True)
- GC.SuppressFinalize(Me)
- End Sub
-#End Region
#Region "Periodos Bloqueo Meses"
Public Function GetPeriodosBloqueo(CveEmpresa As Integer) As Boolean
Dim Retorno = False
@@ -6376,8 +6352,6 @@ Public Class ClsContabilidad
End Function
#End Region
-
-
#Region "ESTADO RESULTADOS HORIZONTAL"
@@ -6567,4 +6541,32 @@ Public Class ClsContabilidad
Return Retorno
End Function
+
+
+#Region "IDisposable Support"
+ ' IDisposable
+ Protected Overridable Sub Dispose(disposing As Boolean)
+ If Not Me.disposedValue Then
+ If disposing Then
+
+ If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
+ If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
+ If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
+ If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
+ If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
+ If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
+ If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
+
+ End If
+ End If
+ Me.disposedValue = True
+ End Sub
+ Public Sub Dispose() Implements IDisposable.Dispose
+ ConexionClose()
+ Dispose(True)
+ GC.SuppressFinalize(Me)
+ End Sub
+#End Region
+
+
End Class
\ No newline at end of file
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index c256e98fe..6cfd8a54b 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -131,6 +131,8 @@ Public Class ClsInventarios
Public Property ResponsableCarga As String
Public Property ResponsableRecibio As String
Public Property Modulo As String
+ Public Property ConAplicacion As Boolean
+
@@ -1279,7 +1281,7 @@ Public Class ClsInventarios
Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha,
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1,
Optional CostoIndirecto As Decimal = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
- Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1) As Boolean
+ Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetallePadre As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleAdd")
@@ -1305,6 +1307,7 @@ Public Class ClsInventarios
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@EsInterno", SqlDbType.Int).Value = EsInterno
+ .Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre
.Add("@CveMovimientoDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -2306,6 +2309,8 @@ Public Class ClsInventarios
FechaI = dr("FechaInicio").ToString
FechaF = dr("FechaFin").ToString
Estatus = dr("Estatus").ToString
+ ConAplicacion = Convert.ToBoolean(dr("ConAplicacion").ToString)
+
Retorno = True
End If
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 49aab559a..f772f0635 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -1157,7 +1157,7 @@ Public Class ClsPaginas
Dim AppNombre As String = String.Format("GlobalDTProyectosUsuarios-{0}", CveEmpresa)
If Application(AppNombre) Is Nothing Then
Dim ObjSubProyectos As New ClsSubProyectos()
- If ObjSubProyectos.GetSubProyectosUsuarios Then Application(AppNombre) = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) Else Alert("Ocurrió un error al cargar los Proyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
+ If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) Else Alert("Ocurrió un error al cargar los Proyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
ObjSubProyectos.Dispose()
GuardaLog("Se Cargo GlobalDTProyectosUsuarios")
End If
@@ -5706,6 +5706,7 @@ Public Class ClsPaginas
Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario)
wsreport = Nothing
params = Nothing
+ ds.Dispose() : ds = Nothing
Else
If IsNothing(MR) Then MR = New ReportViewer
Try
@@ -5735,6 +5736,7 @@ Public Class ClsPaginas
'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
End Try
MR.Dispose()
+ MR = Nothing
'Dim ruta = wsreport.StreamPDF(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario)
'If File.Exists(ruta) Then
' Bytes = File.ReadAllBytes(ruta)
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 7bd11e2fc..31a54c57f 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -6582,6 +6582,8 @@ Namespace Modelos
Me.ClienteSucursal.Sucursal = Cliente.Sucursal
Me.ClienteSucursal.ImprimeNombreSucursal = Cliente.ImprimeNombreSucursal.ToString()
End If
+ Else
+ Cliente = New Modelos.ClienteModel()
End If
End Sub
Public Sub SetMoneda()
@@ -9791,6 +9793,9 @@ Namespace Modelos
Inherits Modelos.EntityModel
Protected Overloads Sub SetDefaultValues()
CveCliente = -1
+ Nombre = ""
+ RFC = ""
+ Codigo = ""
EnviarFactura = "Si"
Estatus = "Activo"
NoExt = ""
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index 625017e87..eb7963a0e 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -3658,6 +3658,7 @@ Public Class Timbrado
+
End If
#Region "Complemento Pago"
@@ -3780,6 +3781,159 @@ Public Class Timbrado
End If
#End Region
+
+#Region "C O M P L E M E N T O C A R T A P O R T E"
+
+ If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
+ If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
+
+ Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
+
+
+
+ ''DATOS GENERALES
+ Dim ComCartaPorte = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorte()
+ Dim Transp As Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteTranspInternac
+ ComCartaPorte.TranspInternac = If(Carta.TranspInternac = "No", Transp.No, Transp.Sí)
+ ComCartaPorte.EntradaSalidaMercSpecified = False
+ ComCartaPorte.ViaEntradaSalidaSpecified = False
+ ComCartaPorte.TotalDistRecSpecified = False
+
+ 'UBICACIONES
+ If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
+ Dim i As Integer = 0
+ ComCartaPorte.Ubicaciones = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacion(Carta.Ubicaciones.Count - 1) {}
+ For Each ubica As CFDICartaPorteUbicaciones In Carta.Ubicaciones
+ 'origen
+ ComCartaPorte.Ubicaciones(i) = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacion
+ ComCartaPorte.Ubicaciones(i).TipoEstacionSpecified = False
+ ComCartaPorte.Ubicaciones(i).DistanciaRecorrida = ubica.DistanciaRecorrida
+ ComCartaPorte.Ubicaciones(i).Origen = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionOrigen With {.IDOrigen = ubica.Origen.IDOrigen,
+ .RFCRemitente = ubica.Origen.RFCRemitente,
+ .NombreRemitente = ubica.Origen.NombreRemitente,
+ .FechaHoraSalida = ubica.Origen.FechaHoraSalida.ToDate}
+ ComCartaPorte.Ubicaciones(i).Domicilio = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionDomicilio With {.Calle = ubica.Origen.Domicilio.Calle,
+ .NumeroExterior = ubica.Origen.Domicilio.NumeroExterior,
+ .NumeroInterior = ubica.Origen.Domicilio.NumeroInterior,
+ .Colonia = ubica.Origen.Domicilio.Colonia,
+ .Localidad = ubica.Origen.Domicilio.Localidad,
+ .Referencia = ubica.Origen.Domicilio.Referencia,
+ .Municipio = ubica.Origen.Domicilio.Municipio,
+ .Estado = ubica.Origen.Domicilio.Estado,
+ .CodigoPostal = ubica.Origen.Domicilio.CP}
+ 'falta pais
+
+
+
+ ComCartaPorte.Ubicaciones(i).Destino = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionDestino With {.IDDestino = ubica.Destino.IDDestino,
+ .RFCDestinatario = ubica.Destino.RFCDestinatario,
+ .NombreDestinatario = ubica.Destino.NombreDestinatario,
+ .FechaHoraProgLlegada = ubica.Destino.FechaHoraProgLlegada.ToDate}
+
+ ComCartaPorte.Ubicaciones(i).Domicilio = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionDomicilio With {.Calle = ubica.Destino.Domicilio.Calle,
+ .NumeroExterior = ubica.Destino.Domicilio.NumeroExterior,
+ .NumeroInterior = ubica.Destino.Domicilio.NumeroInterior,
+ .Colonia = ubica.Destino.Domicilio.Colonia,
+ .Localidad = ubica.Destino.Domicilio.Localidad,
+ .Referencia = ubica.Destino.Domicilio.Referencia,
+ .Municipio = ubica.Destino.Domicilio.Municipio,
+ .Estado = ubica.Destino.Domicilio.Estado,
+ .CodigoPostal = ubica.Destino.Domicilio.CP}
+
+
+ 'cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorrida)
+ 'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.Origen.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
+ 'cfdi.CartaPorteDomicilio(ubica.Origen.Domicilio.Calle, ubica.Origen.Domicilio.NumeroExterior, ubica.Origen.Domicilio.NumeroInterior, ubica.Origen.Domicilio.Colonia, ubica.Origen.Domicilio.Localidad, ubica.Origen.Domicilio.Referencia, ubica.Origen.Domicilio.Municipio, ubica.Origen.Domicilio.Estado, ubica.Origen.Domicilio.Pais, ubica.Origen.Domicilio.CP)
+ 'destino
+ 'cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorrida)
+ 'cfdi.CartaPorteDestino(ubica.Destino.IDDestino, ubica.Destino.RFCDestinatario, ubica.Destino.NombreDestinatario, ubica.Destino.NumRegIdTrib, ubica.Destino.ResidenciaFiscal, ubica.Destino.NumEstacion, ubica.Destino.NombreEstacion, ubica.Destino.NavegacionTrafico, ubica.Destino.FechaHoraProgLlegada)
+ 'cfdi.CartaPorteDomicilio(ubica.Destino.Domicilio.Calle, ubica.Destino.Domicilio.NumeroExterior, ubica.Destino.Domicilio.NumeroInterior, ubica.Destino.Domicilio.Colonia, ubica.Destino.Domicilio.Localidad, ubica.Destino.Domicilio.Referencia, ubica.Destino.Domicilio.Municipio, ubica.Destino.Domicilio.Estado, ubica.Destino.Domicilio.Pais, ubica.Destino.Domicilio.CP)
+ Next
+
+ End If
+
+ 'MERCANCIAS
+ If Carta.Mercancias IsNot Nothing Then
+ ComCartaPorte.Mercancias = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteMercancias
+ ComCartaPorte.Mercancias.PesoBrutoTotal = Carta.Mercancias.PesoBrutoTotal.ToDecimal
+ ComCartaPorte.Mercancias.PesoNetoTotal = Carta.Mercancias.PesoNetoTotal.ToDecimal
+ ComCartaPorte.Mercancias.NumTotalMercancias = Carta.Mercancias.NumTotalMercancias
+ ComCartaPorte.Mercancias.CargoPorTasacion = Carta.Mercancias.CargoporTasacion.ToDecimal
+ ' ComCartaPorte.Mercancias.UnidadPeso = Carta.Mercancias.UnidadPeso
+
+ If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
+ Dim i As Integer = 0
+ ComCartaPorte.Mercancias.Mercancia = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteMercanciasMercancia(Carta.Mercancias.Mercancias.Count - 1) {}
+ For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
+ ComCartaPorte.Mercancias.Mercancia(i) = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteMercanciasMercancia
+ ComCartaPorte.Mercancias.Mercancia(i).BienesTranspSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).ClaveSTCCSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).Descripcion = concep.Descripción
+ ComCartaPorte.Mercancias.Mercancia(i).Cantidad = concep.Cantidad
+ ComCartaPorte.Mercancias.Mercancia(i).ClaveUnidadSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).Unidad = concep.Unidad
+ ComCartaPorte.Mercancias.Mercancia(i).Dimensiones = concep.Dimensiones
+ ComCartaPorte.Mercancias.Mercancia(i).MaterialPeligrosoSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).CveMaterialPeligrosoSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).EmbalajeSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).DescripEmbalaje = concep.DescripEmbalaje
+ ComCartaPorte.Mercancias.Mercancia(i).PesoEnKg = concep.PesoenKg
+ ComCartaPorte.Mercancias.Mercancia(i).ValorMercanciaSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).MonedaSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).FraccionArancelariaSpecified = False
+ ComCartaPorte.Mercancias.Mercancia(i).UUIDComercioExt = concep.UUIDComercioExt
+
+ 'cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, concep.Embalaje, concep.DescripEmbalaje, concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
+ Next
+ End If
+ End If
+
+ '
+ If Carta.FiguraTransporte IsNot Nothing Then
+
+ If Carta.FiguraTransporte.AutoTransporteFederal IsNot Nothing Then
+ ComCartaPorte.FiguraTransporte = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteFiguraTransporte
+
+ ComCartaPorte.FiguraTransporte.CveTransporte = Profact.TimbraCFDI33.Complementos.CartaPorte10.c_CveTransporte.Item02
+ 'ComCartaPorte.FiguraTransporte.CveTransporte.
+
+ 'cfdi.CartaPorteAutotransporteFederal(Carta.FiguraTransporte.AutoTransporteFederal.PermSCT, Carta.FiguraTransporte.AutoTransporteFederal.NumPermisoSCT, Carta.FiguraTransporte.AutoTransporteFederal.NombreAseg, Carta.FiguraTransporte.AutoTransporteFederal.NumPolizaSeguro)
+
+ 'cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.AnioModeloVM)
+
+ 'If Carta.FiguraTransporte.AutoTransporteFederal.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporteFederal.Remolques.Count > 0 Then
+ 'For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporteFederal.Remolques
+ 'cfdi.CartaPorteRemolque(concep.SubTipoRemolque, concep.Placa)
+ ' Next
+ '
+ 'End If
+ End If
+
+
+ 'If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
+ ' Dim i As Integer = 0
+ ' ComCartaPorte.FiguraTransporte.Operadores = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteFiguraTransporteOperadoresOperador(Carta.FiguraTransporte.Operadores.Count - 1)() {}
+ ' For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
+ ' Dim Oper = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteFiguraTransporteOperadoresOperador()
+ ' Oper.RFCOperador = concep.RFCOperador
+ ' Oper.NumLicencia = concep.NumLicencia
+ ' Oper.NombreOperador = concep.NombreOperador
+ ' Oper.NumRegIdTribOperador = concep.NumRegidTribOperador
+ ' 'Oper.ResidenciaFiscalOperador = concep.ResidenciaFiscalOperador
+ ' ComCartaPorte.FiguraTransporte.Operadores
+ ' 'cfdi.CartaPorteOperador(concep.RFCOperador, concep.NumLicencia, concep.NombreOperador, concep.NumRegidTribOperador, concep.ResidenciaFiscalOperador)
+ ' Next
+ 'End If
+
+ End If
+
+ End If
+
+ End If
+
+#End Region
+
+
#Region "Nomina12"
If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then
Dim Nom = New Profact.TimbraCFDI33.Complementos.Nomina12.Nomina()
diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx
index 57248f917..5f30eea0e 100644
--- a/Ashx/SIGWeb.ashx
+++ b/Ashx/SIGWeb.ashx
@@ -600,6 +600,15 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
+ Dim i As Integer = 0 'limpieza de columnas
+ While i < DtRetorno.Columns.Count
+ If Not DtRetorno.Columns(i).ColumnName.Contiene("CveCliente", ColumnaNombre) Then
+ DtRetorno.Columns.RemoveAt(i)
+ Else
+ i = i + 1
+ End If
+ End While
+
DtRetorno.Columns("CveCliente").ColumnName = "id"
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
@@ -913,7 +922,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
DtPSRetorno = DTTmp.Copy
Else
- 'no regresar datos herror al consultar
+ 'no regresar datos error al consultar
DtPSRetorno.Clear()
End If
DTTmp.Dispose()
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 9b63a00ee..2ce35856c 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -1810,6 +1810,18 @@ Partial Class PopUpVerFactura
End If
End If
+ 'SI ES TIPO RELACION 07- APLICACION DE ANTICIPOS
+ If dtVentas(0)("CveTipoRelacion").ToString.ToEntero = 7 Then
+ Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
+
+ Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
+ Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
+
+ If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
+ Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
+ End If
+ End If
+
'End If
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx
index cd4a6e804..419a93c51 100644
--- a/Contabilidad2/CatCuentasAsignaciones.aspx
+++ b/Contabilidad2/CatCuentasAsignaciones.aspx
@@ -143,7 +143,7 @@
-
+
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb
index cc089bec4..e281fdbab 100644
--- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb
+++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb
@@ -26,14 +26,14 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
End Sub
- Private Sub CargaDatos()
- Dim ObjConta As New ClsContabilidad
- If ObjConta.GetCuentasAsignaciones(UsuarioActual.CveEmpresa) Then
- GvDatos.DataSource = ObjConta.DtResultados
- End If
- ObjConta.Dispose()
- GvDatos.DataBind()
- End Sub
+ 'Private Sub CargaDatos()
+ ' Dim ObjConta As New ClsContabilidad
+ ' If ObjConta.GetCuentasAsignaciones(UsuarioActual.CveEmpresa) Then
+ ' GvDatos.DataSource = ObjConta.DtResultados
+ ' End If
+ ' ObjConta.Dispose()
+ ' GvDatos.DataBind()
+ 'End Sub
Private Sub CargaDatosSistema()
Dim ObjConta As New ClsContabilidad
@@ -67,8 +67,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlCuentaGlobal.DataSource = ObjConta.DtResultados
End If
ObjConta.Dispose()
- DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
-
+ DdlProveedor.setEsWebService(True) 'GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
+
DdlClientes.setEsWebService(True)
DdlPersonal.setEsWebService(True)
@@ -102,7 +102,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlConceptoNomina.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCconceptosContables.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
- DdlProveedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ 'DdlProveedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
@@ -123,7 +123,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlCconceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable"))
DdlCuenta.SelectedValueExist(GvRow.DataKey("CveCuenta"))
DdlConceptoNomina.SelectedValueExist(GvRow.DataKey("CveConceptoNomina").ToEntero)
- DdlProveedor.SelectedValueExist(GvRow.DataKey("CveProveedor"))
+ DdlProveedor.ddl.SelectedValueExist(GvRow.DataKey("CveProveedor"))
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
DdlAlmacen.SelectedValueExist(GvRow.DataKey("CveAlmacen"))
TxtIdCuentaContable.Text = GvRow.DataKey("IdCuenta")
@@ -151,41 +151,22 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If Dr IsNot Nothing Then
- If Dr("AplicaCliente").ToString = "True" Then
- divCliente.Visible = True
- DdlClientes.setEsWebService(True)
- End If
- If Dr("AplicaProveedor").ToString = "True" Then
- divProveedor.Visible = True
- End If
+ divCliente.Visible = Dr("AplicaCliente").ToString = "True"
- If Dr("AplicaPersonal").ToString = "True" Then
- divPersonal.Visible = True
- DdlPersonal.setEsWebService(True)
+ divProveedor.Visible = Dr("AplicaProveedor").ToString = "True"
- End If
+ divPersonal.Visible = Dr("AplicaPersonal").ToString = "True"
- If Dr("AplicaImpuesto").ToString = "True" Then
- divPorcentajeIVA.Visible = True
- End If
+ divPorcentajeIVA.Visible = Dr("AplicaImpuesto").ToString = "True"
+ divClasificacion.Visible = Dr("AplicaClasificacion").ToString = "True"
- If Dr("AplicaClasificacion").ToString = "True" Then
- divClasificacion.Visible = True
- End If
+ divBancos.Visible = Dr("AplicaBancos").ToString = "True"
- If Dr("AplicaBancos").ToString = "True" Then
- divBancos.Visible = True
- End If
+ divAlmacen.Visible = Dr("AplicaAlmacen").ToString = "True"
- If Dr("AplicaAlmacen").ToString = "True" Then
- divAlmacen.Visible = True
- End If
-
- If Dr("AplicaSubProyecto").ToString = "True" Then
- divSubProyectos.Visible = True
- End If
+ divSubProyectos.Visible = Dr("AplicaSubProyecto").ToString = "True"
If Dr("AplicaActivoFijo").ToString = "True" Then
divActivoFijo.Visible = True
@@ -194,9 +175,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
' DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo"))
End If
- If Dr("AplicaNomina").ToString = "True" Then
- divConceptoNomina.Visible = True
- End If
+ divConceptoNomina.Visible = Dr("AplicaNomina").ToString = "True"
End If
End Sub
diff --git a/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs
index 09f056b8a..8b76b39b9 100644
--- a/General/PopUpPaqueteriasGuias.aspx.cs
+++ b/General/PopUpPaqueteriasGuias.aspx.cs
@@ -814,7 +814,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
private string getCorreoString()
{
ClsVentas ObjVentas = new ClsVentas();
- if (ObjVentas.GetVenta(CveVenta,UsuarioActual.CveEmpresa))
+ if (ObjVentas.GetVenta(CveVenta,UsuarioActual.CveEmpresa) && ObjVentas.DtResultados.Rows.Count > 0 )
{
int CveVendedor = ObjVentas.DtResultados.Rows[0]["CveVendedor"].ToEntero();
int CveCliente = ObjVentas.DtResultados.Rows[0]["CveCliente"].ToEntero();
diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx
index f606fac90..fca11a4d5 100644
--- a/Inventarios/EntradasSalidas.aspx
+++ b/Inventarios/EntradasSalidas.aspx
@@ -123,7 +123,7 @@
-
+
@@ -134,7 +134,7 @@
--%>
-
+
@@ -165,23 +165,20 @@
Información del movimiento
-
-
>
-
-
-
+
+
-
-
+
+
@@ -191,8 +188,8 @@
-
-
+
+
@@ -286,26 +283,26 @@
-
+
+
-
-
+
<%----%>
+
+
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index 52ae84d9f..5a490db33 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -329,7 +329,7 @@ Partial Class Inventarios_EntradasSalidas
Case "1"
Case "2"
- divMonedaSeccion.Visible = True
+ 'divMonedaSeccion.Visible = True
divGuia.Visible = True
End Select
diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index 66f0a2f72..5f5646989 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -1036,13 +1036,16 @@ Partial Class Inventarios_EntregaAlmacen
End Sub
Private Sub CargaDocumentos(tCveVenta As Integer)
- Dim objInv As New ClsEdocumentacion
-
- If objInv.DocumentacionElectronicaGet(-1, -1, -1, UsuarioActual.CveEmpresa, -1, tCveVenta) Then
- GvDocs.DataSource = objInv.DtResultados.FiltraParametros("Adjunto <> ''")
- End If
- objInv.Dispose()
- GvDocs.DataBind()
+ If tCveVenta > 0 Then
+ Dim objInv As New ClsEdocumentacion
+
+ If objInv.DocumentacionElectronicaGet(-1, -1, -1, UsuarioActual.CveEmpresa, -1, tCveVenta) Then
+ GvDocs.DataSource = objInv.DtResultados.FiltraParametros("Adjunto <> ''")
+ End If
+ objInv.Dispose()
+ GvDocs.DataBind()
+ End If
+
End Sub
diff --git a/Inventarios/InventarioFisico.aspx.vb b/Inventarios/InventarioFisico.aspx.vb
index 4bab376ac..cffe5140e 100644
--- a/Inventarios/InventarioFisico.aspx.vb
+++ b/Inventarios/InventarioFisico.aspx.vb
@@ -507,6 +507,7 @@ Partial Class Inventarios_InventarioFisico
FechaFin = GvRow.DataKey("FechaFin").ToEntero
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto").ToEntero)
chkUsarApp.Checked = Convert.ToBoolean(GvRow.DataKey("ConAplicacion").ToString)
+ divUsuarios.Visible = chkUsarApp.Checked
CargaGvAlmacen()
CargaGvClasificacion()
CargaGvProductosServicios()
diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb
index 8070583a5..3f3695a07 100644
--- a/Inventarios/InventarioFisicoDetalle.aspx.vb
+++ b/Inventarios/InventarioFisicoDetalle.aspx.vb
@@ -161,7 +161,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
End If
str.Clear()
- CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1)
+ CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length)
End If
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb
index 12a19714f..029b42eb0 100644
--- a/Inventarios/RepAnomalias.aspx.vb
+++ b/Inventarios/RepAnomalias.aspx.vb
@@ -41,6 +41,24 @@ Partial Class Inventarios_RepAnomalias
End Set
End Property
+ Public Property aplicacion As Boolean
+ Get
+ Return CType(ViewState("aplicacion"), Boolean)
+ End Get
+ Set(value As Boolean)
+ ViewState("aplicacion") = value
+ End Set
+ End Property
+
+ Public Property CreandoNuevoInventario As Boolean
+ Get
+ Return CType(ViewState("CreandoNuevoInventario"), Boolean)
+ End Get
+ Set(value As Boolean)
+ ViewState("CreandoNuevoInventario") = value
+ End Set
+ End Property
+
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -51,6 +69,7 @@ Partial Class Inventarios_RepAnomalias
If CveInventarioFisico > 0 Then
CargaDatos(CveInventarioFisico)
+ CreandoNuevoInventario = False
End If
End If
@@ -72,7 +91,7 @@ Partial Class Inventarios_RepAnomalias
lbFechaI.Text = Inventario.FechaI
lbFechaF.Text = Inventario.FechaF
CveSubProyecto = Inventario.CveSubProyectoInventario
-
+ aplicacion = Inventario.ConAplicacion
If Inventario.Estatus = "Finalizado" Then
btnFin.Visible = False
End If
@@ -254,7 +273,7 @@ Partial Class Inventarios_RepAnomalias
#End Region
- Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound, GvS.RowDataBound
+ Protected Sub GVF_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Costo") = "-1" Then
e.Row.Cells(8).Text = "0"
@@ -264,6 +283,29 @@ Partial Class Inventarios_RepAnomalias
End If
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
End If
+ If e.Row.RowType = DataControlRowType.Header Then
+ If CreandoNuevoInventario Then
+ e.Row.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);")
+ End If
+ End If
+ End Sub
+
+
+ Protected Sub GVS_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvS.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.DBCampo("Costo") = "-1" Then
+ e.Row.Cells(8).Text = "0"
+ End If
+ If e.Row.Cells(7).Text = MinFecha.ToString Then
+ e.Row.Cells(7).Text = ""
+ End If
+ e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
+ End If
+ If e.Row.RowType = DataControlRowType.Header Then
+ If CreandoNuevoInventario Then
+ e.Row.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);")
+ End If
+ End If
End Sub
#Region " IMPRIMIR "
@@ -353,14 +395,14 @@ Partial Class Inventarios_RepAnomalias
GvF.Columns(0).Visible = True
LnkGuardar.Visible = True
LnkCrear.Visible = False
- GvF.HeaderRow.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);")
+ CreandoNuevoInventario = True
End If
If GvS.Rows.Count > 0 Then
GvS.Columns(0).Visible = True
LnkGuardar.Visible = True
LnkCrear.Visible = False
- GvS.HeaderRow.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);")
+ CreandoNuevoInventario = True
End If
UPAnomalias.Update()
UpdateGvS.Update()
@@ -374,13 +416,15 @@ Partial Class Inventarios_RepAnomalias
Dim ErrorClasif As Boolean = False
Dim ObjInventario As New ClsInventarios
Dim CveInventarioFisicoNew As Integer
- Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor As DataTable
+ Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor, DtUsuario As DataTable
DtAlmacen = Nothing
DtClasificacion = Nothing
DtClasificacionExcluida = Nothing
DtProveedor = Nothing
+ DtUsuario = Nothing
+
ObjInventario.IniciaTransacSQL()
- If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto) Then
+ If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto, aplicacion) Then
CveInventarioFisicoNew = ObjInventario.CveInventarioFisico
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
@@ -396,6 +440,18 @@ Partial Class Inventarios_RepAnomalias
DtProveedor = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
End If
+ If ObjInventario.GetInventarioFisicoDetallesUsuarios(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
+ DtUsuario = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
+ End If
+
+
+ For Each Gvr As DataRow In DtUsuario.Rows
+ If Not ObjInventario.AddInventarioFisicoUsuarios(CveInventarioFisicoNew, Gvr("CveUsuario").ToString.ToEntero, Convert.ToBoolean(Gvr("Incluye").ToString), Convert.ToBoolean(Gvr("Cerrado").ToString), Convert.ToBoolean(Gvr("Bloqueado").ToString)) Then
+ ErrorClasif = True
+ Exit For
+ End If
+ Next
+
For Each Gvr As DataRow In DtAlmacen.Rows
If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisicoNew, Gvr("CveAlmacen").ToString.ToEntero) Then
ErrorClasif = True
@@ -455,6 +511,7 @@ Partial Class Inventarios_RepAnomalias
GvS.Columns(0).Visible = False
LnkGuardar.Visible = False
LnkCrear.Visible = True
+ CreandoNuevoInventario = False
CargaDatos(CveInventarioFisico)
Else
ObjInventario.RollBack()
diff --git a/Inventarios/RepNotasSinAlmacen.aspx b/Inventarios/RepNotasSinAlmacen.aspx
index bb3456d36..8d2148f99 100644
--- a/Inventarios/RepNotasSinAlmacen.aspx
+++ b/Inventarios/RepNotasSinAlmacen.aspx
@@ -195,7 +195,7 @@
-
+
diff --git a/Inventarios/RepNotasSinAlmacen.aspx.vb b/Inventarios/RepNotasSinAlmacen.aspx.vb
index a259a52b6..5fccd46e7 100644
--- a/Inventarios/RepNotasSinAlmacen.aspx.vb
+++ b/Inventarios/RepNotasSinAlmacen.aspx.vb
@@ -279,7 +279,7 @@ Partial Class RepNotasSinAlmacen
e.Row.Cells(1).Text = e.Row.DBCampo("Fecha").ToDate.ToShortDateString
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).Text = "" & e.Row.DBCampo("RazonSocial") & ""
-
+ e.Row.FCLinkButton("lnkAccion").Visible = False
If GvCompras.Columns(4).Visible Then
e.Row.Cells(4).Text = ""
End If
diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx
index de0b9518b..a84424cb8 100644
--- a/Inventarios/TraspasoAlmacen.aspx
+++ b/Inventarios/TraspasoAlmacen.aspx
@@ -190,6 +190,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -827,7 +841,7 @@
-
+
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 0404397b4..2fb2b064c 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -189,6 +189,10 @@ Partial Class Inventarios_TraspasoAlmacen
LblResponsable.Visible = False
End If
+ If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
+ divFechaEnvio.Visible = True
+ End If
+
CargaCombos()
CreaDT()
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index 79a6753a5..c311c48da 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -5129,8 +5129,8 @@ Partial Class OC
option72.Visible = True
DivFolioAdicional.Visible = True
generarAnticipo.Visible = True
- Ddlcliente.DataSource = GlobalDTCliente(CveEmpresaActual)
- Ddlcliente.DataBind()
+ 'Ddlcliente.DataSource = GlobalDTCliente(CveEmpresaActual)
+ 'Ddlcliente.DataBind()
'Ddlcliente.Items.Insert(0, New ListItem(" - ", "-1"))
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index 4362af25c..f2340f58a 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -1231,8 +1231,12 @@
-
+
+
+ Historial de Ventas
+
+
@@ -6525,7 +6540,7 @@
$.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
});
-<%-- $("C_Tab_TabAlta_TxtTelefono").inputmask("mask", {
+ <%-- $("C_Tab_TabAlta_TxtTelefono").inputmask("mask", {
"mask": "(999) 999-9999"
});
@@ -6534,6 +6549,18 @@
"mask": "(999) 999-9999"
});
});--%>
+
+ if (<%= Me.CveCliente %> > 0) {
+ //CARGA EL HISTORIAL DE VENTAS
+ $("#C_Tab_TabHis_tab").click(function () { CargaHistorialVentas(); });
+ //CARGA EL CXC
+ $("#C_Tab_TabCxC_tab").click(function () { CargaCxC(); });
+ //CARGA ANTICIPOS
+ $("#C_Tab_TabAnticipos_tab").click(function () { CargaAnticipos(); });
+ //CARGA BANCOS
+ $("#C_Tab_TabBancos_tab").click(function () { CargaBancos(); });
+ }
+
}
$(document).on('mouseenter', ".truncate", function () {
var $this = $(this);
@@ -6706,6 +6733,23 @@
$get("HdnCuenta").value = op;
$("#BtnCargarCuentas").click();
}
+
+ function CargaCxC() {
+ $('#BtnCargaCxC').click();
+ }
+
+ function CargaAnticipos() {
+ $('#BtnCargaAnticipos').click();
+ }
+
+ function CargaBancos() {
+ $('#BtnCargaBancos').click();
+ }
+
+ function CargaHistorialVentas() {
+ $('#BtnHistorialVentas').click();
+ }
+
function LimpiaModal() {
$('#<%= TxtEnvioDireccion.ClientID %>').val('');
$('#<%= TxtEnvioNoExt.ClientID %>').val('');
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 0513c856d..ed7a105e3 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -25,9 +25,9 @@ Partial Class Clientes
Private Opcion As Integer
Public ReadOnly Property RowStyle As TableItemStyle
- Private ReadOnly Property CveCliente As Integer
+ Public ReadOnly Property CveCliente As Integer
Get
- Return ViewState("CveCliente").ToString().ToEntero()
+ Return If(IsNothing(ViewState("CveCliente")), "-1", ViewState("CveCliente").ToString()).ToEntero()
End Get
End Property
Private Property DTCuentasBancos As DataTable
@@ -1400,6 +1400,7 @@ Partial Class Clientes
HeedarContable.Attributes.Remove("onclick")
UpFiscalContable.Update()
End Sub
+
Private Function CargaDatos() As Boolean
Dim watch As New Diagnostics.Stopwatch()
watch.Start()
@@ -1413,15 +1414,11 @@ Partial Class Clientes
CargaDdlSucursalCliente()
CargaDocumentosVenta(CveCliente)
- Dim RetSC As Boolean = CargaSucursalesCliente()
- Dim RetCC As Boolean = CargaCotizaciones()
- CargaHistorial()
- CargaResumenHistorial()
- Dim RetCxC As Boolean = CargaCxC()
- CargaAnticipos()
+ Dim RetSC As Boolean = CargaSucursalesCliente()
+
+
CargaPersonalAsignado()
CargaUsuariosPortal()
- CargaBancos()
CargaOrdenesServiciosCliente()
CargaImpuestosLocales()
CargaCuentasContablesDdls()
@@ -2059,6 +2056,8 @@ Partial Class Clientes
End If
ObjMovtos.Dispose()
GvBancos.DataBind()
+
+ UpBancos.Update()
End Sub
Protected Sub GvBancos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancos.RowDataBound
@@ -10627,5 +10626,32 @@ Partial Class Clientes
CargaDispositivos(DdlEstatusDispositivos.SelectedValue.ToEntero())
End Sub
+ Protected Sub BtnCargaCxC_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaCxC()
+ UpDatos.Update()
+ End If
+ End Sub
+ Protected Sub BtnHistorialVentas_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaCotizaciones()
+ CargaHistorial()
+ CargaResumenHistorial()
+
+ UpnHistorial.Update()
+ UpDatos.Update()
+ End If
+ End Sub
+ Protected Sub BtnCargaAnticipos_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaAnticipos()
+ End If
+ End Sub
+ Protected Sub BtnCargaBancos_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaBancos()
+ UpDatos.Update()
+ End If
+ End Sub
End Class
diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx
index 3d4835b4c..1dd2de17a 100644
--- a/Ventas/ProductosServicios.aspx
+++ b/Ventas/ProductosServicios.aspx
@@ -1018,7 +1018,13 @@
-
+
+
+
+
+
+
+
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index 61da68735..523d69fc0 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -812,6 +812,7 @@ Partial Class ProductosyServicios
If ObjProductosServicios.PesoKg > 0 Then
TxtPesoKg.Text = ObjProductosServicios.PesoKg.ToString
End If
+ TxtDimensiones.Text = ObjProductosServicios.Dimensiones
DdlTipoPSDes.SelectedValueExist(ObjProductosServicios.CveClasificacionDetalle.ToString)
DdlUnidadMedida.SelectedValue = ObjProductosServicios.CveUnidadMedida.ToString
@@ -939,10 +940,9 @@ Partial Class ProductosyServicios
ChkLote.Checked = ObjProductosServicios.AplicaLote
ChkCaducidad.Checked = ObjProductosServicios.AplicaCaducidad
ChkSeccion.Checked = ObjProductosServicios.AplicaSeccion
- If ObjProductosServicios.DtResultados.Rows(0)("TiempoCaducidad") IsNot Nothing Then
- TxtTiempoCaducidad.Text = ObjProductosServicios.DtResultados.Rows(0)("TiempoCaducidad").ToString()
- DivTiempoCaducidad.Visible = ChkCaducidad.Checked
- End If
+
+ TxtTiempoCaducidad.Text = ObjProductosServicios.DtResultados.Rows(0)("TiempoCaducidad").ToString()
+ DivTiempoCaducidad.Visible = ChkCaducidad.Checked
If ObjProductosServicios.AplicaSeccion Then
CargaGvSeccionAlmacen()
@@ -1330,7 +1330,7 @@ Partial Class ProductosyServicios
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
- CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal) > 0 Then
+ CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim) > 0 Then
ViewState("CvePS") = ObjProductosServicios.CvePS
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
If GVR.FCCheckBox("ChkDeduccion").Checked Then
@@ -1380,7 +1380,7 @@ Partial Class ProductosyServicios
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
- CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal) Then
+ CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim) Then
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 4ec3cd682..c77620d7b 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -6216,7 +6216,7 @@ Partial Class Ventas
Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595)
'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO
- If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta <= 0 Then
+ If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso EsCreaApartirDe)) Then
RBLPago.SelectedValue = "2"
RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
@@ -6234,12 +6234,14 @@ Partial Class Ventas
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
LnkPedido2SinFacturar.Visible = False
LnkCotizaciones.Visible = False
+ BtnsFacturar.Visible = False
End If
UPCondicionesPago.Update()
'CARGAR CREDITO DISPONIBLE AL GENERAR UNA FACTURA
End If
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta <= 0 AndAlso RBLPago.SelectedValue = "1" AndAlso PermiteCredito Then
+ 'FUNCIONALIDAD 702 - NO VERIFICAR LIMITE DE CRÉDITO Y CANDADOS DE VENTA
If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then
RBLPago.SelectedValue = "1"
RBLPago_SelectedIndexChanged(Nothing, Nothing)
@@ -6252,7 +6254,7 @@ Partial Class Ventas
LblCreditoDisponible.Text = CreditoDispo.FormatoNumero
If PorcentajeCredito > 80 Then TrPorcentajeCredito.Visible = True : LblPorcentajeCredito.Text = $"{PorcentajeCredito.FormatoNumero}%"
- If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then
+ If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") AndAlso (Not UsuarioActual.Empresa.Funcionalidad(702).Contiene("2")) Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:
{0}", Vta.SerieVenta)
@@ -6288,8 +6290,9 @@ Partial Class Ventas
' el cliente tiene crédito disponible, no tiene bloqueo
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
- If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
If UsuarioActual.TienePermisoProceso(199) Then DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") ' puede remisionar
+ If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
+
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
@@ -6301,7 +6304,7 @@ Partial Class Ventas
'GENERAR AUTORIZACION SI TIENE EXCEDIO EL LIMITE DE CREDITO
Select Case ValorAutorizacion
Case "1" 'CREAR DOCUMENTO DE AUTORIZACION PA
- If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") Then
+ If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") AndAlso Not (UsuarioActual.Empresa.Funcionalidad(702).Contiene("2")) Then
'VERIFICAR CANDADOS DE VENTA, REMISIONES SIN FACTURAR, FACTURAS QUE NO TENGAN VENCIDAS
Dim Vta As New ClsVentas
@@ -6311,6 +6314,7 @@ Partial Class Ventas
If Opcion > 0 Then
If Opcion = 1 Then
BtnEmitirImprimir.Visible = False
+ BtnsFacturar.Visible = False
End If
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
@@ -6387,7 +6391,7 @@ Partial Class Ventas
End If
'Puede hacer pedido
- If Me.CveVenta <= 0 Then
+ If CveVenta <= 0 Then
If Not UsuarioActual.TienePermisoProceso(177) Then
If DdlTipoComprobante.Items.FindByValue("Pd2") IsNot Nothing Then
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Pd2"))
@@ -7645,36 +7649,40 @@ Partial Class Ventas
'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada.
If (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then
'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
- Dim ObjVentas As New ClsVentas
- If ObjVentas.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) Then
- If ObjVentas.DtResultados.Rows.Count > 0 Then
+ If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then
+ Dim ObjVentas As New ClsVentas
- If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then
- If ObjVentas.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
- ObjVentas.Dispose()
- Alert("Se está excediendo el límite de credito permitido de la Sucursal del Cliente.", TipoMensaje.MsgInformacion)
- Exit Sub
+ If ObjVentas.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) Then
+ If ObjVentas.DtResultados.Rows.Count > 0 Then
+
+ If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then
+ If ObjVentas.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
+ ObjVentas.Dispose()
+ Alert("Se está excediendo el límite de credito permitido de la Sucursal del Cliente.", TipoMensaje.MsgInformacion)
+ Exit Sub
+ End If
+ Else
+ If ObjVentas.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
+ ObjVentas.Dispose()
+ Alert("Se está excediendo el límite de credito permitido del Cliente.", TipoMensaje.MsgInformacion)
+ Exit Sub
+ End If
End If
+
Else
- If ObjVentas.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
- ObjVentas.Dispose()
- Alert("Se está excediendo el límite de credito permitido del Cliente.", TipoMensaje.MsgInformacion)
- Exit Sub
- End If
+ ObjVentas.Dispose()
+ Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError)
+ Exit Sub
End If
-
Else
ObjVentas.Dispose()
Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError)
Exit Sub
End If
- Else
ObjVentas.Dispose()
- Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError)
- Exit Sub
End If
- ObjVentas.Dispose()
+
'End If
End If
@@ -8196,7 +8204,7 @@ Partial Class Ventas
Dim CveVentaAnterior As Integer = Me.CveVenta
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
- ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion)
+ ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre)
'Agregamos las OCs a la tabla
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
@@ -10048,6 +10056,11 @@ Partial Class Ventas
'CLIENTE
ObjFactura.CveCliente = CveCliente
ObjFactura.SetCliente()
+ ObjFactura.CveEmpresaCRM = CveEmpresaCRM
+ If CveCliente = -1 And CveEmpresaCRM > 0 Then
+ ObjFactura.Cliente.Nombre = LblEmpresaCRM.Text
+ ObjFactura.Cliente.RFC = LblRFCCRM.Text
+ End If
'SUCURSAL
'ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero()
@@ -11171,7 +11184,7 @@ Partial Class Ventas
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO "
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer,
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing,
- ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False, Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing)
+ ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False, Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional CveAnticipoPadre As Integer = -1)
Dim Msgok As New StringBuilder
Dim CveAlmacenTraspasoOrigen As Integer = -1
@@ -11277,7 +11290,7 @@ Partial Class Ventas
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado) Then
ErrorList.Add("Ocurrió un error al Generar la Venta. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
- If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 Then
+ If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
If DtVentasNC IsNot Nothing Then
For Each row As DataRow In DtVentasNC.Rows
If Not row("CveVenta").ToString().ToEntero() = -1 Then
@@ -11287,6 +11300,7 @@ Partial Class Ventas
End If
Next
Else
+ 'SI ES REFACTURACION DEBE AGREGAR LA VENTA ANTERIOR COMO RELACIONADA TAMBIEN
If Not CveVenta = -1 Then
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
@@ -11298,6 +11312,14 @@ Partial Class Ventas
End If
End If
End If
+
+ 'SI TIENE UN ANTICIPO TAMBIEN DEBE RELACIONARLO
+ If CveAnticipoPadre > 0 Then
+ If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveAnticipoPadre) Then
+ ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
+ End If
+ End If
+
End If
End If
@@ -13824,7 +13846,7 @@ Partial Class Ventas
CreaObjetosVenta(True)
- If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
+ If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
Alert("Ocurrió un error al procesar los datos para la vista previa. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
ObjFactura = Nothing
Exit Sub
@@ -18142,7 +18164,7 @@ Partial Class Ventas
End Sub
Private Sub SetPermisos()
- If CveVenta < 1 Then
+ If CveVenta < 1 OrElse EsCreaApartirDe Then
'Puede cotizar
If Not UsuarioActual.TienePermisoProceso(59) Then
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Cot"))
@@ -18933,13 +18955,6 @@ Partial Class Ventas
End If
End If
- If Not OcurrioError AndAlso ConSalida Then
- 'Esquema viejo, evitamos que aparezca por surtir
- If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
- OcurrioError = True
- End If
- End If
-
End If
End If
@@ -19108,6 +19123,23 @@ Partial Class Ventas
'COMIENZA: VENTADETALLE
'CUANDO SEA SALIDA VA POR LA VENTA DETALLE DE LA FACTURA DE LA REMISION - OJO!! SOLO FUNCIONA HASTA ORITA QUE SE HACE SALIDA SOLO CUANDO SE FACTURA LA REMISION
Dim CveVentaDetalle = If(ConceptoEntrada.Contiene(3, 40), TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero(), MovDet("CveVentaDetalle").ToString().ToEntero())
+ Dim CveVentaDetallePadre As Integer = -1
+
+ 'If ConceptoEntrada = 3 Then
+ ' CveVentaDetalle = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero()
+ 'ElseIf ConceptoEntrada = 40 Then
+ ' CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
+ ' CveVentaDetallePadre = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero()
+ ' 'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
+ ' If CveVentaDetallePadre < 0 Then
+ ' Alert("no se encontro la venta detalle nueva. Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
+ ' OcurrioError = True
+ ' Exit For
+ ' End If
+ 'Else
+ ' CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
+ 'End If
+
'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
If CveVentaDetalle < 0 Then
Alert("no se encontro la venta detalle. Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
@@ -19128,7 +19160,7 @@ Partial Class Ventas
CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString().ToEntero()
End If
- If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
+ If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, CveVentaDetallePadre:=CveVentaDetallePadre) Then
ContadorMovtosDetalles += 1
Else
OcurrioError = True
@@ -23101,7 +23133,7 @@ Partial Class Ventas
RequiereAlmacenDestino = True
DdlAlmacenAsignado.Items.Clear()
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
- DdlAlmacenAsignado.SelectedValue = "-1"
+ DdlAlmacenAsignado.SelectedValueExist("-1")
DdlAlmacenAsignado.DataBind()
DdlAlmacenAsignado.Items.Insert(0, New ListItem("Almacen", DbRowVenta("CveAlmacenTraspasoOrigen").ToString()))
DdlAlmacenAsignado.SelectedValueExist(DbRowVenta("CveAlmacenTraspasoOrigen").ToString())
@@ -29831,6 +29863,8 @@ Partial Class Ventas
GvPS.Columns(17).Visible = True
GvPS.Columns(18).Visible = True
+ SetPermisos()
+
CambiaTipoDocto()
CambiaSucursalGeneral(RecargarPartidas:=False)
CargaAnticipos(CveCliente)