Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -890,6 +890,32 @@ Public Class ClsClientes
|
||||
' Return Retorno
|
||||
'End Function
|
||||
|
||||
Public Function UpdateClienteFranquicia(CveCliente As Integer, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_ClientesFranquiciaUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveEmpresaActual", SqlDbType.Int).Value = CveEmpresaActual
|
||||
.Add("@CveEmpresaFranquicia", SqlDbType.Int).Value = CveEmpresaFranquicia
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 2627;") Then
|
||||
Alert("El Cliente no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al intentar Actualizar los datos del Cliente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al intentar Actualizar los datos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateClientePersonaFisica(CveCliente As Integer, ApellidoPaterno As String, ApellidoMaterno As String, Nombres As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
|
||||
@@ -2010,7 +2010,7 @@ Public Class ClsInventarios
|
||||
Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha,
|
||||
Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
|
||||
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1,
|
||||
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional ExcluyeTransitorios As Integer = -1) As Decimal
|
||||
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional ExcluyeTransitorios As Integer = -1, Optional BuscarEnTabla As Boolean = False) As Decimal
|
||||
Dim Retorno As Decimal = -1
|
||||
|
||||
If FechaMovto = "-1" Then
|
||||
@@ -2037,6 +2037,7 @@ Public Class ClsInventarios
|
||||
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
|
||||
.Add("@ExcluyeTransitorios", SqlDbType.Int).Value = ExcluyeTransitorios
|
||||
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
|
||||
.Add("@BuscarEnTabla", SqlDbType.Bit).Value = BuscarEnTabla
|
||||
|
||||
.Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output
|
||||
.Add("@CvePSRetorno", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
|
||||
@@ -3459,7 +3459,7 @@ Public Class ClsNominas
|
||||
End Function
|
||||
|
||||
|
||||
Public Function SATSolicitudTimbreIngresosRep(CveEmpresa As Integer, FechaInicio As Date, FechaFin As DateTime, Opcion As Integer, Vista As Integer) As Boolean
|
||||
Public Function SATSolicitudTimbreIngresosRep(CveEmpresa As Integer, FechaInicio As Date, FechaFin As DateTime, Opcion As Integer, Vista As Integer, TipoComprobante As String, TipoDiferencia As Integer) As Boolean
|
||||
|
||||
Dim retorno As Boolean = False
|
||||
Try
|
||||
@@ -3470,6 +3470,8 @@ Public Class ClsNominas
|
||||
.Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
.Add("@Vista", SqlDbType.Int).Value = Vista
|
||||
.Add("@TipoComprobante", SqlDbType.VarChar).Value = TipoComprobante
|
||||
.Add("@TipoDiferencia", SqlDbType.Int).Value = TipoDiferencia
|
||||
End With
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
|
||||
@@ -497,7 +497,7 @@ Public Class ClsOS
|
||||
|
||||
|
||||
Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer,
|
||||
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
|
||||
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet")
|
||||
@@ -514,6 +514,8 @@ Public Class ClsOS
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad
|
||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -6987,7 +6987,7 @@ Public Class ClsPaginas
|
||||
NombreArchivoDescarga = "FacturaUSA"
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(718) = "1" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
|
||||
If EsTicket Then
|
||||
NombreArchivo = "FacturaTicket"
|
||||
NombreArchivoDescarga = "FacturaTicket"
|
||||
|
||||
@@ -875,6 +875,33 @@ Public Class ClsProductosServicios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetUltimoPrecioCompra(CveEmpresa As Integer, CvePS As Integer) As Double
|
||||
|
||||
Dim Retorno As Double = -1
|
||||
|
||||
DataAdapter("PA_Inv_UltimoPrecioCompraGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@PU", SqlDbType.Money).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = CDbl(SqlAdapter.SelectCommand.Parameters("@PU").Value)
|
||||
|
||||
Catch Ex1 As SqlException
|
||||
Me.OnError("Ocurrió un error al obtener el precio unitario.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el precio unitario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region "P R O D U C T O S - E Q U I V A L E N C I A S "
|
||||
|
||||
Public Function GetPSEquivalencias(CvePS As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
@@ -2052,7 +2052,7 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1) As Integer
|
||||
Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1, Optional UpdateFranquicia As Boolean = False) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
|
||||
DataAdapter("PA_Vta_PrecioListaAdd")
|
||||
@@ -2064,6 +2064,7 @@ Public Class ClsVentas
|
||||
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
||||
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
||||
.Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar
|
||||
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -2084,7 +2085,7 @@ Public Class ClsVentas
|
||||
End Function
|
||||
|
||||
Public Function UpdatePrecioLista(PrecioLista As String, Estatus As Boolean, CveUsuario As Integer, Porcentaje As Double,
|
||||
Predeterminada As Boolean, CvePrecioLista As Integer) As Boolean
|
||||
Predeterminada As Boolean, CvePrecioLista As Integer, Optional UpdateFranquicia As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_PrecioListaUpdate")
|
||||
@@ -2096,6 +2097,7 @@ Public Class ClsVentas
|
||||
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
||||
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -9,6 +9,7 @@ Imports System.Reflection
|
||||
Imports System.Xml
|
||||
Imports System.Xml.Serialization
|
||||
Imports Extensiones
|
||||
Imports External.Office
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Profact.TimbraCFDI33.Complementos
|
||||
Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte30
|
||||
@@ -2458,48 +2459,48 @@ Public Class Timbrado
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Comercio Exterior"
|
||||
#Region "C O M P L E M E N T O D E C O M E R C I O E X T E R I O R"
|
||||
|
||||
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior.AplicaComercioExteriorSubProyecto Then
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior IsNot Nothing Then
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior IsNot Nothing Then
|
||||
|
||||
'DATOS GENERALES
|
||||
cfdi.ComercioExterior20(ObjCFDITimbre.Complementos.ComercioExterior.MotivoTraslado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.ClavedePedimento,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.CertificadoOrigen,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.NumCertificadoOrigen,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.NumeroExportadorConfiable,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Incoterm,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Observaciones,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.TipoCambioUSD,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.TotalUSD)
|
||||
'EMISOR
|
||||
cfdi.ComercioExterior20Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CURP))
|
||||
cfdi.ComercioExterior20Domicilio(ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroExterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroInterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Colonia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Localidad,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Referencia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Municipio,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Estado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CP)
|
||||
'RECEPTOR
|
||||
cfdi.ComercioExterior20Receptor(ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumRegIdTrib)
|
||||
cfdi.ComercioExterior20DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroExterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroInterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Colonia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Localidad,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Referencia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Municipio,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Estado,
|
||||
'DATOS GENERALES
|
||||
cfdi.ComercioExterior20(ObjCFDITimbre.Complementos.ComercioExterior.MotivoTraslado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.ClavedePedimento,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.CertificadoOrigen,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.NumCertificadoOrigen,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.NumeroExportadorConfiable,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Incoterm,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Observaciones,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.TipoCambioUSD,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.TotalUSD)
|
||||
'EMISOR
|
||||
cfdi.ComercioExterior20Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CURP))
|
||||
cfdi.ComercioExterior20Domicilio(ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroExterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroInterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Colonia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Localidad,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Referencia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Municipio,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Estado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CP)
|
||||
'RECEPTOR
|
||||
cfdi.ComercioExterior20Receptor(ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumRegIdTrib)
|
||||
cfdi.ComercioExterior20DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroExterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroInterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Colonia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Localidad,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Referencia,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Municipio,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Estado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.CP)
|
||||
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario IsNot Nothing Then
|
||||
cfdi.ComercioExterior20Destinatario(ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumRegIdTrib,
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario IsNot Nothing Then
|
||||
cfdi.ComercioExterior20Destinatario(ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumRegIdTrib,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Nombre,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumeroExterior,
|
||||
@@ -2511,39 +2512,32 @@ Public Class Timbrado
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Estado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.CP)
|
||||
End If
|
||||
|
||||
|
||||
'MERCANCIAS
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior.Mercancias
|
||||
cfdi.ComercioExterior20Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
|
||||
If concep.DescripcionesEspecificas.Marca <> "" Then
|
||||
cfdi.ComercioExterior20MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
|
||||
concep.DescripcionesEspecificas.Modelo,
|
||||
concep.DescripcionesEspecificas.SubModelo,
|
||||
concep.DescripcionesEspecificas.NumeroSerie)
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'MERCANCIAS
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior.Mercancias
|
||||
cfdi.ComercioExterior20Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
|
||||
If concep.DescripcionesEspecificas.Marca <> "" Then
|
||||
cfdi.ComercioExterior20MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
|
||||
concep.DescripcionesEspecificas.Modelo,
|
||||
concep.DescripcionesEspecificas.SubModelo,
|
||||
concep.DescripcionesEspecificas.NumeroSerie)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
#End Region
|
||||
End If
|
||||
|
||||
|
||||
#End Region
|
||||
End If
|
||||
|
||||
|
||||
|
||||
#Region "C O M P L E M E N T O C A R T A P O R T E"
|
||||
|
||||
If UsuarioActual.CveEmpresa = 13 Then
|
||||
|
||||
If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
|
||||
|
||||
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
|
||||
|
||||
''DATOS GENERALES
|
||||
@@ -2557,7 +2551,6 @@ Public Class Timbrado
|
||||
'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
|
||||
cfdi.CartaPorteDomicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
'MERCANCIAS
|
||||
@@ -2681,8 +2674,7 @@ Public Class Timbrado
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Complemento Pago"
|
||||
#Region "C O M P L E M E N T O D E P A G O"
|
||||
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then
|
||||
|
||||
@@ -2700,6 +2692,11 @@ Public Class Timbrado
|
||||
|
||||
For Each docp As CFDIComplementoPago In ObjCFDITimbre.ComplementoPagos20.ComplementoPagos
|
||||
|
||||
Dim MonDiferente As Integer = (From c In docp.DocumentosRelacionados
|
||||
Where c.MonedaDR <> docp.MonedaP
|
||||
Select c.MonedaDR).Count()
|
||||
If MonDiferente > 0 Then cfdi.ContieneVariasMonedas = True 'consideración adicional Rev. B
|
||||
|
||||
cfdi.Pago20(docp.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"),
|
||||
docp.FormaDePagoP,
|
||||
docp.MonedaP,
|
||||
@@ -2730,6 +2727,8 @@ Public Class Timbrado
|
||||
doc.ImpSaldoInsoluto,
|
||||
doc.ObjetoImpuesto)
|
||||
|
||||
'If doc.MonedaDR <> docp.MonedaP Then cfdi.ContieneVariasMonedas = True 'consideración adicional Rev. B
|
||||
|
||||
If doc.Impuestos IsNot Nothing Then
|
||||
''retenciones
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
|
||||
@@ -2771,9 +2770,7 @@ Public Class Timbrado
|
||||
End If
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region "Nomina12"
|
||||
#Region "C O M P L E M E N T O D E N O M I N A"
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then
|
||||
|
||||
'cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd")
|
||||
|
||||
@@ -355,9 +355,9 @@ Public Class E119 : Implements IHttpHandler
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
MsgLog.AppendLine("json:" & json)
|
||||
TieneError = True
|
||||
End If
|
||||
MsgLog.AppendLine("json:" & json)
|
||||
End Using
|
||||
End If
|
||||
|
||||
@@ -405,7 +405,7 @@ Public Class E119 : Implements IHttpHandler
|
||||
New JProperty("SerieFolio", dr("SerieFolio"))
|
||||
)
|
||||
data.Add(objSucursal)
|
||||
Respuesta.status = "success"
|
||||
Respuesta.status = "error"
|
||||
Respuesta.data = data
|
||||
Respuesta.message = "Folio registrado previamente."
|
||||
MsgLog.AppendLine("Folio registrado previamente.")
|
||||
@@ -420,11 +420,16 @@ Public Class E119 : Implements IHttpHandler
|
||||
Return JsonConvert.SerializeObject(Respuesta)
|
||||
End If
|
||||
|
||||
If JsonRequest("billing") IsNot Nothing AndAlso JsonRequest("rfc_info") IsNot Nothing Then
|
||||
RFC = JsonRequest("rfc_info")("rfc_client").ToString()
|
||||
RegimenCliente = JsonRequest("rfc_info")("regimen_client").ToString()
|
||||
UsoCFDI = JsonRequest("rfc_info")("cfdi").ToString()
|
||||
NombreCliente = JsonRequest("billing")("first_name").ToString() & " " & JsonRequest("billing")("last_name").ToString()
|
||||
If JsonRequest("billing") IsNot Nothing AndAlso JsonRequest("rfc_info") IsNot Nothing AndAlso JsonRequest("rfc_info").Count > 0 Then
|
||||
RFC = JsonRequest("rfc_info")(0)("rfc_client").ToString()
|
||||
RegimenCliente = JsonRequest("rfc_info")(0)("regimen_client").ToString()
|
||||
UsoCFDI = JsonRequest("rfc_info")(0)("cfdi").ToString()
|
||||
NombreCliente = JsonRequest("billing")(0)("first_name").ToString() & " " & JsonRequest("billing")(0)("last_name").ToString()
|
||||
'si vienen vacío toman datos predeterminados
|
||||
If RFC = "" Then RFC = "XAXX010101000"
|
||||
If RegimenCliente = "" Then RegimenCliente = "616"
|
||||
If UsoCFDI = "" Then UsoCFDI = "S01"
|
||||
|
||||
If Not String.IsNullOrEmpty(UsoCFDI) Then
|
||||
CveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI().FiltroPrimeroValor("CveUsoCFDI", $"UsoCFDI = '{UsoCFDI.Trim}'").ToEntero()
|
||||
End If
|
||||
@@ -489,16 +494,16 @@ Public Class E119 : Implements IHttpHandler
|
||||
End If
|
||||
If JsonRequest("shipping") IsNot Nothing AndAlso Not TieneError Then
|
||||
Dim CveEstado As Integer = -1
|
||||
Dim Direccion As String = If(JsonRequest("shipping")("address_1") Is Nothing, "", JsonRequest("shipping")("address_1").ToString())
|
||||
Dim Direccion As String = If(JsonRequest("shipping")(0)("address_1") Is Nothing, "", JsonRequest("shipping")(0)("address_1").ToString())
|
||||
Dim NumExt As String = ""
|
||||
Dim NumInt As String = ""
|
||||
Dim Colonia As String = ""
|
||||
Dim Ciudad As String = If(JsonRequest("shipping")("city") Is Nothing, "", JsonRequest("shipping")("city").ToString())
|
||||
Dim Localidad As String = If(JsonRequest("shipping")("city") Is Nothing, "", JsonRequest("shipping")("city").ToString())
|
||||
Dim CP As String = If(JsonRequest("shipping")("postcode") Is Nothing, "", JsonRequest("shipping")("postcode").ToString())
|
||||
Dim Telefono As String = If(JsonRequest("shipping")("phone") Is Nothing, "", JsonRequest("shipping")("phone").ToString())
|
||||
Dim Correo As String = If(JsonRequest("shipping")("email") Is Nothing, "", JsonRequest("shipping")("email").ToString())
|
||||
Dim Estado As String = If(JsonRequest("shipping")("state") Is Nothing, "", JsonRequest("shipping")("state").ToString())
|
||||
Dim Ciudad As String = If(JsonRequest("shipping")(0)("city") Is Nothing, "", JsonRequest("shipping")(0)("city").ToString())
|
||||
Dim Localidad As String = If(JsonRequest("shipping")(0)("city") Is Nothing, "", JsonRequest("shipping")(0)("city").ToString())
|
||||
Dim CP As String = If(JsonRequest("shipping")(0)("postcode") Is Nothing, "", JsonRequest("shipping")(0)("postcode").ToString())
|
||||
Dim Telefono As String = If(JsonRequest("shipping")(0)("phone") Is Nothing, "", JsonRequest("shipping")(0)("phone").ToString())
|
||||
Dim Correo As String = If(JsonRequest("shipping")(0)("email") Is Nothing, "", JsonRequest("shipping")(0)("email").ToString())
|
||||
Dim Estado As String = If(JsonRequest("shipping")(0)("state") Is Nothing, "", JsonRequest("shipping")(0)("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
|
||||
@@ -528,6 +533,7 @@ Public Class E119 : Implements IHttpHandler
|
||||
|
||||
MsgLog.AppendLine("1.6 inicio generar venta")
|
||||
ObjFactura = Modelos.Factura.CrearVentaNueva(Usuario, CveSubProyecto, CveCliente, CveMoneda, "Rem")
|
||||
ObjFactura.AtencionA = NombreCliente
|
||||
MsgLog.AppendFormat("1.6.0 objeto creado {0}", If(ObjFactura IsNot Nothing, "si", "no"))
|
||||
|
||||
If JsonRequest("shiping_lines") IsNot Nothing Then
|
||||
@@ -616,6 +622,7 @@ Public Class E119 : Implements IHttpHandler
|
||||
MsgLog.Append("99.0 ocurrió un error en el proceso")
|
||||
Else
|
||||
MsgLog.Append("4.0 proceso terminado")
|
||||
MsgLog.AppendFormat("Folio:{0} Estatus:", Resp.SerieFolio, Respuesta.status)
|
||||
ObjClientes.Commit()
|
||||
ObjClientes.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
@@ -627,7 +634,7 @@ Public Class E119 : Implements IHttpHandler
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
Finally
|
||||
MsgLog.ToString.GuardaLogAD("LogE119")
|
||||
'MsgLog.ToString.GuardaLogAD("LogE119")
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
|
||||
@@ -836,12 +836,8 @@ Partial Class Bancos_IE
|
||||
'DdlBanco.SelectedValue = ObjIE.CveBanco.ToString
|
||||
|
||||
'Abono es Egreso Egs
|
||||
|
||||
|
||||
CargaTipoTransaccion(If(Tipo = "Abono", "Egs", "Ing"))
|
||||
DdlTipoTransaccion.SelectedValue = ObjIE.CveTipoTransaccion.ToString
|
||||
|
||||
|
||||
DdlCuenta.SelectedValueExist(ObjIE.CveCuenta.ToString)
|
||||
DdlCuenta.Visible = False
|
||||
|
||||
@@ -1026,7 +1022,11 @@ Partial Class Bancos_IE
|
||||
LnkEliminar.Visible = True
|
||||
End If
|
||||
Else
|
||||
If UsuarioActual.TienePermisoProceso(80) AndAlso ObjIE.CveTipoCuenta = 1 Then LnkDesconciliar.Visible = True
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If UsuarioActual.TienePermisoProceso(80) AndAlso ObjIE.CveTipoCuenta = 1 Then LnkDesconciliar.Visible = True
|
||||
Else
|
||||
If UsuarioActual.TienePermisoProceso(80) Then LnkDesconciliar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(85) AndAlso Not ObjIE.FueConciliado Then LnkCancelar.Visible = True
|
||||
@@ -1052,6 +1052,8 @@ Partial Class Bancos_IE
|
||||
LnkEliminar.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(80) Then LnkDesconciliar.Visible = True
|
||||
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
ImprimirIEPDF(ObjIE.CveTipoTransaccion)
|
||||
End If
|
||||
|
||||
@@ -1348,8 +1348,9 @@ Partial Class PopUpVerFactura
|
||||
Dim Guardar As Boolean = UrlParametros("GUARDAR") IsNot Nothing AndAlso UrlParametros("GUARDAR").ToString() = "1"
|
||||
Dim RegenerarPDF As Boolean = UrlParametros("REGENERAR") IsNot Nothing AndAlso UrlParametros("REGENERAR").ToString() = "1"
|
||||
Dim STIMUL As Boolean = UrlParametros("STIMULSOFT") IsNot Nothing AndAlso UrlParametros("STIMULSOFT").ToString() = "1"
|
||||
Dim EsTicket As Boolean = UrlParametros("TICKET") IsNot Nothing AndAlso UrlParametros("TICKET").ToString() = "1"
|
||||
|
||||
GenerarPDFVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimul:=STIMUL)
|
||||
GenerarPDFVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimul:=STIMUL, EsTicket:=EsTicket)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ Partial Class Contratos_Contratos
|
||||
DdlTipo.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlTipo.DataBind()
|
||||
|
||||
Dim CveEstatusVigente = -1
|
||||
Dim CveEstatusVigente As Integer = -1
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa)
|
||||
DdlEstatus.DataSource = ObjContratos.DtResultados
|
||||
@@ -82,10 +82,10 @@ Partial Class Contratos_Contratos
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, DdlClientes.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, TipoContrato:=DdlTipo.SelectedValue.ToEntero) Then
|
||||
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim dt As DataTable = ObjContratos.DtResultados
|
||||
Dim Cliente = If(DdlClientes.SelectedValue = "-1", "", $" <b>Cliente:</b> {DdlClientes.SelectedItem.Text}")
|
||||
Dim Estatus = ($" <b>Estatus:</b> {DdlEstatus.SelectedItem.Text}")
|
||||
Dim Cliente As String = If(DdlClientes.SelectedValue = "-1", "", $" <b>Cliente:</b> {DdlClientes.SelectedItem.Text}")
|
||||
Dim Estatus As String = ($" <b>Estatus:</b> {DdlEstatus.SelectedItem.Text}")
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", "-1"))
|
||||
|
||||
@@ -4119,7 +4119,7 @@
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Carta Porte 3.0</Value>
|
||||
<Value>Carta Porte 2.0</Value>
|
||||
<Style>
|
||||
<FontFamily>calibri</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
|
||||
@@ -2661,94 +2661,6 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Textbox Name="Textbox14">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Sucursal Tijuana</Value>
|
||||
<Style>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<TextDecoration>None</TextDecoration>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Center</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Beneficiario: ELECTRICA SERVEC S DE RL DE CV </Value>
|
||||
<Style>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
<FontSize>8pt</FontSize>
|
||||
<TextDecoration>None</TextDecoration>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Banco: SANTANDER </Value>
|
||||
<Style>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
<FontSize>8pt</FontSize>
|
||||
<TextDecoration>None</TextDecoration>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>CLABE: 014 760 655 074 603 318 </Value>
|
||||
<Style>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
<FontSize>8pt</FontSize>
|
||||
<TextDecoration>None</TextDecoration>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Cuenta: 65507460331 </Value>
|
||||
<Style>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
<FontSize>8pt</FontSize>
|
||||
<TextDecoration>None</TextDecoration>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox1</rd:DefaultName>
|
||||
<Top>8.27176cm</Top>
|
||||
<Left>9.76877cm</Left>
|
||||
<Height>1.89191cm</Height>
|
||||
<Width>9.18009cm</Width>
|
||||
<ZIndex>20</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Image Name="Image1">
|
||||
<Source>Embedded</Source>
|
||||
<Value>RFIRMAELECTRONICAEDITABLE</Value>
|
||||
@@ -2757,7 +2669,7 @@
|
||||
<Left>0.51012cm</Left>
|
||||
<Height>1.73059cm</Height>
|
||||
<Width>3.63914cm</Width>
|
||||
<ZIndex>21</ZIndex>
|
||||
<ZIndex>20</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
@@ -2771,7 +2683,7 @@
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Cuentas Bancarias</Value>
|
||||
<Value>Cuenta Bancaria</Value>
|
||||
<Style />
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
@@ -2784,8 +2696,8 @@
|
||||
<Top>7.75847cm</Top>
|
||||
<Left>0.25136cm</Left>
|
||||
<Height>0.53798cm</Height>
|
||||
<Width>18.6975cm</Width>
|
||||
<ZIndex>22</ZIndex>
|
||||
<Width>9.06118cm</Width>
|
||||
<ZIndex>21</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
@@ -3236,7 +3148,7 @@
|
||||
<Left>0.15747cm</Left>
|
||||
<Height>2.0799cm</Height>
|
||||
<Width>20.85172cm</Width>
|
||||
<ZIndex>23</ZIndex>
|
||||
<ZIndex>22</ZIndex>
|
||||
<Visibility>
|
||||
<Hidden>=Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True)</Hidden>
|
||||
</Visibility>
|
||||
@@ -3277,7 +3189,7 @@
|
||||
<Left>16.84664cm</Left>
|
||||
<Height>0.49387cm</Height>
|
||||
<Width>4.14557cm</Width>
|
||||
<ZIndex>24</ZIndex>
|
||||
<ZIndex>23</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
<%-- <style type="text/css">
|
||||
.gvInventario tr td:nth-child(4) {
|
||||
width: 6% !important;
|
||||
}
|
||||
@@ -42,7 +42,16 @@
|
||||
.btn.default:hover {
|
||||
background-color: lightgray;
|
||||
}
|
||||
</style>--%>
|
||||
<style type="text/css">
|
||||
|
||||
.customCalendarStyle
|
||||
{
|
||||
position: relative; /* Asegura que z-index funcione */
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Entrega Almacén (Surtir Mercancia)
|
||||
@@ -472,145 +481,174 @@
|
||||
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light xspadding bordered ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Salida de Inventario</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<%--AGREGAR POR CODIGO DE BARRAS--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" runat="server" id="DivCodigoSeriePS" visible="false">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="col-md-2 pull-right">
|
||||
<div class="btn-group" style="float: right;">
|
||||
<asp:Button ID="BtnVerSugerencias" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnVerSugerencias_Click" runat="server" Text="Ver Sugerencias" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 pull-right">
|
||||
<table style="float: right;">
|
||||
<tr>
|
||||
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
|
||||
<td>
|
||||
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
|
||||
<asp:TextBox ID="TxtCodigoPS" ClientIDMode="Static" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
<td runat="server" visible="false" id="TdSeriePS">
|
||||
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
|
||||
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="portlet light smmallpadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Salida de Inventario</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" >
|
||||
|
||||
<%--AGREGAR POR CODIGO DE BARRAS--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" runat="server" id="DivCodigoSeriePS" visible="false">
|
||||
|
||||
<%--GV DATOS--%>
|
||||
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
|
||||
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveCategoria,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
<HeaderStyle Height="30px" />
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="cbInv" runat="server" Checked="true" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" Width="2.5%" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Cant. Venta" DataField="CantidadC" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
|
||||
|
||||
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:TemplateField HeaderText="Cant. a Surtir">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TbCantidadF" runat="server" Width="50px" Mask="9,999.99" DataFormatString="{0:#,##0.######}" Style="text-align: right" Text='<%# Eval("CantidadF", "{0:#,##0.######}") %>'></asp:TextBox>
|
||||
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
|
||||
<%-- <asp:HyperLinkField HeaderText="Producto o Servicio" Target="_blank" DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
<asp:Literal ID="LtlHeaderPS" Text="Producto o Servicio" runat="server"></asp:Literal>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplPS" runat="server" Target="_blank" Text='<%# Eval("CodigoPS", "{0}") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Observación" DataField="ObservacionesDetalle" ItemStyle-Width="7.5%" />
|
||||
|
||||
<asp:TemplateField HeaderText="Sección" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>' Width="100px" Enabled="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtCaducidad" Text='<%# Eval("FechaCaducidad") %>' CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server" Visible="false" Enabled="false"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false" Enabled="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" Enabled="false" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
</span>
|
||||
<div class="col-md-2 pull-right">
|
||||
<div class="btn-group" style="float: right;">
|
||||
<asp:Button ID="BtnVerSugerencias" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnVerSugerencias_Click" runat="server" Text="Ver Sugerencias" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 pull-right">
|
||||
<table style="float: right;">
|
||||
<tr>
|
||||
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
|
||||
<td>
|
||||
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
|
||||
<asp:TextBox ID="TxtCodigoPS" ClientIDMode="Static" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
<td runat="server" visible="false" id="TdSeriePS">
|
||||
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
|
||||
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="True">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<%--BOTON GUARDAR--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div align="center">
|
||||
<asp:Label Text="Venta totalmente Surtida" ID="LbSurtida" Font-Size="Small" Visible="false" CssClass="label label-sm label-success" runat="server" />
|
||||
<br />
|
||||
<br />
|
||||
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" CssClass="btn btn-primary" Text="Guardar" Width="150px" ValidationGroup="GrpGuardar" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<%--GV DATOS--%>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
|
||||
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveCategoria,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad"
|
||||
CssClass="" GridLines="None" >
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="cbInv" runat="server" Checked="true" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" Width="2.5%" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Cant. Venta" DataField="CantidadC" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
|
||||
|
||||
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:TemplateField HeaderText="Cant. a Surtir">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TbCantidadF" runat="server" Width="50px" Mask="9,999.99" DataFormatString="{0:#,##0.######}" Style="text-align: right" Text='<%# Eval("CantidadF", "{0:#,##0.######}") %>'></asp:TextBox>
|
||||
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
<asp:Literal ID="LtlHeaderPS" Text="Producto o Servicio" runat="server"></asp:Literal>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplPS" runat="server" Target="_blank" Text='<%# Eval("CodigoPS", "{0}") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Observación" DataField="ObservacionesDetalle" ItemStyle-Width="7.5%" />
|
||||
|
||||
<asp:TemplateField HeaderText="Sección" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%--8--%>
|
||||
<asp:TemplateField HeaderText="Lote/Caducidad" ItemStyle-HorizontalAlign="Left" Visible="false" ItemStyle-Width="270px">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlCaducidadProducto" CssClass="select2me" Width="100%" runat="server" CausesValidation="true" AutoPostBack="true" OnSelectedIndexChanged="DdlCaducidadProducto_SelectedIndexChanged">
|
||||
<asp:ListItem Selected="True" Text="-" Value="|"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--9--%>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>' Width="100px" Enabled="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;" runat="server" visible="false" id="DvFechaCaducidad" >
|
||||
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 87px" runat="server" ></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" > <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="TopLeft" Format="dd/MM/yyyy"
|
||||
> </ajax:CalendarExtender>
|
||||
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="True">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<%--BOTON GUARDAR--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div align="center">
|
||||
<asp:Label Text="Venta totalmente Surtida" ID="LbSurtida" Font-Size="Small" Visible="false" CssClass="label label-sm label-success" runat="server" />
|
||||
<br />
|
||||
<br />
|
||||
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" CssClass="btn btn-primary" Text="Guardar" Width="150px" ValidationGroup="GrpGuardar" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%--AGREGA POR SERIE--%>
|
||||
@@ -702,8 +740,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="DivLote" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpLoteBatch" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
|
||||
@@ -7,6 +7,8 @@ Imports System.IO
|
||||
Imports System.Web.Management
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports MoreLinq
|
||||
Imports Telerik.Web.UI
|
||||
|
||||
Partial Class Inventarios_EntregaAlmacen
|
||||
Inherits ClsPaginas
|
||||
@@ -715,9 +717,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
If DtDatos.SUM("CantidadS") <= 0 Then
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario gvEscondeColumna"
|
||||
Else
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario"
|
||||
End If
|
||||
|
||||
If CveAlmacenTraspasoDestino > 0 And Not (TipoMovimiento = 2 And TipoDocto.Contiene("Rem", "Ped")) Then
|
||||
@@ -920,9 +922,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
CveVentaSurtir = -1
|
||||
CveOSSurtir = -1
|
||||
If DtDatos.SUM("CantidadS") <= 0 Then
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario gvEscondeColumna"
|
||||
Else
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario"
|
||||
End If
|
||||
|
||||
If CveAlmacenTraspasoDestino > 0 Then
|
||||
@@ -1000,9 +1002,18 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
If AplicaSeccion Then GvDatos.Columns(7).Visible = True
|
||||
If AplicaLote Then GvDatos.Columns(8).Visible = True
|
||||
If AplicaCaducidad Then GvDatos.Columns(9).Visible = True
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvDatos.Columns(9).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
If AplicaLote Then GvDatos.Columns(9).Visible = True
|
||||
If AplicaCaducidad Then GvDatos.Columns(10).Visible = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||
GvDatos.Columns(8).Visible = True
|
||||
GvDatos.Columns(9).Visible = False
|
||||
GvDatos.Columns(10).Visible = False
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then
|
||||
GvDatos.Columns(10).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
End If
|
||||
'GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) <> "", UsuarioActual.Empresa.Funcionalidad(147), "")
|
||||
|
||||
'SugerirFecha()
|
||||
@@ -1117,24 +1128,29 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
Else
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl)
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
DvFechaCaducidad.Visible = True
|
||||
' e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
'CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
|
||||
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
|
||||
If (e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha) OrElse UsuarioActual.TienePermisoProceso(364) OrElse UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
End If
|
||||
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
DvFechaCaducidad.Visible = False
|
||||
End If
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaLote")) Then
|
||||
@@ -1190,8 +1206,60 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
|
||||
If Boolean.Parse(e.Row.DataKey("AplicaLote")) Or Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then
|
||||
|
||||
CargarCaducidadProducto(e.Row.DataKey("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto"))
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCaducidadProducto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, DropDownList)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim AplicaLote As Boolean = Boolean.Parse(GvRow.DataKey("AplicaLote"))
|
||||
Dim AplicaCaducidad As Boolean = Boolean.Parse(GvRow.DataKey("AplicaCaducidad"))
|
||||
Dim DdlCaducidadProducto As DropDownList = GvRow.FCDropDownList("DdlCaducidadProducto")
|
||||
|
||||
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
|
||||
Dim Lote As String = ArrayCaducidad(0)
|
||||
Dim FechaCaducidad As String = ArrayCaducidad(1)
|
||||
|
||||
|
||||
|
||||
If AplicaLote Then
|
||||
GvRow.FCTextBox("TxtLote").Text = Lote
|
||||
End If
|
||||
|
||||
If AplicaCaducidad Then
|
||||
GvRow.FCTextBox("TxtCaducidad").Text = FechaCaducidad
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargarCaducidadProducto(CvePS As Integer, ByRef DdlLoteFechaCaducidad As DropDownList)
|
||||
|
||||
Dim almacenes As String = DdlAlmacen.SelectedValue
|
||||
If almacenes = "" Then
|
||||
almacenes = "-1"
|
||||
End If
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||
|
||||
For Each dr As DataRow In ObjInventarios.DtResultados.Rows
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||
Next
|
||||
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDocumentos(tCveVenta As Integer)
|
||||
@@ -1979,8 +2047,24 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||
DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
|
||||
DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||
'Esto es por que
|
||||
Dim DdlCaducidadProducto As DropDownList = gvr.FCDropDownList("DdlCaducidadProducto")
|
||||
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
|
||||
Dim Lote As String = ArrayCaducidad(0)
|
||||
Dim FechaCaducidad As String = ArrayCaducidad(1)
|
||||
|
||||
DtDatos.Rows(Index)("FechaCaducidad") = FechaCaducidad.ToDate
|
||||
DtDatos.Rows(Index)("Lote") = Lote
|
||||
|
||||
Else
|
||||
DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
Index += 1
|
||||
Next
|
||||
@@ -4458,6 +4542,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Return Respuesta
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -161,11 +161,31 @@
|
||||
<asp:GridView ID="GvSeriesPaqueteArmado" runat="server" AutoGenerateColumns="false" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="#" DataField="Row" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Serie" ItemStyle-Width="90%" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="Serie" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox Text='<%# Eval("Serie")%>' ID="TxtSerie" runat="server" Width="90%" />
|
||||
<asp:TextBox Text='<%# Eval("Serie")%>' ID="TxtSerie" runat="server" Width="150px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox Text='<%# Eval("Lote")%>' ID="TxtLote" runat="server" Width="150px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-Width="90%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;" runat="server" >
|
||||
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 87px" runat="server" ></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" > <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="TopLeft" Format="dd/MM/yyyy" > </ajax:CalendarExtender>
|
||||
|
||||
<%--<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -417,25 +437,89 @@
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:Panel runat="server" ID="PnlSeriePaqueteDesarmado" DefaultButton="BtnAgregarSerieDesarmado">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">Serie</div>
|
||||
<div class="col-md-3">
|
||||
<asp:TextBox runat="server" ID="TxtSerieDesarmado" Text="" CssClass="form-control input-sm" />
|
||||
<asp:RequiredFieldValidator ID="RFVSerieDesarmado" runat="server" ControlToValidate="TxtSerieDesarmado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSeriePaqueteDesarmado"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESerieDesarmado" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerieDesarmado" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<div class="col-md-3" runat="server" id="DvDesArmadoSerie" visible="false">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox runat="server" ID="TxtSerieDesarmado" Text="" CausesValidation="true" CssClass="form-control" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtSerieDesarmado" runat="server" ControlToValidate="TxtSerieDesarmado" CssClass="help-block errorimput"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSeriePaqueteDesarmado"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtSerieDesarmado.ClientID.ToString()%>">Serie:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" runat="server" id="DvDesArmadoLote" visible="false">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox runat="server" ID="TxtLoteDesarmado" Text="" CausesValidation="true" CssClass="form-control" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtLoteDesarmado" runat="server" ControlToValidate="TxtLoteDesarmado" CssClass="help-block errorimput"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lote''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSeriePaqueteDesarmado"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLoteDesarmado.ClientID.ToString()%>">Lote:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 col-md-offset-3 text-right">
|
||||
|
||||
<div class="col-md-3" runat="server" id="DvDesArmadoCaducidad" visible="false">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;" runat="server" id="DvFechaCaducidad">
|
||||
|
||||
<label for="<%= TxtDesarmadoCaducidad.ClientID.ToString()%>" style="color: #888888;">Fecha Caducidad:</label>
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px; margin-top: -5px !important;">
|
||||
<asp:TextBox ID="TxtDesarmadoCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 87px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtDesarmadoCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtDesarmadoCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="TopLeft" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtDesarmadoCaducidad" runat="server" ControlToValidate="TxtDesarmadoCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSeriePaqueteDesarmado"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtDesarmadoCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<%-- <div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
|
||||
<label for="<%= TxtFechaNacimiento.ClientID.ToString()%>" style="color: #888888;">Fecha de Nacimiento: </label>
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px; margin-top: -5px !important;">
|
||||
<asp:TextBox ID="TxtFechaNacimiento" CssClass="form-control" MaxLength="20" runat="server" Width="100px" Height="28px"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaNacimiento" class="btn default" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ajax:MaskedEditExtender ID="MEEFechaNacimiento" runat="server" TargetControlID="TxtFechaNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaNacimiento" PopupButtonID="LnkFechaNacimiento" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardarMedico"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardarMedico"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaNacimiento" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaNacimiento" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>--%>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3 text-right">
|
||||
<asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnAgregarSerieDesarmado" OnClick="BtnAgregarSerieDesarmado_Click" ValidationGroup="GrpAgregaSeriePaqueteDesarmado" runat="server" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</asp:Panel>
|
||||
|
||||
<br />
|
||||
|
||||
<asp:GridView ID="GvSeriesPaqueteDesarmado" runat="server" DataKeyNames="Serie" AutoGenerateColumns="false" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
|
||||
<asp:GridView ID="GvSeriesPaqueteDesarmado" runat="server" DataKeyNames="Serie,Lote,FechaCaducidad" AutoGenerateColumns="false" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="#" DataField="Row" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="70%" />
|
||||
<asp:BoundField HeaderText="#" DataField="Row" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="30%" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="30%" />
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-Width="30%" DataFormatString="{0:dd/MM/yyyy}" />
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" CommandName="Delete" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.IO.Packaging
|
||||
Imports Extensiones
|
||||
Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Inherits ClsPaginas
|
||||
@@ -89,12 +90,32 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property AplicaSerie As Boolean
|
||||
Private Property AplicaLotePaquete As Boolean
|
||||
Get
|
||||
Return CType(ViewState("AplicaSerie"), Boolean)
|
||||
Return CType(ViewState("AplicaLotePaquete"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("AplicaSerie") = value
|
||||
ViewState("AplicaLotePaquete") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property AplicaCaducidadPaquete As Boolean
|
||||
Get
|
||||
Return CType(ViewState("AplicaCaducidadPaquete"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("AplicaCaducidadPaquete") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property AplicaSeriePaquete As Boolean
|
||||
Get
|
||||
Return CType(ViewState("AplicaSeriePaquete"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("AplicaSeriePaquete") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -245,6 +266,12 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
|
||||
#Region " PROCESAR - VERIFICAR EXISTENCIAS "
|
||||
Protected Sub BtnVerificarExistenciasArmado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
AplicaSeriePaquete = False
|
||||
AplicaLotePaquete = False
|
||||
AplicaCaducidadPaquete = False
|
||||
|
||||
TipoMovimiento = 1
|
||||
Limpia(TipoMovimiento)
|
||||
|
||||
@@ -289,24 +316,43 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
If ErrorExistencias Then
|
||||
Alert(TextoExistencias, TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
AplicaSerie = CBool(drP("AplicaSerie"))
|
||||
AplicaSeriePaquete = CBool(drP("AplicaSerie"))
|
||||
AplicaLotePaquete = CBool(drP("AplicaLote"))
|
||||
AplicaCaducidadPaquete = CBool(drP("AplicaCaducidad"))
|
||||
BtnGuadarArmado.Visible = True
|
||||
End If
|
||||
|
||||
If AplicaSerie Then
|
||||
|
||||
|
||||
|
||||
If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then
|
||||
DivSeriesPaqueteArmado.Visible = True
|
||||
Dim Dt As New DataTable
|
||||
Dt.Columns.Add("Row", GetType(Integer))
|
||||
Dt.Columns.Add("Serie", GetType(String))
|
||||
Dt.Columns.Add("Lote", GetType(String))
|
||||
Dt.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
|
||||
For index = 1 To TxtCantidadArmado.Text.ToEntero
|
||||
Dim Row = Dt.NewRow
|
||||
Row("Row") = index
|
||||
Row("Serie") = ""
|
||||
Row("Lote") = ""
|
||||
Row("FechaCaducidad") = MinFecha
|
||||
Dt.Rows.Add(Row)
|
||||
Next
|
||||
|
||||
GvSeriesPaqueteArmado.Columns(1).Visible = AplicaSeriePaquete
|
||||
GvSeriesPaqueteArmado.Columns(2).Visible = AplicaLotePaquete
|
||||
GvSeriesPaqueteArmado.Columns(3).Visible = AplicaCaducidadPaquete
|
||||
|
||||
GvSeriesPaqueteArmado.DataSource = Dt
|
||||
GvSeriesPaqueteArmado.DataBind()
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
UpSeriesPaqueteArmado.Update()
|
||||
|
||||
CvePaqueteArmado = DdlPaqueteArmado.SelectedValue.ToEntero
|
||||
@@ -328,10 +374,16 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
UpGeneralesArmado.Update()
|
||||
End Sub
|
||||
Protected Sub BtnVerificarExistenciasDesarmado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
DvDesArmadoCaducidad.Visible = False
|
||||
DvDesArmadoLote.Visible = False
|
||||
DvDesArmadoSerie.Visible = False
|
||||
|
||||
DtDatosDetalle.Clear()
|
||||
BtnGuadarDesarmado.Visible = False
|
||||
TotalDesarmado.Visible = False
|
||||
AplicaSerie = False
|
||||
AplicaSeriePaquete = False
|
||||
TxtSerieDesarmado.Text = ""
|
||||
CvePaqueteDesarmado = -1
|
||||
TipoMovimiento = 2
|
||||
@@ -362,7 +414,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Alert($"No hay existencia suficiente del paquete <b>""{DdlPaqueteDesarmado.SelectedItem.Text}""</b> para desarmar. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
Else
|
||||
AplicaSerie = CBool(drP("AplicaSerie"))
|
||||
AplicaSeriePaquete = CBool(drP("AplicaSerie"))
|
||||
AplicaLotePaquete = CBool(drP("AplicaLote"))
|
||||
AplicaCaducidadPaquete = CBool(drP("AplicaCaducidad"))
|
||||
End If
|
||||
|
||||
|
||||
@@ -391,13 +445,23 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Next
|
||||
End If
|
||||
|
||||
If AplicaSerie Then
|
||||
If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then
|
||||
|
||||
DvDesArmadoCaducidad.Visible = AplicaSeriePaquete
|
||||
DvDesArmadoLote.Visible = AplicaLotePaquete
|
||||
DvDesArmadoSerie.Visible = AplicaCaducidadPaquete
|
||||
|
||||
GvSeriesPaqueteDesarmado.Columns(1).Visible = AplicaSeriePaquete
|
||||
GvSeriesPaqueteDesarmado.Columns(2).Visible = AplicaLotePaquete
|
||||
GvSeriesPaqueteDesarmado.Columns(3).Visible = AplicaCaducidadPaquete
|
||||
|
||||
DivSeriesPaqueteDesarmado.Visible = True
|
||||
CreaDtSeriesDesarmado()
|
||||
DtSeriesDesarmado.Clear()
|
||||
|
||||
GvSeriesPaqueteDesarmado.DataSource = DtSeriesDesarmado
|
||||
GvSeriesPaqueteDesarmado.DataBind()
|
||||
|
||||
End If
|
||||
UpSeriesPaqueteDesarmado.Update()
|
||||
|
||||
@@ -454,42 +518,118 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Case 1 ' ARMADO
|
||||
For Each gvr As GridViewRow In GvDatosArmado.Rows
|
||||
If gvr.DataKey("AplicaSerie") = "True" Then
|
||||
If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then
|
||||
Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
''If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then
|
||||
'' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
'' Exit Sub
|
||||
''End If
|
||||
'If gvr.FCTextBox("TxtSerie") Then
|
||||
|
||||
'End If
|
||||
|
||||
'If gvr.FCTextBox("TxtSerie").Text.Trim = "" Then
|
||||
' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
End If
|
||||
|
||||
If gvr.DataKey("AplicaLote") = "True" Then
|
||||
If gvr.FCTextBox("TxtLote").Text.Trim = "" Then
|
||||
Alert("Es necesario ingresas todos los lotes de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If gvr.DataKey("AplicaCaducidad") = "True" Then
|
||||
|
||||
If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
|
||||
Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
Case 2 ' DESARMADO
|
||||
For Each gvr As GridViewRow In GvDatosDesarmado.Rows
|
||||
|
||||
If gvr.DataKey("AplicaSerie") = "True" Then
|
||||
If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then
|
||||
|
||||
'If gvr.DataKey("AplicaSerie") = "True" Then
|
||||
' 'If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then
|
||||
' ' Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
' ' Exit Sub
|
||||
' 'End If
|
||||
'End If
|
||||
|
||||
If gvr.FCTextBox("Serie").Text.Trim = "" Then
|
||||
Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If gvr.DataKey("AplicaLote") = "True" Then
|
||||
If gvr.FCTextBox("TxtLote").Text.Trim = "" Then
|
||||
Alert("Es necesario ingresas todos los lotes de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If gvr.DataKey("AplicaCaducidad") = "True" Then
|
||||
|
||||
If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
|
||||
Alert("Es necesario ingresas todos las fechas de caducidad de los componentes.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
End Select
|
||||
|
||||
'VALIDA SI EL PAQUETE ES DE SERIE QUE SE INGRESEN TODAS LAS SERIES (CANTIDAD)
|
||||
If AplicaSerie Then
|
||||
If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then
|
||||
Select Case (Tipo)
|
||||
Case 1 ' ARMADO
|
||||
For Each gvr As GridViewRow In GvSeriesPaqueteArmado.Rows
|
||||
If gvr.FCTextBox("TxtSerie").Text.Trim = "" Then
|
||||
Alert("Es necesario indicar las series del paquete a armar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
|
||||
If AplicaSeriePaquete Then
|
||||
If gvr.FCTextBox("TxtSerie").Text.Trim = "" Then
|
||||
Alert("Es necesario indicar las series del paquete a armar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If AplicaLotePaquete Then
|
||||
If gvr.FCTextBox("TxtLote").Text.Trim = "" Then
|
||||
Alert("Es necesario indicar los lotes del paquete a armar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If AplicaCaducidadPaquete Then
|
||||
If gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
|
||||
Alert("Es necesario indicar fechas de caducidad validas del paquete a armar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
Case 2 ' DESARMADO
|
||||
|
||||
If TxtCantidadDesarmado.Text.ToEntero <> DtSeriesDesarmado.Rows.Count Then
|
||||
Alert("Es necesario indicar las series del paquete a desarmar.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("Es necesario indicar las series, lotes o Fecha de caducidad del paquete a desarmar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim TextoError As New StringBuilder
|
||||
If Tipo = 1 Then
|
||||
Dim ObjInventarioVal As New ClsInventarios
|
||||
@@ -572,7 +712,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
End If
|
||||
|
||||
|
||||
Exit Sub
|
||||
|
||||
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
@@ -669,12 +809,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
End If
|
||||
|
||||
|
||||
If AplicaSerie Then
|
||||
If AplicaSeriePaquete Then
|
||||
Dim ContadorPaquete = 1
|
||||
Dim DtSeriesComponentes As New DataTable
|
||||
For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows
|
||||
'AGREGA MOVTO DETALLE DE LA ENTRADA DEL PAQUETE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then
|
||||
|
||||
Dim Serie As String = Gvr.FCTextBox("TxtSerie").Text.Trim
|
||||
Dim Lote As String = Gvr.FCTextBox("TxtLote").Text.Trim
|
||||
Dim FechaCaducidad As Date = If(Gvr.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha, MinFecha, Gvr.FCTextBox("TxtCaducidad").Text.ToDate)
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada"
|
||||
Exit For
|
||||
@@ -736,10 +881,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
'If AplicaSeccion Then
|
||||
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
||||
'End If
|
||||
If AplicaSerie Then
|
||||
If AplicaSeriePaquete Or AplicaLotePaquete Or AplicaCaducidadPaquete Then
|
||||
|
||||
|
||||
For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows
|
||||
|
||||
Dim Serie As String = If(AplicaSeriePaquete, Gvr.DataKey("Serie").Trim, "-1")
|
||||
Dim Lote As String = If(AplicaLotePaquete, Gvr.DataKey("Lote").Trim, "-1")
|
||||
Dim FechaCaducidad As Date = If(AplicaCaducidadPaquete, Gvr.DataKey("FechaCaducidad").Trim.ToDate, MinFecha)
|
||||
|
||||
'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Gvr.DataKey("Serie").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
|
||||
Exit For
|
||||
@@ -751,6 +903,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
Else
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDecimal, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||
@@ -878,7 +1031,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Private Sub Limpia(Tipo As Integer)
|
||||
|
||||
DtDatosDetalle.Clear()
|
||||
AplicaSerie = False
|
||||
AplicaSeriePaquete = False
|
||||
|
||||
|
||||
'If Tipo = 1 Then
|
||||
@@ -1441,6 +1594,11 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Dt.Columns.Add("Row", GetType(Integer))
|
||||
Dt.Columns.Add("Serie", GetType(String))
|
||||
|
||||
'Dim DrPS As DataRow = Nothing
|
||||
'DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=_DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
'Dim AplicaSerie
|
||||
|
||||
|
||||
For Each Row As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CType(sender, LinkButton).CommandArgument.ToEntero)).Rows
|
||||
If i > TxtCantidadArmado.Text.ToEntero Then
|
||||
Exit For
|
||||
@@ -1456,6 +1614,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
|
||||
GvSeriesPaqueteArmado.DataSource = Dt
|
||||
GvSeriesPaqueteArmado.DataBind()
|
||||
|
||||
|
||||
|
||||
UpSeriesPaqueteArmado.Update()
|
||||
End Sub
|
||||
|
||||
@@ -1465,15 +1626,23 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
DtSeriesDesarmado = New DataTable
|
||||
DtSeriesDesarmado.Columns.Add("Row", GetType(Integer))
|
||||
DtSeriesDesarmado.Columns.Add("Serie", GetType(String))
|
||||
DtSeriesDesarmado.Columns.Add("Lote", GetType(String))
|
||||
DtSeriesDesarmado.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnAgregarSerieDesarmado_Click(sender As Object, e As EventArgs)
|
||||
Dim Serie = TxtSerieDesarmado.Text.Trim
|
||||
Dim Serie As String = If(AplicaSeriePaquete, TxtSerieDesarmado.Text.Trim, "-1")
|
||||
Dim Lote As String = If(AplicaLotePaquete, TxtLoteDesarmado.Text.Trim, "-1")
|
||||
Dim FechaCaducidad As Date = If(AplicaCaducidadPaquete, TxtDesarmadoCaducidad.Text.ToDate, MinFecha)
|
||||
|
||||
'VERIFICA EXISTENCIAS
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero
|
||||
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
|
||||
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie,
|
||||
CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
||||
|
||||
If Existencia < 1 Then
|
||||
Alert($"No hay existencia suficiente con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
@@ -1495,9 +1664,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Dim Row = DtSeriesDesarmado.NewRow
|
||||
Row("Row") = DtSeriesDesarmado.MAX("Row").ToEntero + 1
|
||||
Row("Serie") = TxtSerieDesarmado.Text.Trim
|
||||
Row("Lote") = TxtLoteDesarmado.Text.Trim
|
||||
Row("FechaCaducidad") = TxtDesarmadoCaducidad.Text.ToDate
|
||||
|
||||
DtSeriesDesarmado.Rows.Add(Row)
|
||||
|
||||
TxtSerieDesarmado.Text = ""
|
||||
TxtLoteDesarmado.Text = ""
|
||||
TxtDesarmadoCaducidad.Text = ""
|
||||
|
||||
|
||||
If DtSeriesDesarmado.Rows.Count >= TxtCantidadDesarmado.Text.ToEntero Then
|
||||
BtnAgregarSerieDesarmado.Enabled = False
|
||||
|
||||
@@ -3090,9 +3090,7 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
Protected Sub LnkModalMaterialUtilizado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||
|
||||
If TxtPacienteModal.Text.Trim.Length = 0 Then
|
||||
Alert("Debe de proporcionar el paciente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -3102,7 +3100,6 @@ Partial Class OS_OrdenesServicios
|
||||
Alert("Debe de proporcionar el episodio.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
||||
@@ -3117,7 +3114,6 @@ Partial Class OS_OrdenesServicios
|
||||
For Each GVRow As GridViewRow In GvMU.Rows
|
||||
TotalSeleccionado = TotalSeleccionado + GVRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||
Next
|
||||
|
||||
If TotalSeleccionado = 0 Then
|
||||
Alert("No se selecciono ningun material", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -3128,7 +3124,6 @@ Partial Class OS_OrdenesServicios
|
||||
Alert("No se encontró almacen de entrega por adelantado", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim ProcesoOK As Boolean = True
|
||||
@@ -3145,7 +3140,6 @@ Partial Class OS_OrdenesServicios
|
||||
Dim CvePS As Integer = GVRow.DataKey("CvePS").ToEntero
|
||||
|
||||
If CantidadRegistro > 0 Then
|
||||
|
||||
Dim Serie As String = If(GVRow.DataKey("Serie") = "", "-1", GVRow.DataKey("Serie"))
|
||||
Dim Lote As String = If(GVRow.DataKey("Lote") = "", "-1", GVRow.DataKey("Lote"))
|
||||
Dim FechaCaducidad As DateTime = If(GVRow.DataKey("FechaCaducidad") = "", MinFecha, GVRow.DataKey("FechaCaducidad").ToDate)
|
||||
@@ -3316,22 +3310,17 @@ Partial Class OS_OrdenesServicios
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
|
||||
If ProcesoOK Then
|
||||
If Not ObjOS.UpdateVentaOS(Respuesta.CveVenta, CveOS, TxtPacienteModal.Text.Trim, TxtEpisodioModal.Text.Trim) Then
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If ProcesoOK Then
|
||||
If Not ObjOS.UpdateOrdenesServiciosFinaliza(CveOS, -1, -1, UsuarioActual.CveEmpresa, Observaciones:=TxtObservacionModal.Text.Trim) Then
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -3428,7 +3417,6 @@ Partial Class OS_OrdenesServicios
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
@@ -3440,15 +3428,11 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Protected Sub LnkActualizarUsaurioAtendio_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjOs As New ClsOS
|
||||
Dim ProcesoOk As Boolean = True
|
||||
|
||||
|
||||
|
||||
If DdlUsuarioAtendio.SelectedValue.ToEntero > 0 Then
|
||||
For Each GvRow As GridViewRow In GvPS.Rows
|
||||
If Not ObjOs.UpdateOrdenesServiciosAsignadas(GvRow.DataKey("CveOSDetalle").ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, MinFecha, DateTime.Parse(MinFecha.ToShortDateString), UsuarioActual.CveEmpresa) Then
|
||||
@@ -3463,8 +3447,6 @@ Partial Class OS_OrdenesServicios
|
||||
Else
|
||||
Alert("Debe de seleccionar un ténico para actualziar", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
ObjOs.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -85,10 +85,19 @@
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-md-1 ">Cliente:</label>
|
||||
<%-- <label class="col-md-1 ">Cliente:</label>
|
||||
<div class="col-md-1">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<label class="col-md-1 ">Hospital:</label>
|
||||
<div class="col-md-1">
|
||||
|
||||
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="Clave" CausesValidation="true" Width="100%" >
|
||||
</asp:DropDownList>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<label class="col-md-1 truncate">Vendedor:</label>
|
||||
@@ -98,7 +107,7 @@
|
||||
|
||||
<label class="col-md-1 ">Estatus:</label>
|
||||
<div class="col-md-1" >
|
||||
<asp:DropDownList ID="DdlEstatusOS" runat="server" AppendDataBoundItems="true" Width="110px"
|
||||
<asp:DropDownList ID="DdlEstatusOS" runat="server" AppendDataBoundItems="true" Width="100%"
|
||||
DataTextField="EstatusOrdenServicio" DataValueField="CveEstatusOrdenServicio" Class="input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
@@ -109,11 +118,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Técnico:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTecnico" ClientIDMode="Static" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="110px" ></asp:DropDownList>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Técnico:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTecnico" ClientIDMode="Static" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="110px"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
|
||||
<div runat="server" id="DivProyecto" class="col-md-1">
|
||||
@@ -121,38 +130,36 @@
|
||||
</div>
|
||||
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
|
||||
<div runat="server" id="DivSubProyecto" class="col-md-1">
|
||||
<asp:DropDownList ID="DdlSubProyecto" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlSubProyecto" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-md-1 ">Médico:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%" >
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Médico:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Procedimiento:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlProcedimiento" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" Width="100%" >
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
|
||||
<label class="col-md-1 ">Especialidad:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlEspecialidad" CssClass="form-control input-sm select2me" runat="server" DataTextField="Especialidad" Width="100%" DataValueField="CveMedicoEspecialidad"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Procedimiento:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlProcedimiento" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" Width="100%">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,14 +51,14 @@ Partial Class OS_RepOSMedicas
|
||||
|
||||
'CargaClientes
|
||||
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
DdlClientes.setEsWebService(True)
|
||||
Else
|
||||
DdlClientes.setEsWebService(False)
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
'If EsWS Then
|
||||
' DdlClientes.setEsWebService(True)
|
||||
'Else
|
||||
' DdlClientes.setEsWebService(False)
|
||||
' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlClientes.DataBind()
|
||||
' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
'End If
|
||||
|
||||
'Vendedor
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
|
||||
@@ -80,6 +80,48 @@ Partial Class OS_RepOSMedicas
|
||||
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||
DdlProcedimiento.DataBind()
|
||||
|
||||
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
|
||||
DdlEspecialidad.DataSource = ObjVentas.DtResultados
|
||||
Else
|
||||
DdlEspecialidad.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
DdlEspecialidad.DataBind()
|
||||
DdlEspecialidad.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
|
||||
Dim objcliente As New ClsClientes
|
||||
|
||||
If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then
|
||||
DdlClienteSucursal.DataSource = objcliente.DtResultados
|
||||
Else
|
||||
DdlClienteSucursal.DataSource = Nothing
|
||||
End If
|
||||
|
||||
objcliente.Dispose()
|
||||
|
||||
DdlClienteSucursal.DataBind()
|
||||
DdlClienteSucursal.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
|
||||
'Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
'If EsWS Then
|
||||
' DdlCliente.setEsWebService(True)
|
||||
|
||||
'Else
|
||||
' DdlCliente.setEsWebService(False)
|
||||
' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlCliente.DataBind()
|
||||
' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -97,11 +139,13 @@ Partial Class OS_RepOSMedicas
|
||||
Dim ObjOS As New ClsOS
|
||||
Dim FechaI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.ToDate)
|
||||
Dim FechaF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.ToDate)
|
||||
Dim Cvecliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
||||
Dim Cvecliente As Integer = DdlClienteSucursalCliente()
|
||||
Dim CveClienteSucursal As Integer = DdlClienteSucursalSucursal()
|
||||
LnkPersonalizar.Visible = False
|
||||
|
||||
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
|
||||
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
|
||||
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero,
|
||||
CveClienteSucursal:=CveClienteSucursal) Then
|
||||
GvDatos.DataSource = ObjOS.DtResultados
|
||||
If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
|
||||
LnkPersonalizar.Visible = True
|
||||
@@ -127,12 +171,12 @@ Partial Class OS_RepOSMedicas
|
||||
#End Region
|
||||
|
||||
|
||||
Private Sub CargaClientes()
|
||||
DdlClientes.ddl.Items.Clear()
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
'Private Sub CargaClientes()
|
||||
' DdlClientes.ddl.Items.Clear()
|
||||
' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
|
||||
' DdlClientes.DataBind()
|
||||
' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
'End Sub
|
||||
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
|
||||
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
|
||||
@@ -175,19 +219,31 @@ Partial Class OS_RepOSMedicas
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
||||
|
||||
|
||||
Personaliza()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Personaliza()
|
||||
|
||||
GvDatos.Columns(13).Visible = ChkObservaciones.Checked
|
||||
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function DdlClienteSucursalCliente() As Integer
|
||||
If DdlClienteSucursal.SelectedValue = "-1" Then
|
||||
Return -1
|
||||
Else
|
||||
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
|
||||
Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function DdlClienteSucursalSucursal() As Integer
|
||||
If DdlClienteSucursal.SelectedValue = "-1" Then
|
||||
Return -1
|
||||
Else
|
||||
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
|
||||
Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -65,25 +65,44 @@ Partial Class Ventas_CatPreciosLista
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim ObjVta As New ClsVentas
|
||||
Dim ActualizarFranquicias As Boolean = False
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, ChkPredeterminada.Checked, 0) > 0 Then
|
||||
Alert("El Precio de Lista se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al agregar el Precio de Lista", TipoMensaje.MsgError)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If ObjVta.UpdatePrecioLista(TxtPrecioLista.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, 0, ChkPredeterminada.Checked, CvePrecioLista) Then
|
||||
Alert("El Precio de Lista se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar al Precio de Lista", TipoMensaje.MsgError)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
ActualizarFranquicias = True
|
||||
End If
|
||||
|
||||
Dim ObjVta As New ClsVentas
|
||||
ObjVta.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
Try
|
||||
If EsEditar = 0 Then
|
||||
If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, ChkPredeterminada.Checked, 0, UpdateFranquicia:=ActualizarFranquicias) > 0 Then
|
||||
Alert("El Precio de Lista se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al agregar el Precio de Lista", TipoMensaje.MsgError)
|
||||
TieneError = True
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If ObjVta.UpdatePrecioLista(TxtPrecioLista.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, 0, ChkPredeterminada.Checked, CvePrecioLista, UpdateFranquicia:=ActualizarFranquicias) Then
|
||||
Alert("El Precio de Lista se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar al Precio de Lista", TipoMensaje.MsgError)
|
||||
TieneError = True
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
GuardaLog(ex.ToString())
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjVta.RollBack()
|
||||
Else
|
||||
ObjVta.Commit()
|
||||
End If
|
||||
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
|
||||
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
ObjVta.Dispose()
|
||||
@@ -94,6 +113,7 @@ Partial Class Ventas_CatPreciosLista
|
||||
UpDatos.Update()
|
||||
UpBodyCo.Update()
|
||||
|
||||
RecargaGlobal()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
@@ -105,6 +125,8 @@ Partial Class Ventas_CatPreciosLista
|
||||
ObjPrecioLista.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
|
||||
RecargaGlobal()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
@@ -131,155 +153,158 @@ Partial Class Ventas_CatPreciosLista
|
||||
dvEstatus.Visible = False
|
||||
UpBodyCo.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
Private Sub RecargaGlobal()
|
||||
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
|
||||
#Region "VIEJO"
|
||||
' Public Property PuedeEliminar As Boolean
|
||||
' Get
|
||||
' Return CBool(ViewState("PuedeEditar"))
|
||||
' End Get
|
||||
' Set(value As Boolean)
|
||||
' ViewState("PuedeEditar") = value
|
||||
' End Set
|
||||
' End Property
|
||||
|
||||
' Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
' If Not Page.IsPostBack Then
|
||||
|
||||
' CargaDatos()
|
||||
|
||||
' 'Permiso Registro
|
||||
' If UsuarioActual.TienePermisoProceso(132) Then LbAgregar.Enabled = True Else LbAgregar.Enabled = False
|
||||
|
||||
' 'Permiso Eliminar
|
||||
' If UsuarioActual.TienePermisoProceso(134) Then GvDatos.Columns(5).Visible = True Else GvDatos.Columns(6).Visible = False
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Private Sub CargaDatos()
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.GetPrecioListas(CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
' GvDatos.DataSource = ObjListas.DtResultados
|
||||
' GvDatos.DataBind()
|
||||
' Else
|
||||
' Me.GvDatos.DataSource = Nothing
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
' Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
' Dim ObjListas As New ClsVentas
|
||||
|
||||
' If HdnModalidad.Value = "I" Then
|
||||
' If ObjListas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text.Trim, TxtPorcentaje.Text.Trim.ToDouble) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La nueva Lista se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' ObjListas.Dispose()
|
||||
' Else
|
||||
' If HdnID.Value.ToEntero <> -1 Then
|
||||
' If ObjListas.UpdatePrecioLista(TxtPrecioLista.Text.Trim, True, UsuarioActual.CveUsuario, TxtPorcentaje.Text.Trim.ToDouble, HdnID.Value.ToEntero) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La lista se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End Sub
|
||||
|
||||
'#Region "G V D A T O S"
|
||||
' Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
' Dim URL As String = String.Format("javascript:CleanObjects();SetValue('HdnModalidad', 'U');SetValue('HdnID', '{0}'); SetObjects('{1}','{2}');ShowDivRegistro();return false;", e.Row.DBCampo("CvePrecioLista").ToEntero, e.Row.DBCampo("PrecioLista"), e.Row.DBCampo("Porcentaje"))
|
||||
|
||||
' 'GeneroLigas
|
||||
' Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
|
||||
' e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
' e.Row.FCLinkButton("ImgE").OnClientClick = URL
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
' Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.RemovePrecioLista(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("La Lista se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
' Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' Dim PrecioLista As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPrecioLista"), TextBox).Text.Trim
|
||||
' Dim Porcentaje As Double = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPorcentaje"), TextBox).Text.Trim.ToDouble
|
||||
' Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
' Dim CvePrecioLista As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
' If ObjListas.UpdatePrecioLista(PrecioLista, Estatus, UsuarioActual.CveUsuario, Porcentaje, CvePrecioLista) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
'#End Region
|
||||
|
||||
|
||||
'#Region " O R D E N A M I E N T O JAVASCRIPT"
|
||||
' Private Sub OrdenaDatos()
|
||||
' If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
' End If
|
||||
' End Sub
|
||||
'#End Region
|
||||
|
||||
|
||||
|
||||
' Private Sub OcultaDiv()
|
||||
' ScriptManager.RegisterStartupScript(Me, Me.GetType, "Llave", "HideDivRegistro();", True)
|
||||
' End Sub
|
||||
' Public Property PuedeEliminar As Boolean
|
||||
' Get
|
||||
' Return CBool(ViewState("PuedeEditar"))
|
||||
' End Get
|
||||
' Set(value As Boolean)
|
||||
' ViewState("PuedeEditar") = value
|
||||
' End Set
|
||||
' End Property
|
||||
|
||||
' Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
' If Not Page.IsPostBack Then
|
||||
|
||||
' CargaDatos()
|
||||
|
||||
' 'Permiso Registro
|
||||
' If UsuarioActual.TienePermisoProceso(132) Then LbAgregar.Enabled = True Else LbAgregar.Enabled = False
|
||||
|
||||
' 'Permiso Eliminar
|
||||
' If UsuarioActual.TienePermisoProceso(134) Then GvDatos.Columns(5).Visible = True Else GvDatos.Columns(6).Visible = False
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Private Sub CargaDatos()
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.GetPrecioListas(CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
' GvDatos.DataSource = ObjListas.DtResultados
|
||||
' GvDatos.DataBind()
|
||||
' Else
|
||||
' Me.GvDatos.DataSource = Nothing
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
' Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
' Dim ObjListas As New ClsVentas
|
||||
|
||||
' If HdnModalidad.Value = "I" Then
|
||||
' If ObjListas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text.Trim, TxtPorcentaje.Text.Trim.ToDouble) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La nueva Lista se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' ObjListas.Dispose()
|
||||
' Else
|
||||
' If HdnID.Value.ToEntero <> -1 Then
|
||||
' If ObjListas.UpdatePrecioLista(TxtPrecioLista.Text.Trim, True, UsuarioActual.CveUsuario, TxtPorcentaje.Text.Trim.ToDouble, HdnID.Value.ToEntero) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La lista se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End Sub
|
||||
|
||||
'#Region "G V D A T O S"
|
||||
' Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
' Dim URL As String = String.Format("javascript:CleanObjects();SetValue('HdnModalidad', 'U');SetValue('HdnID', '{0}'); SetObjects('{1}','{2}');ShowDivRegistro();return false;", e.Row.DBCampo("CvePrecioLista").ToEntero, e.Row.DBCampo("PrecioLista"), e.Row.DBCampo("Porcentaje"))
|
||||
|
||||
' 'GeneroLigas
|
||||
' Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
|
||||
' e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
' e.Row.FCLinkButton("ImgE").OnClientClick = URL
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
' Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.RemovePrecioLista(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("La Lista se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
' Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' Dim PrecioLista As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPrecioLista"), TextBox).Text.Trim
|
||||
' Dim Porcentaje As Double = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPorcentaje"), TextBox).Text.Trim.ToDouble
|
||||
' Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
' Dim CvePrecioLista As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
' If ObjListas.UpdatePrecioLista(PrecioLista, Estatus, UsuarioActual.CveUsuario, Porcentaje, CvePrecioLista) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
'#End Region
|
||||
|
||||
|
||||
'#Region " O R D E N A M I E N T O JAVASCRIPT"
|
||||
' Private Sub OrdenaDatos()
|
||||
' If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
' End If
|
||||
' End Sub
|
||||
'#End Region
|
||||
|
||||
|
||||
|
||||
' Private Sub OcultaDiv()
|
||||
' ScriptManager.RegisterStartupScript(Me, Me.GetType, "Llave", "HideDivRegistro();", True)
|
||||
' End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -777,14 +777,15 @@ Partial Class Clientes
|
||||
|
||||
'CARGA LOS FILTROS DEL TAB COMPORTAMIENTO VENTA
|
||||
TabComportamientoVentas.Visible = True
|
||||
CargaFiltros()
|
||||
|
||||
'JM 05-02-19: CRM
|
||||
If UsuarioActual.Empresa.UsaCRM Then
|
||||
VerificaVinculacion()
|
||||
UpAccionesCRM.Update()
|
||||
End If
|
||||
|
||||
CargaFiltros()
|
||||
|
||||
'JM 05-02-19: CRM
|
||||
'If UsuarioActual.Empresa.UsaCRM Then
|
||||
If GlobalDTCRMTipoProceso(UsuarioActual.CveEmpresa) IsNot Nothing AndAlso GlobalDTCRMTipoProceso(UsuarioActual.CveEmpresa).Rows.Count > 0 Then
|
||||
VerificaVinculacion()
|
||||
UpAccionesCRM.Update()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'si es acumuladora
|
||||
'AndAlso UsuarioActual.CveRol.Contiene(1280, 1511)
|
||||
If Not PermiteEditar() Then 'sino puede editar todos los datos del cliente, se bloquean los de distribuidor
|
||||
@@ -2617,6 +2618,10 @@ Partial Class Clientes
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not ErrorProceso AndAlso UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
ErrorProceso = Not ActualizarClienteFranquicia(ObjClientes, CveClienteNuevo)
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
@@ -2670,6 +2675,10 @@ Partial Class Clientes
|
||||
If Not ErrorProceso AndAlso Not GuardarDocumentosClientes(objDoc, Me.CveCliente) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
If Not ErrorProceso AndAlso UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
ErrorProceso = Not ActualizarClienteFranquicia(ObjClientes, Me.CveCliente)
|
||||
End If
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
@@ -2772,6 +2781,23 @@ Partial Class Clientes
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function ActualizarClienteFranquicia(ByRef ObjClientes As ClsClientes, CveClienteRef As Integer) As Boolean
|
||||
Dim TieneError As Boolean = False
|
||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
|
||||
Dim Franquicias As String() = FranquiciasStr.Split(","c)
|
||||
|
||||
For Each Franquicia As String In Franquicias
|
||||
Dim CveEmpresaFranquicia As Integer = Franquicia.ToEntero
|
||||
If Not ObjClientes.UpdateClienteFranquicia(CveClienteRef, UsuarioActual.CveEmpresa, CveEmpresaFranquicia) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Not TieneError
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
@@ -111,6 +111,8 @@
|
||||
<label class="col-md-1">Sucursal: </label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVSubProyecto" runat="server" InitialValue="-1" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario, por favor ingréselo." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESubproyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Fecha Inicial:</label>
|
||||
<div class="col-md-1">
|
||||
@@ -185,7 +187,7 @@
|
||||
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClick" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkDis" Visible="false" CssClass="ChkAllEvt" />
|
||||
<asp:CheckBox runat="server" ID="chkDis" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField="Folio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" Target="_blank" />
|
||||
@@ -210,7 +212,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" style="padding-bottom: 15px; display: flex; align-items: flex-end; justify-content: flex-end;">
|
||||
<asp:UpdatePanel ID="UpFacturar" runat="server" class="portlet light xspadding bordered " style="min-width: 100%;" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
@@ -233,7 +235,7 @@
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlPeriodo" DataTextField="Descripcion" DataValueField="CveSATPeriodicidad" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlPeriodo_SelectedIndexChanged"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVPeriodo" runat="server" InitialValue="-1" ControlToValidate="DdlPeriodo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Periodo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPerido" runat="server" HighlightCssClass="vco" TargetControlID="RFVPeriodo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPerido" runat="server" HighlightCssClass="vco" TargetControlID="RFVPeriodo" Width="150px" PopupPosition="BottomRight"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
@@ -242,7 +244,7 @@
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlMes" DataTextField="Descripcion" DataValueField="CveSATMes" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVMes" runat="server" InitialValue="-1" ControlToValidate="DdlMes" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEMes" runat="server" HighlightCssClass="vco" TargetControlID="RFVMes" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEMes" runat="server" HighlightCssClass="vco" TargetControlID="RFVMes" Width="150px" PopupPosition="BottomRight"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
@@ -252,7 +254,7 @@
|
||||
<asp:DropDownList ID="DdlAnio" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVAnio" runat="server" InitialValue="-1" ControlToValidate="DdlAnio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitir"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEAnio" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnio" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEAnio" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnio" Width="150px" PopupPosition="BottomRight"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
@@ -49,6 +49,10 @@ Partial Class Ventas_FacturacionGlobal
|
||||
|
||||
DdlAnio.Items.Add(New ListItem(Anio.ToString(), Anio.ToString()))
|
||||
DdlAnio.Items.Add(New ListItem(AnioAnterior.ToString(), AnioAnterior.ToString()))
|
||||
|
||||
txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy")
|
||||
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
@@ -58,6 +62,7 @@ Partial Class Ventas_FacturacionGlobal
|
||||
DdlMes.DataSource = GlobalDTGralSATMeses().FiltraParametros("ISNULL(CveSATPeriodicidad,0) <> 5")
|
||||
End If
|
||||
DdlMes.DataBind()
|
||||
DdlMes.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
@@ -128,8 +133,15 @@ Partial Class Ventas_FacturacionGlobal
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveVenta").ToEntero() > 0 Then
|
||||
e.Row.FCCheckBox("chkDis").Visible = True
|
||||
If e.Row.DBCampo("Saldo").ToDecimal() > 0 Then
|
||||
e.Row.FCCheckBox("chkDis").Enabled = False
|
||||
e.Row.FCCheckBox("chkDis").ToolTip = "No se puede seleccionar esta remisión porque no ha sido pagada"
|
||||
Else
|
||||
e.Row.FCCheckBox("chkDis").Enabled = True
|
||||
e.Row.FCCheckBox("chkDis").CssClass = "ChkAllEvt"
|
||||
End If
|
||||
Else
|
||||
e.Row.FCCheckBox("chkDis").Visible = False
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
@@ -137,7 +149,7 @@ Partial Class Ventas_FacturacionGlobal
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
|
||||
Dim CveMoneda As Integer = -1
|
||||
Dim CveMoneda As Integer = 1
|
||||
|
||||
Dim SbRemisiones As New StringBuilder()
|
||||
Dim RemisionesLista As New List(Of Integer)
|
||||
@@ -171,6 +183,26 @@ Partial Class Ventas_FacturacionGlobal
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
|
||||
If DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0 Then
|
||||
Alert("No se pudieron cargar las remsiones para facturar", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0 Then
|
||||
Alert("No se pudieron cargar los pagos", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Me.CveSubProyecto <= 0 Then
|
||||
Alert("No se pudo cargar la sucursal", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If CveCliente <= 0 Then
|
||||
Alert("No se pudo cargar el cliente", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, Me.CveSubProyecto, CveCliente, CveMoneda, "Ing")
|
||||
ObjFactura.EsFacturaGlobal = True
|
||||
ObjFactura.CveSATPeriodicidad = DdlPeriodo.SelectedValue.ToEntero()
|
||||
@@ -188,6 +220,12 @@ Partial Class Ventas_FacturacionGlobal
|
||||
|
||||
ObjFactura.CalculaTotales()
|
||||
ObjFactura.PreparaTimbre()
|
||||
|
||||
If ObjFactura.Total <> DtPagos.SUMD("Importe") Then
|
||||
Alert("Los pagos no coinciden con el total de la factura", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPs = 2")
|
||||
|
||||
Dim SbAlert As New StringBuilder()
|
||||
|
||||
@@ -337,7 +337,7 @@ Partial Class Ventas_PVCobranza
|
||||
PnlContado.Visible = False
|
||||
ObjConta.Commit()
|
||||
CargaDatos()
|
||||
Alert("Pago Registrado correctamente.<br/><br/> <a href='#' class='Texto'>Imprimir ticket</a>", TipoMensaje.MsgInformacion)
|
||||
Alert($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1®ENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjConta.RollBack()
|
||||
End If
|
||||
|
||||
@@ -3194,7 +3194,7 @@ Partial Class ProductosyServicios
|
||||
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
|
||||
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
|
||||
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv,
|
||||
EsPaquete, DdlSATPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
|
||||
EsPaquete, DdlSATPS.SelectedValue.ToEntero, CveEmpresaFranquicia, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
|
||||
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
|
||||
CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, IEPSGrabaIVA:=ChkIepsIVA.Checked,
|
||||
VentaMinima:=TxtVentaMinima.Text.ToDecimal, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, RetISR:=(TxtRetISR.Text.Trim.ToDouble / 100), PrecioMinimo:=TxtPrecioMinimo.Text.ToDecimal,
|
||||
|
||||
@@ -612,13 +612,13 @@
|
||||
<b>Paciente:</b>
|
||||
</td>
|
||||
<td runat="server">
|
||||
<asp:TextBox ID="TxtPaciente" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="50"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtPaciente" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="50"></asp:TextBox>
|
||||
</td>
|
||||
<td runat="server" id="Td9" visible="true">
|
||||
<b>Episodio:</b>
|
||||
</td>
|
||||
<td runat="server">
|
||||
<asp:TextBox ID="TxtEpisodio" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="20"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtEpisodio" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="20"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1183,7 +1183,7 @@
|
||||
<%--</asp:Panel>--%>
|
||||
|
||||
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
|
||||
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle"
|
||||
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,ImporteIVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle"
|
||||
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
|
||||
<Columns>
|
||||
<%--0--%>
|
||||
@@ -1404,6 +1404,8 @@
|
||||
<%--19--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkDescuentos" runat="server" Visible="false" AlternateText="Clonar" CausesValidation="False" CommandName="Descuento" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-comment-o'></i>" />
|
||||
<asp:LinkButton ID="imgClone" runat="server" AlternateText="Clonar" CausesValidation="False" CommandName="Clonar" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
||||
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-clone'></i>" />
|
||||
</ItemTemplate>
|
||||
@@ -1851,7 +1853,7 @@
|
||||
</div>
|
||||
<div class=" col-sm-10">
|
||||
<div class="Widthall" style="overflow-x: auto;">
|
||||
<asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" Style="text-align: center;" GridLines="None">
|
||||
<asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -1890,7 +1892,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Lote" HeaderText="Lote" />
|
||||
<asp:BoundField DataField="FechaCaducidad" HeaderText="FechaCaducidad" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="FechaCaducidad" HeaderText="F. Caducidad" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -2543,14 +2545,14 @@
|
||||
<asp:GridView ID="GvMercanciasCP" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
|
||||
EmptyDataText="No hay datos disponibles" DataKeyNames="Consec">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Font-Size="6pt" HeaderText="#" ItemStyle-Width="10%">
|
||||
<asp:TemplateField ItemStyle-Font-Size="6pt" HeaderText="#" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlConsecutivo" runat="server" Text='<%# Eval("Consec", "{0:N0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%" />
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="60%" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N2}" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Esta seguro de eliminar la mercancía?" data-btn-ok-label="si" />
|
||||
@@ -4319,6 +4321,83 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ModalDescPS" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel runat="server" ID="UpDescPS" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="LblTituloDesc" runat="server" ClientIDMode="Static" Text="Descuento:"></asp:Label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnDescPS" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<asp:HiddenField ID="HdnConsecPS" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnTotalCompra" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<table style="width: 90%">
|
||||
<tr>
|
||||
<td>SubTotal</td>
|
||||
<td>
|
||||
<asp:Label ID="LblSubtotalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
|
||||
</td>
|
||||
<td>Total</td>
|
||||
<td>
|
||||
<asp:Label ID="LblTotalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>% Descuento</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtPorPS" runat="server" CausesValidation="true" ClientIDMode="Static" MaxLength="12" Text="0" ValidationGroup="GrpDescuentoP" Width="72px"></asp:TextBox>
|
||||
<asp:CompareValidator ID="CVPorPS" runat="server" ControlToValidate="TxtPorPS" Display="None" ErrorMessage="El campo <b>''Descuento por Porcentaje''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpPorPS"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPorPS" runat="server" HighlightCssClass="vco" TargetControlID="CVPorPS" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
(%)
|
||||
</td>
|
||||
<td>IVA</td>
|
||||
<td>
|
||||
<asp:Label ID="LblIVADescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>
|
||||
<asp:Label runat="server" ClientIDMode="Static" Text="Descuento"></asp:Label>
|
||||
</b>
|
||||
</td>
|
||||
<td><b>
|
||||
<asp:Label ID="LblDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b></td>
|
||||
<td>
|
||||
<b>
|
||||
<asp:Label runat="server" ClientIDMode="Static" Text="% Utilidad"></asp:Label>
|
||||
</b>
|
||||
</td>
|
||||
<td><b>
|
||||
<asp:Label ID="LblUtilidadPorcentaje" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b>Total Final</b></td>
|
||||
<td>
|
||||
<b>
|
||||
<asp:Label ID="LblTotalFinalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnPorPS" runat="server" Text="Aplicar" ValidationGroup="GrpPorPS" CssClass="btn btn-primary" OnClick="BtnPorPS_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
|
||||
<ContentTemplate>
|
||||
@@ -8430,7 +8509,7 @@
|
||||
|
||||
|
||||
<%--Cliente Sucursales --%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaClientesucursal">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
||||
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="Clave" CausesValidation="true"
|
||||
@@ -8444,8 +8523,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--Cliente Solo se usa para en PAgo Directo --%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaCliente">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright" style="margin-top: -7px!important">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClienteSucursal">Cliente:</asp:Label>
|
||||
<ADS:Dropdownlost CssClassDdl="form-control select2me" ID="DdlClientesModal" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
|
||||
Style="margin-top: -5px!important" IncluyeTodos="false"></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%--Medico Procedimiento--%>
|
||||
@@ -8462,7 +8550,7 @@
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Médico:</asp:Label>
|
||||
</div>
|
||||
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
||||
<asp:LinkButton runat="server" ID="LnkAddMedicoModal" OnClick="LnkAddMedicoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important" ></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="LnkAddMedicoModal" OnClick="LnkAddMedicoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" Style="margin-top: 8px!important"></asp:LinkButton>
|
||||
</div>
|
||||
<div class="form-group col-md-5 form-md-line-input input-iconright ">
|
||||
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento"
|
||||
@@ -8476,7 +8564,7 @@
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
||||
</div>
|
||||
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
||||
<asp:LinkButton runat="server" ID="LnkAddProcedimientoModal" OnClick="LnkAddProcedimientoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="LnkAddProcedimientoModal" OnClick="LnkAddProcedimientoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" Style="margin-top: 8px!important"></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8517,9 +8605,9 @@
|
||||
<asp:BoundField DataField="Abreviatura" HeaderText="UM">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:N4}") %>' Style="text-align: right!important" Width="80px" Enabled="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:N4}") %>' Style="text-align: right!important" Width="80px" Enabled="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -8544,14 +8632,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DvModalAddMedico" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddMedico" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
||||
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
|
||||
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
|
||||
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
|
||||
</div>
|
||||
<asp:Button ID="BtnRecargaMedicos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaMedicos_Click" />
|
||||
<asp:HiddenField ID="HdnCveMedicoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
@@ -8560,22 +8648,22 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="DvModalAddProcedimiento" class="modal ADS fade" role="dialog">
|
||||
<div id="DvModalAddProcedimiento" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
||||
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
|
||||
</div>
|
||||
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
|
||||
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
|
||||
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
|
||||
</div>
|
||||
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
|
||||
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
@@ -9657,6 +9745,46 @@
|
||||
$("#LblSubTotal1").text($("#TxtSubTotal").val());
|
||||
}
|
||||
|
||||
|
||||
function CalculaDescPS() {
|
||||
if ($get("TxtPorPS").value != "") {
|
||||
var PorcentajeDescuento = parseFloat($get("TxtPorPS").value);
|
||||
if (PorcentajeDescuento < 0 || PorcentajeDescuento > 99) {
|
||||
alert("No se puede aplicar ese porcentaje de descuento");
|
||||
return;
|
||||
}
|
||||
|
||||
var subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||
var Monto = parseFloat($get("LblTotalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||
|
||||
var Total = Monto - ((Monto * PorcentajeDescuento) / 100);
|
||||
|
||||
$get("LblTotalFinalDescPS").innerText = formato_numero(Total, 2, '.', ',');
|
||||
|
||||
var TotalRedondeado = parseFloat($get("LblTotalFinalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||
|
||||
var descuento = - ((TotalRedondeado - (subTotal * 1.16)) / 1.16);
|
||||
|
||||
$get("LblIVADescPS").innerText = formato_numero(((subTotal - descuento) * 0.16), 2, '.', ',');
|
||||
|
||||
$get("LblDescPS").innerText = formato_numero(descuento, 2, '.', ',');
|
||||
$get("HdnDescPS").value = descuento;
|
||||
|
||||
var totalCompra = parseFloat($get("HdnTotalCompra").value);
|
||||
if (totalCompra > 0) {
|
||||
var utilidad = ((TotalRedondeado - totalCompra) / TotalRedondeado) * 100;
|
||||
$get("LblUtilidadPorcentaje").innerText = formato_numero(utilidad, 2, '.', ',');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$get("LblTotalFinalDescPS").innerText = "0.00";
|
||||
$get("LblDescPS").innerText = "0.00";
|
||||
$get("LblIVADescPS").innerText = "0.00";
|
||||
$get("LblUtilidadPorcentaje").innerText = "0.00";
|
||||
$get("HdnDescPS").innerText = "0.00";
|
||||
}
|
||||
}
|
||||
|
||||
function formato_numero(numero, decimales, separador_decimal, separador_miles) { // v2007-08-06
|
||||
numero = parseFloat(numero);
|
||||
if (isNaN(numero)) {
|
||||
@@ -10501,17 +10629,17 @@
|
||||
}
|
||||
|
||||
|
||||
function fncRegargaMedicos(CveNuevoMedico) {
|
||||
function fncRegargaMedicos(CveNuevoMedico) {
|
||||
|
||||
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
|
||||
$('#BtnRecargaMedicos').click();
|
||||
}
|
||||
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
|
||||
$('#BtnRecargaMedicos').click();
|
||||
}
|
||||
|
||||
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
|
||||
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
|
||||
|
||||
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
|
||||
$('#BtnRecargaProcedimientos').click();
|
||||
}
|
||||
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
|
||||
$('#BtnRecargaProcedimientos').click();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -539,6 +539,34 @@ Partial Class Ventas
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Property CveClienteOS As Integer
|
||||
Get
|
||||
If ViewState("CveClienteOS") Is Nothing Then
|
||||
ViewState("CveClienteOS") = -1
|
||||
End If
|
||||
Return ViewState("CveClienteOS").ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClienteOS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveClienteSucursalOS As Integer
|
||||
Get
|
||||
If ViewState("CveClienteSucursalOS") Is Nothing Then
|
||||
ViewState("CveClienteSucursalOS") = -1
|
||||
End If
|
||||
Return ViewState("CveClienteSucursalOS").ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClienteSucursalOS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Property CveClienteSucursal As Integer
|
||||
Get
|
||||
If ViewState("CveClienteSucursal") Is Nothing Then
|
||||
@@ -2567,6 +2595,7 @@ Partial Class Ventas
|
||||
TabAlmacen.Enabled = UsuarioActual.Empresa.UsaInventarios
|
||||
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtPorPS.Attributes.Add("onKeyUp", "CalculaDescPS();")
|
||||
|
||||
CreaDTmpC()
|
||||
CreaDTmpF()
|
||||
@@ -4146,7 +4175,8 @@ Partial Class Ventas
|
||||
If DrPS IsNot Nothing Then
|
||||
Dim CveTipoPS As Integer = DrPS("CveTipoPS").ToString().ToEntero()
|
||||
Dim CveTipoInv As Integer = DrPS("Inv_CveMetodoInventario").ToString().ToEntero()
|
||||
Dim existencia As Decimal = ps.GetExistenciasPS(Row.DataKey("CvePS").ToEntero(), Row.DataKey("CveUM").ToEntero(), UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Dim existencia As Decimal = ps.GetExistenciasPS(Row.DataKey("CvePS").ToEntero(), Row.DataKey("CveUM").ToEntero(), UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||
If (existencia < Row.FCTextBox("TxtCant").Text.ToEntero() AndAlso CveTipoPS <> 1) AndAlso UsuarioActual.CveEmpresa.Contiene(72, 80) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ped") Then ' And DdlContratosModal.SelectedValue.ToEntero() <> 196 Then
|
||||
Alert("No cuenta con la cantidad suficiente en inventario para el producto: <br/>" + Row.FCLiteral("LtlPS").Text + ".", TipoMensaje.MsgAdvertencia)
|
||||
TmpDT.Clear()
|
||||
@@ -8245,6 +8275,10 @@ Partial Class Ventas
|
||||
e.Row.FCLinkButton("imgE").Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.TienePermisoProceso(374) Then
|
||||
e.Row.FCLinkButton("LnkDescuentos").Visible = True
|
||||
End If
|
||||
|
||||
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
|
||||
' e.Row.FCLinkButton("imgE").Enabled = False
|
||||
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
||||
@@ -8385,7 +8419,8 @@ Partial Class Ventas
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim Existencia As Decimal
|
||||
If ValidaExistencia Then
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||
End If
|
||||
|
||||
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||
@@ -9391,7 +9426,10 @@ Partial Class Ventas
|
||||
CveUnidad = dr("CveUM").ToString().ToEntero()
|
||||
Cantidad = TmpDT.SUM("Cantidad", $"CvePS = {CveProducto} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") 'VALIDA CONTRA LA SUMA DEL MISMO PS
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso RemisionesLista.Count < 1 AndAlso dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(),
|
||||
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1,
|
||||
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||
If Existencia < Cantidad Then
|
||||
MensajeCosto.AppendFormat("<br/>El Producto <b>{0}</b>. No cuenta con la cantidad suficiente en inventario. Cuenta con {1}.", dr("CodigoPS").ToString(), Existencia.FormatoNumero(2))
|
||||
Continue For
|
||||
@@ -15266,7 +15304,8 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||
If Existencia < Cantidad Then
|
||||
OcurrioError = True
|
||||
ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
|
||||
@@ -17720,7 +17759,11 @@ Partial Class Ventas
|
||||
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") OrElse ((DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119)) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ped") And UsuarioActual.CveEmpresa.Contiene(186)))) Then
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
||||
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(),
|
||||
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1,
|
||||
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||
|
||||
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
|
||||
@@ -22103,7 +22146,8 @@ Partial Class Ventas
|
||||
If TxtCodigoSerie.Text.Trim <> "" Then
|
||||
Dim Serie As String = TxtCodigoSerie.Text.Trim().ToUpper()
|
||||
Dim Objinventarios As New ClsInventarios
|
||||
Dim Existencia As Decimal = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, Serie:=Serie, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero())
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Dim Existencia As Decimal = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, Serie:=Serie, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), BuscarEnTabla:=BuscarEnTabla)
|
||||
Dim ExistenciaActual As Decimal = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Serie))
|
||||
CvePS = Objinventarios.CvePS
|
||||
Objinventarios.Dispose()
|
||||
@@ -23045,8 +23089,8 @@ Partial Class Ventas
|
||||
End If
|
||||
'SIN EXISTENCIA
|
||||
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then
|
||||
|
||||
Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero(), Serie:=Gvr.FCTextBox("TxtSerie").Text.ToString(), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero(), Serie:=Gvr.FCTextBox("TxtSerie").Text.ToString(), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||
ExistenciaActual = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
|
||||
|
||||
'Valida Existencia
|
||||
@@ -23888,7 +23932,6 @@ Partial Class Ventas
|
||||
Dim RowNum As Integer = Convert.ToInt32(e.CommandArgument)
|
||||
Dim GvRow As GridViewRow = GvPS.Rows(RowNum)
|
||||
|
||||
|
||||
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
|
||||
TxtCantidad.Text = GvRow.FCTextBox("TxtCantidad").Text
|
||||
DdlClasificacion.SelectedValue = GvRow.FCDropDownList("DdlClasificacion").SelectedValue
|
||||
@@ -23914,6 +23957,32 @@ Partial Class Ventas
|
||||
RegistraScript("Recalcula();")
|
||||
LbAgregar_Click(Nothing, Nothing)
|
||||
|
||||
ElseIf e.CommandName = "Descuento" Then
|
||||
LblSubtotalDescPS.Text = ""
|
||||
LblTotalDescPS.Text = ""
|
||||
LblTituloDesc.Text = "Descuento"
|
||||
HdnConsecPS.Value = "-1"
|
||||
HdnTotalCompra.Value = ""
|
||||
TxtPorPS.Text = ""
|
||||
LblIVADescPS.Text = ""
|
||||
|
||||
Dim GvRow As GridViewRow = GvPS.Rows(e.CommandArgument.ToString().ToEntero())
|
||||
LblTituloDesc.Text = $"Descuento: {GvRow.DataKey("PS")}"
|
||||
HdnConsecPS.Value = GvRow.DataKey("Consec")
|
||||
LblSubtotalDescPS.Text = (GvRow.DataKey("Total").ToDecimal()).FormatoNumero()
|
||||
LblTotalDescPS.Text = (GvRow.DataKey("Total").ToDecimal() + GvRow.DataKey("ImporteIVA").ToDecimal()).FormatoNumero()
|
||||
LblIVADescPS.Text = GvRow.DataKey("ImporteIVA").FormatoNumero()
|
||||
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
Dim PrecioCompra = ObjPS.GetUltimoPrecioCompra(UsuarioActual.CveEmpresa, GvRow.DataKey("CvePS").ToEntero())
|
||||
If PrecioCompra > 0 Then
|
||||
HdnTotalCompra.Value = (PrecioCompra * GvRow.DataKey("Cantidad").ToDouble() * 1.16).ToString()
|
||||
End If
|
||||
End Using
|
||||
|
||||
UpDescPS.Update()
|
||||
|
||||
RegistraScript("$('#ModalDescPS').modal({backdrop: 'static', keyboard: false});")
|
||||
Else
|
||||
DdlPS_SelectedIndexChanged(Nothing, Nothing)
|
||||
End If
|
||||
@@ -25504,7 +25573,8 @@ Partial Class Ventas
|
||||
|
||||
If AplicaSerie Then
|
||||
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||
If Existencia < 1 Then
|
||||
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato},Serie:{Dr2("Serie").ToString()}")
|
||||
Return False
|
||||
@@ -25517,7 +25587,8 @@ Partial Class Ventas
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1, BuscarEnTabla:=BuscarEnTabla)
|
||||
If Existencia < Cantidad Then
|
||||
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato}")
|
||||
Return False
|
||||
@@ -25742,7 +25813,8 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'VERIFICA EXISTENCIAS
|
||||
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow)
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow, BuscarEnTabla:=BuscarEnTabla)
|
||||
If Existencia < 1 Then
|
||||
MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>")
|
||||
Continue For
|
||||
@@ -35079,7 +35151,7 @@ Partial Class Ventas
|
||||
If CveEntregaAlmacen > 0 Then
|
||||
|
||||
For Each RowPS As DataRow In ObjFactura.DtMercancias.Rows
|
||||
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToDecimal, RowPS("CveUnidadMedida").ToString().ToEntero, UsuarioActual.CveUsuario) Then
|
||||
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToDecimal, RowPS("CveUnidadMedida").ToString().ToEntero, UsuarioActual.CveUsuario, RowPS("PesoKg").ToString().ToDecimal) Then
|
||||
ErrorProceso = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -35343,6 +35415,7 @@ Partial Class Ventas
|
||||
DtMercancias.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
DtMercancias.Columns.Add(New DataColumn("CveUnidadMedida", GetType(Integer)))
|
||||
DtMercancias.Columns.Add(New DataColumn("CodigoPS", GetType(String)))
|
||||
DtMercancias.Columns.Add(New DataColumn("PesoKg", GetType(Decimal)))
|
||||
End Sub
|
||||
Protected Sub LnkAddPSMercancia_Click(sender As Object, e As EventArgs)
|
||||
If DtMercancias Is Nothing Then
|
||||
@@ -35494,6 +35567,22 @@ Partial Class Ventas
|
||||
CargarCamiones()
|
||||
HabilitarControlesCartaPorte(ChkEmitirCartaPorte.Checked)
|
||||
|
||||
If DtMercancias Is Nothing Then CreaDTMercancias()
|
||||
DtMercancias.Clear()
|
||||
'carga los productos inventariables como mercancía
|
||||
For Each drPS As DataRow In TmpDT.FiltraParametros("CveTipoPS= 2").Rows
|
||||
Dim NewRow As DataRow = DtMercancias.NewRow
|
||||
NewRow("Consec") = DtMercancias.MAX("Consec").ToEntero() + 1
|
||||
NewRow("Cantidad") = drPS("Cantidad")
|
||||
NewRow("CvePS") = drPS("CvePS")
|
||||
NewRow("CveUnidadMedida") = drPS("CveUM")
|
||||
NewRow("CodigoPS") = drPS("PSCodigo")
|
||||
DtMercancias.Rows.Add(NewRow)
|
||||
Next
|
||||
|
||||
GvMercanciasCP.DataSource = DtMercancias
|
||||
GvMercanciasCP.DataBind()
|
||||
|
||||
End Sub
|
||||
'Protected Sub ChkAgregarFlete_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -36256,6 +36345,17 @@ Partial Class Ventas
|
||||
DdlClienteSucursal.DataBind()
|
||||
DdlClienteSucursal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
DdlClientesModal.setEsWebService(True)
|
||||
|
||||
Else
|
||||
DdlClientesModal.setEsWebService(False)
|
||||
DdlClientesModal.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientesModal.DataBind()
|
||||
DdlClientesModal.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
|
||||
@@ -36272,7 +36372,7 @@ Partial Class Ventas
|
||||
If RBLTipoVenta.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
DvModalTipoVentaPasoTipo.Visible = False
|
||||
DvModalTipoVentaPasoCliente.Visible = True
|
||||
DvModalTipoVentaClientesucursal.Visible = True
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = True
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = True
|
||||
|
||||
@@ -36298,6 +36398,7 @@ Partial Class Ventas
|
||||
ChkRequiereTecnicoModal.Checked = True
|
||||
ChkRequiereTecnicoModal.Enabled = False
|
||||
DvModalRequiereOSFecha.Visible = True
|
||||
DvModalTipoVentaCliente.Visible = True
|
||||
Case "3" 'A-Vista
|
||||
ChkRequiereTecnicoModal.Checked = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
@@ -36345,17 +36446,17 @@ Partial Class Ventas
|
||||
Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
|
||||
End If
|
||||
End Function
|
||||
Private Function DdlClienteSucursalSucursal() As Integer
|
||||
|
||||
Private Function DdlClienteSucursalSucursal() As Integer
|
||||
If DdlClienteSucursal.SelectedValue = "-1" Then
|
||||
Return -1
|
||||
Else
|
||||
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
|
||||
Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub SeleccionarClienteSucursal(CveCliente As Integer)
|
||||
|
||||
Dim IndexSeleccion As Integer = 0
|
||||
@@ -36387,7 +36488,8 @@ Partial Class Ventas
|
||||
LnkDvModalTipoVentaAceptar.Visible = False
|
||||
|
||||
DvModalTipoVentaPasoTipo.Visible = True
|
||||
DvModalTipoVentaPasoCliente.Visible = False
|
||||
DvModalTipoVentaClientesucursal.Visible = False
|
||||
DvModalTipoVentaCliente.Visible = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
|
||||
|
||||
@@ -36420,15 +36522,36 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If RBLTipoVenta.SelectedValue.ToEntero = 2 Then
|
||||
|
||||
If DdlClientesModal.SelectedValue.ToEntero > 0 Then
|
||||
ViewState("CveCliente") = DdlClientesModal.SelectedValue.ToEntero
|
||||
Else
|
||||
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
If DdlClienteSucursalCliente() > 0 Then
|
||||
ViewState("CveCliente") = DdlClienteSucursalCliente()
|
||||
If DdlClienteSucursalCliente() > 0 Then
|
||||
CveClienteOS = DdlClienteSucursalCliente()
|
||||
Else
|
||||
Alert("Debe de seleccionar un hospital.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
If DdlClienteSucursalCliente() > 0 Then
|
||||
ViewState("CveCliente") = DdlClienteSucursalCliente()
|
||||
CveClienteOS = CveCliente
|
||||
Else
|
||||
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
CveClienteSucursalOS = DdlClienteSucursalSucursal()
|
||||
|
||||
|
||||
If ChkRequiereTecnicoModal.Checked Then
|
||||
If Not IsDate(TxtFechaModal.Text.Replace(",", "")) Then
|
||||
Alert("El campo fecha no es valido.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -36516,7 +36639,17 @@ Partial Class Ventas
|
||||
|
||||
CargaCliente(CveCliente)
|
||||
|
||||
DdlSucursalCliente.SelectedValueExist(DdlClienteSucursalSucursal)
|
||||
|
||||
' Si es pago directo no asigna la sucurasl al dll
|
||||
If RBLTipoVenta.SelectedValue.ToEntero <> 2 Then
|
||||
If DdlClienteSucursalSucursal() > 0 Then
|
||||
DdlSucursalCliente.SelectedValueExist(DdlClienteSucursalSucursal())
|
||||
Else
|
||||
If DdlSucursalCliente.Items.Count >= 2 Then
|
||||
DdlSucursalCliente.SelectedIndex = 1
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlTipoComprobante_SelectedIndexChanged(sender, Nothing)
|
||||
|
||||
@@ -36640,8 +36773,10 @@ Partial Class Ventas
|
||||
|
||||
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
|
||||
|
||||
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
|
||||
|
||||
|
||||
If ObjOrdenServicio.AddOrdenesServicios(CveClienteOS, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=CveClienteSucursalOS,
|
||||
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
|
||||
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime,
|
||||
Paciente:=TxtPaciente.Text, IdentificadorCliente:=TxtEpisodio.Text) Then
|
||||
@@ -36794,6 +36929,20 @@ Partial Class Ventas
|
||||
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
|
||||
CargaAnticipos(CveCliente)
|
||||
End Sub
|
||||
Protected Sub BtnPorPS_Click(sender As Object, e As EventArgs)
|
||||
If HdnDescPS.Value.ToEntero() > 0 Then
|
||||
Dim RowUpdate As DataRow = TmpDT.Select($"Consec = {HdnConsecPS.Value}").FirstOrDefault()
|
||||
If RowUpdate IsNot Nothing Then
|
||||
RowUpdate("Descuento") = HdnDescPS.Value.ToDecimal()
|
||||
RowUpdate("ImporteIVA") = LblIVADescPS.Text.ToDecimal()
|
||||
|
||||
CalculaTotalesVenta()
|
||||
RegistraScript("$('#ModalDescPS').modal('hide');")
|
||||
End If
|
||||
Else
|
||||
Alert("No se pudo aplicar el descuento", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user