Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -383,7 +383,7 @@ Public Class ClsContratos
|
||||
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
|
||||
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
|
||||
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False,
|
||||
Optional DiaMesFacturacion As Integer = 1) As Boolean
|
||||
Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Con_ContratosUpdate")
|
||||
@@ -436,7 +436,8 @@ Public Class ClsContratos
|
||||
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
|
||||
.Add("@FacturacionCicilica", SqlDbType.Bit).Value = FacturacionCicilica
|
||||
.Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico
|
||||
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
|
||||
.Add("@DiaMesFacturacion", SqlDbType.TinyInt).Value = DiaMesFacturacion
|
||||
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -728,7 +729,7 @@ Public Class ClsContratos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function CicloComercialUpdate(CveCicloComercial As Integer, FueFacturado As Boolean, CveEmpresa As Integer) As Boolean
|
||||
Public Function CicloComercialUpdate(CveCicloComercial As Integer, FueFacturado As Boolean, CveEmpresa As Integer, Optional CveVenta As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Con_CicloComercialUpdate")
|
||||
|
||||
@@ -736,6 +737,7 @@ Public Class ClsContratos
|
||||
.Add("@FueFacturado", SqlDbType.Bit).Value = FueFacturado
|
||||
.Add("@CveCicloComercial", SqlDbType.Int).Value = CveCicloComercial
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
|
||||
End With
|
||||
Try
|
||||
@@ -1003,13 +1005,13 @@ Public Class ClsContratos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddContratosAvance(CveContratoDetalle As Integer, Cantidad As Double, Fecha As DateTime, CveUsuario As Integer, Optional CveEstimacion As Integer = -1) As Boolean
|
||||
Public Function AddContratosAvance(CveContratoDetalle As Integer, Cantidad As Double, Fecha As Date, CveUsuario As Integer, Optional CveEstimacion As Integer = -1) As Boolean
|
||||
Dim Retorno = False
|
||||
DataAdapter("PA_Con_ContratosAvanceAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
|
||||
.Add("@Cantidad", SqlDbType.Int).Value = Cantidad
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha.ToString("yyyy/MM/dd")
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion
|
||||
End With
|
||||
@@ -1076,9 +1078,32 @@ Public Class ClsContratos
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "ESTIMACION"
|
||||
|
||||
Public Function GetContratosAvanceEstimacion(CveContrato As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Con_ContratosAvanceEstimacionGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar los avances del Contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " S E C C I O N E S "
|
||||
Public Function GetSecciones() As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -1589,6 +1589,58 @@ Public Class ClsInventarios
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetExistenciasCaducidad(CvePS As Integer, CveAlmacen As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveAlmacenes As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_ExistenciaCaducidadGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CveAlmacen", SqlDbType.VarChar).Value = CveAlmacen
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveAlmacenes", SqlDbType.VarChar).Value = CveAlmacenes
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
|
||||
Me.OnError("Ocurrió un error al obtener el kardex de almacen.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el kardex de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetProductosCaducidad(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveClasificacion As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_ProductosCaducidadGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
||||
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
||||
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el listo de caducidad de productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " INVENTARIOS - REPORTES "
|
||||
@@ -5208,13 +5260,13 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function DeleteMovimientosProyectados(TipoMovto As Integer) As Boolean
|
||||
Public Function DeleteMovimientosProyectados(TipoMovto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("Inv_MovimientosProyectadosDelete")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@TipoMovto", SqlDbType.TinyInt).Value = TipoMovto
|
||||
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -38,14 +38,14 @@ Public Class ClsPaginas
|
||||
|
||||
|
||||
|
||||
Public ReadOnly Property EsProduccion As Boolean
|
||||
Get
|
||||
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
|
||||
Return False
|
||||
Else
|
||||
Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1")
|
||||
End If
|
||||
End Get
|
||||
Public ReadOnly Property EsProduccion As Boolean
|
||||
Get
|
||||
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
|
||||
Return False
|
||||
Else
|
||||
Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1")
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Propiedades"
|
||||
@@ -3783,6 +3783,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Contratos/Contrato2.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Flotillas/CatMantenimientos.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Inventarios/PaqueteDetalles.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Inventarios/RepProductosPorCaducar.aspx".ToUpper(), 693)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@ Public Class ClsProductosServicios
|
||||
Public Property CveMetodoInventario As Integer
|
||||
Public Property CveTipoPS As Integer
|
||||
Public Property Estado2 As Integer
|
||||
Public Property CveMarca As Integer
|
||||
|
||||
Public Property CveMarca As Integer
|
||||
|
||||
Public Property IEPSPorcentaje As Double
|
||||
|
||||
Public Property AplicaIEPS As Boolean
|
||||
@@ -202,11 +202,11 @@ Public Class ClsProductosServicios
|
||||
CveConexion = 0
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1",
|
||||
Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
||||
Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1,
|
||||
Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1",
|
||||
Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
||||
Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1,
|
||||
Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1", Optional TopSelect As Integer = 10000) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -404,7 +404,7 @@ Public Class ClsProductosServicios
|
||||
Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1,
|
||||
Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
|
||||
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False,
|
||||
Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False) As Integer
|
||||
Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
|
||||
DataAdapter("PA_ProductosServiciosAdd")
|
||||
@@ -483,6 +483,7 @@ Public Class ClsProductosServicios
|
||||
.Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote
|
||||
.Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad
|
||||
.Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion
|
||||
.Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -629,7 +630,7 @@ Public Class ClsProductosServicios
|
||||
Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1,
|
||||
Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
|
||||
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False,
|
||||
Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False) As Boolean
|
||||
Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -710,6 +711,7 @@ Public Class ClsProductosServicios
|
||||
.Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote
|
||||
.Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad
|
||||
.Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion
|
||||
.Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -1683,10 +1685,10 @@ Public Class ClsProductosServicios
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "Precios Lista"
|
||||
Public Function GetPSPreciosLista(CveEmpresa As Integer, CvePrecioLista As Integer, Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1,
|
||||
Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean
|
||||
@@ -1844,7 +1846,7 @@ Public Class ClsProductosServicios
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
End Function
|
||||
Public Function GetPSExistenciasWS(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
|
||||
CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
||||
Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
|
||||
@@ -1853,38 +1855,38 @@ Public Class ClsProductosServicios
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProductosExistenciasWSGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
|
||||
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
|
||||
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
|
||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||
.Add("@Lote", SqlDbType.VarChar).Value = Lote
|
||||
.Add("@Batch", SqlDbType.VarChar).Value = Batch
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
|
||||
.Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
|
||||
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
|
||||
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
|
||||
End With
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
|
||||
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
|
||||
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
|
||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||
.Add("@Lote", SqlDbType.VarChar).Value = Lote
|
||||
.Add("@Batch", SqlDbType.VarChar).Value = Batch
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
|
||||
.Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
|
||||
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
|
||||
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Porcentaje Productos"
|
||||
Public Function GetPorcentajeProductos(CveCliente As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -107,40 +107,40 @@ Public Class ClsVentas
|
||||
Data = New DataTable
|
||||
End Sub
|
||||
|
||||
#Region "Conexiones"
|
||||
#Region "Conexiones"
|
||||
|
||||
Private Sub ConexionAdd()
|
||||
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
Private Sub ConexionAdd()
|
||||
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
Try
|
||||
DataAdapter("PA_Sis_RegistrarConexion")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
|
||||
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
|
||||
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
SqlAdapter.Fill(Data)
|
||||
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ConexionClose()
|
||||
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
|
||||
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
CveConexion = 0
|
||||
End If
|
||||
|
||||
End With
|
||||
SqlAdapter.Fill(Data)
|
||||
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ConexionClose()
|
||||
If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
|
||||
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
CveConexion = 0
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
@@ -462,7 +462,7 @@ Public Class ClsVentas
|
||||
Optional TipoDocto As String = "Cot", Optional Vigencia As Date = MinFecha, Optional CondicionesPago As Integer = -1,
|
||||
Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1,
|
||||
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1,
|
||||
Optional RetISR As Double = -1, Optional Kilometraje As Double = 0) As Boolean
|
||||
Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasUpdate")
|
||||
|
||||
@@ -493,6 +493,7 @@ Public Class ClsVentas
|
||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||
.Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra
|
||||
.Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje
|
||||
.Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -855,7 +855,7 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
If CveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
|
||||
If Not ObjContr.CicloComercialUpdate(Me.CveCicloComercial, True, UsuarioActual.CveEmpresa) Then
|
||||
If Not ObjContr.CicloComercialUpdate(Me.CveCicloComercial, True, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
|
||||
ErrorList.Add("No se pudo actualizar ")
|
||||
End If
|
||||
End If
|
||||
|
||||
709
Ashx/SIGFacturacionCiclica.ashx
Normal file
709
Ashx/SIGFacturacionCiclica.ashx
Normal file
@@ -0,0 +1,709 @@
|
||||
<%@ WebHandler Language="VB" Class="SIGFacturacionCiclica" %>
|
||||
'Option Explicit On
|
||||
'Option Strict On
|
||||
|
||||
Imports System
|
||||
Imports System.Web
|
||||
Imports System.Data
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports Microsoft.AspNet.SignalR
|
||||
|
||||
Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionState
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
context.Response.ContentType = "text/plain"
|
||||
Dim retorno = False
|
||||
Try
|
||||
If context.Request("Metodo") IsNot Nothing Then
|
||||
Select Case context.Request("Metodo")
|
||||
Case "EjecutaServicio"
|
||||
ModExtensiones.GuardaLogAD("Servicio Ejecutado...........", "LogFacturacionCiclica")
|
||||
retorno = IniciaFacturacionMasiva()
|
||||
End Select
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ex.GuardaLog(ex.Message)
|
||||
End Try
|
||||
|
||||
If retorno Then
|
||||
context.Response.Write("True")
|
||||
Else
|
||||
context.Response.Write("False")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
||||
Get
|
||||
Return False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Function Parametros(Cadena As String) As Hashtable
|
||||
Dim P1() As String = Cadena.Split("&"c)
|
||||
Dim Tmp As String
|
||||
Dim P2() As String
|
||||
|
||||
Dim URLParametros As New Hashtable
|
||||
|
||||
For Each Tmp In P1
|
||||
P2 = Tmp.Replace("%26%", "&").Split("="c)
|
||||
URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
|
||||
Next
|
||||
Return URLParametros
|
||||
End Function
|
||||
|
||||
#Region "V A L I D A - D A T O S"
|
||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||
Dim UsuarioActual As Usuario = Nothing
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
If ObjUsuarios.GetUsuarios(100) Then
|
||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa)
|
||||
UsuarioActual.CveEmpresa = CveEmpresa
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
End If
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
Return UsuarioActual
|
||||
End Function
|
||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
|
||||
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||
|
||||
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||
For Each Row As Data.DataRow In dttmp.Rows
|
||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||
Next
|
||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||
End If
|
||||
|
||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Private Function IniciaFacturacionMasiva() As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
Dim FechaRef As DateTime = DateTime.Now
|
||||
Dim DTCicloComercial As DataTable = Nothing
|
||||
|
||||
Using ObjContratos As New ClsContratos
|
||||
If ObjContratos.CicloComercialGet(-1, -1, -1, -1, FechaRef, FechaRef, -1) Then
|
||||
DTCicloComercial = ObjContratos.DtResultados.FiltraParametros("FueFacturado = 0 AND FacturacionCiclicaAutomatico = 1")
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DTCicloComercial IsNot Nothing Then
|
||||
For Each RowEmpresa As DataRow In DTCicloComercial.FiltraParametros("", DistinctColumns:={"CveEmpresa"}).Rows
|
||||
Dim CveEmpresa As Integer = RowEmpresa("CveEmpresa").ToString().ToEntero()
|
||||
Dim UsuarioActual = ValidaUsuarioSistema(CveEmpresa)
|
||||
If UsuarioActual IsNot Nothing Then
|
||||
Retorno = EjecutarFacturacionMasiva(UsuarioActual, DTCicloComercial.FiltraParametros($"CveEmpresa = {CveEmpresa}"))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function EjecutarFacturacionMasiva(UsuarioActual As Usuario, DTCicloComercial As DataTable) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
If DTCicloComercial IsNot Nothing Then
|
||||
For Each Row As DataRow In DTCicloComercial.Rows
|
||||
|
||||
If Row("Observaciones").ToString().Contains("{DIA}") Then
|
||||
Row("Observaciones") = Row("Observaciones").ToString().Replace("{DIA}", DateTime.Now.Day.ToString())
|
||||
End If
|
||||
|
||||
If Row("Observaciones").ToString().Contains("{MES}") Then
|
||||
Dim fecha As DateTime = DateTime.Now
|
||||
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
|
||||
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
|
||||
|
||||
Row("Observaciones") = Row("Observaciones").ToString().Replace("{MES}", nombreMes)
|
||||
End If
|
||||
|
||||
If Row("Observaciones").ToString().Contains("{AÑO}") Then
|
||||
Row("Observaciones") = Row("Observaciones").ToString().Replace("{AÑO}", DateTime.Now.Year.ToString())
|
||||
End If
|
||||
|
||||
If Row("Observaciones").ToString().Contains("{TC}") Then
|
||||
Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", GlobalTipoCambio(Now).FormatoNumero)
|
||||
End If
|
||||
|
||||
Dim Resp = EmitirImprimir(UsuarioActual, Row)
|
||||
|
||||
If Resp.CveVenta > 0 Then
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function EmitirImprimir(UsuarioActual As Usuario, RowCiclo As DataRow) As Modelos.Factura.MMensajeFactura
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
|
||||
Dim ObjFactura = CreaObjetosVenta(UsuarioActual, RowCiclo)
|
||||
|
||||
If ObjFactura Is Nothing Then
|
||||
Resp.Mensajes.Add("Ocurrió un error al procesar los datos de la Venta ")
|
||||
ObjFactura = Nothing
|
||||
Return Resp
|
||||
End If
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If ObjFactura.DtDetalle.Rows.Count > 0 Then
|
||||
Resp = ObjFactura.EmitirFactura()
|
||||
Else
|
||||
Resp.Mensajes.Add("No se pudo completar facturación por que no se encontraron partidas ")
|
||||
End If
|
||||
Else
|
||||
Resp.Mensajes.Add("No se pudo completar facturación por que no se encontraro el cliente ")
|
||||
End If
|
||||
|
||||
Return Resp
|
||||
End Function
|
||||
|
||||
#Region "P R E P A R A - V E N T A"
|
||||
Private Function CreaDTVentas() As DataTable
|
||||
Dim TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Codigo", GetType(String))
|
||||
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDT.Columns.Add("UM", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveUM", GetType(String))
|
||||
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoPS", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
|
||||
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("Serie", GetType(String))
|
||||
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||
TmpDT.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Descuento", GetType(Decimal))
|
||||
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
||||
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Total", GetType(Decimal))
|
||||
'Para uso del módulo contable
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
|
||||
|
||||
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
||||
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
|
||||
'Contratos
|
||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
'Remisiones a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
|
||||
|
||||
'Pedido2 a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("Origen", GetType(Integer))
|
||||
'Ordenes Servicio
|
||||
TmpDT.Columns.Add("CveOS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
|
||||
TmpDT.Columns.Add("Folio", GetType(Integer))
|
||||
TmpDT.Columns.Add("Estatus", GetType(String))
|
||||
'Ordenamiento
|
||||
TmpDT.Columns.Add("Orden", GetType(Integer))
|
||||
TmpDT.Columns.Add("TipoDocto", GetType(String))
|
||||
'OC
|
||||
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
|
||||
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
||||
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
|
||||
Return TmpDT
|
||||
End Function
|
||||
Private Function CreaObjetosVenta(UsuarioActual As Usuario, DR As DataRow) As Modelos.Factura
|
||||
Dim ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
Try
|
||||
ObjFactura.DirectorioServidor = HttpContext.Current.Server.MapPath("/")
|
||||
|
||||
Dim CveProyecto As String = ""
|
||||
Dim CveSubProyecto As String = ""
|
||||
Dim Proyecto As String = ""
|
||||
Dim SubProyecto As String = ""
|
||||
Dim CveCicloComercial = DR("CveCicloComercial").ToString().ToEntero()
|
||||
|
||||
ObjFactura.CveCicloComercial = CveCicloComercial
|
||||
|
||||
Dim TmpDT As DataTable = CreaDTVentas()
|
||||
|
||||
ObjFactura.Version = "3.3"
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFactura.ConvertirPesos = False
|
||||
ObjFactura.CveMoneda = DR("CveMoneda").ToString.ToEntero
|
||||
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
|
||||
ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, GlobalTipoCambio(Now))
|
||||
ObjFactura.TipoDocto = "Ing"
|
||||
ObjFactura.RefDocto = ""
|
||||
ObjFactura.Folio = -1
|
||||
ObjFactura.Serie = "-1"
|
||||
ObjFactura.CveMesa = -1
|
||||
ObjFactura.Fecha = DR("FechaVenc").ToString.ToDate
|
||||
ObjFactura.CvePrePoliza = -1
|
||||
ObjFactura.CveMetodoPago = 1
|
||||
ObjFactura.MetodoPago = "Efectivo"
|
||||
ObjFactura.FechaPago = DateTime.Today
|
||||
ObjFactura.MotivoDescuento = ""
|
||||
ObjFactura.Observaciones = DR("Observaciones").ToString
|
||||
ObjFactura.FechaEjecucion = DateTime.Today
|
||||
'ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {1}")
|
||||
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||
ObjFactura.CveCondicionEntrega = -1
|
||||
ObjFactura.CondicionEntrega = ""
|
||||
ObjFactura.NumeroCuenta = ""
|
||||
'ObjFactura.CveSucursal = GlobalDTSucursales.FiltroPrimeroValor("CveSucursal", $"CveEmpresa = {UsuarioActual.CveEmpresa}").ToEntero
|
||||
'ObjFactura.Cliente.NumCtaPago = TxtNumCtaPago.Text.Trim
|
||||
ObjFactura.CondicionesPago = 0
|
||||
ObjFactura.FormaPago = 0
|
||||
'ObjFactura.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text)
|
||||
ObjFactura.PedidoContrato = ""
|
||||
ObjFactura.NumeroContrato = DR("NumeroContrato").ToString
|
||||
ObjFactura.DescripcionContrato = DR("DescripcionContrato").ToString
|
||||
ObjFactura.CveCorte = -1
|
||||
ObjFactura.TipoDocumento = "Factura"
|
||||
ObjFactura.Alfa1 = ""
|
||||
ObjFactura.Alfa2 = ""
|
||||
ObjFactura.Alfa3 = ""
|
||||
'Totales, Y se llena TmpDTImpuestos
|
||||
ObjFactura.Descuento = 0
|
||||
ObjFactura.Amortizacion = 0
|
||||
ObjFactura.CveContrato = DR("CveContrato").ToString.ToEntero
|
||||
CveProyecto = DR("CveProyecto").ToString
|
||||
Proyecto = DR("ProyectoContrato").ToString
|
||||
CveSubProyecto = DR("CveSubProyecto").ToString
|
||||
ObjFactura.CveSubProyecto = CveSubProyecto.ToEntero
|
||||
ObjFactura.CveSubProyectoCobranza = CveSubProyecto.ToEntero
|
||||
ObjFactura.CveSubProyectoEjecucion = CveSubProyecto.ToEntero
|
||||
|
||||
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", ObjFactura.CveSubProyecto)))
|
||||
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
|
||||
|
||||
|
||||
SubProyecto = DR("SubProyectoContrato").ToString
|
||||
|
||||
Dim DtDetalle As DataTable = Nothing
|
||||
Dim objContratos As New ClsContratos
|
||||
If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then
|
||||
DtDetalle = objContratos.DtResultados
|
||||
Else
|
||||
DtDetalle = Nothing
|
||||
End If
|
||||
objContratos.Dispose()
|
||||
|
||||
Dim DtR As DataRow
|
||||
ObjFactura.SubTotal = SUM(DtDetalle, "Total").ToDecimal
|
||||
ObjFactura.IVA = SUM(DtDetalle, "ImporteIVA").ToDecimal
|
||||
ObjFactura.RetIVA = SUM(DtDetalle, "ImporteRetIVA").ToDecimal
|
||||
ObjFactura.RetISR = SUM(DtDetalle, "ImporteRetISR").ToDecimal
|
||||
ObjFactura.IEPS = SUM(DtDetalle, "ImporteIEPS").ToDecimal
|
||||
ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA + ObjFactura.IEPS - (ObjFactura.RetIVA + ObjFactura.RetISR)
|
||||
|
||||
For Each row As DataRow In DtDetalle.Rows
|
||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
|
||||
|
||||
DtR = TmpDT.NewRow
|
||||
DtR("CveVenta") = -1
|
||||
DtR("Codigo") = row("Codigo")
|
||||
DtR("Consec") = TmpDT.Rows.Count + 1
|
||||
DtR("Cantidad") = row("CantidadContratada")
|
||||
DtR("CveUM") = row("CveUM")
|
||||
DtR("UM") = row("UM")
|
||||
DtR("SATClaveUM") = row("SATClaveUM")
|
||||
DtR("CveClasificacion") = row("CveClasificacion")
|
||||
DtR("Clasificacion") = row("Clasificacion")
|
||||
DtR("CvePS") = row("CvePS")
|
||||
DtR("PS") = row("PS")
|
||||
DtR("CodigoPS") = row("CodigoPS")
|
||||
DtR("SATClaveProdServ") = row("SATClaveProdServ")
|
||||
DtR("NoIdentificacion") = row("NoIdentificacion")
|
||||
DtR("CveTipoPS") = drPS("CveTipoPS")
|
||||
DtR("CveTipoInvPS") = drPS("Inv_CveMetodoInventario")
|
||||
DtR("Obs") = row("Observacion").ToString
|
||||
DtR("PU") = row("PU")
|
||||
DtR("IVA") = row("PorcentajeIVA")
|
||||
DtR("PorcentajeIVA") = row("PorcentajeIVA")
|
||||
DtR("ImporteIVA") = row("ImporteIVA")
|
||||
DtR("PorcentajeIEPS") = row("PorcentajeIEPS")
|
||||
DtR("ImporteIEPS") = row("ImporteIEPS")
|
||||
DtR("PorcentajeRetIVA") = row("PorcentajeRetIVA")
|
||||
DtR("ImporteRetIVA") = row("ImporteRetIVA")
|
||||
DtR("PorcentajeRetISR") = row("PorcentajeRetISR")
|
||||
DtR("ImporteRetISR") = row("ImporteRetISR")
|
||||
DtR("Descuento") = 0
|
||||
DtR("TipoDescuento") = 0
|
||||
DtR("CveProyecto") = CveProyecto
|
||||
DtR("Proyecto") = Proyecto
|
||||
DtR("CveSubProyecto") = CveSubProyecto
|
||||
DtR("SubProyecto") = SubProyecto
|
||||
DtR("CveVentaDetalle") = 0
|
||||
DtR("CveContratoDetalle") = row("CveContratoDetalle")
|
||||
DtR("CuentaPredial") = row("CuentaPredial")
|
||||
DtR("TotalImporte") = row("Total")
|
||||
|
||||
TmpDT.Rows.Add(DtR)
|
||||
Next
|
||||
|
||||
'DETALLES
|
||||
ObjFactura.DtDetalle = TmpDT
|
||||
|
||||
'CLIENTE
|
||||
ObjFactura.CveCliente = DR("CveCliente").ToString.ToEntero
|
||||
ObjFactura.SetCliente()
|
||||
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If ObjCliente.GetClientes(ObjFactura.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33
|
||||
ObjFactura.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
|
||||
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
|
||||
|
||||
ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33
|
||||
ObjFactura.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
|
||||
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
|
||||
|
||||
ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI
|
||||
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||
|
||||
ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
|
||||
|
||||
If GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows.Count > 0 Then
|
||||
ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows(0)("MetodoPago").ToString
|
||||
Else
|
||||
ObjFactura.CveMetodoPago = 1
|
||||
ObjFactura.MetodoPago = "Efectivo"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjCliente.GetSucursales(ObjFactura.CveCliente) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
ObjFactura.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
|
||||
Else
|
||||
ObjFactura.CveClienteSucursal = -1
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
|
||||
'SUBPROYECTO
|
||||
'ObjFactura.SetSubProyectoMatriz(Me)
|
||||
'ObjFactura.SetSubProyecto(Me)
|
||||
|
||||
ObjFactura.Timbre = PreParaTimbre(ObjFactura, UsuarioActual)
|
||||
Catch ex As Exception
|
||||
ObjFactura = Nothing
|
||||
OnError("Ocurrió un error al generar la factura", ex)
|
||||
End Try
|
||||
|
||||
|
||||
Return ObjFactura
|
||||
|
||||
End Function
|
||||
|
||||
Private Function PreParaTimbre(Obj As Modelos.Factura, UsuarioActual As Usuario) As CFDITimbre
|
||||
Dim Timbre As New CFDITimbre
|
||||
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
|
||||
Timbre.Comprobante.Folio = Obj.Folio.ToString
|
||||
Timbre.Comprobante.Serie = Obj.Serie
|
||||
Timbre.Comprobante.Fecha = Obj.FechaCP
|
||||
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||
Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
|
||||
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||
Timbre.Comprobante.Subtotal = Obj.SubTotal
|
||||
Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||
Timbre.Comprobante.Moneda = Obj.MonedaSAT
|
||||
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
|
||||
Timbre.Comprobante.Total = Obj.Total
|
||||
|
||||
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
||||
Timbre.Comprobante.Confirmacion = ""
|
||||
|
||||
Timbre.Receptor.RFC = Obj.Cliente.RFC
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
||||
Timbre.Receptor.ResidenciaFiscal = ""
|
||||
Timbre.Receptor.NumeroRegistroTributario = ""
|
||||
Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
|
||||
|
||||
|
||||
If Obj.CveTipoRelacion > 0 Then
|
||||
Select Case Obj.CveTipoRelacion
|
||||
Case 1
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "01"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "01-Nota de Crédito aplicada a Ingreso"
|
||||
Case 2
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "02"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "02-Nota de débito de los documentos relacionados"
|
||||
Case 3
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "03"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "03-Devolución aplicada a Ingreso"
|
||||
Case 4
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "04"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "04-Refacturación de Ingreso"
|
||||
Case 7
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "07"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
|
||||
Case 8
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "08"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "08-Factura generada por pagos en parcialidades "
|
||||
Case 9
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "09"
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
|
||||
|
||||
End Select
|
||||
|
||||
'If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
||||
' For Each Dr As DataRow In DtVentasNC.Rows
|
||||
' Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString)
|
||||
' Next
|
||||
'Else
|
||||
' Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
|
||||
'End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
Dim totIVA As Decimal = Obj.IVA
|
||||
Dim totRetIVA As Decimal = Obj.RetIVA
|
||||
Dim totRetISR As Decimal = Obj.RetISR
|
||||
Dim i As Integer = 1
|
||||
|
||||
'detalles
|
||||
Dim tPS As String = ""
|
||||
|
||||
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
If drr("PS").ToString.Length = 1 Then
|
||||
tPS = drr("Obs").ToString
|
||||
Else
|
||||
If drr("PS").ToString.Length = 0 Then
|
||||
tPS = ""
|
||||
Else
|
||||
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
|
||||
End If
|
||||
End If
|
||||
'condicionante, especial
|
||||
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
|
||||
|
||||
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
|
||||
.Descripcion = tPS,
|
||||
.ValorUnitario = drr("PU").ToString.ToDecimal,
|
||||
.Importe = drr("TotalImporte").ToString.ToDecimal,
|
||||
.Descuento = drr("Descuento").ToString.ToDecimal,
|
||||
.Unidad = drr("UM").ToString,
|
||||
.ClaveUnidad = drr("SATClaveUM").ToString,
|
||||
.ClaveProdServ = drr("SATClaveProdServ").ToString,
|
||||
.Noidentificacion = drr("Noidentificacion").ToString,
|
||||
.CuentaPredial = drr("CuentaPredial").ToString}
|
||||
'verifica suma subtotales
|
||||
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
|
||||
concepto.Importe = totSubTotal
|
||||
End If
|
||||
totSubTotal = totSubTotal - concepto.Importe
|
||||
|
||||
'siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
|
||||
' If drr("ImporteIVA").ToString.ToDouble > 0 Then
|
||||
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
|
||||
' End If
|
||||
|
||||
If drr("ImporteIEPS").ToString.ToDouble > 0 Then
|
||||
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString.ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString.ToDecimal})
|
||||
End If
|
||||
|
||||
If drr("ImporteRetIVA").ToString.ToDouble > 0 Then 'si hay retenciones
|
||||
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString.ToDecimal})
|
||||
End If
|
||||
|
||||
If drr("ImporteRetISR").ToString.ToDouble > 0 Then 'retención de ISR
|
||||
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetISR").ToString.ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
|
||||
End If
|
||||
|
||||
Timbre.Conceptos.Add(concepto)
|
||||
i += 1
|
||||
Next
|
||||
Return Timbre
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "G L O B A L - D T"
|
||||
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
|
||||
Get
|
||||
If GlobalTipoCambio <= 0 Then
|
||||
'sino tiene dato lo recargo por si ya esta insertado
|
||||
If Fecha = MinFecha Then Fecha = Now
|
||||
|
||||
Dim ObjGral As New ClsGenerales
|
||||
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
|
||||
Else
|
||||
HttpContext.Current.Application("GlobalTipoCambio") = 0
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
|
||||
End Get
|
||||
Set(value As Double)
|
||||
HttpContext.Current.Application("GlobalTipoCambio") = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
Property GlobalDTMonedas() As DataTable
|
||||
Get
|
||||
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTMonedas") = value
|
||||
End Set
|
||||
End Property
|
||||
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1, Optional Codigo As String = "-1") As DataTable
|
||||
Get
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
|
||||
If ObjPS.GetPS(CvePS, -1, CveEmpresa, Codigo:=Codigo, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then
|
||||
GlobalDTPS = ObjPS.DtResultados
|
||||
Else
|
||||
GlobalDTPS = Nothing
|
||||
End If
|
||||
|
||||
ObjPS.Dispose()
|
||||
End Get
|
||||
End Property
|
||||
Public Property GlobalDTVtaFormaPago() As DataTable
|
||||
Get
|
||||
GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTVtaFormaPago") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTVtaMetodoPago() As DataTable
|
||||
Get
|
||||
GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
|
||||
Get
|
||||
If EsPersonaFisica <> -1 Then
|
||||
Dim Tipo As String = ""
|
||||
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
|
||||
|
||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
|
||||
GlobalDTSATUsosCFDI = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property GlobalDTMetodosPago() As DataTable
|
||||
Get
|
||||
GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application("GlobalDTMetodosPago"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTMetodosPago") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
|
||||
Get
|
||||
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
|
||||
'sino existe, recarga los datos
|
||||
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
|
||||
Dim P As New ClsSubProyectos
|
||||
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
|
||||
P.Dispose()
|
||||
End If
|
||||
|
||||
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
|
||||
Dim StrSQL As New StringBuilder
|
||||
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
|
||||
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
|
||||
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
|
||||
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
|
||||
|
||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
|
||||
GlobalDTSubProyectos = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
|
||||
Else
|
||||
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
|
||||
HttpContext.Current.Application(AppNombre) = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
End Class
|
||||
@@ -3258,7 +3258,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
|
||||
|
||||
Else
|
||||
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
'Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||
End If
|
||||
|
||||
|
||||
@@ -17669,7 +17669,7 @@ Partial Class Compras_Compras
|
||||
ViewState("IVAPS") = Drr("IVA").ToString().ToDouble()
|
||||
DdlProyecto.SelectedValueExist(Drr("CveProyecto"))
|
||||
|
||||
'DdlIVA.Enabled = True
|
||||
DdlIVA.Enabled = True
|
||||
|
||||
If Not Modalidad = "U" Then
|
||||
|
||||
@@ -17989,13 +17989,13 @@ Partial Class Compras_Compras
|
||||
Row("IEPSPSPorcentaje") = PorcentajeIEPS
|
||||
Else
|
||||
'If DdlIVA.SelectedValue.ToDouble = 0 Then Row("IVA") = 0 Else Row("IVA") = Math.Round(IVA * Total, DecimalesPermitidos)
|
||||
Row("IVA") = Math.Round(IVA * Total, DecimalesPermitidos)
|
||||
Row("IVA") = Math.Round(IVA * Total, 2)
|
||||
Row("IVAPorcentaje") = IVA
|
||||
Row("RetIVA") = Math.Round(RetIVA * Total, DecimalesPermitidos)
|
||||
Row("RetIVA") = Math.Round(RetIVA * Total, 2)
|
||||
Row("RetIVAPorcentaje") = RetIVA
|
||||
Row("RetISR") = Math.Round(RetISR * Total, DecimalesPermitidos)
|
||||
Row("RetISR") = Math.Round(RetISR * Total, 2)
|
||||
Row("RetISRPorcentaje") = RetISR
|
||||
Row("IEPSPS") = Math.Round(IEPSPS * Total, DecimalesPermitidos)
|
||||
Row("IEPSPS") = Math.Round(IEPSPS * Total, 2)
|
||||
Row("IEPSPSPorcentaje") = IEPSPS
|
||||
End If
|
||||
Row("ImporteConImpuestos") = (Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble) + Row("IVA").ToString.ToDouble + Row("IEPSPS").ToString.ToDouble - (Row("RetIVA").ToString.ToDouble + Row("RetISR").ToString.ToDouble)
|
||||
|
||||
@@ -1248,10 +1248,10 @@ Partial Class PopUpVerFactura
|
||||
Dim PuestoEnrego As String = ObjInventarios.PuestoEntrego
|
||||
Dim ResponsableCarga As String = ObjInventarios.ResponsableCarga
|
||||
Dim ResponsableRecibio As String = ObjInventarios.ResponsableRecibio
|
||||
Dim UsuarioCapturo As String = ObjInventarios.DtResultados.FiltroPrimeroValor("UsuarioCapturo")
|
||||
|
||||
If Recibio.Trim = "" Then
|
||||
Dim ObjRH As New ClsRH
|
||||
|
||||
If ObjRH.GetPersonal(ObjInventarios.CvePersonal, UsuarioActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then
|
||||
Recibio = ObjRH.DtResultados.Rows(0)("NombreCompleto").ToString
|
||||
End If
|
||||
@@ -1276,7 +1276,9 @@ Partial Class PopUpVerFactura
|
||||
|
||||
Dim CveMovimientoRelacionado As Integer = -1
|
||||
Dim FolioRelacionado As String = ""
|
||||
Dim CveConceptoMovtoRelacionado As Integer = -1
|
||||
Dim CveConceptoMovtoRelacionado As Integer = -1
|
||||
|
||||
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero
|
||||
|
||||
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
@@ -1285,6 +1287,9 @@ Partial Class PopUpVerFactura
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
|
||||
CveConceptoMovtoRelacionado = 37
|
||||
ElseIf CveConcepto.Contiene(36, 37) Then
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
|
||||
CveConceptoMovtoRelacionado = 3
|
||||
ElseIf CveConcepto.Contiene(2) AndAlso CveTipoAlmacen.Contiene(24, 25) Then
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
|
||||
CveConceptoMovtoRelacionado = 3
|
||||
End If
|
||||
@@ -1316,7 +1321,7 @@ Partial Class PopUpVerFactura
|
||||
Dim CveTipoAlmacenRelacionado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenRelacionado}").ToString.ToEntero
|
||||
|
||||
'SI TIENE RELACIONADO UN MOVIMIENTO VIRTUAL DEBE AGREGAR ESTE MOVIMIENTO A LA IMPRESION
|
||||
If CveTipoAlmacenRelacionado = 24 Then
|
||||
If CveTipoAlmacenRelacionado.Contiene(24, 25) Then
|
||||
If ObjInventarios.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then
|
||||
Dim DtUsados As DataTable = ObjInventarios.DtResultados.Copy()
|
||||
CantidadUsados = DtUsados.SUM("Cantidad").ToDecimal()
|
||||
@@ -1342,7 +1347,28 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso CveCompra > 0 Then
|
||||
If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0")
|
||||
If DtFaltante.Rows.Count > 0 Then
|
||||
Dim SbPendientes As New StringBuilder
|
||||
SbPendientes.AppendFormat("Los siguientes productos quedaron pendientes por recibir:")
|
||||
For Each Row As DataRow In DtFaltante.Rows
|
||||
SbPendientes.AppendFormat(" PS:{0} Cant.:{1:N0},", Row("CodigoPS"), Row("CantidadF"))
|
||||
Next
|
||||
SbPendientes.Remove(SbPendientes.Length - 1, 1)
|
||||
|
||||
SbPendientes.AppendFormat(" Total Cant.:{0:N0}, Total Costo:{1:N2}", DtFaltante.SUM("CantidadF"), DtFaltante.SUM("Total"))
|
||||
|
||||
If Not String.IsNullOrEmpty(Observaciones) Then
|
||||
Observaciones = SbPendientes.ToString() + ".<br/>" + Observaciones
|
||||
Else
|
||||
Observaciones = SbPendientes.ToString()
|
||||
End If
|
||||
End If
|
||||
DtFaltante.Dispose()
|
||||
End If
|
||||
End If
|
||||
|
||||
If CveTipoAlmacen = 20 Then
|
||||
CveConcepto = 24
|
||||
@@ -1359,7 +1385,7 @@ Partial Class PopUpVerFactura
|
||||
MunicipioDestino, EstadoDestino, PaisDestino, CPDestino, FechaMovimiento, NombreCapturo, PuestoRecibio,
|
||||
PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio, NombreCliente,
|
||||
CantidadProductos:=CantidadProductos, CantidadUsados:=CantidadUsados, CveTipoAlmacen:=CveTipoAlmacen, NombreEntrego:=NombreEntrego,
|
||||
CveConceptoMovRelacionado:=CveConceptoMovtoRelacionado, FolioRelacionado:=FolioRelacionado)
|
||||
CveConceptoMovRelacionado:=CveConceptoMovtoRelacionado, FolioRelacionado:=FolioRelacionado, UsuarioRegistro:=UsuarioCapturo)
|
||||
|
||||
End Sub
|
||||
Private Sub PUanacExtr(CveMoneda As Integer) 'preciounitario a moneda nacional o extranjera
|
||||
@@ -1377,7 +1403,7 @@ Partial Class PopUpVerFactura
|
||||
EstadoOrigen As String, PaisOrigen As String, CPOrigen As String, CalleDestino As String, NoExtDestino As String, ColoniaDestino As String, LocalidadDestino As String, MunicipioDestino As String,
|
||||
EstadoDestino As String, PaisDestino As String, CPDestino As String, FechaMovimiento As Date, NombreCapturo As String, PuestoRecibio As String, PuestoEntrego As String,
|
||||
RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String, Optional CantidadProductos As Decimal = 0, Optional CantidadUsados As Decimal = 0,
|
||||
Optional CveTipoAlmacen As Integer = -1, Optional NombreEntrego As String = "", Optional CveConceptoMovRelacionado As Integer = -1, Optional FolioRelacionado As String = "")
|
||||
Optional CveTipoAlmacen As Integer = -1, Optional NombreEntrego As String = "", Optional CveConceptoMovRelacionado As Integer = -1, Optional FolioRelacionado As String = "", Optional UsuarioRegistro As String = "")
|
||||
|
||||
|
||||
Select Case CveConcepto
|
||||
@@ -1527,6 +1553,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), "")))
|
||||
params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), "")))
|
||||
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
|
||||
params.Add(New ReportParameter("Observaciones", Observaciones))
|
||||
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
||||
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
|
||||
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
|
||||
@@ -1762,7 +1789,8 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("NombreRecibio", Recibio))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
|
||||
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
|
||||
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
|
||||
params.Add(New ReportParameter("UsuarioRegistro", UsuarioRegistro))
|
||||
|
||||
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
Else
|
||||
@@ -2550,19 +2578,19 @@ Partial Class PopUpVerFactura
|
||||
If (UsuarioActual.CveEmpresa = 72) Then
|
||||
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
|
||||
End If
|
||||
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
'Else
|
||||
' params.Add(New ReportParameter("Folio", Folio))
|
||||
' params.Add(New ReportParameter("Fecha", Fecha))
|
||||
' params.Add(New ReportParameter("Almacen", Almacen))
|
||||
' params.Add(New ReportParameter("SubProyecto", SubProyecto))
|
||||
' params.Add(New ReportParameter("Observaciones", Observaciones))
|
||||
' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
|
||||
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
||||
' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
'End If
|
||||
|
||||
|
||||
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
'Else
|
||||
' params.Add(New ReportParameter("Folio", Folio))
|
||||
' params.Add(New ReportParameter("Fecha", Fecha))
|
||||
' params.Add(New ReportParameter("Almacen", Almacen))
|
||||
' params.Add(New ReportParameter("SubProyecto", SubProyecto))
|
||||
' params.Add(New ReportParameter("Observaciones", Observaciones))
|
||||
' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
|
||||
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
||||
' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
'End If
|
||||
|
||||
|
||||
Case 18 'D E V O L U C I O N D E L C L I E N T E
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DevolucionCliente.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
@@ -2739,36 +2767,36 @@ Partial Class PopUpVerFactura
|
||||
ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Salida por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
ElseIf CveConcepto = 22 Then
|
||||
ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
End If
|
||||
|
||||
'Case 22 'ENTRADA POR PRESTAMO
|
||||
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
' Dim params As New List(Of ReportParameter)
|
||||
|
||||
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
' If Imagen.Exists Then
|
||||
' params.Add(New ReportParameter("LogoPath", logouri))
|
||||
' Else
|
||||
' params.Add(New ReportParameter("LogoPath", ""))
|
||||
' End If
|
||||
|
||||
' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo"))
|
||||
' params.Add(New ReportParameter("Almacen", Almacen))
|
||||
' params.Add(New ReportParameter("Fecha", Fecha))
|
||||
' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
|
||||
' params.Add(New ReportParameter("Folio", Folio))
|
||||
' params.Add(New ReportParameter("Descuentos", ""))
|
||||
' params.Add(New ReportParameter("IVA", ""))
|
||||
' params.Add(New ReportParameter("Total", ""))
|
||||
' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
|
||||
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
||||
' params.Add(New ReportParameter("FacturadoA", NombreCliente))
|
||||
' If (UsuarioActual.CveEmpresa = 72) Then
|
||||
' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
|
||||
' End If
|
||||
' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
|
||||
End If
|
||||
|
||||
'Case 22 'ENTRADA POR PRESTAMO
|
||||
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
' Dim params As New List(Of ReportParameter)
|
||||
|
||||
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
' If Imagen.Exists Then
|
||||
' params.Add(New ReportParameter("LogoPath", logouri))
|
||||
' Else
|
||||
' params.Add(New ReportParameter("LogoPath", ""))
|
||||
' End If
|
||||
|
||||
' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo"))
|
||||
' params.Add(New ReportParameter("Almacen", Almacen))
|
||||
' params.Add(New ReportParameter("Fecha", Fecha))
|
||||
' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
|
||||
' params.Add(New ReportParameter("Folio", Folio))
|
||||
' params.Add(New ReportParameter("Descuentos", ""))
|
||||
' params.Add(New ReportParameter("IVA", ""))
|
||||
' params.Add(New ReportParameter("Total", ""))
|
||||
' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
|
||||
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
||||
' params.Add(New ReportParameter("FacturadoA", NombreCliente))
|
||||
' If (UsuarioActual.CveEmpresa = 72) Then
|
||||
' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
|
||||
' End If
|
||||
' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
|
||||
Case 24 'SALIDA POR RESGUARDO
|
||||
If DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 20 Or DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 19 Then
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
@@ -3251,11 +3279,11 @@ Partial Class PopUpVerFactura
|
||||
If CveConcepto = 2 Then
|
||||
ElseIf CveConcepto = 3 Then
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "OP = 'OC' - IMPRIME PDF OC"
|
||||
Private Sub ImprimePDFOC(CveOrdenCompra As Integer)
|
||||
Dim reporte As Byte() = NewGeneraBytesOC(CveOrdenCompra, ConBitacora:=(UsuarioActual.Empresa.Funcionalidad(119) = "1"))
|
||||
@@ -3848,7 +3876,7 @@ Partial Class PopUpVerFactura
|
||||
Dr("Abono") = 0
|
||||
DtMovimientosPoliza.Rows.Add(Dr)
|
||||
End If
|
||||
ElseIf UsuarioActual.CveEmpresa = 119 Then
|
||||
ElseIf UsuarioActual.CveEmpresa.Contiene(119, 141) Then
|
||||
Dim PreP As New ClsContabilidad
|
||||
If PreP.GetPrePolizasDetalle(-1, CveIE) Then
|
||||
DtMovimientosPoliza = New DataTable
|
||||
@@ -3861,8 +3889,8 @@ Partial Class PopUpVerFactura
|
||||
|
||||
For Each drt As DataRow In PreP.DtResultados.Rows
|
||||
Dim Dr = DtMovimientosPoliza.NewRow
|
||||
Dr("CODIGO") = drt("ContpaqCodigo")
|
||||
Dr("Cuenta") = drt("ContpaqCuenta")
|
||||
Dr("CODIGO") = drt("CuentaCodigo")
|
||||
Dr("Cuenta") = drt("CuentaNombre")
|
||||
Dr("Cargo") = If(drt("TipoMovto").ToString = "False", drt("ImporteMN"), "0")
|
||||
Dr("Abono") = If(drt("TipoMovto").ToString = "True", drt("ImporteMN"), "0")
|
||||
DtMovimientosPoliza.Rows.Add(Dr)
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<asp:TemplateField HeaderText="Importe" ItemStyle-Width="125px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTotal" runat="server" Text='<%# String.Format("{0} {1}", Eval("Total", "{0:N2}"), Eval("Abreviatura")) %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -555,7 +555,7 @@
|
||||
<hr style="border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));" />
|
||||
|
||||
<asp:GridView ID="GVPDocumentosRelacionadosPagos" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn"
|
||||
DataKeyNames="CveFactura,CveCompra,CveIE,Fecha,FechaPago"
|
||||
DataKeyNames="CveFactura,CveCompra,CveIE,Fecha,FechaPago,ImpPagado,CvePrePolizaDetalle"
|
||||
data-sort="true" Width="100%" EmptyDataText="No se encontró registros con la información del complemento de pago"
|
||||
ShowHeaderWhenEmpty="true" AutoGenerateColumns="False">
|
||||
<Columns>
|
||||
|
||||
@@ -2697,17 +2697,36 @@ Partial Class Compras_eFacturas
|
||||
|
||||
namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3")
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
|
||||
|
||||
' namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
|
||||
nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
|
||||
|
||||
|
||||
nodeaGral = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", XMLDoc.DocumentElement.Prefix), namespaces)
|
||||
|
||||
nodeTFD = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces)
|
||||
nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", "pago10"), namespaces)
|
||||
nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", "pago10"), namespaces)
|
||||
'Monto = ValorXML(nodePagos, "Monto").ToDecimal
|
||||
|
||||
Dim nodePago As XmlNodeList = nodePagos.SelectNodes(String.Format("//{0}:DoctoRelacionado", "pago10"), namespaces)
|
||||
Dim PrefijoPagos As String = ""
|
||||
|
||||
For Each nodoPrefijo As XmlNode In nodeComp.ChildNodes
|
||||
If nodoPrefijo.Prefix <> "tfd" Then
|
||||
PrefijoPagos = nodoPrefijo.Prefix
|
||||
End If
|
||||
Next
|
||||
|
||||
namespaces.AddNamespace(PrefijoPagos, "http://www.sat.gob.mx/Pagos")
|
||||
nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
|
||||
|
||||
|
||||
nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", PrefijoPagos), namespaces)
|
||||
nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", PrefijoPagos), namespaces)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
' Dim nodePago As XmlNodeList = nodePagos.SelectNodes(String.Format("//{0}:DoctoRelacionado", "pago10"), namespaces)
|
||||
|
||||
SeriePago = ValorXML(nodeaGral, "Serie")
|
||||
FolioPago = ValorXML(nodeaGral, "Folio")
|
||||
@@ -2735,11 +2754,12 @@ Partial Class Compras_eFacturas
|
||||
DTDocumentosRelacionados.Columns.Add("FechaPago", GetType(Date))
|
||||
DTDocumentosRelacionados.Columns.Add("CveMetodoPago", GetType(Integer))
|
||||
DTDocumentosRelacionados.Columns.Add("SerieFolioCompra")
|
||||
DTDocumentosRelacionados.Columns.Add("CvePrePolizaDetalle", GetType(Integer))
|
||||
|
||||
|
||||
|
||||
Dim nodePagosN As XmlNodeList
|
||||
nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", "pago10"), namespaces)
|
||||
nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", PrefijoPagos), namespaces)
|
||||
|
||||
|
||||
|
||||
@@ -2775,7 +2795,7 @@ Partial Class Compras_eFacturas
|
||||
|
||||
|
||||
Dim ObjCompraFolios As New ClsCompras
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace($"{PrefijoPagos}:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
'
|
||||
'.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
||||
If ObjCompraFolios.DtResultados.Rows.Count > 0 Then
|
||||
@@ -2789,7 +2809,7 @@ Partial Class Compras_eFacturas
|
||||
dRow2("CveFactura") = drow("CveFactura").ToString.ToEntero
|
||||
dRow2("CveMetodoPago") = drow("CveMetodoPago").ToString.ToEntero
|
||||
dRow2("SerieFolioCompra") = drow("SerieFolioCompra").ToString
|
||||
|
||||
dRow2("CvePrePolizaDetalle") = drow("CvePrePolizaDetalle").ToString
|
||||
|
||||
If drow("CveIE").ToString.ToEntero > 0 Then
|
||||
|
||||
@@ -2860,7 +2880,7 @@ Partial Class Compras_eFacturas
|
||||
|
||||
Dim TieneRegistros As Boolean = False
|
||||
|
||||
If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
||||
If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", "").Replace("pagos10:", ""), UsuarioActual.CveEmpresa) Then
|
||||
GvVincularPago.DataSource = ObjCompras.DtResultados
|
||||
|
||||
If ObjCompras.DtResultados.Rows.Count > 0 Then
|
||||
@@ -2982,9 +3002,9 @@ Partial Class Compras_eFacturas
|
||||
ObjCompra.IniciaTransacSQL()
|
||||
|
||||
|
||||
For Each Gv As GridViewRow In GvVincularPago.Rows
|
||||
For Each Gv As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
|
||||
|
||||
If Not ObjCompra.AddComplementoPago(Gv.DataKey("CveIE").ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("Monto").ToDecimal, Gv.DataKey("CvePrePolizaDetalle").ToEntero, CveFacturaPago) > 0 Then
|
||||
If Not ObjCompra.AddComplementoPago(Gv.DataKey("CveIE").ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("ImpPagado").ToDecimal, Gv.DataKey("CvePrePolizaDetalle").ToEntero, CveFacturaPago) > 0 Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -487,14 +487,14 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="TrPeriodo" runat="server" visible="False">
|
||||
<%-- <div class="row" id="TrPeriodo" runat="server" visible="False">
|
||||
<label class="col-md-2 truncate">
|
||||
<asp:Label ID="Label5" runat="server" Text="Periodo:"></asp:Label></label><div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="True" DataTextField="Nombre" DataValueField="CvePeriodo" Class="table-group-action-input form-control input-inline input-sm select2me" Width="75%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Fecha Inicial:</label>
|
||||
@@ -575,14 +575,6 @@
|
||||
<asp:TextBox ID="TxtTotal" runat="server" MaxLength="12" Width="100px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender8" runat="server" TargetControlID="TxtTotal" FilterType="Custom, Numbers" ValidChars=",." BehaviorID="_content_SoloNumeros" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row" id="DvObservaciones" runat="server" visible="false">
|
||||
<label class="col-md-2 truncate ">Observación de Facturación:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtObservaciones" runat="server" Width="400px" TextMode="MultiLine" Rows="2"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -816,12 +808,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row" style="display: none;">
|
||||
<label class="col-md-2 truncate">Importe:</label>
|
||||
<div class="col-md-10">
|
||||
@@ -1933,7 +1919,110 @@
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabFacCiclica" runat="server" HeaderText="Facturación Ciclica">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpFacCiclica" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet smmallpadding light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Datos de Facturación</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate ">Aplica Facturación Ciclica:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:CheckBox ID="ChkAplicaFacCiclica" AutoPostBack="True" OnCheckedChanged="ChkAplicaFacCiclica_CheckedChanged" runat="server"></asp:CheckBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="DivFacCiclica" runat="server" visible="false">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">
|
||||
<asp:Label ID="Label6" runat="server" Text="Periodo:"></asp:Label></label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" AppendDataBoundItems="True" AutoPostBack="true" OnSelectedIndexChanged="DdlPeriodo_SelectedIndexChanged" DataTextField="Nombre" DataValueField="CvePeriodo" Class="table-group-action-input form-control input-inline input-sm select2me" Width="75%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">
|
||||
<asp:Label ID="Label5" runat="server" Text="Dia del mes:"></asp:Label></label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlDiaFact" runat="server" AppendDataBoundItems="True" Class="table-group-action-input form-control input-inline input-sm select2me" Width="75%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate ">Facturación Automatica:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:CheckBox ID="ChkFacAutomatica" runat="server"></asp:CheckBox>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate ">Observación de Facturación:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtObservaciones" runat="server" Width="400px" TextMode="MultiLine" Rows="2"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="portlet smmallpadding light bordered" id="DivCiclosComerciales" runat="server" visible="false">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Ciclos de facturación</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12" align="right">
|
||||
<input type="text" id="TxtFiltraCiclos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtFiltraCiclos','{0}')", GvCiclosComerciales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtFiltraCiclos','{0}')", GvDatosAvance.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvCiclosComerciales" ClientIDMode="Static" ShowHeader="true" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron documentos." CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Fecha Vencimiento" DataField="FechaVenc" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Fue Facturado" DataField="FueFacturadoTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<%-- <asp:BoundField HeaderText="Periodo" DataField="Periodo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
<asp:HyperLinkField HeaderText="Serie-Folio" DataTextField="VentaFacturada" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVentaFacturada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:BoundField HeaderText="Moneda" DataField="MonedaVenta" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha Facturación" DataField="FechaIngVenta" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<%-- <asp:BoundField HeaderText="SubTotal" DataField="SubTotalVenta" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="IVA" DataField="IVAVenta" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="IEPS" DataField="IVAVenta" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />--%>
|
||||
<asp:BoundField HeaderText="Total" DataField="TotalVenta" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel ID="TabSistema" runat="server" HeaderText="Sistema">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
@@ -366,7 +366,7 @@ Partial Class Contratos_Default
|
||||
'TxtArchivo.Visible = True
|
||||
|
||||
CargaDatos()
|
||||
|
||||
CargaCiclosComerciales()
|
||||
CargaDatosAvance()
|
||||
CargaDatosAvancePorDocumento()
|
||||
CargaInventarios()
|
||||
@@ -810,11 +810,14 @@ Partial Class Contratos_Default
|
||||
cargaClientes()
|
||||
Else
|
||||
CargaContratista()
|
||||
End If
|
||||
End If
|
||||
|
||||
CargaPeriodos()
|
||||
DdlPeriodo_SelectedIndexChanged(DdlPeriodo, EventArgs.Empty)
|
||||
|
||||
If DdlTipoContrato.SelectedValue = "14" Then
|
||||
TrCtaEquipo.Visible = True
|
||||
TrPeriodo.Visible = True
|
||||
'TrPeriodo.Visible = True
|
||||
RFVEstatus.ValidationGroup = ""
|
||||
RequiredFieldValidator1.ValidationGroup = ""
|
||||
DvMin.Visible = True
|
||||
@@ -824,34 +827,31 @@ Partial Class Contratos_Default
|
||||
RowEstatus.Visible = False
|
||||
RowPorcentajeComision.Visible = False
|
||||
dvAddendum.Visible = False
|
||||
CargaPeriodos()
|
||||
|
||||
CargaPlantillas()
|
||||
TrContratoPlantilla.Visible = True
|
||||
TabPres.HeaderText = "Partidas"
|
||||
Else
|
||||
DtPeriodo = Nothing
|
||||
End If
|
||||
|
||||
|
||||
If DdlTipoContrato.SelectedValue = "25" Then
|
||||
trLicitacion.Visible = False
|
||||
divResponsable.Visible = False
|
||||
TrPeriodo.Visible = True
|
||||
CargaPeriodos()
|
||||
trIva.Visible = False
|
||||
trAnticipo.Visible = False
|
||||
trAmortizacion.Visible = False
|
||||
trPorGarantia.Visible = False
|
||||
DvMin.Visible = False
|
||||
RowFlexible.Visible = False
|
||||
RowPorcentajeComision.Visible = False
|
||||
DvMax.Visible = False
|
||||
DvTotal.Visible = False
|
||||
RowEstatus.Visible = False
|
||||
TabPres.HeaderText = "Partidas"
|
||||
DdlSubProyectoContrato.AutoPostBack = True
|
||||
DvObservaciones.Visible = True
|
||||
End If
|
||||
'If DdlTipoContrato.SelectedValue = "25" Then
|
||||
' trLicitacion.Visible = False
|
||||
' divResponsable.Visible = False
|
||||
' 'TrPeriodo.Visible = True
|
||||
' trIva.Visible = False
|
||||
' trAnticipo.Visible = False
|
||||
' trAmortizacion.Visible = False
|
||||
' trPorGarantia.Visible = False
|
||||
' DvMin.Visible = False
|
||||
' RowFlexible.Visible = False
|
||||
' RowPorcentajeComision.Visible = False
|
||||
' DvMax.Visible = False
|
||||
' DvTotal.Visible = False
|
||||
' RowEstatus.Visible = False
|
||||
' TabPres.HeaderText = "Partidas"
|
||||
' DdlSubProyectoContrato.AutoPostBack = True
|
||||
' 'DvObservaciones.Visible = True
|
||||
'End If
|
||||
|
||||
Dim CveTipoContrato = DdlTipoContrato.SelectedValue
|
||||
|
||||
@@ -879,9 +879,9 @@ Partial Class Contratos_Default
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
UpGral.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
@@ -935,10 +935,11 @@ Partial Class Contratos_Default
|
||||
CargaContratoPadre()
|
||||
CargaContratoAddendum()
|
||||
|
||||
|
||||
If ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero = 14 Then
|
||||
CargaPeriodos()
|
||||
|
||||
TrCtaEquipo.Visible = True
|
||||
TrPeriodo.Visible = True
|
||||
'TrPeriodo.Visible = True
|
||||
RFVEstatus.ValidationGroup = ""
|
||||
RequiredFieldValidator1.ValidationGroup = ""
|
||||
DvMin.Visible = True
|
||||
@@ -957,54 +958,69 @@ Partial Class Contratos_Default
|
||||
TabPres.HeaderText = "Partidas"
|
||||
End If
|
||||
|
||||
If ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero = 25 Then
|
||||
trLicitacion.Visible = False
|
||||
divResponsable.Visible = False
|
||||
TrPeriodo.Visible = True
|
||||
CargaPeriodos()
|
||||
trIva.Visible = False
|
||||
trAnticipo.Visible = False
|
||||
trAmortizacion.Visible = False
|
||||
trPorGarantia.Visible = False
|
||||
DvMin.Visible = False
|
||||
DvMax.Visible = False
|
||||
DvTotal.Visible = False
|
||||
TabPVInsumos.Visible = False
|
||||
RowEstatus.Visible = False
|
||||
TabPres.HeaderText = "Partidas"
|
||||
thOcCliente.Style.Add("display", "none")
|
||||
tdOcCliente.Style.Add("display", "none")
|
||||
thNoIdentificacionv.Style.Add("display", "none")
|
||||
thLimitar.Style.Add("display", "none")
|
||||
tdLimitar2.Style.Add("display", "none")
|
||||
tdNoIdentificacionv.Style.Add("display", "none")
|
||||
RowFlexible.Visible = False
|
||||
TableDatosCabecera.Visible = False
|
||||
TabAvanveDocumento.Visible = False
|
||||
TabSistema.Visible = False
|
||||
RowPorcentajeComision.Visible = False
|
||||
TabContratosGastos.Visible = False
|
||||
tdCveInterna.Text = ""
|
||||
tdLimitar.Text = ""
|
||||
tdOC.Text = ""
|
||||
THAvance.Visible = False
|
||||
THAvance.Style.Add("display", "none")
|
||||
TDAvance.Style.Add("display", "none")
|
||||
TxtOCInterna.Visible = False
|
||||
TxtNoIdentificacionv.Visible = False
|
||||
ChkLimitarVenta.Visible = False
|
||||
DvObservaciones.Visible = True
|
||||
TDObservacion.Visible = True
|
||||
tdObservaciones.Visible = True
|
||||
TxtObservaciones.Text = ObjContratos.DtResultados.Rows(0)("Observaciones").ToString
|
||||
Gv.Columns(6).Visible = True
|
||||
DdlPeriodo.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CvePeriodo").ToString)
|
||||
End If
|
||||
'If ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero = 25 Then
|
||||
' trLicitacion.Visible = False
|
||||
' divResponsable.Visible = False
|
||||
' 'TrPeriodo.Visible = True
|
||||
' CargaPeriodos()
|
||||
' trIva.Visible = False
|
||||
' trAnticipo.Visible = False
|
||||
' trAmortizacion.Visible = False
|
||||
' trPorGarantia.Visible = False
|
||||
' DvMin.Visible = False
|
||||
' DvMax.Visible = False
|
||||
' DvTotal.Visible = False
|
||||
' TabPVInsumos.Visible = False
|
||||
' RowEstatus.Visible = False
|
||||
' TabPres.HeaderText = "Partidas"
|
||||
' thOcCliente.Style.Add("display", "none")
|
||||
' tdOcCliente.Style.Add("display", "none")
|
||||
' thNoIdentificacionv.Style.Add("display", "none")
|
||||
' thLimitar.Style.Add("display", "none")
|
||||
' tdLimitar2.Style.Add("display", "none")
|
||||
' tdNoIdentificacionv.Style.Add("display", "none")
|
||||
' RowFlexible.Visible = False
|
||||
' TableDatosCabecera.Visible = False
|
||||
' TabAvanveDocumento.Visible = False
|
||||
' TabSistema.Visible = False
|
||||
' RowPorcentajeComision.Visible = False
|
||||
' TabContratosGastos.Visible = False
|
||||
' tdCveInterna.Text = ""
|
||||
' tdLimitar.Text = ""
|
||||
' tdOC.Text = ""
|
||||
' THAvance.Visible = False
|
||||
' THAvance.Style.Add("display", "none")
|
||||
' TDAvance.Style.Add("display", "none")
|
||||
' TxtOCInterna.Visible = False
|
||||
' TxtNoIdentificacionv.Visible = False
|
||||
' ChkLimitarVenta.Visible = False
|
||||
' 'DvObservaciones.Visible = True
|
||||
' TDObservacion.Visible = True
|
||||
' tdObservaciones.Visible = True
|
||||
' TxtObservaciones.Text = ObjContratos.DtResultados.Rows(0)("Observaciones").ToString
|
||||
' Gv.Columns(6).Visible = True
|
||||
' DdlPeriodo.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CvePeriodo").ToString)
|
||||
'End If
|
||||
|
||||
If ObjContratos.DtResultados.Rows(0)("CveVendedor").ToString.ToEntero > 0 Then
|
||||
DdlVendedor.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CveVendedor"))
|
||||
End If
|
||||
|
||||
ChkAplicaFacCiclica.Checked = CBool(ObjContratos.DtResultados.Rows(0)("FacturacionCicilica"))
|
||||
|
||||
If ChkAplicaFacCiclica.Checked Then
|
||||
CargaPeriodos()
|
||||
|
||||
ChkFacAutomatica.Checked = CBool(ObjContratos.DtResultados.Rows(0)("FacturacionCiclicaAutomatico"))
|
||||
|
||||
DdlPeriodo.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CvePeriodo"))
|
||||
DdlPeriodo_SelectedIndexChanged(DdlPeriodo, EventArgs.Empty)
|
||||
|
||||
DdlDiaFact.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("DiaMesFacturacion").ToString())
|
||||
TxtObservaciones.Text = ObjContratos.DtResultados.Rows(0)("Observaciones").ToString
|
||||
ChkAplicaFacCiclica_CheckedChanged(ChkAplicaFacCiclica, EventArgs.Empty)
|
||||
End If
|
||||
|
||||
|
||||
If (DdlAlmacenDestino.Items.FindByValue(ObjContratos.CveAlmacen.ToString()) Is Nothing) Then
|
||||
Dim dr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", ObjContratos.CveAlmacen))
|
||||
@@ -1224,10 +1240,10 @@ Partial Class Contratos_Default
|
||||
Maximo = txtMaximo.Text.ToDouble
|
||||
Total = TxtTotal.Text.ToDouble
|
||||
|
||||
If DdlTipoContrato.SelectedValue = "25" AndAlso DdlPeriodo.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Debe seleccionar el periodo de facturación.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
'If DdlTipoContrato.SelectedValue = "25" AndAlso DdlPeriodo.SelectedValue.ToEntero() <= 0 Then
|
||||
' Alert("Debe seleccionar el periodo de facturación.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
If DdlMoneda.SelectedIndex > 0 Then
|
||||
If TxtTipoCambio.Text.Trim.Length = 0 Or TxtTipoCambio.Text.Trim.ToDouble = 0.0 Then
|
||||
@@ -1246,207 +1262,195 @@ Partial Class Contratos_Default
|
||||
Dim ObjContratos As New ClsContratos
|
||||
Dim ObjInventarios As New ClsInventarios(ObjContratos.IniciaTransacSQL)
|
||||
|
||||
'Crear Contrato
|
||||
If Not CveContrato > 0 Then
|
||||
Try
|
||||
'Crear Contrato
|
||||
If Not CveContrato > 0 Then
|
||||
|
||||
CveContrato = ObjContratos.AddContratos(TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate,
|
||||
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
|
||||
TxtPorGarantia.Text.ToDouble, "." & Session("FileExtension").ToString, "", DdlContratoPadre.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, Minimo, Maximo, Total,
|
||||
DdlMoneda.SelectedValue.ToEntero, ModalidadDetalle, If(DdlTipoContrato.SelectedValue.ToEntero = 25 OrElse UsuarioActual.Empresa.CvePlataforma = 3, 1, DdlEstatus.SelectedValue.ToEntero), TipoContrato,
|
||||
TxtTipoCambio.Text.ToDouble, CveSucursalCliente:=DdlSucursalCliente.SelectedValue.ToEntero, CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero,
|
||||
PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero, TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero,
|
||||
CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero, CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero,
|
||||
Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(),
|
||||
FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=DdlDiaFact.SelectedValue.ToEntero())
|
||||
|
||||
|
||||
TieneError = Not GuardaFianzas(ObjContratos)
|
||||
|
||||
|
||||
If CveContrato > 0 AndAlso Not TieneError Then
|
||||
'Renombrar archivo
|
||||
If ViewState("extencion") IsNot Nothing Then
|
||||
If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then
|
||||
If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then
|
||||
Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos")
|
||||
End If
|
||||
Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\"
|
||||
|
||||
'ViewState("extencion") = FileExtension
|
||||
'ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", ViewState("FName").ToString)
|
||||
Try
|
||||
If File.Exists(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Then
|
||||
File.Delete(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
End If
|
||||
System.IO.File.Move(ViewState("FUrl").ToString, String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
'If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso DdlTipoContrato.SelectedValue = "14" Then
|
||||
' Dim FechaI As DateTime = TxtFechaInicial.Text.ToDateTime
|
||||
' Dim FechaF As DateTime = TxtFechaFinal.Text.ToDateTime
|
||||
' Dim Periodo As Integer = DtPeriodo.FiltraParametros($"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").Rows(0)("Dias").ToString.ToEntero
|
||||
' Dim VigenciaEnDias As Double = DateDiff(DateInterval.Day, FechaI, FechaF)
|
||||
' Dim CiclosComerciales As Integer = Math.Round(VigenciaEnDias / Periodo).ToEntero
|
||||
' For Ciclo As Integer = 1 To CiclosComerciales
|
||||
' If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaI.AddDays(Periodo * Ciclo)) Then TieneError = True : Exit For
|
||||
' Next
|
||||
'End If
|
||||
|
||||
If ChkAplicaFacCiclica.Checked Then
|
||||
TieneError = Not GenerarCiclosComerciales(CveContrato, False, ObjContratos)
|
||||
End If
|
||||
|
||||
If TxtNumeroContrato.Text = FolioSugerido Then
|
||||
Dim ObjFolios As New ClsGralFolios
|
||||
If Not ObjFolios.UpdateFolioActual(DdlSubProyectoContrato.SelectedValue.ToEntero, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
End If
|
||||
|
||||
If ChkImpuestosLocales.Checked Then
|
||||
Dim count As Integer = 0
|
||||
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
count = count + 1
|
||||
ObjContratos.AddContratoImpuestosLocales(CveContrato, GVR.DataKey("CveImpuestoLocal").ToEntero)
|
||||
End If
|
||||
Next
|
||||
|
||||
If count = 0 Then
|
||||
Alert("Debe seleccionar un Impuesto Local", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Modificado = True
|
||||
|
||||
Dim ArchivoUpdate As String = "-1"
|
||||
|
||||
If Session("FileExtension").ToString <> "" Then
|
||||
ArchivoUpdate = "." & Session("FileExtension").ToString
|
||||
Else
|
||||
|
||||
End If
|
||||
|
||||
If ObjContratos.UpdateContratos(CveContrato, TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate,
|
||||
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
|
||||
TxtPorGarantia.Text.ToDouble, ArchivoUpdate, "", DdlContratoPadre.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, Minimo, Maximo, Total, DdlMoneda.SelectedValue.ToEntero,
|
||||
ModalidadDetalle, If(UsuarioActual.Empresa.CvePlataforma = 3 OrElse CveTipoContrato = 25, 1, DdlEstatus.SelectedValue.ToEntero), TipoContrato, TxtTipoCambio.Text.ToDouble, CveSucursalCliente:=DdlSucursalCliente.SelectedValue.ToEntero,
|
||||
CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero,
|
||||
TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero,
|
||||
CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked,
|
||||
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=DdlDiaFact.SelectedValue.ToEntero(), CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero()) Then
|
||||
|
||||
|
||||
TieneError = Not GuardaFianzas(ObjContratos)
|
||||
|
||||
'Renombrar archivo
|
||||
If Not TieneError Then
|
||||
|
||||
'If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso DdlTipoContrato.SelectedValue = "14" Then
|
||||
|
||||
' If Not ObjContratos.CicloComercialDelete(CveContrato, False, UsuarioActual.CveEmpresa) Then
|
||||
' TieneError = True
|
||||
' End If
|
||||
|
||||
' Dim FechaIN As DateTime = TxtFechaInicial.Text.ToDateTime
|
||||
' Dim FechaFN As DateTime = TxtFechaFinal.Text.ToDateTime
|
||||
' Dim Periodo As Integer = DtPeriodo.FiltraParametros($"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").Rows(0)("Dias").ToString.ToEntero
|
||||
' Dim VigenciaEnDias As Double = DateDiff(DateInterval.Day, FechaI, FechaF)
|
||||
' Dim CiclosComerciales As Integer = Math.Round(VigenciaEnDias / Periodo).ToEntero
|
||||
' For Ciclo As Integer = 1 To CiclosComerciales
|
||||
' If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaI.AddDays(Periodo * Ciclo)) Then TieneError = True : Exit For
|
||||
' Next
|
||||
'End If
|
||||
|
||||
If ChkAplicaFacCiclica.Checked Then
|
||||
TieneError = Not GenerarCiclosComerciales(CveContrato, True, ObjContratos)
|
||||
Else
|
||||
|
||||
If Not ObjContratos.CicloComercialDelete(CveContrato, False, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ViewState("extencion") IsNot Nothing Then
|
||||
|
||||
If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then
|
||||
If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then
|
||||
Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos")
|
||||
End If
|
||||
Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\"
|
||||
|
||||
Try
|
||||
If File.Exists(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Then
|
||||
File.Delete(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
End If
|
||||
System.IO.File.Move(ViewState("FUrl").ToString, String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
' System.IO.File.Move(Archivo, String.Format("{0}{1}{2}", Ruta, CveContrato.ToString, Extension))
|
||||
End If
|
||||
End If
|
||||
|
||||
If ChkImpuestosLocales.Checked Then
|
||||
Dim count As Integer = 0
|
||||
ObjContratos.LimpiaImpuestosLocales(CveContrato)
|
||||
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
count = count + 1
|
||||
ObjContratos.AddContratoImpuestosLocales(CveContrato, GVR.DataKey("CveImpuestoLocal").ToEntero)
|
||||
End If
|
||||
Next
|
||||
|
||||
If count = 0 Then
|
||||
Alert("Debe seleccionar un Impuesto Local", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
ObjContratos.LimpiaImpuestosLocales(CveContrato)
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
OnError("Ocurrió un error al guardar el contrato.", ex)
|
||||
End Try
|
||||
|
||||
CveContrato = ObjContratos.AddContratos(TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate,
|
||||
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
|
||||
TxtPorGarantia.Text.ToDouble, "." & Session("FileExtension").ToString, "", DdlContratoPadre.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, Minimo, Maximo, Total,
|
||||
DdlMoneda.SelectedValue.ToEntero, ModalidadDetalle, If(DdlTipoContrato.SelectedValue.ToEntero = 25 OrElse UsuarioActual.Empresa.CvePlataforma = 3, 1, DdlEstatus.SelectedValue.ToEntero), TipoContrato,
|
||||
TxtTipoCambio.Text.ToDouble, CveSucursalCliente:=DdlSucursalCliente.SelectedValue.ToEntero, CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero,
|
||||
PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero, TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero,
|
||||
CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero, CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero,
|
||||
Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim())
|
||||
|
||||
|
||||
TieneError = Not GuardaFianzas(ObjContratos)
|
||||
|
||||
|
||||
If CveContrato > 0 AndAlso Not TieneError Then
|
||||
'Renombrar archivo
|
||||
If ViewState("extencion") IsNot Nothing Then
|
||||
If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then
|
||||
If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then
|
||||
Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos")
|
||||
End If
|
||||
Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\"
|
||||
|
||||
'ViewState("extencion") = FileExtension
|
||||
'ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", ViewState("FName").ToString)
|
||||
Try
|
||||
If File.Exists(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Then
|
||||
File.Delete(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
End If
|
||||
System.IO.File.Move(ViewState("FUrl").ToString, String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso DdlTipoContrato.SelectedValue = "14" Then
|
||||
Dim FechaI As DateTime = TxtFechaInicial.Text.ToDateTime
|
||||
Dim FechaF As DateTime = TxtFechaFinal.Text.ToDateTime
|
||||
Dim Periodo As Integer = DtPeriodo.FiltraParametros($"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").Rows(0)("Dias").ToString.ToEntero
|
||||
Dim VigenciaEnDias As Double = DateDiff(DateInterval.Day, FechaI, FechaF)
|
||||
Dim CiclosComerciales As Integer = Math.Round(VigenciaEnDias / Periodo).ToEntero
|
||||
For Ciclo As Integer = 1 To CiclosComerciales
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaI.AddDays(Periodo * Ciclo)) Then TieneError = True : Exit For
|
||||
Next
|
||||
ElseIf DdlTipoContrato.SelectedValue = "25" Then
|
||||
Dim FechaI As DateTime = TxtFechaInicial.Text.ToDateTime
|
||||
Dim FechaF As DateTime = TxtFechaFinal.Text.ToDateTime
|
||||
If FechaI >= DateTime.Today Then
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaI) Then TieneError = True
|
||||
End If
|
||||
Dim Periodo As Integer = DtPeriodo.FiltroPrimeroValor("Meses", $"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").ToEntero
|
||||
Dim VigenciaMeses As Double = DateDiff(DateInterval.Month, FechaI, FechaF)
|
||||
Dim CiclosComerciales As Integer = Math.Ceiling(VigenciaMeses / Periodo).ToEntero
|
||||
For Ciclo As Integer = 1 To CiclosComerciales
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, If(FechaI.AddMonths(Periodo * Ciclo) > FechaF, FechaF, FechaI.AddMonths(Periodo * Ciclo))) Then TieneError = True : Exit For
|
||||
Next
|
||||
End If
|
||||
|
||||
If TxtNumeroContrato.Text = FolioSugerido Then
|
||||
Dim ObjFolios As New ClsGralFolios
|
||||
If Not ObjFolios.UpdateFolioActual(DdlSubProyectoContrato.SelectedValue.ToEntero, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
End If
|
||||
|
||||
If ChkImpuestosLocales.Checked Then
|
||||
Dim count As Integer = 0
|
||||
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
count = count + 1
|
||||
ObjContratos.AddContratoImpuestosLocales(CveContrato, GVR.DataKey("CveImpuestoLocal").ToEntero)
|
||||
End If
|
||||
Next
|
||||
|
||||
If count = 0 Then
|
||||
Alert("Debe seleccionar un Impuesto Local", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Modificado = True
|
||||
|
||||
Dim ArchivoUpdate As String = "-1"
|
||||
|
||||
If Session("FileExtension").ToString <> "" Then
|
||||
ArchivoUpdate = "." & Session("FileExtension").ToString
|
||||
Else
|
||||
|
||||
End If
|
||||
|
||||
If ObjContratos.UpdateContratos(CveContrato, TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate,
|
||||
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
|
||||
TxtPorGarantia.Text.ToDouble, ArchivoUpdate, "", DdlContratoPadre.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, Minimo, Maximo, Total, DdlMoneda.SelectedValue.ToEntero,
|
||||
ModalidadDetalle, If(UsuarioActual.Empresa.CvePlataforma = 3 OrElse CveTipoContrato = 25, 1, DdlEstatus.SelectedValue.ToEntero), TipoContrato, TxtTipoCambio.Text.ToDouble, CveSucursalCliente:=DdlSucursalCliente.SelectedValue.ToEntero,
|
||||
CveAlmacenOrigen:=DdlAlmacenOrigen.SelectedValue.ToEntero, CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, PorcentajeComision:=TxtPorcentajeComision.Text.ToEntero,
|
||||
TipoGarantia:=DdlTipoGarantia.SelectedValue.ToEntero, Folio:=TxtFolio.Text.ToEntero, FechaVenc:=txtFechaVenc.Text.ToDate, EstatusFianza:=DdlEstatusFianza.SelectedValue.ToEntero, CveContratoPlantilla:=DdlPlantillaContrato.SelectedValue.ToEntero,
|
||||
CveCuentaEquipo:=DdlCuentaEquipo.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=DdlClienteDireccionEnvio.SelectedValue.ToEntero, AplicaImpuestosLocales:=ChkImpuestosLocales.Checked,
|
||||
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim()) Then
|
||||
|
||||
|
||||
TieneError = Not GuardaFianzas(ObjContratos)
|
||||
|
||||
'Renombrar archivo
|
||||
If Not TieneError Then
|
||||
|
||||
If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso DdlTipoContrato.SelectedValue = "14" Then
|
||||
Dim FechaIN As DateTime = TxtFechaInicial.Text.ToDateTime
|
||||
Dim FechaFN As DateTime = TxtFechaFinal.Text.ToDateTime
|
||||
Dim Periodo As Integer = DtPeriodo.FiltraParametros($"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").Rows(0)("Dias").ToString.ToEntero
|
||||
Dim VigenciaEnDias As Double = DateDiff(DateInterval.Day, FechaI, FechaF)
|
||||
Dim CiclosComerciales As Integer = Math.Round(VigenciaEnDias / Periodo).ToEntero
|
||||
For Ciclo As Integer = 1 To CiclosComerciales
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaI.AddDays(Periodo * Ciclo)) Then TieneError = True : Exit For
|
||||
Next
|
||||
ElseIf CveTipoContrato = 25 Then
|
||||
Dim FechaIN As DateTime = TxtFechaInicial.Text.ToDateTime
|
||||
Dim FechaFN As DateTime = TxtFechaFinal.Text.ToDateTime
|
||||
If FechaFN <> FechaF OrElse FechaI <> FechaIN Then
|
||||
If Not ObjContratos.CicloComercialDelete(CveContrato, False, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
If Not TieneError Then
|
||||
If FechaIN >= DateTime.Today Then
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaIN) Then TieneError = True
|
||||
End If
|
||||
Dim Periodo As Integer = DtPeriodo.FiltroPrimeroValor("Meses", $"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").ToEntero
|
||||
Dim VigenciaMeses As Double = DateDiff(DateInterval.Month, FechaI, FechaF)
|
||||
Dim CiclosComerciales As Integer = Math.Ceiling(VigenciaMeses / Periodo).ToEntero
|
||||
For Ciclo As Integer = 1 To CiclosComerciales
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, If(FechaIN.AddMonths(Periodo * Ciclo) > FechaFN, FechaFN, FechaIN.AddMonths(Periodo * Ciclo))) Then TieneError = True : Exit For
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If ViewState("extencion") IsNot Nothing Then
|
||||
|
||||
If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then
|
||||
If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then
|
||||
Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos")
|
||||
End If
|
||||
Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\"
|
||||
|
||||
Try
|
||||
If File.Exists(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Then
|
||||
File.Delete(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
End If
|
||||
System.IO.File.Move(ViewState("FUrl").ToString, String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
' System.IO.File.Move(Archivo, String.Format("{0}{1}{2}", Ruta, CveContrato.ToString, Extension))
|
||||
End If
|
||||
End If
|
||||
|
||||
If ChkImpuestosLocales.Checked Then
|
||||
Dim count As Integer = 0
|
||||
ObjContratos.LimpiaImpuestosLocales(CveContrato)
|
||||
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
count = count + 1
|
||||
ObjContratos.AddContratoImpuestosLocales(CveContrato, GVR.DataKey("CveImpuestoLocal").ToEntero)
|
||||
End If
|
||||
Next
|
||||
|
||||
If count = 0 Then
|
||||
Alert("Debe seleccionar un Impuesto Local", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
ObjContratos.LimpiaImpuestosLocales(CveContrato)
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
ObjContratos.RollBack()
|
||||
Else
|
||||
ObjContratos.Commit()
|
||||
|
||||
If ObjContratos.GetContratos(-1, -1) Then
|
||||
Application("GlobalDTContratos") = ObjContratos.DtResultados
|
||||
End If
|
||||
|
||||
Limpiar()
|
||||
If Modificado Then
|
||||
Alert("El Contrato se modificó Correctamente.", TipoMensaje.MsgInformacion, String.Format("document.location.href=""/Contratos/Contrato.aspx?CveContrato={0}""", CveContrato))
|
||||
@@ -1454,10 +1458,104 @@ Partial Class Contratos_Default
|
||||
Alert("El Contrato se registró Correctamente.", TipoMensaje.MsgInformacion, String.Format("document.location.href=""/Contratos/Contrato.aspx?CveContrato={0}""", CveContrato))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UpGral.Update()
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
UpGral.Update()
|
||||
|
||||
RecargaGlobalContratos()
|
||||
End Sub
|
||||
Private Function GenerarCiclosComerciales(CveContrato As Integer, EsActualizacion As Boolean, ByRef ObjContratos As ClsContratos) As Boolean
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
Dim FechaI As DateTime = TxtFechaInicial.Text.ToDateTime
|
||||
Dim FechaF As DateTime = TxtFechaFinal.Text.ToDateTime
|
||||
|
||||
If EsActualizacion Then
|
||||
Dim DtCiclos As DataTable = Nothing
|
||||
If ObjContratos.CicloComercialGet(Me.CveContrato, -1, -1, UsuarioActual.CveEmpresa, MinFecha, MaxFecha) Then
|
||||
Dim RowCiclo As DataRow = ObjContratos.DtResultados.FiltroPrimero("FueFacturado = 1", Orderby:="FechaVenc DESC")
|
||||
If RowCiclo IsNot Nothing Then
|
||||
FechaI = RowCiclo("FechaVenc").ToString().ToDateTime()
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not ObjContratos.CicloComercialDelete(CveContrato, False, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim PeriodoMeses As Integer = DtPeriodo.FiltroPrimeroValor("Meses", $"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").ToEntero
|
||||
|
||||
Dim PeriodoDias As Integer = DtPeriodo.FiltraParametros($"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").Rows(0)("Dias").ToString.ToEntero
|
||||
|
||||
If PeriodoMeses > 0 AndAlso PeriodoDias <= 0 Then
|
||||
Dim VigenciaMeses As Double = DateDiff(DateInterval.Month, FechaI, FechaF)
|
||||
Dim CiclosComercialesEnMeses As Integer = Math.Ceiling(VigenciaMeses / PeriodoMeses).ToEntero
|
||||
|
||||
For Ciclo As Integer = 1 To CiclosComercialesEnMeses
|
||||
Dim FechaRef As DateTime = FechaI.AddMonths(PeriodoMeses * Ciclo)
|
||||
Dim lastDayOfMonth = DateTime.DaysInMonth(FechaRef.Year, FechaRef.Month)
|
||||
Dim DiaMes As Integer = If(FechaRef.Day < DdlDiaFact.SelectedValue.ToEntero(), lastDayOfMonth, DdlDiaFact.SelectedValue.ToEntero())
|
||||
|
||||
Dim FechaFact = New DateTime(FechaRef.Year, FechaRef.Month, DiaMes)
|
||||
FechaFact = If(FechaFact > FechaF, FechaF, FechaFact)
|
||||
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaFact) Then TieneError = True : Exit For
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If PeriodoDias > 0 AndAlso PeriodoMeses <= 0 Then
|
||||
Dim VigenciaEnMeses As Double = DateDiff(DateInterval.Month, FechaI, FechaF)
|
||||
Dim CiclosComercialesEnDias As Integer = VigenciaEnMeses.ToEntero()
|
||||
|
||||
'RECORRE LOS MESES QUE VA A FACTURAR
|
||||
For CicloMes As Integer = 1 To CiclosComercialesEnDias
|
||||
|
||||
Dim FechaRef As DateTime = FechaI.AddMonths(CicloMes)
|
||||
Dim CiclosPorMesDecimal As Double = (FechaRef.LastDayOfMonth().Day.ToString().ToDouble() / PeriodoDias.ToString().ToDouble())
|
||||
|
||||
Dim CiclosPorMes As Integer = Math.Truncate(CiclosPorMesDecimal).ToEntero()
|
||||
Dim DecimalPart As Double = CiclosPorMesDecimal - CiclosPorMes.ToString().ToDouble()
|
||||
|
||||
If DecimalPart > 0.7D Then
|
||||
CiclosPorMes += 1
|
||||
End If
|
||||
|
||||
Dim DiaAnterior As Integer = 0
|
||||
|
||||
For CicloDias = 1 To CiclosPorMes
|
||||
Dim DiaMes As Integer = 0
|
||||
|
||||
If CicloDias = 1 Then
|
||||
DiaMes = DdlDiaFact.SelectedValue.ToEntero()
|
||||
Else
|
||||
DiaMes = DiaAnterior + PeriodoDias
|
||||
End If
|
||||
|
||||
Dim FechaFact As DateTime = New DateTime(FechaRef.Year, FechaRef.Month, If(DiaMes > FechaRef.LastDayOfMonth().Day, FechaRef.LastDayOfMonth().Day, DiaMes))
|
||||
|
||||
DiaAnterior = FechaFact.Day
|
||||
|
||||
If Not ObjContratos.CicloComercialAdd(CveContrato, -1, DdlCliente.SelectedValue.ToEntero, False, -1, 1, UsuarioActual.CveEmpresa, FechaFact) Then TieneError = True : Exit For
|
||||
Next
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Return Not TieneError
|
||||
End Function
|
||||
Private Sub RecargaGlobalContratos()
|
||||
Using ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(-1, -1) Then
|
||||
Application("GlobalDTContratos") = ObjContratos.DtResultados
|
||||
End If
|
||||
End Using
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
@@ -3468,13 +3566,54 @@ Partial Class Contratos_Default
|
||||
End If
|
||||
DdlPeriodo.DataSource = DtPeriodo
|
||||
ObjContratos.Dispose()
|
||||
|
||||
DdlPeriodo.DataBind()
|
||||
UpGral.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If DtPeriodo IsNot Nothing Then
|
||||
If DdlPeriodo.SelectedValue.ToEntero() > 0 Then
|
||||
Dim PeriodoDias As Integer = DtPeriodo.FiltraParametros($"CvePeriodo = {DdlPeriodo.SelectedValue.ToEntero}").Rows(0)("Dias").ToString.ToEntero
|
||||
If PeriodoDias > 0 Then
|
||||
CargaDiasMes(PeriodoDias)
|
||||
Else
|
||||
CargaDiasMes()
|
||||
End If
|
||||
Else
|
||||
CargaDiasMes()
|
||||
End If
|
||||
Else
|
||||
CargaDiasMes()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaDiasMes(Optional NumMaxDias As Integer = 31)
|
||||
DdlDiaFact.Items.Clear()
|
||||
For i = 1 To NumMaxDias
|
||||
DdlDiaFact.Items.Add(New ListItem(i.ToString(), i.ToString()))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCiclosComerciales()
|
||||
If ChkAplicaFacCiclica.Checked Then
|
||||
DivCiclosComerciales.Visible = True
|
||||
Using ObjContratos As New ClsContratos
|
||||
If ObjContratos.CicloComercialGet(Me.CveContrato, -1, -1, UsuarioActual.CveEmpresa, MinFecha, MaxFecha) Then
|
||||
GvCiclosComerciales.DataSource = ObjContratos.DtResultados.FiltraParametros("", Orderby:="FechaVenc ASC")
|
||||
End If
|
||||
End Using
|
||||
Else
|
||||
DivCiclosComerciales.Visible = False
|
||||
End If
|
||||
GvCiclosComerciales.DataBind()
|
||||
UpFacCiclica.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " IMPRESION "
|
||||
|
||||
|
||||
#Region " IMPRIMIR AVANCE POR DOCUMENTO "
|
||||
Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles LBImprimir.Click
|
||||
GenerarPDF()
|
||||
@@ -4339,15 +4478,22 @@ Partial Class Contratos_Default
|
||||
ObjContratos.Dispose()
|
||||
GvImpuestosLocales.DataBind()
|
||||
UpImpuestos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub ChkAplicaFacCiclica_CheckedChanged(sender As Object, e As EventArgs)
|
||||
DivFacCiclica.Visible = ChkAplicaFacCiclica.Checked
|
||||
DivCiclosComerciales.Visible = ChkAplicaFacCiclica.Checked
|
||||
|
||||
UpFacCiclica.Update()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,13 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
|
||||
|
||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
|
||||
|
||||
<ajax:TabPanel ID="TabAvance" runat="server" HeaderText="Avance">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
@@ -70,8 +76,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1" style="text-align:right!important">
|
||||
Fecha:
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<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="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
@@ -82,12 +95,21 @@
|
||||
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<a class="linkfile" id="btnanexogral" runat="server" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6" style="text-align:right">
|
||||
<a class="linkfile" id="btnanexogral" runat="server" >
|
||||
<span class="btn btn-circle btn-sm btn-success"><i class='fa fa-plus'></i></span>Agregar
|
||||
<asp:TextBox ID="AnexoGral" Text='' runat="server"></asp:TextBox>
|
||||
</a>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<table class="table table-striped Widthall">
|
||||
<tr>
|
||||
<th style="width: 300px;"></th>
|
||||
@@ -107,13 +129,18 @@
|
||||
<th style="text-align: right;">Anexo</th>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
|
||||
DataKeyNames="CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance"
|
||||
CssClass="table GVEstimacion table-advance table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:LinkButton>
|
||||
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false" ></asp:LinkButton>
|
||||
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
@@ -148,27 +175,217 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText=" ">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" />
|
||||
<a class="btn btn-circle btn-sm btn-success hidden linkfile">
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm btn-success" ID="LnkModalDropzone" Visible="false"> <i class='fa fa-plus'></i></asp:LinkButton>
|
||||
<%-- <a class="btn btn-circle btn-sm btn-success hidden linkfile">
|
||||
<i class='fa fa-plus'></i><asp:TextBox ID="TXTAnexo" CssClass="hidden" runat="server"></asp:TextBox>
|
||||
</a>
|
||||
</a>--%>
|
||||
|
||||
|
||||
<div runat="server" id="ModalAnexoEvidencia" class="modal ADS fade" role="dialog">
|
||||
<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">Cargar Evidencia</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<div style="text-align:left">
|
||||
<asp:TextBox ID="TXTAnexo" CssClass="ADSdropzone hidden" data-maxFile="10" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<div class="text-center"><asp:Button id="BtnGuardar" CssClass="btn btn-primary" runat="server" Text="Guardar" Visible="false" /></div>
|
||||
<asp:GridView ID="GvAnexos" AutoGenerateColumns="false" runat="server" ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron archivos">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Archivo">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HPLArchivo" runat="server"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
<asp:Button id="BtnGuardar" CssClass="btn btn-primary" runat="server" Text="Guardar" Visible="false" ValidationGroup="GrpGuardar" />
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabEstimación" runat="server" HeaderText="Estimación">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpEstimaciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarEstimaciones" runat="server" Text="Consultar" class="btn btn-default" />
|
||||
</div>
|
||||
|
||||
<div class="titlefiltros caption" style="position: relative;">
|
||||
<asp:UpdatePanel class="row" ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<label class="col-md-1 truncate">Contrato:</label>
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="ddls">
|
||||
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" AutoPostBack="true" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvEstimaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
|
||||
DataKeyNames="CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance"
|
||||
CssClass="table GVEstimacion table-advance table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false" ></asp:LinkButton>
|
||||
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Cantidad", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Importe", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%-- <asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText=" ">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" />
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm btn-success" ID="LnkModalDropzone" Visible="false"> <i class='fa fa-plus'></i></asp:LinkButton>
|
||||
|
||||
|
||||
|
||||
<div runat="server" id="ModalAnexoEvidencia" class="modal ADS fade" role="dialog">
|
||||
<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">Cargar Evidencia</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<div style="text-align:left">
|
||||
<asp:TextBox ID="TXTAnexo" CssClass="ADSdropzone hidden" data-maxFile="10" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="text-center">
|
||||
|
||||
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal fade " id="dropmodal">
|
||||
@@ -178,7 +395,7 @@
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Dropzone</span>
|
||||
<span class="caption-subject bold uppercase">Cargar Evidencia</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -193,25 +410,86 @@
|
||||
<div id="my-dropzone" class="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center!important">
|
||||
<br />
|
||||
<button id="btnCerrarModal" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="ModalAnexos" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<asp:UpdatePanel ID="UpModalAnexos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<!-- 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 runat="server" ID="LblTituloModalAnexo"></asp:Label></h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12" style="text-align:center!important">
|
||||
<asp:GridView ID="GvAnexos" AutoGenerateColumns="false" runat="server" ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron archivos" Width="100"
|
||||
DataKeyNames="Archivo" CssClass="table GVEstimacion table-advance table-hover" GridLines ="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Anexos">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="LnkArchivo" runat="server" OnClick="LnkArchivo_Click"></asp:LinkButton>
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
|
||||
|
||||
<%--<script src="../Scripts/dropzone/dropzone.min.js"></script>--%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" Runat="Server">
|
||||
|
||||
<script>
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
<script>
|
||||
|
||||
$(".linkfile").click(function () {
|
||||
showmodalFile($(this).find('input').attr('id'));
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
$(".linkfile").click(function () {
|
||||
showmodalFile($(this).find('input').attr('id'));
|
||||
});
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
$(".linkfile").click(function () {
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
$(".linkfile").click(function () {
|
||||
showmodalFile($(this).find('input').attr('id'));
|
||||
});
|
||||
});
|
||||
@@ -224,7 +502,8 @@
|
||||
ADDropzone(obj);
|
||||
$('#dropmodal').modal();
|
||||
}
|
||||
function ValidateCant(variable){
|
||||
function ValidateCant(variable) {
|
||||
|
||||
var txt = $(variable);
|
||||
var max = txt.data('cantidad');
|
||||
var value = parseInt(txt.val());
|
||||
@@ -235,16 +514,24 @@
|
||||
txt.val(0);
|
||||
}
|
||||
var importe = $('.txtimporte[data-cve="' + txt.data('cve') + '"]');
|
||||
|
||||
importe.val(parseFloat(txt.val()) * parseFloat(txt.data('pu')));
|
||||
FormatoMoneda2(importe);
|
||||
if (parseInt(txt.val()) > 0) {
|
||||
$($(txt.parent()).parent()).find(".linkfile").removeClass("hidden");
|
||||
} else {
|
||||
var ocultar = $($(txt.parent()).parent()).find(".linkfile");
|
||||
if (!ocultar.hasClass("hidden")) {
|
||||
ocultar.addClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
//FormatoMoneda2(importe);
|
||||
|
||||
//if (parseInt(txt.val()) > 0) {
|
||||
|
||||
// $($(txt.parent()).parent()).find(".linkfile").removeClass("hidden");
|
||||
|
||||
//} else {
|
||||
|
||||
// var ocultar = $($(txt.parent()).parent()).find(".linkfile");
|
||||
|
||||
// if (!ocultar.hasClass("hidden")) {
|
||||
// ocultar.addClass("hidden");
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
//);
|
||||
</script>
|
||||
|
||||
@@ -46,22 +46,31 @@ Partial Class Contratos_ContratoAvance
|
||||
Set(value As String)
|
||||
ViewState("fecha") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
If Not IsPostBack Then
|
||||
BtnGuardar.Visible = False
|
||||
btnanexogral.Visible = False
|
||||
CargaContrato()
|
||||
btnanexogral.Visible = False
|
||||
CargaContrato()
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Filtros"
|
||||
|
||||
Private Sub CargaContrato()
|
||||
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format("CveContratoTipo=4"))
|
||||
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (4,30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||
DdlContratos.DataBind()
|
||||
|
||||
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (4,30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||
DDlContratosEstimaciones.DataBind()
|
||||
|
||||
|
||||
CargaddlAvance()
|
||||
End Sub
|
||||
|
||||
@@ -124,8 +133,10 @@ Partial Class Contratos_ContratoAvance
|
||||
End Sub
|
||||
Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles Gv.RowDataBound
|
||||
If e.Row.RowIndex > -1 Then
|
||||
|
||||
e.Row.FCTextBox("TxtCantidad").Visible = (fecha = "")
|
||||
e.Row.FCLinkButton("LnkAnexo").Visible = Not (fecha = "")
|
||||
e.Row.FCLinkButton("LnkAnexo").Visible = Not (fecha = "")
|
||||
|
||||
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
|
||||
e.Row.FCTextBox("TxtCantidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkAnexo").Visible = False
|
||||
@@ -140,9 +151,32 @@ Partial Class Contratos_ContratoAvance
|
||||
e.Row.CssClass = "SubTotales3"
|
||||
End If
|
||||
End If
|
||||
|
||||
If e.Row.DataKey("CveContratoDetalle").ToEntero > 0 Then
|
||||
|
||||
Dim LnkAnexo As LinkButton = e.Row.FCLinkButton("LnkModalDropzone")
|
||||
'LnkAnexo.Visible = True
|
||||
Dim DVAnexo As Control = DirectCast(e.Row.FindControl("ModalAnexoEvidencia"), Control)
|
||||
LnkAnexo.OnClientClick = $" $('#{DVAnexo.ClientID}').modal('show'); return false;"
|
||||
|
||||
If DdlAvances.SelectedIndex > 0 Then
|
||||
LnkAnexo.Visible = False
|
||||
Else
|
||||
LnkAnexo.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GetAnexos(sender As Object, e As System.EventArgs)
|
||||
Protected Sub GetAnexos(sender As Object, e As System.EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
|
||||
LblTituloModalAnexo.Text = "Anexo " & GvRow.DataKey("PS")
|
||||
|
||||
'Get the button that raised the event
|
||||
Dim btn As LinkButton = DirectCast(sender, LinkButton)
|
||||
Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
|
||||
@@ -154,22 +188,49 @@ Partial Class Contratos_ContratoAvance
|
||||
GvAnexos.Visible = True
|
||||
Else
|
||||
GvAnexos.Visible = False
|
||||
End If
|
||||
objContrato.Dispose()
|
||||
End If
|
||||
|
||||
objContrato.Dispose()
|
||||
|
||||
UpModalAnexos.Update()
|
||||
|
||||
RegistraScript("$('#ModalAnexos').modal('show');")
|
||||
|
||||
End Sub
|
||||
Protected Sub GvAnexos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvAnexos.RowDataBound
|
||||
Protected Sub GvAnexos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvAnexos.RowDataBound
|
||||
|
||||
If e.Row.RowIndex > -1 Then
|
||||
Dim Archivo As String = e.Row.DBCampo("Archivo").ToString
|
||||
Dim start As Integer = Len(Archivo.Split("-"c)(0))
|
||||
Dim link As HyperLink = e.Row.FCHyperLink("HPLArchivo")
|
||||
link.Text = Archivo.Substring(start + 1)
|
||||
link.NavigateUrl = String.Format("/Empresas/{0}/Contrato/{1}/Anexos/{2}", UsuarioActual.CveEmpresa, CveContrato, Archivo)
|
||||
Dim LnkArchivo As LinkButton = e.Row.FCLinkButton("LnkArchivo")
|
||||
|
||||
LnkArchivo.Text = Archivo.Substring(start + 1)
|
||||
'link.NavigateUrl = String.Format("/Empresas/{0}/Contrato/{1}/Anexos/{2}", UsuarioActual.CveEmpresa, CveContrato, Archivo)
|
||||
|
||||
ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkArchivo)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkArchivo_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim Archivo As String = GvRow.DataKey("Archivo").ToString
|
||||
|
||||
Response.ContentType = "application/octet-stream"
|
||||
Response.AppendHeader("Content-Disposition", $"attachment; filename={Archivo}")
|
||||
Response.TransmitFile($"{UsuarioActual.Empresa.Ruta}\Contrato\{DdlContratos.SelectedValue.ToEntero}\Anexos\{Archivo}")
|
||||
Response.End()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
Dim TieneError = False
|
||||
@@ -177,47 +238,58 @@ Partial Class Contratos_ContratoAvance
|
||||
Dim Cantidad As Double
|
||||
Dim filesgral As List(Of Archivo) = AnexoGral.getfiles().Archivos
|
||||
Dim guardarArchivos As New List(Of Archivo)
|
||||
For Each gvr As GridViewRow In Gv.Rows
|
||||
CveContratoDetalle = gvr.DataKey("CveContratoDetalle").ToEntero
|
||||
If CveContratoDetalle > 0 Then
|
||||
Cantidad = gvr.FCTextBox("TxtCantidad").Text.ToDouble
|
||||
|
||||
For Each gvr As GridViewRow In Gv.Rows
|
||||
|
||||
CveContratoDetalle = gvr.DataKey("CveContratoDetalle").ToEntero
|
||||
|
||||
If CveContratoDetalle > 0 Then
|
||||
|
||||
Cantidad = gvr.FCTextBox("TxtCantidad").Text.ToDouble
|
||||
|
||||
If Cantidad > 0 Then
|
||||
If ObjContratos.AddContratosAvance(CveContratoDetalle, Cantidad, TxtFecha.Text.ToDateTime, UsuarioActual.CveUsuario) Then
|
||||
If ObjContratos.AddContratosAvance(CveContratoDetalle, Cantidad, TxtFecha.Text.ToDateTime, UsuarioActual.CveUsuario) Then
|
||||
|
||||
Dim CveContratoAvance As Integer = ObjContratos.DtResultados.Rows(0)("CveContratoAvance").ToString.ToEntero
|
||||
Dim files As List(Of Archivo) = gvr.FCTextBox("TXTAnexo").getfiles().Archivos
|
||||
|
||||
For Each fileItem As Archivo In filesgral
|
||||
guardarArchivos.Add(fileItem)
|
||||
If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
For Each fileItem As Archivo In files
|
||||
'For Each fileItem As Archivo In filesgral 'GENERAL
|
||||
' guardarArchivos.Add(fileItem)
|
||||
' If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
|
||||
' TieneError = True
|
||||
' Exit For
|
||||
' End If
|
||||
'Next
|
||||
|
||||
For Each fileItem As Archivo In files
|
||||
guardarArchivos.Add(fileItem)
|
||||
If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If TieneError Then
|
||||
ObjContratos.RollBack()
|
||||
Alert("No se logro guardar el Presupuesto favor de intentarlo mas tarde o comuniquese con soporte", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato)
|
||||
For Each fileItem As Archivo In filesgral
|
||||
fileItem.filename.filesMove(fileItem.filename, urlsave)
|
||||
Next
|
||||
Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato)
|
||||
For Each fileItem As Archivo In filesgral
|
||||
fileItem.filename.FilesMove(fileItem.filename, urlsave)
|
||||
Next
|
||||
|
||||
For Each fileItem As Archivo In guardarArchivos
|
||||
fileItem.filename.filesMove(fileItem.filename, urlsave)
|
||||
fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extencion}", ""), urlsave)
|
||||
Next
|
||||
ObjContratos.Commit()
|
||||
Alert("se guardo Correctamente")
|
||||
@@ -226,8 +298,84 @@ Partial Class Contratos_ContratoAvance
|
||||
ObjContratos.Dispose()
|
||||
CargaddlAvance()
|
||||
CargaDatosAvance()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region "ESTIMACION"
|
||||
|
||||
|
||||
Private Sub CargaAvancesParaEstimar()
|
||||
|
||||
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
Dim DTEstimaciones As New DataTable
|
||||
|
||||
|
||||
If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DTEstimaciones = ObjContratos.DtResultados
|
||||
BtnGuardarEstimacion.Visible = True
|
||||
Else
|
||||
BtnGuardarEstimacion.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
ObjContratos.Dispose()
|
||||
|
||||
|
||||
If DTEstimaciones.Rows.Count > 0 Then
|
||||
GvEstimaciones.DataSource = DTEstimaciones
|
||||
Else
|
||||
GvEstimaciones.DataSource = Nothing
|
||||
End If
|
||||
GvEstimaciones.DataBind()
|
||||
|
||||
UpEstimaciones.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click
|
||||
|
||||
CargaAvancesParaEstimar()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
|
||||
|
||||
|
||||
If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then
|
||||
If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
Else
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
End If
|
||||
Else
|
||||
e.Row.CssClass = "SubTotales3"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click
|
||||
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
|
||||
|
||||
|
||||
ObjContratos.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -157,8 +157,30 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpAccionesPresupuestos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkModalAddPSVentas" Visible="false" runat="server" OnClick="LnkModalAddPSVentas_Click"> <i class="fa fa-plus" style="font-weight:bold;" ></i>Agregar PS Venta</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkModalAddPSControl" Visible="false" runat="server" OnClick="LnkModalAddPSControl_Click"> <i class="fa fa-plus" style="font-weight:bold;"></i>Agregar PS Control</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkModalAddPresupuestoVentas" Visible="false" runat="server" OnClick="LnkModalAddPresupuestoVentas_Click"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i>Agregar Presupuesto Venta</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkModalAddPresupuestoControl" Visible="false" runat="server" OnClick="LnkModalAddPresupuestoControl_Click"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i>Agregar Presupuesto Control</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
@@ -890,71 +912,10 @@
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}');sumagvx();", Gv.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
<table class="table Widthall">
|
||||
<tr class="Titulos">
|
||||
<td runat="server" id="thOcCliente" style="width: 75px">
|
||||
<asp:Literal Text="OC <br/> Cliente" ID="tdOC" runat="server" />
|
||||
</td>
|
||||
<td style="width: 150px">Cantidad</td>
|
||||
<td runat="server" id="thLimitar" style="width: 75px">
|
||||
<asp:Literal Text="Limitar" runat="server" ID="tdLimitar" /></td>
|
||||
<td runat="server" id="thNoIdentificacionv" style="width: 75px">
|
||||
<asp:Literal Text="Clave Interna Cliente" ID="tdCveInterna" runat="server" /></td>
|
||||
<td style="width: 400px">Producto/Servicio</td>
|
||||
<td style="width: 100px">U. M.</td>
|
||||
<td style="width: 150px" runat="server" id="TDObservacion" visible="false">Observación</td>
|
||||
<td style="width: 150px">Precio Unitario</td>
|
||||
<td style="width: 150px">Total</td>
|
||||
<td style="width: 150px" id="THAvance" runat="server" visible="false">Permite Avance</td>
|
||||
<%-- <td style="width: 150px" id="tdCol7" runat="server">Permite Estimación </td>--%>
|
||||
<td style="width: 100px">Comandos</td>
|
||||
</tr>
|
||||
<tr class="Titulos">
|
||||
<td runat="server" id="tdOcCliente">
|
||||
<asp:TextBox ID="TxtOCInterna" runat="server" MaxLength="15" Width="70px"></asp:TextBox>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Width="70px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="CVECantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td runat="server" id="tdLimitar2">
|
||||
<asp:CheckBox ID="ChkLimitarVenta" runat="server" />
|
||||
</td>
|
||||
<td runat="server" id="tdNoIdentificacionv">
|
||||
<asp:TextBox ID="TxtNoIdentificacionv" runat="server" MaxLength="15" Width="70px"></asp:TextBox>
|
||||
</td>
|
||||
<td>
|
||||
<div style="max-width: 550px;">
|
||||
<asp:DropDownList ID="DdlClasificacionAdd" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;"></asp:DropDownList>
|
||||
<br />
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProductows" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlUM" runat="server" AutoPostBack="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</td>
|
||||
|
||||
<td runat="server" id="tdObservaciones" visible="false">
|
||||
<asp:TextBox ID="TxtObservacionesDetalles" runat="server" Width="100px"></asp:TextBox>
|
||||
</td>
|
||||
|
||||
<td style="width: 75px">
|
||||
<asp:TextBox ID="TxtPU" runat="server" Width="70px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVPU" runat="server" ControlToValidate="TxtPU" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''P.U.''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="CVEPU" runat="server" HighlightCssClass="vco" TargetControlID="RFVPU" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td></td>
|
||||
<td id="TDAvance" runat="server" visible="false"></td>
|
||||
<td>
|
||||
<asp:Button Text="Agregar" runat="server" ID="BtnAgregarDetalle" Width="100px" OnClick="BtnAgregarDetalle_Click" ValidationGroup="GrpAgregar" class="btn btn-default" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
</ContentTemplate>
|
||||
@@ -965,122 +926,139 @@
|
||||
<asp:UpdatePanel ID="UpGV" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="Gv" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Conceptos" DataKeyNames="CveContratoDetalle,CveUM, CvePS, Cantidad, PU,CveTipoPresupuesto,CveClasificacion" ShowHeader="true" SelectedRowStyle-BackColor="#66CCFF" CssClass="table table-striped table-hover Widthall mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="OC <br/> Cliente">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LbOCInternaEdit" Text='<%# Eval("OCInterna")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtOCInternaEdit" MaxLength="15" runat="server" Text='<%# Eval("OCInterna") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtCantidad" Text='<%# Eval("CantidadContratada")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("CantidadContratada") %>' Width="90px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Limitar">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblLimitar" Text='<%# If(Eval("LimitarCantidad").ToString = "True", "Si", "No")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkLimitarCantidad" runat="server" Checked='<%# Eval("LimitarCantidad").ToString%>'></asp:CheckBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Clave <br/> Interna <br/> Cliente">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblNoIdentificacion" Text='<%# Eval("NoIdentificacion")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtNoIdentificacion" MaxLength="15" runat="server" Text='<%# Eval("NoIdentificacion") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="400px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="U.M.">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtUM" Text='<%# Eval("UM")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlUMEdit" runat="server" AutoPostBack="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="table-group-action-input form-control input-inline input-small input-sm" Style="width: 75px !important;"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="100px" />
|
||||
</asp:TemplateField>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="Gv" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Conceptos"
|
||||
DataKeyNames="CveContratoDetalle,CveUM, CvePS, Cantidad, PU,CveTipoPresupuesto,CveClasificacion,CodigoPS,LimitarCantidad,PS,OCInterna,NoIdentificacion,PermitirAvance"
|
||||
ShowHeader="true" SelectedRowStyle-BackColor="#66CCFF" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="OC <br/> Cliente">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LbOCInternaEdit" Text='<%# Eval("OCInterna")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtOCInternaEdit" MaxLength="15" runat="server" Text='<%# Eval("OCInterna") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtCantidad" Text='<%# Eval("CantidadContratada")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("CantidadContratada") %>' Width="90px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Limitar">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblLimitar" Text='<%# If(Eval("LimitarCantidad").ToString = "True", "Si", "No")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkLimitarCantidad" runat="server" Checked='<%# Eval("LimitarCantidad").ToString%>'></asp:CheckBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Clave Int. Cliente">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblNoIdentificacion" Text='<%# Eval("NoIdentificacion")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtNoIdentificacion" MaxLength="15" runat="server" Text='<%# Eval("NoIdentificacion") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="400px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="U.M.">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtUM" Text='<%# Eval("UM")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlUMEdit" runat="server" AutoPostBack="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="table-group-action-input form-control input-inline input-small input-sm" Style="width: 75px !important;"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="100px" />
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Observacion" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblObservacion" Text='<%# Eval("Observacion")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtObservacion" runat="server" Text='<%# Eval("Observacion") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Observacion" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblObservacion" Text='<%# Eval("Observacion")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtObservacion" runat="server" Text='<%# Eval("Observacion") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Precio Unitario">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPU" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtPU" runat="server" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' Width="90px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderPU" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtTotal" CssClass="ltltotalgvx" data-value='<%# Eval("Total")%>' Text='<%# Eval("Total", "{0:###,###,##0.00##}")%>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Avance" Visible="True">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton runat="server" ID="LnkHabilitaAvance" Text= "" OnClick="LnkHabilitaAvance_Click" Enabled="false"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Habilitar el avance?" data-btn-ok-label="si" ></asp:LinkButton>
|
||||
|
||||
<asp:TemplateField HeaderText="Precio Unitario">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPU" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtPU" runat="server" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' Width="90px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderPU" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtTotal" CssClass="ltltotalgvx" data-value='<%# Eval("Total")%>' Text='<%# Eval("Total", "{0:###,###,##0.00##}")%>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Avance" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="CHKPAvance" Enabled="false" AutoPostBack="true" OnCheckedChanged="AvaClick" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="Estimacion">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="CHKPEstimacion" Enabled="false" AutoPostBack="true" OnCheckedChanged="EstClick" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<div style="width: 65px;">
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" /><asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<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 el concepto?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:CheckBox ID="CHKPAvance" Enabled="True" Visible="false" AutoPostBack="true" OnCheckedChanged="AvaClick" runat="server" />
|
||||
|
||||
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditarPresupuestoVentaDetalle" OnClick="LnkEditarPresupuestoVentaDetalle_Click" runat="server" AlternateText="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%-- <asp:TemplateField HeaderText="Editar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<div style="width: 65px;">
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" /><asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<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 el concepto?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<table class="table Widthall">
|
||||
@@ -1117,10 +1095,10 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabPVInsumos" runat="server" HeaderText="Suministros">
|
||||
<ajax:TabPanel ID="TabPVInsumos" runat="server" HeaderText="Control">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpTitulosInsumos" runat="server" UpdateMode="Conditional">
|
||||
<%-- <asp:UpdatePanel ID="UpTitulosInsumos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:Panel ID="PanelContratosInsumos" runat="server">
|
||||
@@ -1140,7 +1118,7 @@
|
||||
<td style="width: 150px">Precio Unitario</td>
|
||||
<td style="width: 150px">Total</td>
|
||||
<td style="width: 150px" id="THAvanceInsumos" runat="server" visible="false">Permite Avance</td>
|
||||
<%-- <td style="width: 150px" id="tdCol7" runat="server">Permite Estimación </td>--%>
|
||||
|
||||
<td style="width: 100px">Comandos</td>
|
||||
</tr>
|
||||
<tr class="Titulos">
|
||||
@@ -1180,109 +1158,126 @@
|
||||
</asp:Panel>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:UpdatePanel>--%>
|
||||
|
||||
|
||||
|
||||
<div class="row col-md-12" align="right">
|
||||
<input type="text" id="TxtBusqueda3" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}');sumagvx();", GvInsumos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}');sumagvx();", GvInsumos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel ID="UpGVInsumos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvInsumos" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Conceptos" DataKeyNames="CveContratoDetalle,CveUM, CvePS, Cantidad, PU,CveTipoPresupuesto,CveClasificacion" ShowHeader="true" SelectedRowStyle-BackColor="#66CCFF" CssClass="table table-striped table-hover Widthall mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtCantidad" Text='<%# Eval("CantidadContratada")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("CantidadContratada") %>' Width="90px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Limitar">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblLimitar" Text='<%# If(Eval("LimitarCantidad").ToString = "True", "Si", "No")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkLimitarCantidad" runat="server" Checked='<%# Eval("LimitarCantidad").ToString%>'></asp:CheckBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Clave <br/> Interna">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblNoIdentificacion" Text='<%# Eval("NoIdentificacion")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtNoIdentificacion" MaxLength="15" runat="server" Text='<%# Eval("NoIdentificacion") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="400px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="U.M.">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtUM" Text='<%# Eval("UM")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlUMEdit" runat="server" AutoPostBack="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="table-group-action-input form-control input-inline input-small input-sm" Style="width: 75px !important;"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="100px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Precio Unitario">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPU" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtPU" runat="server" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' Width="90px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderPU" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:GridView ID="GvInsumos" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Conceptos"
|
||||
DataKeyNames="CveContratoDetalle,CveUM, CvePS, Cantidad, PU,CveTipoPresupuesto,CveClasificacion,CodigoPS,LimitarCantidad,PS,NoIdentificacion" ShowHeader="true" SelectedRowStyle-BackColor="#66CCFF"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtTotal" CssClass="ltltotalgvx2" data-value='<%# Eval("Total")%>' Text='<%# Eval("Total", "{0:###,###,##0.00##}")%>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtCantidad" Text='<%# Eval("CantidadContratada")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("CantidadContratada") %>' Width="90px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Limitar">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblLimitar" Text='<%# If(Eval("LimitarCantidad").ToString = "True", "Si", "No")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkLimitarCantidad" runat="server" Checked='<%# Eval("LimitarCantidad").ToString%>'></asp:CheckBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Clave <br/> Interna">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblNoIdentificacion" Text='<%# Eval("NoIdentificacion")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtNoIdentificacion" MaxLength="15" runat="server" Text='<%# Eval("NoIdentificacion") %>' Width="70px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="400px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="U.M.">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtUM" Text='<%# Eval("UM")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlUMEdit" runat="server" AutoPostBack="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="table-group-action-input form-control input-inline input-small input-sm" Style="width: 75px !important;"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="100px" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Precio Unitario">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPU" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtPU" runat="server" Text='<%# Eval("PU", "{0:###,###,##0.00##}")%>' Width="90px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtenderPU" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</EditItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Avance" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="CHKPAvance" Enabled="false" AutoPostBack="true" OnCheckedChanged="AvaClick" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="Estimacion">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="CHKPEstimacion" Enabled="false" AutoPostBack="true" OnCheckedChanged="EstClick" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<div style="width: 65px;">
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" /><asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<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 el concepto?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtTotal" CssClass="ltltotalgvx2" data-value='<%# Eval("Total")%>' Text='<%# Eval("Total", "{0:###,###,##0.00##}")%>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Avance" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="CHKPAvance" Enabled="false" AutoPostBack="true" OnCheckedChanged="AvaClick" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditarPresupuestoControlDetalle" OnClick="LnkEditarPresupuestoControlDetalle_Click" runat="server" AlternateText="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<%-- <asp:TemplateField HeaderText="Editar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<div style="width: 65px;">
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" /><asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
|
||||
<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 el concepto?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table Widthall">
|
||||
<tr class="Titulos">
|
||||
@@ -2233,6 +2228,7 @@
|
||||
|
||||
|
||||
<%--MODAL UPLOAD--%>
|
||||
|
||||
<div id="ModalUpload" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
@@ -2449,13 +2445,6 @@
|
||||
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="position: relative;">
|
||||
<div class="row ">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-5" style="position: relative; margin-left: 10px!important">
|
||||
<asp:TextBox ID="txtFechaI4" Style="margin-top: 10px!important" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
|
||||
@@ -2519,6 +2508,222 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%-- Modal Ventas presupuestos Agregar--%>
|
||||
<div id="ModalVentasAddPS" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalVentasAddPS" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlModalVentasPSTitulo" runat="server"></asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtOCInterna" CssClass="form-control" runat="server" MaxLength="100" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtOCInterna.ClientID.ToString()%>">OC:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSVentas"> </asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCantidad.ClientID.ToString()%>">Cantidad:</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkLimitarVenta" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkLimitarVenta.ClientID.ToString()%>">Limitar:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNoIdentificacionv" runat="server" MaxLength="15" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtNoIdentificacionv.ClientID.ToString()%>">Clave Interna Cliente:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlClasificacionAdd" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;"></asp:DropDownList>
|
||||
<label for="<%= DdlClasificacionAdd.ClientID.ToString()%>">Clasificación:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProductows" CssStyle="width: 100%;" CssClassDdl="form-control select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
<label for="<%= DdlProductows.ClientID.ToString()%>">Producto:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUM" runat="server" AutoPostBack="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control select2me" ></asp:DropDownList>
|
||||
<label for="<%= DdlUM.ClientID.ToString()%>">U. M.:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPU" runat="server" Width="70px" CssClass="form-control"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVPU" runat="server" ControlToValidate="TxtPU" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''P.U.''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSVentas"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtPU.ClientID.ToString()%>">P.U.:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="text-align:right!important">
|
||||
<asp:CheckBox ID="ChkContinualAgregandoVentas" runat="server" TextAlign="Left" Text="Continuar agregando" CssClass="form-control" Checked="true" />
|
||||
</div>
|
||||
<br />
|
||||
<td id="TDAvance" runat="server" visible="false"></td>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<asp:Button Text="Guardar" runat="server" ID="BtnAgregarDetalle" Width="100px" OnClick="BtnAgregarDetalle_Click" ValidationGroup="GrpAddPSVentas" class="btn btn-success" /></td>
|
||||
<button id="Button5" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%--MODAL CONTROL PRESUPUESTOS AGREGAR--%>
|
||||
<div id="ModalControlAddPS" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalControlAddPS" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlModalControlPSTitulo" runat="server"></asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCantidadInsumos" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FETxtCantidadInsumos" runat="server" TargetControlID="TxtCantidadInsumos" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVTxtCantidadInsumos" runat="server" ControlToValidate="TxtCantidadInsumos" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSControl"> </asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCantidadInsumos.ClientID.ToString()%>">Cantidad:</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkLimitarInsumos" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkLimitarInsumos.ClientID.ToString()%>">Limitar:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNoIdentificacionvInsumos" runat="server" MaxLength="15" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtNoIdentificacionvInsumos.ClientID.ToString()%>">Clave Interna:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlClasificacionAddInsumos" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="table-group-action-input form-control input-inline input-sm select2me" Style="width: 100%;"></asp:DropDownList>
|
||||
<label for="<%= DdlClasificacionAddInsumos.ClientID.ToString()%>">Clasificación:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= DdlProductowsInsumos.ClientID.ToString()%>">Producto:</label>
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProductowsInsumos" CssStyle="width: 100%;" CssClassDdl="form-control select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUMInsumos" runat="server" AutoPostBack="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control select2me" ></asp:DropDownList>
|
||||
<label for="<%= DdlUMInsumos.ClientID.ToString()%>">U. M.:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPUInsumos" runat="server" Width="70px" CssClass="form-control"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FETxtPUInsumos" runat="server" TargetControlID="TxtPUInsumos" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVTxtPUInsumos" runat="server" ControlToValidate="TxtPUInsumos" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''P.U.''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddPSControl"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtPUInsumos.ClientID.ToString()%>">P.U.:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="text-align:right!important">
|
||||
<asp:CheckBox ID="ChkContinualAgregandoControl" runat="server" TextAlign="Left" Text="Continuar agregando" CssClass="form-control" Checked="true" />
|
||||
</div>
|
||||
<br />
|
||||
<td id="TD1" runat="server" visible="false"></td>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:Button Text="Guardar" runat="server" ID="BtnAgregarDetalleInsumos" Width="100px" OnClick="BtnAgregarDetalleInsumos_Click" ValidationGroup="GrpAddPSControl" class="btn btn-success" />
|
||||
<button id="Button4" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%--Modal Carga Presupuesto--%>
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModalCargaPresupuesto">
|
||||
<ContentTemplate>
|
||||
|
||||
<div id="ModalUploadPresupuesto" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title"><asp:Label runat="server" ID="LnlModalcargaPresupuestoTitulo"></asp:Label></h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:TextBox ID="TxtModalCargaPresupuesto" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:Button ID="BtnCargaPresupuesto" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnCargaPresupuesto_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<iframe id="my_iframe" style="display: none;"></iframe>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -394,7 +394,17 @@ Partial Class Contratos_ContratoObra
|
||||
'Configuración de Modalidad Update
|
||||
BtnGuardar.Text = "Guardar Cambios"
|
||||
|
||||
If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then TAB.ActiveTabIndex = Request("Opt").ToEntero
|
||||
If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero
|
||||
|
||||
If CveContrato > 0 Then
|
||||
|
||||
LnkModalAddPSVentas.Visible = True
|
||||
LnkModalAddPSControl.Visible = True
|
||||
LnkModalAddPresupuestoVentas.Visible = True
|
||||
LnkModalAddPresupuestoControl.Visible = True
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
'Configuración de Modalidad Insert
|
||||
LblFechaCaptura.Text = Now.ToShortDateString()
|
||||
@@ -914,9 +924,10 @@ Partial Class Contratos_ContratoObra
|
||||
#Region " CARGA DATOS "
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
Dim Ruta = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\"
|
||||
'DivTipoContrato.Visible = False
|
||||
|
||||
Dim Ruta = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\"
|
||||
'DivTipoContrato.Visible = False
|
||||
|
||||
|
||||
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
If ObjContratos.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
@@ -1001,30 +1012,30 @@ Partial Class Contratos_ContratoObra
|
||||
TabPVInsumos.Visible = False
|
||||
RowEstatus.Visible = False
|
||||
TabPres.HeaderText = "Partidas"
|
||||
thOcCliente.Style.Add("display", "none")
|
||||
tdOcCliente.Style.Add("display", "none")
|
||||
thNoIdentificacionv.Style.Add("display", "none")
|
||||
thLimitar.Style.Add("display", "none")
|
||||
tdLimitar2.Style.Add("display", "none")
|
||||
tdNoIdentificacionv.Style.Add("display", "none")
|
||||
'thOcCliente.Style.Add("display", "none")
|
||||
'tdOcCliente.Style.Add("display", "none")
|
||||
'thNoIdentificacionv.Style.Add("display", "none")
|
||||
'thLimitar.Style.Add("display", "none")
|
||||
'tdLimitar2.Style.Add("display", "none")
|
||||
'tdNoIdentificacionv.Style.Add("display", "none")
|
||||
'RowFlexible.Visible = False
|
||||
TableDatosCabecera.Visible = False
|
||||
TabAvanveDocumento.Visible = False
|
||||
TabSistema.Visible = False
|
||||
'RowPorcentajeComision.Visible = False
|
||||
TabContratosGastos.Visible = False
|
||||
tdCveInterna.Text = ""
|
||||
tdLimitar.Text = ""
|
||||
tdOC.Text = ""
|
||||
THAvance.Visible = False
|
||||
THAvance.Style.Add("display", "none")
|
||||
'tdCveInterna.Text = ""
|
||||
'tdLimitar.Text = ""
|
||||
'tdOC.Text = ""
|
||||
'THAvance.Visible = False
|
||||
'THAvance.Style.Add("display", "none")
|
||||
TDAvance.Style.Add("display", "none")
|
||||
TxtOCInterna.Visible = False
|
||||
TxtNoIdentificacionv.Visible = False
|
||||
ChkLimitarVenta.Visible = False
|
||||
DvObservaciones.Visible = True
|
||||
TDObservacion.Visible = True
|
||||
tdObservaciones.Visible = True
|
||||
'TDObservacion.Visible = True
|
||||
'tdObservaciones.Visible = True
|
||||
TxtObservaciones.Text = ObjContratos.DtResultados.Rows(0)("Observaciones").ToString
|
||||
Gv.Columns(6).Visible = True
|
||||
'DdlPeriodo.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CvePeriodo").ToString)
|
||||
@@ -1768,6 +1779,9 @@ Partial Class Contratos_ContratoObra
|
||||
DdlProductows.SelectedText = "Seleccione"
|
||||
DdlProductows.SelectedValue = "-1"
|
||||
End If
|
||||
|
||||
UpModalVentasAddPS.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPSInsumos()
|
||||
@@ -1852,53 +1866,123 @@ Partial Class Contratos_ContratoObra
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarDetalle_Click(sender As Object, e As EventArgs)
|
||||
Dim Row As DataRow = TmpDT.NewRow()
|
||||
Row("Cantidad") = TxtCantidad.Text.ToDouble.FormatoNumero
|
||||
Row("CantidadContratada") = TxtCantidad.Text.ToDouble.FormatoNumero
|
||||
Row("CveUM") = DdlUM.SelectedValue.ToEntero
|
||||
Row("UM") = DdlUM.SelectedItem
|
||||
Row("CveClasificacion") = DdlClasificacionAdd.SelectedValue
|
||||
Row("Clasificacion") = DdlClasificacionAdd.SelectedItem
|
||||
Row("CvePS") = DdlProductows.SelectedValue.ToEntero
|
||||
Row("PS") = DdlProductows.SelectedText
|
||||
Row("CodigoPS") = DdlProductows.SelectedText
|
||||
Row("PU") = TxtPU.Text.ToDouble.FormatoNumero
|
||||
Row("Total") = (TxtCantidad.Text.ToDouble * TxtPU.Text.ToDouble).FormatoNumero
|
||||
Row("CveTipoPresupuesto") = 2
|
||||
Row("NoIdentificacion") = TxtNoIdentificacionv.Text.Trim
|
||||
Row("OCInterna") = TxtOCInterna.Text.Trim
|
||||
Row("LimitarCantidad") = If(ChkLimitarVenta.Checked, 1, 0)
|
||||
Row("Observacion") = TxtObservacionesDetalles.Text
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then
|
||||
If Autorizado Then
|
||||
Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
|
||||
guardarBitacora(msj)
|
||||
End If
|
||||
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
||||
TmpDT.Rows.Add(Row)
|
||||
TmpDT.AcceptChanges()
|
||||
Dim TotalRow = Row("Total").ToString.ToDouble
|
||||
|
||||
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
|
||||
|
||||
UpGV.Update()
|
||||
TxtCantidad.Text = ""
|
||||
TxtOCInterna.Text = ""
|
||||
TxtNoIdentificacionv.Text = ""
|
||||
TxtObservacionesDetalles.Text = ""
|
||||
TxtPU.Text = ""
|
||||
DdlClasificacionAdd.SelectedValue = "-1"
|
||||
LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
|
||||
LblImporte.Text = LbTotalGeneral.Text
|
||||
TxtCantidad.Focus()
|
||||
UpGral.Update()
|
||||
Else
|
||||
Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
If CveContratoDetalleEditar = -1 Then
|
||||
|
||||
Dim Row As DataRow = TmpDT.NewRow()
|
||||
Row("Cantidad") = TxtCantidad.Text.ToDouble.FormatoNumero
|
||||
Row("CantidadContratada") = TxtCantidad.Text.ToDouble.FormatoNumero
|
||||
Row("CveUM") = DdlUM.SelectedValue.ToEntero
|
||||
Row("UM") = DdlUM.SelectedItem
|
||||
Row("CveClasificacion") = DdlClasificacionAdd.SelectedValue
|
||||
Row("Clasificacion") = DdlClasificacionAdd.SelectedItem
|
||||
Row("CvePS") = DdlProductows.SelectedValue.ToEntero
|
||||
Row("PS") = DdlProductows.SelectedText
|
||||
Row("CodigoPS") = DdlProductows.SelectedText
|
||||
Row("PU") = TxtPU.Text.ToDouble.FormatoNumero
|
||||
Row("Total") = (TxtCantidad.Text.ToDouble * TxtPU.Text.ToDouble).FormatoNumero
|
||||
Row("CveTipoPresupuesto") = 2
|
||||
Row("NoIdentificacion") = TxtNoIdentificacionv.Text.Trim
|
||||
Row("OCInterna") = TxtOCInterna.Text.Trim
|
||||
Row("LimitarCantidad") = If(ChkLimitarVenta.Checked, 1, 0)
|
||||
Row("Observacion") = "" 'TxtObservacionesDetalles.Text
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
|
||||
If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then
|
||||
|
||||
If Autorizado Then
|
||||
Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
|
||||
guardarBitacora(msj)
|
||||
End If
|
||||
|
||||
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
||||
TmpDT.Rows.Add(Row)
|
||||
TmpDT.AcceptChanges()
|
||||
Dim TotalRow = Row("Total").ToString.ToDouble
|
||||
|
||||
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
|
||||
|
||||
UpGV.Update()
|
||||
LimpiarModalVentas()
|
||||
|
||||
LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
|
||||
LblImporte.Text = LbTotalGeneral.Text
|
||||
TxtCantidad.Focus()
|
||||
UpGral.Update()
|
||||
|
||||
|
||||
If Not ChkContinualAgregandoVentas.Checked Then
|
||||
RegistraScript("$('#ModalVentasAddPS').modal('hide')")
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
Else
|
||||
|
||||
|
||||
Dim Cantidad, PU As Double : Dim CvePS, CveUM As Integer
|
||||
Dim NoIdentificacion As String = ""
|
||||
Dim OCInterna As String = ""
|
||||
Dim LimitarCantidad As Boolean
|
||||
Dim Observaciones As String = ""
|
||||
|
||||
Cantidad = TxtCantidad.Text.ToDouble
|
||||
PU = TxtPU.Text.ToDouble
|
||||
CvePS = DdlProductows.SelectedValue.ToEntero
|
||||
CveUM = DdlUM.SelectedValue.ToEntero
|
||||
NoIdentificacion = TxtNoIdentificacionv.Text.Trim
|
||||
OCInterna = TxtOCInterna.Text.Trim
|
||||
LimitarCantidad = If(ChkLimitarVenta.Checked, True, False)
|
||||
Observaciones = ""
|
||||
|
||||
Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0)
|
||||
Dim LimitarCantidadValidator As Boolean = row("LimitarCantidad").ToString = "True"
|
||||
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, LimitarCantidad, OCInterna, Observaciones) Then
|
||||
|
||||
If Autorizado Then
|
||||
Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}",
|
||||
row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU)
|
||||
guardarBitacora(msj)
|
||||
End If
|
||||
|
||||
row("Cantidad") = Cantidad
|
||||
row("CantidadContratada") = Cantidad
|
||||
row("PU") = PU
|
||||
row("Total") = Cantidad * PU
|
||||
row("CveUM") = CveUM
|
||||
row("UM") = DdlUM.SelectedItem.Text
|
||||
row("NoIdentificacion") = NoIdentificacion
|
||||
row("OCInterna") = OCInterna
|
||||
row("LimitarCantidad") = LimitarCantidad
|
||||
row("Observacion") = Observaciones
|
||||
|
||||
TmpDT.AcceptChanges()
|
||||
Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion)
|
||||
RegistraScript("$('#ModalVentasAddPS').modal('hide')")
|
||||
Else
|
||||
Alert("Error al Actualizar Detalle", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
|
||||
|
||||
Gv.EditIndex = -1
|
||||
LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero
|
||||
LblImporte.Text = LbTotalGeneral.Text
|
||||
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosPresup()
|
||||
@@ -1959,12 +2043,14 @@ Partial Class Contratos_ContratoObra
|
||||
End Sub
|
||||
Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles Gv.RowDataBound
|
||||
|
||||
If e.Row.RowIndex > -1 Then
|
||||
|
||||
e.Row.FCCheckBox("CHKPAvance").Visible = Autorizado
|
||||
'e.Row.FCCheckBox("CHKPEstimacion").Visible = Autorizado
|
||||
If e.Row.RowIndex > -1 Then
|
||||
|
||||
Dim LnkHabilitaAvance As LinkButton = e.Row.FCLinkButton("LnkHabilitaAvance")
|
||||
' e.Row.FCCheckBox("CHKPAvance").Visible = Autorizado
|
||||
'e.Row.FCCheckBox("CHKPEstimacion").Visible = Autorizado
|
||||
If UsuarioActual.TienePermisoProceso(124) Then
|
||||
e.Row.FCCheckBox("CHKPAvance").Enabled = True
|
||||
LnkHabilitaAvance.Enabled = True
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("PermitirAvance").ToString = "1" Then
|
||||
@@ -1982,7 +2068,20 @@ Partial Class Contratos_ContratoObra
|
||||
If CveTipoContrato = 25 Then
|
||||
e.Row.Cells(1).Width = Unit.Pixel(10)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(250)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If e.Row.DBCampo("PermitirAvance").ToString = "1" Then
|
||||
LnkHabilitaAvance.Text = "<i class='fa fa-check-square-o' aria-hidden='true'></i>"
|
||||
LnkHabilitaAvance.Attributes.Add("data-original-title", "¿Deshabilitar avance?")
|
||||
Else
|
||||
LnkHabilitaAvance.Text = "<i class='fa fa-square-o' aria-hidden='true'></i>"
|
||||
LnkHabilitaAvance.Attributes.Add("data-original-title", "¿Habilitar avance?")
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
|
||||
@@ -2069,7 +2168,8 @@ Partial Class Contratos_ContratoObra
|
||||
If ObjContratos.RemoveContratosDetalle(CveContratoDetalle, CveContrato) Then
|
||||
TmpDT.Rows.Remove(DbRow)
|
||||
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
|
||||
LbTotalGeneral.Text = Gv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLabel("LtTotal").Text.ToDouble).ToString.FormatoNumero
|
||||
LbTotalGeneral.Text = Gv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLabel("LtTotal").Text.ToDouble).ToString.FormatoNumero
|
||||
Alert("Detalle eliminado eliminado correctamente.")
|
||||
Else
|
||||
Alert("Ocurrió un error al eliminar el detalle (Producto/Servicio). Por favor vuelva a intentar", TipoMensaje.MsgError)
|
||||
End If
|
||||
@@ -2100,48 +2200,112 @@ Partial Class Contratos_ContratoObra
|
||||
UpGVInsumos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarDetalleInsumos_Click(sender As Object, e As EventArgs)
|
||||
Dim Row As DataRow = TmpDT.NewRow()
|
||||
Row("Cantidad") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero
|
||||
Row("CantidadContratada") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero
|
||||
Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero
|
||||
Row("UM") = DdlUMInsumos.SelectedItem
|
||||
Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue
|
||||
Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem
|
||||
Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero
|
||||
Row("PS") = DdlProductowsInsumos.SelectedText
|
||||
Row("CodigoPS") = DdlProductowsInsumos.SelectedText
|
||||
Row("PU") = TxtPUInsumos.Text.ToDouble.FormatoNumero
|
||||
Row("Total") = (TxtCantidadInsumos.Text.ToDouble * TxtPUInsumos.Text.ToDouble).FormatoNumero
|
||||
Row("CveTipoPresupuesto") = 1
|
||||
Row("NoIdentificacion") = TxtNoIdentificacionvInsumos.Text.Trim
|
||||
Row("LimitarCantidad") = If(ChkLimitar.Checked, 1, 0)
|
||||
Protected Sub BtnAgregarDetalleInsumos_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If CveContratoDetalleEditar = -1 Then
|
||||
|
||||
Dim Row As DataRow = TmpDT.NewRow()
|
||||
Row("Cantidad") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero
|
||||
Row("CantidadContratada") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero
|
||||
Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero
|
||||
Row("UM") = DdlUMInsumos.SelectedItem
|
||||
Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue
|
||||
Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem
|
||||
Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero
|
||||
Row("PS") = DdlProductowsInsumos.SelectedText
|
||||
Row("CodigoPS") = DdlProductowsInsumos.SelectedText
|
||||
Row("PU") = TxtPUInsumos.Text.ToDouble.FormatoNumero
|
||||
Row("Total") = (TxtCantidadInsumos.Text.ToDouble * TxtPUInsumos.Text.ToDouble).FormatoNumero
|
||||
Row("CveTipoPresupuesto") = 1
|
||||
Row("NoIdentificacion") = TxtNoIdentificacionvInsumos.Text.Trim
|
||||
Row("LimitarCantidad") = If(ChkLimitarInsumos.Checked, 1, 0)
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "") Then
|
||||
If Autorizado Then
|
||||
Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
|
||||
guardarBitacora(msj)
|
||||
End If
|
||||
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
||||
TmpDT.Rows.Add(Row)
|
||||
Dim TotalRow = Row("Total").ToString.ToDouble
|
||||
|
||||
CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
|
||||
|
||||
UpGVInsumos.Update()
|
||||
LimpiarModalControl()
|
||||
LbTotalGeneralInsumos.Text = (LbTotalGeneralInsumos.Text.ToDouble + TotalRow).ToString.FormatoNumero
|
||||
'LblImporte.Text = LbTotalGeneral.Text
|
||||
TxtCantidadInsumos.Focus()
|
||||
UpGral.Update()
|
||||
|
||||
|
||||
If Not ChkContinualAgregandoControl.Checked Then
|
||||
RegistraScript("$('#ModalControlAddPS').modal('hide')")
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
|
||||
Else
|
||||
|
||||
Dim Cantidad, PU As Double
|
||||
Dim CvePS, CveUM As Integer
|
||||
Dim NoIdentificacion As String = ""
|
||||
Dim LimitarCantidad As Boolean
|
||||
|
||||
Cantidad = TxtCantidadInsumos.Text.ToDouble
|
||||
PU = TxtPUInsumos.Text.ToDouble
|
||||
CvePS = DdlProductowsInsumos.SelectedValue.ToEntero
|
||||
CveUM = DdlUMInsumos.SelectedValue.ToEntero
|
||||
NoIdentificacion = TxtNoIdentificacionvInsumos.Text.Trim
|
||||
LimitarCantidad = If(ChkLimitarInsumos.Checked, True, False)
|
||||
|
||||
Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0)
|
||||
|
||||
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, LimitarCantidad, "") Then
|
||||
|
||||
If Autorizado Then
|
||||
Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}",
|
||||
row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU)
|
||||
guardarBitacora(msj)
|
||||
End If
|
||||
|
||||
row("Cantidad") = Cantidad
|
||||
row("CantidadContratada") = Cantidad
|
||||
row("PU") = PU
|
||||
row("Total") = Cantidad * PU
|
||||
row("CveUM") = CveUM
|
||||
row("UM") = DdlUMInsumos.SelectedItem.Text
|
||||
row("NoIdentificacion") = NoIdentificacion
|
||||
row("LimitarCantidad") = LimitarCantidad
|
||||
TmpDT.AcceptChanges()
|
||||
Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion)
|
||||
RegistraScript("$('#ModalControlAddPS').modal('hide')")
|
||||
Else
|
||||
Alert("Error al Actualizar Detalle", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
|
||||
GvInsumos.EditIndex = -1
|
||||
LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero
|
||||
CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "") Then
|
||||
If Autorizado Then
|
||||
Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
|
||||
guardarBitacora(msj)
|
||||
End If
|
||||
Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
||||
TmpDT.Rows.Add(Row)
|
||||
Dim TotalRow = Row("Total").ToString.ToDouble
|
||||
|
||||
CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
|
||||
|
||||
UpGVInsumos.Update()
|
||||
TxtCantidadInsumos.Text = ""
|
||||
TxtPUInsumos.Text = ""
|
||||
DdlClasificacionAddInsumos.SelectedValue = "-1"
|
||||
LbTotalGeneralInsumos.Text = (LbTotalGeneralInsumos.Text.ToDouble + TotalRow).ToString.FormatoNumero
|
||||
'LblImporte.Text = LbTotalGeneral.Text
|
||||
TxtCantidadInsumos.Focus()
|
||||
UpGral.Update()
|
||||
Else
|
||||
Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "GV PRESUPUESTOS"
|
||||
@@ -2251,7 +2415,8 @@ Partial Class Contratos_ContratoObra
|
||||
If ObjContratos.RemoveContratosDetalle(CveContratoDetalle, CveContrato) Then
|
||||
TmpDT.Rows.Remove(DbRow)
|
||||
CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
|
||||
LbTotalGeneralInsumos.Text = GvInsumos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLiteral("LtTotal").Text.ToDouble).ToString.FormatoNumero
|
||||
LbTotalGeneralInsumos.Text = GvInsumos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLabel("LtTotal").Text.ToDouble).ToString.FormatoNumero
|
||||
Alert("Detalle eliminado eliminado correctamente.")
|
||||
Else
|
||||
Alert("Ocurrió un error al eliminar el detalle (Producto/Servicio). Por favor vuelva a intentar", TipoMensaje.MsgError)
|
||||
End If
|
||||
@@ -2284,7 +2449,7 @@ Partial Class Contratos_ContratoObra
|
||||
Row("Total") = (TxtCantidadInt.Text.ToDouble * TxtPUInt.Text.ToDouble).FormatoNumero
|
||||
Row("CveTipoPresupuesto") = 1
|
||||
Row("NoIdentificacion") = TxtNoIdentificacionv.Text.Trim
|
||||
Row("LimitarCantidad") = ChkLimitar.Checked
|
||||
Row("LimitarCantidad") = False 'ChkLimitar.Checked <-- Estaba usando un checkbox de un logar muy diferente a donde esta ese formilario, posiblemente se copio codigo y se fue por equivocacion
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Row("LimitarCantidad").ToString.ToEntero = 1, "") Then
|
||||
@@ -4408,8 +4573,505 @@ Partial Class Contratos_ContratoObra
|
||||
|
||||
|
||||
|
||||
Property ModalVentasPSAdd As Boolean
|
||||
Get
|
||||
If ViewState("ModalVentasAdd") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return Boolean.Parse(ViewState("ModalVentasAdd").ToString)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ModalVentasAdd") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property ModalControlPSAdd As Boolean
|
||||
Get
|
||||
If ViewState("ModalControlPSAdd") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return Boolean.Parse(ViewState("ModalControlPSAdd").ToString)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ModalControlPSAdd") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property Carga As Boolean
|
||||
Get
|
||||
If ViewState("ModalControlPSAdd") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return Boolean.Parse(ViewState("ModalControlPSAdd").ToString)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ModalControlPSAdd") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Enum EnumTipoCargaPresupuesto
|
||||
Ventas
|
||||
Control
|
||||
End Enum
|
||||
|
||||
Property TipoCargaPresupuesto As EnumTipoCargaPresupuesto
|
||||
Get
|
||||
If ViewState("TipoCargaPresupuesto") Is Nothing Then
|
||||
Return EnumTipoCargaPresupuesto.Ventas
|
||||
Else
|
||||
Return DirectCast(ViewState("TipoCargaPresupuesto"), EnumTipoCargaPresupuesto)
|
||||
End If
|
||||
End Get
|
||||
Set(value As EnumTipoCargaPresupuesto)
|
||||
ViewState("TipoCargaPresupuesto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property CveContratoDetalleEditar As Integer
|
||||
Get
|
||||
|
||||
If ViewState("CveContratoDetalleEditar") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveContratoDetalleEditar").ToString.ToEntero
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveContratoDetalleEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub LnkModalAddPresupuestoVentas_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LnlModalcargaPresupuestoTitulo.Text = "Carga Presupuesto Ventas"
|
||||
UpModalCargaPresupuesto.Update()
|
||||
RegistraScript("$('#ModalUploadPresupuesto').modal('show')")
|
||||
TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkModalAddPresupuestoControl_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LnlModalcargaPresupuestoTitulo.Text = "Carga Presupuesto Control"
|
||||
UpModalCargaPresupuesto.Update()
|
||||
RegistraScript("$('#ModalUploadPresupuesto').modal('show')")
|
||||
TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Control
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkModalAddPSVentas_Click(sender As Object, e As EventArgs)
|
||||
|
||||
ModalVentasPSAdd = True
|
||||
ChkContinualAgregandoVentas.Visible = True
|
||||
ChkContinualAgregandoVentas.Checked = True
|
||||
LimpiarModalVentas()
|
||||
RegistraScript("$('#ModalVentasAddPS').modal('show')")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkModalAddPSControl_Click(sender As Object, e As EventArgs)
|
||||
|
||||
ModalControlPSAdd = True
|
||||
ChkContinualAgregandoControl.Visible = True
|
||||
ChkContinualAgregandoControl.Checked = True
|
||||
LimpiarModalControl()
|
||||
RegistraScript("$('#ModalControlAddPS').modal('show')")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkEditarPresupuestoVentaDetalle_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
LimpiarModalVentas()
|
||||
|
||||
'CveContratoDetalle,CveUM,CvePS,Cantidad,PU,CveTipoPresupuesto,CveClasificacion,CodigoPS,LimitarCantidad
|
||||
|
||||
CveContratoDetalleEditar = GvRow.DataKey("CveContratoDetalle").ToEntero
|
||||
|
||||
|
||||
TxtOCInterna.Text = GvRow.DataKey("OCInterna")
|
||||
TxtCantidad.Text = GvRow.DataKey("Cantidad").ToDouble.ToString
|
||||
|
||||
ChkLimitarVenta.Checked = Boolean.Parse(GvRow.DataKey("LimitarCantidad"))
|
||||
|
||||
TxtNoIdentificacionv.Text = GvRow.DataKey("NoIdentificacion").ToDouble.ToString
|
||||
DdlClasificacionAdd.SelectedValueExist(GvRow.DataKey("CveClasificacion").ToEntero)
|
||||
|
||||
DdlProductows.txtText.Value = GvRow.DataKey("PS").ToString
|
||||
DdlProductows.txtValue.Value = GvRow.DataKey("CvePS").ToString
|
||||
|
||||
DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
|
||||
DdlUM.DataBind()
|
||||
DdlUM.SelectedValueExist(GvRow.DataKey("CveUM").ToDouble.ToString)
|
||||
|
||||
TxtPU.Text = GvRow.DataKey("PU").ToDouble.ToString
|
||||
|
||||
|
||||
|
||||
ModalVentasPSAdd = False
|
||||
ChkContinualAgregandoVentas.Visible = False
|
||||
ChkContinualAgregandoVentas.Checked = False
|
||||
|
||||
|
||||
RegistraScript("$('#ModalVentasAddPS').modal('show')")
|
||||
End Sub
|
||||
Protected Sub LnkEditarPresupuestoControlDetalle_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
LimpiarModalControl()
|
||||
|
||||
CveContratoDetalleEditar = gvRow.DataKey("CveContratoDetalle").ToEntero
|
||||
|
||||
TxtCantidadInsumos.Text = gvRow.DataKey("Cantidad").ToDouble.ToString
|
||||
ChkLimitarInsumos.Checked = Boolean.Parse(gvRow.DataKey("LimitarCantidad"))
|
||||
TxtNoIdentificacionvInsumos.Text = gvRow.DataKey("NoIdentificacion")
|
||||
|
||||
DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero)
|
||||
|
||||
DdlProductowsInsumos.txtText.Value = gvRow.DataKey("PS").ToString
|
||||
DdlProductowsInsumos.txtValue.Value = gvRow.DataKey("CvePS").ToString
|
||||
|
||||
|
||||
DdlUMInsumos.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductowsInsumos.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
|
||||
DdlUMInsumos.DataBind()
|
||||
DdlUMInsumos.SelectedValueExist(gvRow.DataKey("CveUM").ToDouble.ToString)
|
||||
|
||||
|
||||
|
||||
TxtPUInsumos.Text = gvRow.DataKey("PU").ToDouble.ToString
|
||||
|
||||
|
||||
|
||||
ModalControlPSAdd = False
|
||||
ChkContinualAgregandoControl.Visible = False
|
||||
ChkContinualAgregandoControl.Checked = False
|
||||
|
||||
RegistraScript("$('#ModalControlAddPS').modal('show')")
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub LimpiarModalVentas()
|
||||
|
||||
TxtOCInterna.Text = ""
|
||||
TxtCantidad.Text = ""
|
||||
ChkLimitarVenta.Checked = False
|
||||
TxtNoIdentificacionv.Text = ""
|
||||
DdlClasificacionAdd.SelectedValueExist(-1)
|
||||
DdlProductows.txtText.Value = ""
|
||||
DdlProductows.txtValue.Value = ""
|
||||
DdlUM.SelectedValueExist(-1)
|
||||
TxtPU.Text = ""
|
||||
|
||||
|
||||
If ModalVentasPSAdd = True Then
|
||||
LtlModalVentasPSTitulo.Text = "Agregar Producto Presupuesto de Ventas"
|
||||
Else
|
||||
LtlModalVentasPSTitulo.Text = "Editar Producto Presupuesto de Ventas"
|
||||
End If
|
||||
|
||||
|
||||
UpModalVentasAddPS.Update()
|
||||
|
||||
End Sub
|
||||
Private Sub LimpiarModalControl()
|
||||
|
||||
|
||||
|
||||
TxtCantidadInsumos.Text = ""
|
||||
ChkLimitarInsumos.Checked = False
|
||||
TxtNoIdentificacionvInsumos.Text = ""
|
||||
|
||||
DdlClasificacionAddInsumos.SelectedValueExist(-1)
|
||||
DdlProductowsInsumos.txtText.Value = ""
|
||||
DdlProductowsInsumos.txtValue.Value = ""
|
||||
DdlUMInsumos.SelectedValueExist(-1)
|
||||
TxtPUInsumos.Text = ""
|
||||
|
||||
|
||||
If ModalControlPSAdd = True Then
|
||||
LtlModalControlPSTitulo.Text = "Agregar Producto Presupuesto Control"
|
||||
Else
|
||||
LtlModalControlPSTitulo.Text = "Editar Producto Presupuesto Control"
|
||||
End If
|
||||
|
||||
UpModalControlAddPS.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim DTCargaPresupuesto As New DataTable
|
||||
DTCargaPresupuesto = CargaPreSupuestoExcel()
|
||||
|
||||
If DTCargaPresupuesto.Rows.Count > 0 Then
|
||||
ProcesaDatosCargaPresupuesto(DTCargaPresupuesto)
|
||||
Else
|
||||
Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Function CargaPreSupuestoExcel() As DataTable
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = TxtModalCargaPresupuesto.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
Dim DTPS = New DataTable
|
||||
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
|
||||
|
||||
If Not FileExtension.ToUpper.Contiene("XLSX", "XSL") Then
|
||||
Alert("El archivo no es una archivo de Excel", TipoMensaje.MsgAdvertencia)
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
Dim tempArray() As String
|
||||
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||
SpreadsheetInfo.SetLicense(Extensiones.SerialGemBoxSpreadsheet)
|
||||
Dim workbook = ExcelFile.Load(fileItem.FileUrl)
|
||||
Dim worksheet = workbook.Worksheets(0)
|
||||
DTPS = worksheet.CreateDataTable(New CreateDataTableOptions() With
|
||||
{
|
||||
.ColumnHeaders = True,
|
||||
.StartRow = 0,
|
||||
.NumberOfColumns = 4,
|
||||
.NumberOfRows = worksheet.Rows.Count,
|
||||
.Resolution = ColumnTypeResolution.AutoPreferStringCurrentCulture
|
||||
})
|
||||
|
||||
Next
|
||||
|
||||
TxtModalCargaPresupuesto.Text = ""
|
||||
|
||||
RegistraScript("$('#ModalUploadPresupuesto').modal('hide')")
|
||||
|
||||
UpModalCargaPresupuesto.Update()
|
||||
|
||||
Return DTPS
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable)
|
||||
|
||||
Dim DTPS = New DataTable
|
||||
DTPS.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
DTPS.Columns.Add("Cantidad", GetType(Double))
|
||||
DTPS.Columns.Add("CantidadContratada", GetType(Double))
|
||||
DTPS.Columns.Add("CveUM", GetType(Integer))
|
||||
DTPS.Columns.Add("UM", GetType(String))
|
||||
DTPS.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
DTPS.Columns.Add("Clasificacion", GetType(String))
|
||||
DTPS.Columns.Add("CvePS", GetType(Integer))
|
||||
DTPS.Columns.Add("PS", GetType(String))
|
||||
DTPS.Columns.Add("CodigoPS", GetType(String))
|
||||
DTPS.Columns.Add("PU", GetType(Double))
|
||||
DTPS.Columns.Add("Total", GetType(Double))
|
||||
DTPS.Columns.Add("CveTipoPresupuesto", GetType(Integer))
|
||||
DTPS.Columns.Add("PermitirAvance", GetType(Integer))
|
||||
DTPS.Columns.Add("PermitirEstimacion", GetType(Integer))
|
||||
DTPS.Columns.Add("UsuarioAvance", GetType(Integer))
|
||||
DTPS.Columns.Add("Cantidad_Original", GetType(Double))
|
||||
DTPS.Columns.Add("PU_Original", GetType(Double))
|
||||
DTPS.Columns.Add("Total_Original", GetType(Double))
|
||||
DTPS.Columns.Add("NoIdentificacion", GetType(String))
|
||||
DTPS.Columns.Add("LimitarCantidad", GetType(Integer))
|
||||
DTPS.Columns.Add("OCInterna", GetType(String))
|
||||
DTPS.Columns.Add("Observacion", GetType(String))
|
||||
|
||||
Dim RowNoEncontrados As String = ""
|
||||
|
||||
For Each DrowPS As DataRow In DTPresupuesto.Rows
|
||||
|
||||
|
||||
Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c)
|
||||
Dim CvePS As Integer
|
||||
Dim CveUM As Integer
|
||||
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
End If
|
||||
End If
|
||||
|
||||
If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then
|
||||
|
||||
CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
|
||||
|
||||
Dim Row As DataRow = DTPS.NewRow()
|
||||
Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
|
||||
Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
|
||||
Row("CveUM") = CveUM
|
||||
Row("UM") = ""
|
||||
Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
|
||||
Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString
|
||||
Row("CvePS") = CvePS
|
||||
Row("PS") = DrowPS("PS").ToString
|
||||
Row("CodigoPS") = DrowPS("PS").ToString
|
||||
Row("PU") = DrowPS("PU").ToString.ToDouble
|
||||
Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
|
||||
|
||||
|
||||
Select Case TipoCargaPresupuesto
|
||||
Case EnumTipoCargaPresupuesto.Ventas
|
||||
Row("CveTipoPresupuesto") = 2
|
||||
Exit Select
|
||||
Case EnumTipoCargaPresupuesto.Control
|
||||
Row("CveTipoPresupuesto") = 1
|
||||
Exit Select
|
||||
Case Else
|
||||
Row("CveTipoPresupuesto") = 1
|
||||
End Select
|
||||
|
||||
|
||||
Row("NoIdentificacion") = ""
|
||||
Row("OCInterna") = ""
|
||||
Row("LimitarCantidad") = 0
|
||||
Row("Observacion") = ""
|
||||
|
||||
DTPS.Rows.Add(Row)
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
|
||||
|
||||
Dim ErrorProceso = False
|
||||
Dim ObjContratos As New ClsContratos
|
||||
Dim TotalRow As Double = 0
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
|
||||
For Each Row As DataRow In DTPS.Rows
|
||||
|
||||
If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then
|
||||
|
||||
If Autorizado Then
|
||||
Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
|
||||
guardarBitacora(msj)
|
||||
End If
|
||||
|
||||
Dim NrowTmpDT As DataRow = TmpDT.NewRow
|
||||
|
||||
|
||||
NrowTmpDT("Cantidad") = Row("Cantidad")
|
||||
NrowTmpDT("CantidadContratada") = Row("CantidadContratada")
|
||||
NrowTmpDT("CveUM") = Row("CveUM")
|
||||
NrowTmpDT("UM") = Row("UM")
|
||||
NrowTmpDT("CveClasificacion") = Row("CveClasificacion")
|
||||
NrowTmpDT("Clasificacion") = Row("Clasificacion")
|
||||
NrowTmpDT("CvePS") = Row("CvePS")
|
||||
NrowTmpDT("PS") = Row("PS")
|
||||
NrowTmpDT("CodigoPS") = Row("CodigoPS")
|
||||
NrowTmpDT("PU") = Row("PU")
|
||||
NrowTmpDT("Total") = Row("Total")
|
||||
NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto")
|
||||
NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion")
|
||||
NrowTmpDT("OCInterna") = Row("OCInterna")
|
||||
NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad")
|
||||
NrowTmpDT("Observacion") = Row("Observacion")
|
||||
|
||||
|
||||
NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
||||
|
||||
TmpDT.Rows.Add(NrowTmpDT)
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble
|
||||
Else
|
||||
ErrorProceso = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
If ErrorProceso Then
|
||||
ObjContratos.RollBack()
|
||||
Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError)
|
||||
Else
|
||||
|
||||
ObjContratos.Commit()
|
||||
Alert("Presupuesto Cargado correctamente")
|
||||
|
||||
|
||||
Select Case TipoCargaPresupuesto
|
||||
Case EnumTipoCargaPresupuesto.Ventas
|
||||
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
|
||||
UpGV.Update()
|
||||
Exit Select
|
||||
Case EnumTipoCargaPresupuesto.Control
|
||||
CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
|
||||
UpGVInsumos.Update()
|
||||
Exit Select
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
|
||||
LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
|
||||
LblImporte.Text = LbTotalGeneral.Text
|
||||
UpGral.Update()
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjContratos.Dispose()
|
||||
|
||||
If RowNoEncontrados.Length > 0 Then
|
||||
Alert($"Productos no encontrados <br> {RowNoEncontrados} ")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkHabilitaAvance_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim PermitirAvance As Integer = GvRow.DataKey("PermitirAvance").ToEntero
|
||||
|
||||
'Get the button that raised the event
|
||||
'Dim btn As CheckBox = DirectCast(sender, CheckBox)
|
||||
'Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToString.ToEntero
|
||||
Dim objContrato As New ClsContratos
|
||||
|
||||
If objContrato.UpdateContratosDetalleAvance(CveContratoDetalle, IIf(PermitirAvance = 1, 0, 1).ToString.ToEntero) Then
|
||||
Dim row = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0)
|
||||
|
||||
row("PermitirAvance") = IIf(PermitirAvance = 1, 0, 1).ToString.ToEntero
|
||||
|
||||
|
||||
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
|
||||
|
||||
|
||||
Alert("Se ha permitido levantar avance", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("no se pudo permitir avance", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
objContrato.Dispose()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -195,7 +195,10 @@ Partial Class Contratos_FacturacionMasiva
|
||||
End Sub
|
||||
|
||||
Protected Sub btnConsultar_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
|
||||
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
|
||||
Dim CveContrato As Integer = If(DdlContrato.SelectedValue.ToEntero <= 0, -1, DdlContrato.SelectedValue.ToEntero)
|
||||
Dim CveCliente As Integer = If(DdlCliente.SelectedValue.ToEntero <= 0, -1, DdlCliente.SelectedValue.ToEntero)
|
||||
|
||||
CargaDatos(CveContrato, CveCliente)
|
||||
RegistraScript("$('#ex').removeClass('expand');$('#ex').addClass('collapse');$('.portlet-body').css('display', '');")
|
||||
End Sub
|
||||
|
||||
@@ -232,7 +235,10 @@ Partial Class Contratos_FacturacionMasiva
|
||||
Alert("No se generaron facturas", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
|
||||
Dim CveContrato As Integer = If(DdlContrato.SelectedValue.ToEntero <= 0, -1, DdlContrato.SelectedValue.ToEntero)
|
||||
Dim CveCliente As Integer = If(DdlCliente.SelectedValue.ToEntero <= 0, -1, DdlCliente.SelectedValue.ToEntero)
|
||||
|
||||
CargaDatos(CveContrato, CveCliente)
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
UpBodyEstatus.Update()
|
||||
End Sub
|
||||
@@ -245,6 +251,7 @@ Partial Class Contratos_FacturacionMasiva
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
ViewState("CveCicloComercial") = pCveCicloComercial
|
||||
CreaObjetosVenta()
|
||||
|
||||
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
|
||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||
ObjFactura = Nothing
|
||||
@@ -253,7 +260,7 @@ Partial Class Contratos_FacturacionMasiva
|
||||
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If DTDetalle.Rows.Count > 0 Then
|
||||
If ObjFactura.DtDetalle.Rows.Count > 0 Then
|
||||
|
||||
Resp = ObjFactura.EmitirFactura()
|
||||
|
||||
@@ -468,9 +475,7 @@ Partial Class Contratos_FacturacionMasiva
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
End Sub
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
|
||||
Dim ObjFolios As New ClsGralFolios()
|
||||
Dim Folio As String = ""
|
||||
Dim Serie As String = ""
|
||||
|
||||
Dim CveProyecto As String = ""
|
||||
Dim CveSubProyecto As String = ""
|
||||
Dim Proyecto As String = ""
|
||||
@@ -479,21 +484,21 @@ Partial Class Contratos_FacturacionMasiva
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
ObjFactura.DirectorioServidor = Server.MapPath("/")
|
||||
ObjFactura.CveCicloComercial = CveCicloComercial
|
||||
|
||||
Dim DR As DataRow = DTCicloComercial.FiltroPrimero($"CveCicloComercial = {CveCicloComercial}")
|
||||
|
||||
ObjFactura.Version = "3.3"
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFactura.TipoCambio = 20
|
||||
ObjFactura.TipoCambio = 1
|
||||
ObjFactura.ConvertirPesos = False
|
||||
ObjFactura.CveMoneda = DR("CveMoneda").ToString.ToEntero
|
||||
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
|
||||
ObjFactura.TipoDocto = "Ing"
|
||||
ObjFactura.RefDocto = ""
|
||||
ObjFactura.Folio = Folio.ToEntero
|
||||
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero, -1)
|
||||
ObjFactura.Serie = Serie
|
||||
ObjFactura.Folio = -1
|
||||
ObjFactura.Serie = "-1"
|
||||
ObjFactura.CveMesa = -1
|
||||
ObjFactura.Fecha = DR("FechaVenc").ToString.ToDate
|
||||
ObjFactura.CvePrePoliza = -1
|
||||
@@ -533,18 +538,7 @@ Partial Class Contratos_FacturacionMasiva
|
||||
ObjFactura.CveSubProyectoEjecucion = CveSubProyecto.ToEntero
|
||||
|
||||
|
||||
SubProyecto = DR("SubProyectoContrato").ToString
|
||||
|
||||
|
||||
If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then
|
||||
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format($" Estado = 'Activo' AND CveSubProyecto = {CveSubProyecto} "))
|
||||
If DT.Rows.Count > 0 Then
|
||||
Serie = DT.Rows(0)("Serie").ToString
|
||||
Folio = DT.Rows(0)("FActual").ToString
|
||||
End If
|
||||
DT.Dispose()
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
SubProyecto = DR("SubProyectoContrato").ToString
|
||||
|
||||
Dim objContratos As New ClsContratos
|
||||
If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then
|
||||
@@ -561,8 +555,6 @@ Partial Class Contratos_FacturacionMasiva
|
||||
ObjFactura.RetISR = SUM(DTDetalle, "ImporteRetISR").ToDecimal
|
||||
ObjFactura.IEPS = SUM(DTDetalle, "ImporteIEPS").ToDecimal
|
||||
ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA + ObjFactura.IEPS - (ObjFactura.RetIVA + ObjFactura.RetISR)
|
||||
ObjFactura.Serie = Serie
|
||||
ObjFactura.Folio = Folio.ToEntero
|
||||
|
||||
For Each row As DataRow In DTDetalle.Rows
|
||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
|
||||
|
||||
@@ -1187,6 +1187,77 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Textbox Name="Textbox13">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Usuario Registró:</Value>
|
||||
<Style>
|
||||
<FontStyle>Normal</FontStyle>
|
||||
<FontSize>9pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Right</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox5</rd:DefaultName>
|
||||
<Top>1.62251cm</Top>
|
||||
<Left>0.79137cm</Left>
|
||||
<Height>0.6cm</Height>
|
||||
<Width>2.90426cm</Width>
|
||||
<ZIndex>6</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Textbox Name="Textbox38">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Parameters!UsuarioRegistro.Value</Value>
|
||||
<Style>
|
||||
<FontStyle>Normal</FontStyle>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Left</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox33</rd:DefaultName>
|
||||
<Top>1.62251cm</Top>
|
||||
<Left>3.69563cm</Left>
|
||||
<Height>0.6cm</Height>
|
||||
<Width>5.93606cm</Width>
|
||||
<ZIndex>7</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</ReportItems>
|
||||
<Style>
|
||||
<Border>
|
||||
@@ -1387,6 +1458,12 @@
|
||||
<Nullable>true</Nullable>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="UsuarioRegistro">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
</ReportParameters>
|
||||
<rd:ReportUnitType>Cm</rd:ReportUnitType>
|
||||
<rd:ReportID>e6b08487-acfe-4020-a8f2-f9a54953646f</rd:ReportID>
|
||||
|
||||
@@ -3661,6 +3661,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
GvEntradas.Columns(4).Visible = DtTemp.MAX("Serie") <> ""
|
||||
GvEntradas.Columns(5).Visible = DtTemp.MAX("Lote") <> ""
|
||||
GvEntradas.Columns(6).Visible = DtTemp.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
GvEntradas.Columns(6).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -3773,6 +3774,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
GvSalidas.Columns(3).Visible = DtTemp.MAX("Serie") <> ""
|
||||
GvSalidas.Columns(4).Visible = DtTemp.MAX("Lote") <> ""
|
||||
GvSalidas.Columns(5).Visible = DtTemp.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
GvSalidas.Columns(5).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -4049,6 +4051,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
'activa caducidad
|
||||
ThCaducidadEntrada.Visible = AplicaCaducidad
|
||||
ThCaducidadEntrada.InnerText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
TrCaducidadEntrada.Visible = AplicaCaducidad
|
||||
|
||||
Else
|
||||
@@ -4082,6 +4085,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
'activa caducidad
|
||||
ThCaducidadSalida.Visible = AplicaCaducidad
|
||||
ThCaducidadSalida.InnerText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
TrCaducidadSalida.Visible = AplicaCaducidad
|
||||
|
||||
Else
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Clientes Personal Entrega</span>
|
||||
<span class="caption-subject bold uppercase">PERSONAL AUTORIZADO PARA ENTREGAS EN ALMACÉN:</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
@@ -456,7 +456,7 @@
|
||||
|
||||
<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 Secciones" />
|
||||
<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">
|
||||
@@ -516,7 +516,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control" runat="server" Visible="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="F.Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
@@ -527,7 +527,7 @@
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="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" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Enabled="True" 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>
|
||||
@@ -847,7 +847,7 @@
|
||||
<asp:GridView ID="GvSugerencias" runat="server" EmptyDataText="No se encontraron registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Sección Almacen" DataField="Seccion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
@@ -675,9 +675,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString()
|
||||
Case "Ing", "Ped"
|
||||
Filtro = "CveConcepto IN (3,40)"
|
||||
Case "Dev", "dPe"
|
||||
Case "Dev"
|
||||
'cuand es devolucionventa=1, es cancelación de la devolución
|
||||
If EsDevolucionVenta = 1 Then Filtro = "CveConcepto = 18" Else Filtro = "CveConcepto IN (3,40)"
|
||||
Case "DPe"
|
||||
Filtro = "CveConcepto = 9"
|
||||
Case Else
|
||||
Filtro = "CveConcepto = 9"
|
||||
End Select
|
||||
@@ -847,6 +849,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If AplicaSeccion Then GvDatos.Columns(7).Visible = True
|
||||
If AplicaLote Then GvDatos.Columns(8).Visible = True
|
||||
If AplicaCaducidad Then GvDatos.Columns(9).Visible = True
|
||||
GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
|
||||
End If
|
||||
GvDatos.DataSource = DtDatos
|
||||
@@ -1035,6 +1038,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString() = "True", True, False)
|
||||
End If
|
||||
|
||||
GvSerie.Columns(1).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
|
||||
If AplicaCaducidad Then
|
||||
GvSerie.Columns(1).Visible = True
|
||||
TdCaducidad1.Visible = True
|
||||
@@ -1238,6 +1243,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Private Sub CargaLote(Optional CerrarCompletado As Boolean = False)
|
||||
|
||||
RegistraScript("$('#DivLote').modal('show')")
|
||||
GvLote.Columns(2).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
GvLote.DataSource = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
|
||||
GvLote.DataBind()
|
||||
|
||||
|
||||
@@ -127,6 +127,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkSeries" Visible="false" runat="server"><i class="fa fa-list"></i> Series Disponibles</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkCaducidad" Visible="false" runat="server"><i class="fa fa-list"></i> Caducidad de producto</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#Kardex"> </a>
|
||||
</li>
|
||||
@@ -378,6 +381,11 @@
|
||||
<asp:HyperLink runat="server" Target="_blank" ID="hlFolioD" Text='<%# Eval("FolioDocto")%>' CssClass="Texto" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Left" HeaderText="Folio Rel." Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink runat="server" Target="_blank" ID="hlFolioDr" Text='<%# Eval("FolioRelacionEntrada")%>' NavigateUrl='<%# Eval("CveVentaRelacionada", "/Ventas/Ventas.aspx?CveVenta={0}")%>' CssClass="Texto" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Left" HeaderText="U. M.">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbUm" runat="server" Text='<%# Eval("UnidadMedida")%>' data-toggle="tooltip" title='<%# Eval("CveUnidadMedida")%>'></asp:Label>
|
||||
@@ -538,6 +546,45 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="DivModalCaducidad" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpdatePanel2" UpdateMode="Conditional" RenderMode="Inline" style="width:50%">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal1" Text="Producto con caducidad" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="width:100%">
|
||||
<div style="width:98%;margin-left:1.5%;margin-right:1.5%">
|
||||
<asp:UpdatePanel ID="UpProductoCaducidad" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvProductoCaducidad" Width="98%" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="False" AllowPaging="False"
|
||||
ShowFooter="True" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-advance table-hover ScrollAD" GridLines="None"
|
||||
DataKeyNames="Almacen,Cantidad,FechaCaducidad">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Almacén" DataField="Almacen"/>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Right"/>
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="125px"/>
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="125px"/>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="100px"/>
|
||||
</Columns>
|
||||
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -66,9 +66,9 @@ Partial Class Inventarios_Kardex
|
||||
Private Sub CargaPermisos()
|
||||
If UsuarioActual.CveRol = 1 Then ChkAgruparAlmacen.Visible = True
|
||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||
GvM.Columns(13).Visible = TienePermisoImportes ' costo
|
||||
GvM.Columns(14).Visible = TienePermisoImportes ' importe
|
||||
GvM.Columns(16).Visible = TienePermisoImportes ' valor
|
||||
GvM.Columns(14).Visible = TienePermisoImportes ' costo
|
||||
GvM.Columns(15).Visible = TienePermisoImportes ' importe
|
||||
GvM.Columns(17).Visible = TienePermisoImportes ' valor
|
||||
End Sub
|
||||
|
||||
Private Function isWithFamily() As Boolean
|
||||
@@ -87,7 +87,7 @@ Partial Class Inventarios_Kardex
|
||||
CBLTiposAlmacen.DataSource = GlobalDTTipoAlmacen(-1)
|
||||
CBLTiposAlmacen.DataBind()
|
||||
For Each item As ListItem In CBLTiposAlmacen.Items
|
||||
If item.Text = "Entrega Adelantado" Then
|
||||
If item.Text.Contiene("Entrega Adelantado", "Transitorio") Then
|
||||
item.Selected = False
|
||||
Else
|
||||
item.Selected = True
|
||||
@@ -199,13 +199,24 @@ Partial Class Inventarios_Kardex
|
||||
AplicaSeccion = DtTemp.MAX("SeccionAlmacen") <> ""
|
||||
AplicaLote = DtTemp.MAX("Lote") <> ""
|
||||
AplicaCaducidad = DtTemp.MAX("FechaCaducidad") <> ""
|
||||
If AplicaSeccion Then GvM.Columns(7).Visible = True
|
||||
If AplicaSerie Then GvM.Columns(8).Visible = True
|
||||
If AplicaLote Then GvM.Columns(9).Visible = True
|
||||
If AplicaCaducidad Then GvM.Columns(10).Visible = True
|
||||
|
||||
Dim AuxAplicaSerie As Boolean = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaSerie") = "True"
|
||||
GvM.Columns(6).Visible = DtTemp.MAX("FolioRelacionEntrada") <> ""
|
||||
|
||||
If AplicaSeccion Then GvM.Columns(8).Visible = True
|
||||
If AplicaSerie Then GvM.Columns(9).Visible = True
|
||||
If AplicaLote Then GvM.Columns(10).Visible = True
|
||||
If AplicaCaducidad Then GvM.Columns(11).Visible = True
|
||||
|
||||
Dim Drp As datarow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("")
|
||||
Dim AuxAplicaSerie As Boolean
|
||||
Dim AuxAplicaCad As Boolean
|
||||
If Drp IsNot Nothing Then
|
||||
AuxAplicaSerie = Drp("AplicaSerie").ToString = "True"
|
||||
AuxAplicaCad = Drp("AplicaCaducidad").ToString = "True"
|
||||
End If
|
||||
|
||||
LnkSeries.Visible = AuxAplicaSerie
|
||||
LnkCaducidad.Visible = AuxAplicaCad
|
||||
'CARGA INDICADORES
|
||||
If UsuarioActual.TienePermisoProceso(201) Then
|
||||
DivIndicadores.Visible = True
|
||||
@@ -324,6 +335,25 @@ Partial Class Inventarios_Kardex
|
||||
ObjInventarios.Dispose()
|
||||
GvSeries.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarCaducidadProducto()
|
||||
Dim almacenes As String = ddlAlmacen.GetSelectedValues()
|
||||
If almacenes = "" Then
|
||||
almacenes = "-1"
|
||||
End If
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasCaducidad(ddlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||
GvProductoCaducidad.DataSource = ObjInventarios.DtResultados
|
||||
GvProductoCaducidad.columns(2).visible = ObjInventarios.DtResultados.max("Serie") <> ""
|
||||
GvProductoCaducidad.columns(3).visible = ObjInventarios.DtResultados.max("Lote") <> ""
|
||||
GvProductoCaducidad.columns(4).visible = ObjInventarios.DtResultados.max("FechaCaducidad").todate > minfecha
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
GvProductoCaducidad.DataBind()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " IMPRIMIR "
|
||||
@@ -440,6 +470,12 @@ Partial Class Inventarios_Kardex
|
||||
UpGridSeries.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalSerie"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkCaducidad_OnClick(sender As Object, e As EventArgs) Handles LnkCaducidad.Click
|
||||
CargarCaducidadProducto()
|
||||
UpProductoCaducidad.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalCaducidad"))
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
@@ -200,7 +200,9 @@
|
||||
<asp:Label runat="server" ID="LblProyectado" Text="Incluir Proyectados" class="col-md-1 truncate" />
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyeccionFiltro" runat="server" CssClass="select2me" Width="100%" >
|
||||
<asp:ListItem Text="Si" Value="1" />
|
||||
<asp:ListItem Text="Todos (Entradas/Salidas)" Value="3" />
|
||||
<asp:ListItem Text="Entradas" Value="1" />
|
||||
<asp:ListItem Text="Salidas" Value="2" />
|
||||
<asp:ListItem Text="No" Value="0" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
@@ -272,7 +274,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="row" style="width: 100%; text-align: center">
|
||||
<asp:Label runat="server" ID="LblProyeccionOpcion" />
|
||||
<asp:RadioButtonList ID="RblProyeccionOpcion" runat="server" RepeatDirection="Horizontal" Width="50%" Style="margin: 0 25% 0 25%">
|
||||
<asp:RadioButtonList ID="RblProyeccionOpcion" runat="server" RepeatDirection="Horizontal" Width="50%" Style="margin: 0 25% 0 25%">
|
||||
<asp:ListItem Text="Entrada" Value="1" Selected="True" />
|
||||
<asp:ListItem Text="Salida" Value="2" />
|
||||
</asp:RadioButtonList>
|
||||
|
||||
@@ -396,9 +396,7 @@ Partial Class Inventarios_KardexAlmacen
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
ObjInventarios.IniciaTransacSQL()
|
||||
|
||||
Dim TipoMovot As Integer = If(RblProyeccionOpcion.SelectedValue = "1", 0, 1)
|
||||
|
||||
If ObjInventarios.DeleteMovimientosProyectados(TipoMovot) Then
|
||||
If ObjInventarios.DeleteMovimientosProyectados(RblProyeccionOpcion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Dim DtProductosEmpresas As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
For Each dtRow As DataRow In dt.Rows
|
||||
Dim Codigo As String = dtRow("Código").ToString
|
||||
|
||||
@@ -478,18 +478,18 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control" runat="server" Visible="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtLote" Width="80px" class="form-control input-sm" runat="server" Visible="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="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" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server" Visible="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtCaducidad" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server" Visible="false"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false"> <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="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Enabled="True" 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>
|
||||
|
||||
@@ -1293,6 +1293,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
If AplicaSeccion Then GvInv.Columns(11).Visible = True
|
||||
If AplicaLote Then GvInv.Columns(12).Visible = True
|
||||
GvInv.Columns(13).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
If AplicaCaducidad Then GvInv.Columns(13).Visible = True
|
||||
|
||||
If AplicaSerie OrElse AplicaSeccion OrElse AplicaLote OrElse AplicaCaducidad Then
|
||||
@@ -1824,6 +1825,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End Sub
|
||||
Private Sub CargaLote(Tipo As Integer, Optional CerrarCompletado As Boolean = False)
|
||||
RegistraScript("$('#DivLote').modal();", "ModalLote")
|
||||
GvLote.Columns(2).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
GvLote.DataSource = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
|
||||
GvLote.DataBind()
|
||||
|
||||
@@ -2688,7 +2690,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacenFiltro).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4")
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4")
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
@@ -2882,9 +2884,16 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
'VERIFICA SI TIENE PENDIENTE POR SURTIR
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso TipoMovimiento = 3 Then
|
||||
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 2, UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
If ObjInventario.RecepcionAlmacenGet(CveCompraSurtir, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
Dim DtFaltante As DataTable = ObjInventario.DtResultados.FiltraParametros("CantidadF > 0")
|
||||
If DtFaltante.Rows.Count = 0 Then
|
||||
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 2, UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
DtFaltante.Dispose()
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -1152,7 +1152,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
If Not ErrorMovInv Then
|
||||
|
||||
|
||||
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, CveMovimiento)
|
||||
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, CveMovimiento)
|
||||
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
|
||||
If IDPoliza > 0 Then Msg = Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza)
|
||||
|
||||
@@ -35,7 +35,7 @@ Partial Class Inventarios_RepApartados
|
||||
DdlSubProyectos.DataBind()
|
||||
DdlSubProyectos.Items.Insert(0, New ListItem(" Todas ", "-1"))
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.setEsWebService(True)
|
||||
Else
|
||||
DdlClientesWS.setEsWebService(False)
|
||||
@@ -44,15 +44,9 @@ Partial Class Inventarios_RepApartados
|
||||
DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
DdlClienteTraspasar.setEsWebService(True)
|
||||
Else
|
||||
DdlClienteTraspasar.setEsWebService(False)
|
||||
DdlClienteTraspasar.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClienteTraspasar.DataBind()
|
||||
DdlClienteTraspasar.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
|
||||
DdlClienteTraspasar.setEsWebService(True)
|
||||
|
||||
Dim DTVendedores As New DataTable
|
||||
DTVendedores = GlobalDTVendedores(UsuarioActual.CveEmpresa, True)
|
||||
DTVendedores.Merge(GlobalDTVendedores(UsuarioActual.CveEmpresa, False))
|
||||
@@ -139,7 +133,13 @@ Partial Class Inventarios_RepApartados
|
||||
End If
|
||||
|
||||
DdlClienteTraspasar.SelectedValue = "-1"
|
||||
DdlClienteTraspasar.SelectedText = "Seleccione"
|
||||
DdlClienteTraspasar.SelectedText = "Seleccione"
|
||||
|
||||
|
||||
If UsuarioActual.CveVendedor > 0 AndAlso CveVendedor.ToEntero <= 0 Then
|
||||
CveVendedor = UsuarioActual.CveVendedor.ToString
|
||||
End If
|
||||
|
||||
|
||||
DdlVendedor.SelectedValueExist(CveVendedor)
|
||||
DdlSubProyectos.SelectedValueExist(CveSucursal)
|
||||
|
||||
104
Inventarios/RepProductosPorCaducar.aspx
Normal file
104
Inventarios/RepProductosPorCaducar.aspx
Normal file
@@ -0,0 +1,104 @@
|
||||
<%@ Page Title="Compras - Reporte de Productos por Caducar" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepProductosPorCaducar.aspx.cs" Inherits="Inventarios_RepProductosPorCaducar" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Productos por Caducar
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpLnkAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkImprimirPDF" runat="server" OnClick="LnkImprimirPDF_Click" Visible="true"><i class="fa fa-file-pdf-o"></i><span style="padding: 10px">PDF</span></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkImprimirExcel" runat="server" OnClick="LnkImprimirExcel_Click" Visible="true"><i class="fa fa-file-excel-o"></i><span style="padding: 10px">Excel</span></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimirPDF"/>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimirExcel"/>
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="PFiltros" class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" class="btn btn-primary" ValidationGroup="Valida" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
<div class="col-sm-1" style="text-align:right">
|
||||
<label>Proveedor:</label>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<ADS:Dropdownlost ID="DdlProveedor" runat="server" DataValueField="CveProveedor" DataTextField="RazonSocial" CssClassDdl="select2me" Width="100%" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<div class="col-sm-1" style="text-align:right">
|
||||
<label>Fecha Inicio:</label>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;display:flex">
|
||||
<asp:TextBox ID="TxtFechaInicio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgCalFechaIEjec" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaIEjec" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender ID="CalFechaIEjec" runat="server" TargetControlID="TxtFechaInicio" PopupButtonID="ImgCalFechaIEjec" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
<div class="col-sm-1" style="text-align:right">
|
||||
<label>Fecha Fin:</label>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;display:flex">
|
||||
<asp:TextBox ID="TxtFechaFin" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LinkButton1" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TxtFechaFin" PopupButtonID="ImgCalFechaIEjec" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
<div class="col-sm-1" style="text-align:right">
|
||||
<label>Sucursal:</label>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList runat="server" ID="DdlSucursal" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-sm-1" style="text-align:right">
|
||||
<label>Clasificación:</label>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList runat="server" ID="DdlClasificacion" CssClass="select2me" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="Cantidad,PS,Lote,FechaCaducidad" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Reporte de productos caducidad " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="PS" DataField="PS" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" DataFormatString = "{0:dd/MM/yyyy}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
141
Inventarios/RepProductosPorCaducar.aspx.cs
Normal file
141
Inventarios/RepProductosPorCaducar.aspx.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
using System.Text;
|
||||
|
||||
public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
|
||||
{
|
||||
private DataTable DTDatos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DataTable)ViewState["DTDatos"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["DTDatos"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaFiltros();
|
||||
CargarDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargarDatos()
|
||||
{
|
||||
ClsInventarios ObjInventarios = new ClsInventarios();
|
||||
if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(),TxtFechaInicio.Text.ToDate(),TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(),
|
||||
DdlClasificacion.SelectedValue.ToEntero()))
|
||||
{
|
||||
GvDatos.DataSource = ObjInventarios.DtResultados;
|
||||
DTDatos = ObjInventarios.DtResultados;
|
||||
}
|
||||
ObjInventarios.Dispose();
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
|
||||
private void CargaFiltros()
|
||||
{
|
||||
CargarFechaText();
|
||||
CargarProveedores();
|
||||
CargarSucursales();
|
||||
CargarClasificaciones();
|
||||
|
||||
}
|
||||
|
||||
private void CargarFechaText()
|
||||
{
|
||||
DateTime date = new DateTime(DateTime.Today.Year, DateTime.Today.Month,1);
|
||||
TxtFechaInicio.Text = date.ToString("dd/MM/yyyy");
|
||||
TxtFechaFin.Text = date.AddMonths(1).AddDays(-1).ToString("dd/MM/yyyy");
|
||||
}
|
||||
|
||||
private void CargarProveedores()
|
||||
{
|
||||
DdlProveedor.setEsWebService(true);
|
||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores");
|
||||
DdlProveedor.SelectedValue = "-1";
|
||||
DdlProveedor.SelectedText = "Todos";
|
||||
}
|
||||
|
||||
private void CargarSucursales()
|
||||
{
|
||||
ClsSubProyectos ObjSubProyectos = new ClsSubProyectos();
|
||||
if (ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DdlSucursal.DataSource = ObjSubProyectos.DtResultados;
|
||||
}
|
||||
ObjSubProyectos.Dispose();
|
||||
DdlSucursal.DataBind();
|
||||
DdlSucursal.Items.Insert(0, new ListItem("Todas", "-1"));
|
||||
}
|
||||
|
||||
private void CargarClasificaciones()
|
||||
{
|
||||
ClsClasificaciones ObjClasificacion = new ClsClasificaciones();
|
||||
if (ObjClasificacion.GetClasificaciones(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DdlClasificacion.DataSource = ObjClasificacion.DtResultados;
|
||||
}
|
||||
ObjClasificacion.Dispose();
|
||||
DdlClasificacion.DataBind();
|
||||
DdlClasificacion.Items.Insert(0,new ListItem("Todas","-1"));
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargarDatos();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
protected void LnkImprimirPDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
ImprimirReporte("PDF");
|
||||
}
|
||||
|
||||
protected void LnkImprimirExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
ImprimirReporte("Excel");
|
||||
}
|
||||
|
||||
private void ImprimirReporte(string formato)
|
||||
{
|
||||
StringBuilder Filtros = new StringBuilder();
|
||||
Filtros.AppendFormat("<strong>Proveedor: </strong>{0} ", DdlProveedor.SelectedText);
|
||||
Filtros.AppendFormat("<strong>Fecha Inicio: </strong>{0} ", TxtFechaInicio.Text);
|
||||
Filtros.AppendFormat("<strong>Fecha Fin: </strong>{0} ", TxtFechaFin.Text);
|
||||
Filtros.AppendFormat("<strong>Sucursal: </strong>{0} ", DdlSucursal.SelectedItem.Text);
|
||||
Filtros.AppendFormat("<strong>Clasificación: </strong>{0} ", DdlClasificacion.SelectedItem.Text);
|
||||
List<ReportParameter> @params = new List<ReportParameter>();
|
||||
|
||||
@params.Add(new ReportParameter("Filtros", Filtros.ToString()));
|
||||
@params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
@params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||
|
||||
var logouri = string.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
System.IO.FileInfo Imagen = new System.IO.FileInfo(string.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", logouri));
|
||||
}
|
||||
else
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", ""));
|
||||
}
|
||||
@params.Add(new ReportParameter("FechaCaducidadHeader", (UsuarioActual.Empresa.Funcionalidad(147) == "Fecha Elaboración" ? "Fecha Elaboración" : "Fecha Caducidad")));
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepProductosCaducidad.rdlc", DTDatos, @params, "Reporte de Productos por Caducar", formato);
|
||||
}
|
||||
}
|
||||
@@ -702,6 +702,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
End If
|
||||
|
||||
Dim RealizarMovimientoVirtual As Boolean = False
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso TipoAlmacenOrigen.Contiene(1, 27) Then
|
||||
RealizarMovimientoVirtual = True
|
||||
End If
|
||||
|
||||
'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd
|
||||
If Not ChkTransitorio.Checked Then
|
||||
@@ -855,7 +861,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
|
||||
'VIRTUAL SALIDA
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
If RealizarMovimientoVirtual Then
|
||||
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
|
||||
|
||||
@@ -922,7 +928,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
|
||||
'VIRTUAL ENTRADA
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
If RealizarMovimientoVirtual Then
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
|
||||
|
||||
'SI EL ALMACEN DESTINO ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
|
||||
@@ -1010,7 +1016,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
@@ -1259,6 +1265,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
TxtnFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
ThFechaCaducidad.InnerText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
'GvDatos.Columns(8).Visible = CBool(drP("AplicaCaducidad"))
|
||||
|
||||
@@ -1310,6 +1317,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> ""
|
||||
GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> ""
|
||||
GvDatos.Columns(7).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha
|
||||
GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0
|
||||
|
||||
@@ -1725,7 +1733,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL
|
||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
|
||||
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un erro al cancelar el traspaso"
|
||||
@@ -1817,9 +1825,18 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
|
||||
|
||||
Dim CveAlmacenEntrada As Integer = GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero
|
||||
Dim CveAlmacenSalida As Integer = GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero
|
||||
Dim CveAlmacenSalida As Integer = DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero
|
||||
|
||||
Dim TipoAlmacenDestino As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenEntrada}").ToEntero()
|
||||
Dim TipoAlmacenOrigen As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenSalida}").ToEntero()
|
||||
|
||||
|
||||
Dim RealizarMovimientoVirtual As Boolean = False
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso TipoAlmacenOrigen.Contiene(1, 27) Then
|
||||
RealizarMovimientoVirtual = True
|
||||
End If
|
||||
|
||||
|
||||
'AGREGAMOS LA SALIDA
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||
@@ -1887,11 +1904,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
@@ -1902,7 +1919,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'VIRTUAL ENTRADA
|
||||
Dim CveMovimientoVirtualEntrada As Integer = 0
|
||||
Dim FolioVirtualEntrada As Integer = 0
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
If RealizarMovimientoVirtual Then
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenRecepcion.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
@@ -2012,8 +2029,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TxtObservacionesRecepcion.Text = ""
|
||||
|
||||
Dim Mensaje As StringBuilder = New StringBuilder
|
||||
Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida)
|
||||
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) 'onclick='ImprimirTraslado()'
|
||||
Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoEntrada)
|
||||
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()'
|
||||
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/><br/>Folio Virtual <b> <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> </b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
|
||||
|
||||
|
||||
|
||||
@@ -1002,9 +1002,9 @@ Partial Class RH_Personal
|
||||
|
||||
Private Sub CargaTiposContrato()
|
||||
Dim dt As DataTable = GlobalDTTiposContrato
|
||||
dt.Columns.Add("txtoddl", GetType(String), "CodigoTipoContrato + ' ' + TipoContrato")
|
||||
DdlTipoContrato.DataSource = dt
|
||||
DdlTipoContrato.DataBind()
|
||||
'dt.Columns.Add("txtoddl", GetType(String), "CodigoTipoContrato + ' ' + TipoContrato")
|
||||
'DdlTipoContrato.DataSource = dt
|
||||
'DdlTipoContrato.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTurno()
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -205,7 +205,7 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
|
||||
DataTable dtCloned = DTVentas.Clone();
|
||||
dtCloned.Columns[3].DataType = typeof(string);
|
||||
dtCloned.Columns[3].DataType = typeof(DateTime);
|
||||
|
||||
foreach (DataRow row in DTVentas.Rows)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ public class TareasJam : IHttpHandler
|
||||
DTVentas = dtCloned;
|
||||
foreach (DataRow dRow in DTVentas.Rows)
|
||||
{
|
||||
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");
|
||||
DateTime tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd").ToDate();
|
||||
dRow[3] = tmpDate;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
|
||||
dtCloned = DTAlmacenes.Clone();
|
||||
dtCloned.Columns[3].DataType = typeof(string);
|
||||
dtCloned.Columns[3].DataType = typeof(DateTime);
|
||||
|
||||
foreach (DataRow row in DTAlmacenes.Rows)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ public class TareasJam : IHttpHandler
|
||||
DTAlmacenes = dtCloned;
|
||||
foreach (DataRow dRow in DTAlmacenes.Rows)
|
||||
{
|
||||
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");
|
||||
DateTime tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd").ToDate();
|
||||
dRow[3] = tmpDate;
|
||||
}
|
||||
DTAlmacenes.AcceptChanges();
|
||||
@@ -249,8 +249,6 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
if (!ErrorProceso)
|
||||
{
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
int count = 2;
|
||||
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
|
||||
@@ -261,7 +259,7 @@ public class TareasJam : IHttpHandler
|
||||
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
|
||||
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
|
||||
wsVentas.Cell(count, 4).Value = "'" + DRow["Sale Date"].ToString();
|
||||
wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString();
|
||||
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
|
||||
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
|
||||
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
|
||||
@@ -279,7 +277,7 @@ public class TareasJam : IHttpHandler
|
||||
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
|
||||
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
|
||||
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
|
||||
wsAlmacenes.Cell(count, 4).Value = "'" + DRow["Stock Date"].ToString();
|
||||
wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString();
|
||||
count++;
|
||||
}
|
||||
wbAlmacenes.SaveAs(RutaAlmacenes);
|
||||
@@ -455,7 +453,7 @@ public class TareasJam : IHttpHandler
|
||||
Ventas.Ruta = RutaVentas;
|
||||
Clientes.Ruta = RutaClientes;
|
||||
Almacenes.Ruta = RutaAlmacenes;
|
||||
|
||||
|
||||
ListaArchivos.Add(Productos);
|
||||
ListaArchivos.Add(Ventas);
|
||||
ListaArchivos.Add(Clientes);
|
||||
@@ -479,7 +477,7 @@ public class TareasJam : IHttpHandler
|
||||
private bool CargarArchivos(FileInfo FInfo, string FTPServer, string FTPUsr, string FTPPass )
|
||||
{
|
||||
bool Respuesta;
|
||||
|
||||
|
||||
if (FInfo.Exists)
|
||||
{
|
||||
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
||||
|
||||
@@ -844,11 +844,11 @@
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Clientes Personal Entrega</span>
|
||||
<span class="caption-subject bold uppercase">PERSONAL AUTORIZADO PARA ENTREGAS EN ALMACÉN:</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarClientePersonalEntrega" data-toggle="tooltip" data-placement="right" title="Agregar dirección de envio." CssClass="btn btn-circle btn-default" Text="<i class='fa fa-plus'></i> Agregar"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarClientePersonalEntrega" data-toggle="tooltip" data-placement="right" title="Agregar personal autorizado para entregas." CssClass="btn btn-circle btn-default" Text="<i class='fa fa-plus'></i> Agregar"></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6234,10 +6234,10 @@
|
||||
<asp:TextBox runat="server" ID="TxtPersonalEntrega" CssClass="form-control" MaxLength="70" CausesValidation="true" />
|
||||
<label for="TxtPersonalEntrega">Personal Entrega:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<%--<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlUsuarioEntrega">Usuario:</label>
|
||||
<asp:DropDownList runat="server" ID="DdlUsuarioEntrega" DataTextField="Usuario" DataValueField="CveUsuario" CssClass="select2me" Width="100%"/>
|
||||
</div>
|
||||
</div>--%>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkPersonalEntrega">Estatus:</label>
|
||||
<asp:CheckBox runat="server" ID="ChkPersonalEntrega" CssClass="make-switchsd" data-size="small" Text=" " />
|
||||
|
||||
@@ -1754,7 +1754,6 @@ Partial Class Clientes
|
||||
TxtCorreoEntregaAlmacen.Text = ObjClientes.DtResultados(0)("CorreoEntregaAlmacen").ToString
|
||||
|
||||
CargarClientePersonalEntrega()
|
||||
CargarUsuariosEntrega()
|
||||
Else
|
||||
Existe = False
|
||||
Alert("El Cliente Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -5548,8 +5547,15 @@ Partial Class Clientes
|
||||
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged
|
||||
If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then
|
||||
|
||||
Dim tmp As DataTable = DTHistorialVentas.FiltraParametros($"TipoDocto = '{RblTipo.SelectedValue}'")
|
||||
If tmp.Rows.Count > 0 Then
|
||||
Dim tmp As DataTable = Nothing
|
||||
|
||||
If RblTipo.SelectedValue.Contiene("Ped") Then
|
||||
tmp = DTHistorialVentas.FiltraParametros($"TipoDocto IN('Ped','Pd2')")
|
||||
Else
|
||||
tmp = DTHistorialVentas.FiltraParametros($"TipoDocto = '{RblTipo.SelectedValue}'")
|
||||
End If
|
||||
|
||||
If tmp IsNot Nothing AndAlso tmp.Rows.Count > 0 Then
|
||||
Dim Totales As DataRow = tmp.NewRow
|
||||
Totales("SubTotal") = tmp.SUM("SubTotal")
|
||||
Totales("Total") = tmp.SUM("Total")
|
||||
@@ -10229,12 +10235,6 @@ Partial Class Clientes
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargarUsuariosEntrega()
|
||||
DdlUsuarioEntrega.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlUsuarioEntrega.DataBind()
|
||||
DdlUsuarioEntrega.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargarClientePersonalEntrega()
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetClientesPersonalEntrega(-1, CveCliente, UsuarioActual.CveEmpresa, -1) Then
|
||||
@@ -10246,8 +10246,8 @@ Partial Class Clientes
|
||||
|
||||
Protected Sub BtnAgregarClientePersonalEntrega_Click(sender As Object, e As EventArgs) Handles BtnAgregarClientePersonalEntrega.Click
|
||||
TxtPersonalEntrega.Text = ""
|
||||
DdlUsuarioEntrega.SelectedValue = "-1"
|
||||
ChkPersonalEntrega.Checked = False
|
||||
ChkPersonalEntrega.Checked = True
|
||||
LnkClientePersonalEntrega.Text = "Agregar"
|
||||
UpClientePersonalEntrega.Update()
|
||||
RegistraScript("$('#DivModalClientePersonalEntrega').modal('show');")
|
||||
End Sub
|
||||
@@ -10255,11 +10255,11 @@ Partial Class Clientes
|
||||
Protected Sub LnkClientePersonalEntrega_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If LnkClientePersonalEntrega.Text = "Agregar" Then
|
||||
If ObjVentas.AddClientesPersonalEntrega(TxtPersonalEntrega.Text, CveCliente, DdlUsuarioEntrega.SelectedValue.ToEntero, ChkPersonalEntrega.Checked) Then
|
||||
If ObjVentas.AddClientesPersonalEntrega(TxtPersonalEntrega.Text, CveCliente, UsuarioActual.CveUsuario, ChkPersonalEntrega.Checked) Then
|
||||
Alert("Usuario para entregar agregado correctamente")
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.UpdateClientesPersonalEntrega(CveClientePersonalEntrega, TxtPersonalEntrega.Text, DdlUsuarioEntrega.SelectedValue.ToEntero, ChkPersonalEntrega.Checked) Then
|
||||
If ObjVentas.UpdateClientesPersonalEntrega(CveClientePersonalEntrega, TxtPersonalEntrega.Text, UsuarioActual.CveUsuario, ChkPersonalEntrega.Checked) Then
|
||||
Alert("Usuario para entregar actualizado correctamente")
|
||||
End If
|
||||
End If
|
||||
@@ -10273,7 +10273,6 @@ Partial Class Clientes
|
||||
Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
|
||||
CveClientePersonalEntrega = GvRow.DataKey("CvePersonalEntrega").ToEntero
|
||||
TxtPersonalEntrega.Text = GvRow.DataKey("PersonalEntrega")
|
||||
DdlUsuarioEntrega.SelectedValue = GvRow.DataKey("CveUsuario")
|
||||
ChkPersonalEntrega.Checked = GvRow.DataKey("Estatus") = "True"
|
||||
LnkClientePersonalEntrega.Text = "Actualizar"
|
||||
UpClientePersonalEntrega.Update()
|
||||
|
||||
@@ -849,6 +849,14 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<label class="col-md-6 truncate">Aplica Sección</label>
|
||||
<div class="col-md-6">
|
||||
|
||||
<asp:CheckBox ID="ChkSeccion" CssClass="chksino" data-size="small" runat="server" AutoPostBack="true" OnCheckedChanged="ChkSeccion_CheckedChanged" Text=" " />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<label class="col-md-6 truncate">Aplica Lote</label>
|
||||
<div class="col-md-6">
|
||||
@@ -861,16 +869,16 @@
|
||||
<label class="col-md-6 truncate">Aplica Caducidad</label>
|
||||
<div class="col-md-6">
|
||||
|
||||
<asp:CheckBox ID="ChkCaducidad" CssClass="chksino" data-size="small" runat="server" Text=" " />
|
||||
<asp:CheckBox ID="ChkCaducidad" CssClass="chksino" data-size="small" runat="server" Text=" " OnCheckedChanged="ChkCaducidad_CheckedChanged" AutoPostBack="true"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<label class="col-md-6 truncate">Aplica Sección</label>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="DivTiempoCaducidad" visible="false">
|
||||
<label class="col-md-6 truncate">Tiempo de Caducidad</label>
|
||||
<div class="col-md-6">
|
||||
|
||||
<asp:CheckBox ID="ChkSeccion" CssClass="chksino" data-size="small" runat="server" AutoPostBack="true" OnCheckedChanged="ChkSeccion_CheckedChanged" Text=" " />
|
||||
|
||||
<asp:TextBox runat="server" ID="TxtTiempoCaducidad" Width="75px"/><label>Días</label>
|
||||
<asp:RegularExpressionValidator ID="RfvTxtTiempoCaducidad" runat="server" ControlToValidate="TxtTiempoCaducidad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tiempo Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar" ValidationExpression="\d{1,}" Display="None"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceTxtTiempoCaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtTiempoCaducidad" Width="300px" ></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" id="DivProveedorCompra" runat="server" visible="false">
|
||||
|
||||
@@ -876,6 +876,10 @@ Partial Class ProductosyServicios
|
||||
ChkLote.Checked = ObjProductosServicios.AplicaLote
|
||||
ChkCaducidad.Checked = ObjProductosServicios.AplicaCaducidad
|
||||
ChkSeccion.Checked = ObjProductosServicios.AplicaSeccion
|
||||
If ObjProductosServicios.DtResultados.Rows(0)("TiempoCaducidad") IsNot Nothing Then
|
||||
TxtTiempoCaducidad.Text = ObjProductosServicios.DtResultados.Rows(0)("TiempoCaducidad").ToString()
|
||||
DivTiempoCaducidad.Visible = ChkCaducidad.Checked
|
||||
End If
|
||||
|
||||
If ObjProductosServicios.AplicaSeccion Then
|
||||
CargaGvSeccionAlmacen()
|
||||
@@ -1190,6 +1194,16 @@ Partial Class ProductosyServicios
|
||||
Dim CveMarca As Integer = 0
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) And CvePS = -1 Then CveMarca = DdlMarcaPSDes.SelectedValue.ToEntero Else CveMarca = DdlMarca.SelectedValue.ToEntero
|
||||
|
||||
Dim TiempoCaducidad As Integer = -1
|
||||
If ChkCaducidad.Checked Then
|
||||
If TxtTiempoCaducidad.Text.Length > 0 AndAlso IsNumeric(TxtTiempoCaducidad.Text) Then
|
||||
TiempoCaducidad = TxtTiempoCaducidad.Text.ToEntero()
|
||||
Else
|
||||
Alert("Falta indicar el tiempo de caducidad", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If CvePS = -1 Then
|
||||
Dim PSS As String = TxtPS.Text.Trim.Replace("|", "")
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper
|
||||
@@ -1204,7 +1218,7 @@ Partial Class ProductosyServicios
|
||||
CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
|
||||
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
|
||||
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
|
||||
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked) > 0 Then
|
||||
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad) > 0 Then
|
||||
ViewState("CvePS") = ObjProductosServicios.CvePS
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
@@ -1224,6 +1238,9 @@ Partial Class ProductosyServicios
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True)
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
@@ -1250,7 +1267,7 @@ Partial Class ProductosyServicios
|
||||
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
|
||||
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
|
||||
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
|
||||
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked) Then
|
||||
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad) Then
|
||||
|
||||
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
|
||||
TieneError = True
|
||||
@@ -1287,6 +1304,9 @@ Partial Class ProductosyServicios
|
||||
Next
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False)
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
@@ -1411,7 +1431,7 @@ Partial Class ProductosyServicios
|
||||
Dim ObjAliasDelete As New ClsProductosServicios
|
||||
Dim TieneError = False
|
||||
|
||||
If ObjAliasDelete.RemovePSAlias(GVAlias.Rows(e.RowIndex).DataKey("CvePS").ToString.ToEntero, GVAlias.Rows(e.RowIndex).DataKey("PSAlias").ToString) Then
|
||||
If ObjAliasDelete.RemovePSAlias(GVAlias.Rows(e.RowIndex).DataKey("CvePS").ToString.ToEntero, GVAlias.Rows(e.RowIndex).DataKey("PSAlias").ToString, -1) Then
|
||||
GVAlias.EditIndex = -1
|
||||
CargarAlias()
|
||||
UPGVAlias.Update()
|
||||
@@ -1618,11 +1638,15 @@ Partial Class ProductosyServicios
|
||||
If CvePSAdicional < 0 Then
|
||||
If Not ObjProductosServicios.AddPSAdicionales(CvePS, DdlPSAdicional.SelectedValue.ToEntero, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
TieneError = True
|
||||
Else
|
||||
TieneError = GuardarProductosEquivalenteEnFranquicia(ObjProductosServicios, True)
|
||||
End If
|
||||
Else
|
||||
|
||||
If Not ObjProductosServicios.UpdatePSAdicionales(CvePS, DdlPSAdicional.SelectedValue.ToEntero, CvePSAdicional, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
TieneError = True
|
||||
Else
|
||||
TieneError = GuardarProductosEquivalenteEnFranquicia(ObjProductosServicios, False)
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -2731,4 +2755,142 @@ Partial Class ProductosyServicios
|
||||
End If
|
||||
Return Existencia > 0
|
||||
End Function
|
||||
|
||||
Protected Sub ChkCaducidad_CheckedChanged(sender As Object, e As EventArgs)
|
||||
Dim Activar As Boolean = ChkCaducidad.Checked
|
||||
DivTiempoCaducidad.Visible = Activar
|
||||
RfvTxtTiempoCaducidad.Enabled = Activar
|
||||
End Sub
|
||||
|
||||
Private Function GuardarProductoEnFranquicia(ObjPS As ClsProductosServicios, PSS As String, CveMetodoInv As Integer, EsPaquete As Integer, Agregar As Boolean) As Boolean
|
||||
Dim EmpresasFranquicia = New Integer() {152}
|
||||
For Each Franquicia As Integer In EmpresasFranquicia
|
||||
Dim nombreEmpresa As String = GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")
|
||||
Dim CveClasificacion As Integer = GlobalDTClasificaciones(CveEmpresa:=Franquicia).FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion = '{0}'", DdlClasificacion.SelectedItem.Text)).ToEntero
|
||||
Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(CveEmpresa:=Franquicia).FiltroPrimeroValor("CveUnidadMedida", String.Format("UnidadMedida = '{0}'", DdlUnidadMedida.SelectedItem.Text)).ToEntero
|
||||
Dim CveClasificacion2 As Integer = GlobalDTClasificaciones(CveEmpresa:=Franquicia).FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion = '{0}'", DdlClasificacion2.SelectedItem.Text)).ToEntero
|
||||
Dim CveTipo As Integer = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacionDetalle", String.Format("ClasificacionDetalle = '{0}'", DdlTipoPSDes.SelectedItem.Text)).ToEntero
|
||||
Dim CveMarcaFranquicia As Integer = -1
|
||||
If ObjPS.GetMarcas(Franquicia) Then
|
||||
CveMarcaFranquicia = ObjPS.DtResultados.FiltroPrimeroValor("CveMarca", String.Format("Marca = '{0}'", DdlMarca.SelectedItem.Text)).ToEntero
|
||||
End If
|
||||
Dim CveModelo As Integer = -1
|
||||
Dim CveMedida As Integer = -1
|
||||
Dim CveRin As Integer = -1
|
||||
|
||||
Dim ObjGral As New ClsGenerales()
|
||||
If ObjGral.GetModelos(Franquicia) Then
|
||||
CveModelo = ObjGral.DtResultados.FiltroPrimeroValor("CveModelo", String.Format("Modelo = '{0}'", DdlModelo.SelectedItem.Text)).ToEntero
|
||||
End If
|
||||
If ObjGral.GetMedidas(Franquicia) Then
|
||||
CveMedida = ObjGral.DtResultados.FiltroPrimeroValor("CveMedida", String.Format("Medida = '{0}'", DdlMedida.SelectedItem.Text)).ToEntero
|
||||
End If
|
||||
If ObjGral.GetRimTamanios(Franquicia) Then
|
||||
CveRin = ObjGral.DtResultados.FiltroPrimeroValor("CveRinTamaño", String.Format("RinTamaño = '{0}'", DdlRin.SelectedItem.Text)).ToEntero
|
||||
End If
|
||||
|
||||
ObjGral.Dispose()
|
||||
|
||||
If CveClasificacion <= 0 Then
|
||||
Alert(String.Format("La clasificación indicada no existe en la franquicia: '{0}'", nombreEmpresa), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
If CveUnidadMedida <= 0 Then
|
||||
Alert(String.Format("La unidad de medida indicada no existe en la franquicia: '{0}'", nombreEmpresa), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
If CveTipo <= 0 And DdlTipoPSDes.SelectedValue.ToEntero <> -1 Then
|
||||
Alert(String.Format("El tipo de producto indicado no existe en la franquicia: '{0}'", nombreEmpresa), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
If CveMarcaFranquicia <= 0 And DdlMarca.SelectedValue.ToEntero <> -1 Then
|
||||
Alert(String.Format("La marca indicada no existe en la franquicia: '{0}'", nombreEmpresa), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
If CveModelo <= 0 And DdlModelo.SelectedValue.ToEntero <> -1 Then
|
||||
Alert(String.Format("El modelo indicado no existe en la franquicia: '{0}'", nombreEmpresa), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
If CveMedida <= 0 And DdlMedida.SelectedValue.ToEntero <> -1 Then
|
||||
Alert(String.Format("La medida indicada no existe en la franquicia: '{0}'", nombreEmpresa), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
If CveRin <= 0 And DdlRin.SelectedValue.ToEntero <> -1 Then
|
||||
Alert(String.Format("El rin indicado no existe en la franquicia: '{0}'", nombreEmpresa), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
|
||||
If Agregar Then
|
||||
If Not ObjPS.AddPS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, "", TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
|
||||
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, DdlProveedor.txtValue.Value.ToEntero, True, ChkAplicaParaVenta.Checked, UsuarioActual.CveUsuario,
|
||||
Franquicia, CveMetodoInv, EsPaquete, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, FuePorXML:=False, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2,
|
||||
CveMarca:=CveMarcaFranquicia, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
|
||||
CveConceptoContable:=DdlConceptoRelacionado.SelectedValue.ToEntero, CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero,
|
||||
IEPSGrabaIVA:=ChkIepsIVA.Checked, VentaMinima:=TxtVentaMinima.Text.ToDecimal, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, RetISR:=(TxtRetISR.Text.Trim.ToDouble / 100),
|
||||
PrecioMinimo:=TxtPrecioMinimo.Text.ToDecimal, CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero,
|
||||
CveClasificacionDetalle:=CveTipo, CveTamaño:=DdlTamanio.SelectedValue.ToEntero, CveModelo:=CveModelo,
|
||||
CveMedida:=CveMedida, CveRinTamaño:=CveRin, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString,
|
||||
ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString,
|
||||
EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero()) > 0 Then
|
||||
'Alert(String.Format("Error al agregar el nuevo producto en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")))
|
||||
Return True
|
||||
|
||||
End If
|
||||
Else
|
||||
|
||||
If ObjPS.GetPS(-1, CveClasificacion, Franquicia, Codigo:=TxtCodigo.Text.Trim.ToUpper) Then
|
||||
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS").ToEntero()
|
||||
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.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, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
|
||||
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
|
||||
CveConceptoContable:=DdlConceptoRelacionado.SelectedValue.ToEntero, 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,
|
||||
CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario,
|
||||
CveClasificacionDetalle:=CveTipo, CveTamaño:=DdlTamanio.SelectedValue.ToEntero, CveModelo:=CveModelo,
|
||||
CveMedida:=CveMedida, CveRinTamaño:=CveRin, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString,
|
||||
ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString,
|
||||
EsOutSourcing:=ChkEsOutSourcing.Checked, AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked,
|
||||
TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero()) Then
|
||||
Return True
|
||||
|
||||
End If
|
||||
Else
|
||||
Alert(String.Format("El producto no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function GuardarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, Agregar As Boolean) As Boolean
|
||||
Dim EmpresasFranquicia = New Integer() {152}
|
||||
For Each Franquicia As Integer In EmpresasFranquicia
|
||||
Dim CvePSPagina As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", TxtCodigo.Text.Trim)).ToEntero
|
||||
Dim CvePSAdicional As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", DdlPSAdicional.SelectedItem.Text)).ToEntero
|
||||
|
||||
If CvePSPagina <= 0 Then
|
||||
Alert(String.Format("El producto de la página no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If CvePSPagina <= 0 Then
|
||||
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If Agregar Then
|
||||
If Not ObjPS.AddPSAdicionales(CvePSPagina, CvePSAdicional, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Dim PSAnterior As String = GlobalDTPS(Franquicia).FiltroPrimeroValor("PS", String.Format("CvePS = '{0}'", CvePSAdicional))
|
||||
Dim CvePSAnterio As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAnterior)).ToEntero
|
||||
|
||||
If Not ObjPS.UpdatePSAdicionales(CvePSPagina, CvePSAdicional, CvePSAnterio, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -2330,11 +2330,9 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'ENVIO DE FACTURA
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
|
||||
ChkEnviarFactura.Checked = EnviarCorreoCliente
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
End If
|
||||
ChkEnviarFactura.Checked = False
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
End If
|
||||
|
||||
'Modalidad Contrato
|
||||
@@ -2565,9 +2563,17 @@ Partial Class Ventas
|
||||
ChkEnviarFactura.Visible = False
|
||||
LblEnviarMail.Visible = False
|
||||
Else
|
||||
ChkEnviarFactura.Checked = EnviarCorreoCliente
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem", "PeC", "PA", "Pd2") Then
|
||||
'ENVIO DE FACTURA
|
||||
ChkEnviarFactura.Checked = False
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
Else
|
||||
ChkEnviarFactura.Checked = EnviarCorreoCliente
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
CargaFletes()
|
||||
@@ -3934,14 +3940,22 @@ Partial Class Ventas
|
||||
Case "PeC"
|
||||
DdlTipoComprobante.Items.Insert(5, New ListItem("Pedido de Consignación", "PeC"))
|
||||
Case "PA"
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 16, True, False)
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 16, True, False)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
CvePedidoA = CveVenta
|
||||
DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero()
|
||||
EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString())
|
||||
Case "Pd2"
|
||||
CvePedido2 = CveVenta
|
||||
BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False)
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
End Select
|
||||
|
||||
DdlTipoComprobante.SelectedValue = DbRowVenta("TipoDocto").ToString()
|
||||
@@ -4582,7 +4596,12 @@ Partial Class Ventas
|
||||
|
||||
'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR
|
||||
If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True)
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
BtnsFacturar.Visible = True
|
||||
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
||||
End If
|
||||
@@ -5028,9 +5047,16 @@ Partial Class Ventas
|
||||
ChkEnviarFactura.Visible = False
|
||||
LblEnviarMail.Visible = False
|
||||
Else
|
||||
ChkEnviarFactura.Visible = True
|
||||
ChkEnviarFactura.Checked = EnviarCorreoCliente
|
||||
LblEnviarMail.Visible = True
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem", "PeC", "PA", "Pd2") Then
|
||||
'ENVIO DE FACTURA
|
||||
ChkEnviarFactura.Checked = False
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
Else
|
||||
ChkEnviarFactura.Checked = EnviarCorreoCliente
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail)
|
||||
@@ -5602,7 +5628,6 @@ Partial Class Ventas
|
||||
BtnsFacturar.Visible = False
|
||||
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
||||
Else
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
|
||||
BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False)
|
||||
End If
|
||||
@@ -5622,7 +5647,11 @@ Partial Class Ventas
|
||||
Else
|
||||
BtnGeneraAutorizacion.Visible = False
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
@@ -5633,6 +5662,24 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'CUANDO SEA COTIZACION Y SEA COMPUPROVEEDORES (EMPRESA 72) NO DEBE ENVIAR CORREO AL CLIENTE
|
||||
If UsuarioActual.CveEmpresa = 72 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
ChkEnviarFactura.Checked = False
|
||||
ChkEnviarFactura.Visible = False
|
||||
LblEnviarMail.Visible = False
|
||||
Else
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem", "PeC", "PA", "Pd2") Then
|
||||
'ENVIO DE FACTURA
|
||||
ChkEnviarFactura.Checked = False
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
Else
|
||||
ChkEnviarFactura.Checked = EnviarCorreoCliente
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -7462,7 +7509,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If CveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
|
||||
If Not ObjContr.CicloComercialUpdate(CveCicloComercial, True, UsuarioActual.CveEmpresa) Then
|
||||
If Not ObjContr.CicloComercialUpdate(CveCicloComercial, True, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
|
||||
ErrorList.Add("No se pudo actualizar ")
|
||||
End If
|
||||
End If
|
||||
@@ -8063,6 +8110,7 @@ Partial Class Ventas
|
||||
Drt("CveVenta") = ObjFactura.CveVenta
|
||||
Drt("Importe") = 0
|
||||
Drt("FolioFiscal") = ObjFactura.FolioFiscal
|
||||
Drt("Folio") = ObjFactura.SerieFolio
|
||||
DtVentasNC.Rows.Add(Drt)
|
||||
DtVentasNC.AcceptChanges()
|
||||
End If
|
||||
@@ -8304,6 +8352,7 @@ Partial Class Ventas
|
||||
Drt("CveVenta") = ObjFactura.CveVenta
|
||||
Drt("Importe") = 0
|
||||
Drt("FolioFiscal") = ObjFactura.FolioFiscal
|
||||
Drt("Folio") = ObjFactura.SerieFolio
|
||||
DtVentasNC.Rows.Add(Drt)
|
||||
DtVentasNC.AcceptChanges()
|
||||
End If
|
||||
@@ -9055,6 +9104,7 @@ Partial Class Ventas
|
||||
Drt("CveVenta") = gvr.DataKey("CveVenta")
|
||||
Drt("Importe") = gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text
|
||||
Drt("FolioFiscal") = gvr.DataKey("FolioFiscal")
|
||||
Drt("Folio") = gvr.DataKey("Folio")
|
||||
DtVentasNC.Rows.Add(Drt)
|
||||
End If
|
||||
Next
|
||||
@@ -11408,7 +11458,7 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto"})
|
||||
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"})
|
||||
|
||||
If DT.Rows.Count > 0 Then
|
||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||
@@ -11441,8 +11491,6 @@ Partial Class Ventas
|
||||
If Row2("CveClasificacion").ToString() = "19929" Then IdCtaContable = 1142
|
||||
End If
|
||||
|
||||
' CveCuenta = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresosSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero()
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
If IdCtaContable <= 0 Then
|
||||
@@ -11450,12 +11498,7 @@ Partial Class Ventas
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
'If CveCuenta <= 0 Then
|
||||
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString() + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString()}"))
|
||||
' CveCuentaContabilizacion = 0
|
||||
'End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=Row2("CveSubProyecto").ToString().ToEntero(), ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveCuenta:=CveCuenta) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=Row2("CveSubProyecto").ToString().ToEntero(), ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, PorcentajeImpuesto:=Row2("PorcentajeIVA").ToString().ToDecimal) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
ViewState("SeGuardoPrePoliza") = True
|
||||
@@ -12633,6 +12676,10 @@ Partial Class Ventas
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
End If
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
'End If
|
||||
@@ -12646,7 +12693,7 @@ Partial Class Ventas
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
@@ -12668,8 +12715,6 @@ Partial Class Ventas
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
|
||||
If CveVenta > 0 Then CreaObjetosVenta()
|
||||
|
||||
'TIMBRADO NUEVO
|
||||
Try
|
||||
pdf = PdfFactura(ObjFactura)
|
||||
@@ -12677,6 +12722,10 @@ Partial Class Ventas
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
End If
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
|
||||
@@ -12688,7 +12737,7 @@ Partial Class Ventas
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
@@ -12719,6 +12768,10 @@ Partial Class Ventas
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
End If
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
|
||||
@@ -12727,7 +12780,7 @@ Partial Class Ventas
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
@@ -14845,11 +14898,10 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'ENVIO DE FACTURA
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
|
||||
ChkEnviarFactura.Checked = EnviarCorreoCliente
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
End If
|
||||
|
||||
ChkEnviarFactura.Checked = False
|
||||
ChkEnviarFactura.Visible = True
|
||||
LblEnviarMail.Visible = True
|
||||
|
||||
End If
|
||||
|
||||
@@ -14876,7 +14928,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
|
||||
|
||||
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
|
||||
|
||||
TabAlmacen.Enabled = DdlTipoComprobante.SelectedValue <> "Ant"
|
||||
@@ -17788,7 +17839,7 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region " MANDA CORREO "
|
||||
Private Sub MandaMails(CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String)
|
||||
Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String)
|
||||
|
||||
Dim ObjMail As New ClsSisMail()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
@@ -18351,7 +18402,7 @@ Partial Class Ventas
|
||||
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
|
||||
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
|
||||
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
|
||||
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble) Then
|
||||
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
@@ -21907,7 +21958,14 @@ Partial Class Ventas
|
||||
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
||||
If Mensaje = "" Then Return 0
|
||||
|
||||
Dim Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
Dim Celular As String = ""
|
||||
|
||||
Try
|
||||
Celular = ObjFactura.Cliente.CobranzaTelefono
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
If Celular.Length <> 10 Then Return 3
|
||||
|
||||
'ARMA MENSAJE
|
||||
@@ -24006,12 +24064,14 @@ Partial Class Ventas
|
||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TC", .DataType = GetType(Decimal), .DefaultValue = 1})
|
||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TCCambioValuacion", .DataType = GetType(Decimal), .DefaultValue = 1})
|
||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
|
||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
|
||||
End Sub
|
||||
|
||||
Private Sub CargaNCDT(pCveVenta As Integer, Importe As Decimal, Optional FolioFiscal As String = "", Optional NuevaFactura As Integer = -1, Optional ByRef ObjVentas As ClsVentas = Nothing, Optional TC As Decimal = 1)
|
||||
If (pCveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs")) OrElse (pCveVenta > 0 AndAlso NuevaFactura = 1) Then
|
||||
Dim CveEstatusFacturaNC As Integer = -1
|
||||
Dim TCCambioValuacion As Decimal = 1
|
||||
Dim Folio As String = ""
|
||||
If FolioFiscal = "" Then
|
||||
Dim ObjVentasAplicar As ClsVentas
|
||||
If ObjVentas IsNot Nothing Then
|
||||
@@ -24020,6 +24080,7 @@ Partial Class Ventas
|
||||
ObjVentasAplicar = New ClsVentas
|
||||
End If
|
||||
If ObjVentasAplicar.GetVenta(pCveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentasAplicar.DtResultados.Rows.Count > 0 Then
|
||||
Folio = ObjVentasAplicar.DtResultados.FiltroPrimeroValor("SerieFolio").ToString()
|
||||
FolioFiscal = ObjVentasAplicar.DtResultados.FiltroPrimeroValor("FolioFiscal").ToString()
|
||||
TC = ObjVentasAplicar.DtResultados.FiltroPrimeroValor("TipoCambio").ToString().ToDecimal()
|
||||
TCCambioValuacion = ObjVentasAplicar.DtResultados.FiltroPrimeroValor("TipoCambioValuacion").ToString().ToDecimal()
|
||||
@@ -24040,6 +24101,7 @@ Partial Class Ventas
|
||||
Dr("TC") = TC
|
||||
Dr("TCCambioValuacion") = TCCambioValuacion
|
||||
Dr("CveEstatusFactura") = CveEstatusFacturaNC
|
||||
Dr("Folio") = Folio
|
||||
|
||||
DtVentasNC.Rows.Add(Dr)
|
||||
End If
|
||||
@@ -24882,7 +24944,7 @@ Partial Class Ventas
|
||||
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
|
||||
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(),
|
||||
CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal,
|
||||
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble) Then
|
||||
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then
|
||||
MensajeError = "Ocurrió un error al actualizar la información de la cotización"
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user