This commit is contained in:
2020-11-13 20:55:48 -07:00
38 changed files with 2376 additions and 563 deletions

View File

@@ -439,7 +439,8 @@ Public Class ClsCompras
Optional AplicaCostoIndirecto As Integer = -1, Optional EstatusAlmacen As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveTipoGasto As Integer = -1,
Optional AF_Medida As Integer = -1, Optional AF_TipoMantenimiento As Integer = -1, Optional Referencia As String = "", Optional OtrosGastos As Decimal = 0,
Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0,
Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, Optional IEPSPSIVAPorcentaje As Double = 0, Optional NoDeducible As Boolean = False) As Boolean
Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, Optional IEPSPSIVAPorcentaje As Double = 0,
Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -482,6 +483,7 @@ Public Class ClsCompras
.Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje
.Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
End With
Try

View File

@@ -145,6 +145,7 @@ Public Class ClsContratos
Public Property FechaFinal As DateTime
Public Property Ubicacion As String
Public Property Responsable As String
Public Property Lugar As String
Public Property CveSubProyecto As Integer
Public Property SubProyectoContrato As String
Public Property CveProyecto As Integer
@@ -290,6 +291,8 @@ Public Class ClsContratos
Me.FechaVenc = Data.Rows(0)("FechaVenc").ToString.ToDate
Me.CveVendedor = Data.Rows(0)("CveVendedor").ToString.ToEntero
Me.ImporteTotal = Data.Rows(0)("ImporteTotal").ToString.ToDecimal
Me.Lugar = Data.Rows(0)("Lugar").ToString
Observaciones = Data.Rows(0)("Observaciones").ToString
CveDireccionEnvio = Data.Rows(0)("CveDireccionEnvio").ToString.ToEntero
AplicaImpuestosLocales = CBool(Data.Rows(0)("AplicaImpuestosLocales"))
@@ -540,7 +543,7 @@ Public Class ClsContratos
Geom As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, 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 CvePeriodo 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 = "") As Integer
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional Lugar As String = "") As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Con_ContratosObraAdd")
@@ -591,6 +594,7 @@ Public Class ClsContratos
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
.Add("@Lugar", SqlDbType.VarChar).Value = Lugar
.Add("@CveContrato", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -617,7 +621,7 @@ Public Class ClsContratos
CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
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 = "") As Boolean
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional Lugar As String = "") As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosObraUpdate")
@@ -666,7 +670,8 @@ Public Class ClsContratos
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
.Add("@Lugar", SqlDbType.VarChar).Value = Lugar
End With
@@ -773,6 +778,30 @@ Public Class ClsContratos
Return Retorno
End Function
Public Function GetContratosObraAvancesControlAcumulativo(CveContrato As Integer, CveEstimacion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosObraAvancesControlAcumulativo")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al consultar elcontrol acumulativo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
#Region "C I C L O C O M E R C I A L"
@@ -1040,9 +1069,10 @@ Public Class ClsContratos
End Try
Return Retorno
End Function
End Function
#End Region
#Region "Contratos detalles Avance"
Public Function GetContratosAvanceHistoricos(CveContrato As Integer, CveTipoPresupuesto As Integer, fecha As String) As Boolean
Dim Retorno = False
@@ -1254,6 +1284,30 @@ Public Class ClsContratos
#End Region
#Region "CONTRATOS OBRA COMPRAS"
Public Function GetContratosObraCompras(CveContrato As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosAvanceObraComprasGet")
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
@@ -2100,11 +2154,11 @@ Public Class ClsContratos
End Try
Return Retorno
End Function
End Function
#Region " REPORTES AVANCES "
Public Function GetReporteContratosAvancesCP(CveEmpresa As Integer, CveCliente As Integer, CveProveedor As Integer, CveTipoContrato As Integer, CveContrato As Integer, Optional CveEstatus As Integer = -1, Optional CveTipoEstatus As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -2129,7 +2183,17 @@ Public Class ClsContratos
End Try
Return Retorno
End Function
End Function
Public Function GetReporteContratosAvancesDetalleCP(CveContrato As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2148,8 +2212,34 @@ Public Class ClsContratos
OnError("Ocurrió un error al obtener el Reporte de Avances Detalle CP.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetReporteContratosAvancesDetalleControl(CveContrato As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Con_ReporteContratosAvancesControlDetalle")
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 obtener el Reporte de Avances de control.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetVentasAvance(CveContrato As Integer, CveClasificacion As Integer, CvePS As Integer, Tipo As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -68,6 +68,7 @@ Public Class ClsOC
Public Property FechaEstimadaEntrega As Date
'Private _NombreUsuario As String
Public Property CveProveedor As Integer
Public Property TipoProveedor As String
Public Property CveProveedorSucursal As Integer
Public Property SucursalDireccion As String
Public Property ProveedorContacto As String
@@ -736,6 +737,7 @@ Public Class ClsOC
_NombreUsuario = dr("NombreUsuario").ToString
_CveProveedor = If(Not IsDBNull(dr("CveProveedor")), dr("CveProveedor").ToString.ToEntero, -1)
Me.TipoProveedor = If(Not IsDBNull(dr("CveTipoProveedor")), dr("CveTipoProveedor").ToString, "-1")
_CveProveedorSucursal = If(Not IsDBNull(dr("CveProveedorSucursal")), dr("CveProveedorSucursal").ToString.ToEntero, -1)
_RazonSocial = If(Not IsDBNull(dr("RazonSocial")), dr("RazonSocial").ToString, "")
_Direccion = If(Not IsDBNull(dr("Direccion")), dr("Direccion").ToString, "")
@@ -1250,7 +1252,7 @@ Public Class ClsOC
pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0,
Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0,
Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0,
Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveVentaDetalleCotizacion As Integer = -1) As Boolean
Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraDetalleAdd")
@@ -1281,6 +1283,10 @@ Public Class ClsOC
.Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje
.Add("@CveVentaDetalleCotizacion", SqlDbType.Int).Value = CveVentaDetalleCotizacion
.Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra
End With
Try
@@ -1303,7 +1309,7 @@ Public Class ClsOC
pObservacion As String, pCveUsuario As Integer, pCveOrdenCompraDetalle As Integer, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0,
Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0,
Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0,
Optional IEPSPSIVAPorcentaje As Double = 0) As Integer
Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveTipoGastoObra As Integer = -1) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_OC_OrdenesCompraDetalleUpdate")
@@ -1333,6 +1339,7 @@ Public Class ClsOC
.Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje
.Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje
.Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra
End With
Try

View File

@@ -7376,7 +7376,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2)))
End If
'DATOS PARA DESCUENTO
If EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 122, 126) Then 'EMPRESAS QUE YA TIENEN EL AJUSTE EN EL FORMATO
If EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 119, 122, 126) Then 'EMPRESAS QUE YA TIENEN EL AJUSTE EN EL FORMATO
params.Add(New ReportParameter("SubTotal", ObjOC.SubTotal.ToString))
params.Add(New ReportParameter("SubTotal2", DtDetalle.SUM("Total").ToString))
Else
@@ -7406,6 +7406,9 @@ Public Class ClsPaginas
params.Add(New ReportParameter("ProveedorDireccion", If(ObjOC.CveProveedorSucursal > 0, ObjOC.SucursalDireccion, ObjOC.Direccion)))
params.Add(New ReportParameter("ProveedorTel", If(ObjOC.CveProveedorSucursal > 0, ObjOC.SucursalTelefono, ObjOC.Telefono)))
If UsuarioActual.CveEmpresa = 119 Then
params.Add(New ReportParameter("TipoProveedor", ObjOC.TipoProveedor))
End If
params.Add(New ReportParameter("ProveedorRFC", ObjOC.RFC))
params.Add(New ReportParameter("IVA", ObjOC.IVA.ToString))
params.Add(New ReportParameter("RetIVA", ObjOC.RetIVA.ToString.FormatoNumero(2)))

View File

@@ -10,18 +10,25 @@ Imports System.IO
Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
If context.Request("metodo").ToString() = "GetTokenAngular" Then
If context.Request("metodo") IsNot Nothing AndAlso context.Request("metodo").ToString() = "GetTokenAngular" Then
'context.Response.ContentType = "application/json; charset=utf-8"
context.Response.ContentType = "text/json"
Dim origin As String = context.Request.UrlReferrer.ToString()
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
If context.Request IsNot Nothing AndAlso context.Request.UrlReferrer IsNot Nothing Then
Dim origin As String = context.Request.UrlReferrer.ToString()
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
End If
'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200")
'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST")
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept")
context.Response.AddHeader("Access-Control-Allow-Credentials", "true")
context.Response.StatusCode = 200
Dim key As String = GetTokenAngular(context)
Dim key As String = ""
Try
key = GetTokenAngular(context)
Catch ex As Exception
GuardaLog(ex.ToString())
End Try
Dim json As String = JsonConvert.SerializeObject(key)
context.Response.Write(json)
context.Response.Flush()
@@ -959,6 +966,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETUMSAT(ByVal context As HttpContext) As String
Dim retorno As String = ""
If context.Application("GlobalDTPSATUM") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATUnidadMedida Then context.Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else context.Application("GlobalDTPSATUM") = Nothing
ObjGrales.Dispose()
End If
Dim DTUM = DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow))
Dim DtPSRetorno As DataTable

View File

@@ -2679,7 +2679,7 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("CveContrato", GetType(Integer))
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
GvPS.DataSource = TmpDT
@@ -5055,7 +5055,8 @@ Partial Class Compras_Compras
CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia, OtrosGastos:=Row("OtrosGastos").ToString.ToDecimal,
RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble,
IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble,
IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False)) Then
IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False),
CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero) Then
ErrorDetalles = True
Exit For
@@ -11262,6 +11263,8 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
TmpDTOriginal = New DataTable
TmpDTOriginal.Columns.Add("Consec", GetType(Integer))
TmpDTOriginal.Columns.Add("Cantidad", GetType(Decimal))
@@ -11367,6 +11370,7 @@ Partial Class Compras_Compras
TmpDTOriginal.Columns.Add("NoDeducible", GetType(Boolean))
TmpDTOriginal.Columns.Add("Importe", GetType(Double))
TmpDTOriginal.Columns.Add("CveContratoDetalle", GetType(Double))
End Sub
@@ -14699,7 +14703,7 @@ Partial Class Compras_Compras
If TxtFecha.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFecha.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Or DdlTipoComprobante.SelectedValue.Contiene("NC") Then
'CREA POLIZA NEGATIVA
If IdPoliza > 0 AndAlso ObjAC IsNot Nothing Then
If IdPoliza > 0 AndAlso ObjAC IsNot Nothing AndAlso UsuarioActual.Empresa.UsaAC Then
If ObjAC.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
dt = ObjAC.DtResultados
@@ -14737,7 +14741,7 @@ Partial Class Compras_Compras
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePolizaNueva, CBool(dr("TipoMovto").ToString), dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, dr("CveConceptoContable").ToString.ToEntero,
dr("Concepto").ToString, TxtFechaCancelacion.Text.ToDate, dr("IdCtaContable").ToString.ToEntero, dr("IdSegmentoNegocio").ToString.ToEntero, dr("CveIE").ToString.ToEntero,
dr("CveVenta").ToString.ToEntero, dr("CveCompra").ToString.ToEntero, dr("CveSubProyecto").ToString.ToEntero, dr("CveCliente").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero,
dr("CveMovimientoAlmacen").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("CveAcreedor").ToString.ToEntero, dr("CveColectiva").ToString.ToEntero, dr("CveCreditoDetalle").ToString.ToEntero, CveCuenta:=dr("CveCuenta").ToString.ToEntero,
dr("CveMovimientoAlmacen").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, -1, -1, dr("CveCreditoDetalle").ToString.ToEntero, CveCuenta:=dr("CveCuenta").ToString.ToEntero,
ImporteMX:=dr("Importe").ToString.ToDecimal * -1, ImporteME:=dr("Importe").ToString.ToDecimal * -1, CveTipoGasto:=dr("CveTipoGasto").ToString.ToEntero, CveClasificacion:=dr("CveClasificacion").ToString.ToEntero, CveOCDetalle:=dr("CveOCDetalle").ToString.ToEntero,
CveCompraAmortizacion:=dr("CveCompraAmortizacion").ToString.ToEntero) Then
ErrorCancelar = True
@@ -14761,7 +14765,7 @@ Partial Class Compras_Compras
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePolizaNueva, CBool(dr("TipoMovto").ToString), dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, dr("CveConceptoContable").ToString.ToEntero,
dr("Concepto").ToString, TxtFechaCancelacion.Text.ToDate, dr("IdCtaContable").ToString.ToEntero, dr("IdSegmentoNegocio").ToString.ToEntero, dr("CveIE").ToString.ToEntero,
dr("CveVenta").ToString.ToEntero, dr("CveCompra").ToString.ToEntero, dr("CveSubProyecto").ToString.ToEntero, dr("CveCliente").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero,
dr("CveMovimientoAlmacen").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("CveAcreedor").ToString.ToEntero, dr("CveColectiva").ToString.ToEntero, dr("CveCreditoDetalle").ToString.ToEntero, CveCuenta:=dr("CveCuenta").ToString.ToEntero,
dr("CveMovimientoAlmacen").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, -1, -1, dr("CveCreditoDetalle").ToString.ToEntero, CveCuenta:=dr("CveCuenta").ToString.ToEntero,
ImporteMX:=dr("Importe").ToString.ToDecimal * -1, ImporteME:=dr("Importe").ToString.ToDecimal * -1, CveTipoGasto:=dr("CveTipoGasto").ToString.ToEntero, CveClasificacion:=dr("CveClasificacion").ToString.ToEntero, CveOCDetalle:=dr("CveOCDetalle").ToString.ToEntero) Then
ErrorCancelar = True
Exit For
@@ -15645,8 +15649,10 @@ Partial Class Compras_Compras
Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero
Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero
Dim CveSATPS As Integer = gvr.FCDropDownLost("DdlSATPS").SelectedValue.ToEntero
Dim CveTipoGasto As Integer = -1
Dim TipoGasto As String = ""
Dim CveTipoGasto As Integer = dr("CveTipoGastoObra").ToString.ToEntero
Dim TipoGasto As String = dr("TipoGasto").ToString
Dim CveContratoDetalle As Integer = dr("CveContratoDetalle").ToString.ToEntero
'[IPP] PROVISIONAL PARA TIPO GASTO
If GlobalDTTiposGastos(UsuarioActual.CveEmpresa) IsNot Nothing AndAlso GlobalDTTiposGastos(UsuarioActual.CveEmpresa).Rows.Count = 1 Then
@@ -15657,7 +15663,8 @@ Partial Class Compras_Compras
End If
End If
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False, CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto)
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False,
CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle)
'CARGA PE
Index = TmpDT.Rows.Count - 1
@@ -17896,7 +17903,7 @@ Partial Class Compras_Compras
Obs As String, PU As Double, Total As Double, IVA As Double, RetIVA As Double, RetISR As Double, IEPSPS As Double, IEPSPSIVA As Double, Descuento As Double, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True,
Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Double = 0,
Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Double = 0,
Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False) As Integer
Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1) As Integer
Dim Row As DataRow = Nothing
@@ -18017,6 +18024,8 @@ Partial Class Compras_Compras
Row("CveTipoGasto") = CveTipoGasto
Row("TipoGasto") = If(CveTipoGasto > 0, TipoGasto, "")
Row("CveContratoDetalle") = CveContratoDetalle
If UsuarioActual.Empresa.UsaAC Then
Row("CveProgramaOperativo") = DdlACGeneral1.SelectedValue.ToEntero
Row("CveUnidadAdministrativa") = DdlACGeneral2.SelectedValue.ToEntero

View File

@@ -658,7 +658,7 @@
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarFaturas" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
<asp:Button ID="BtnGuardarFaturas" runat="server" ClientIDMode="Static" Text="Aceptar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -1208,7 +1208,7 @@ Partial Class Compras_eFacturas
DtNoRecibidas.ReadXml(Ruta)
Dim conta As Integer = 1
Str.Append("Se encontraron las siguientes facturas con problema:<br/> <table width='900px'><tr class='Titulos'><td>Serie</td><td>Folio</td><td>Fecha</td><td>Proveedor</td><td>Importe</td><td>Motivo</td><td>Correo</td><td>F. Recepción</td></tr>")
Str.Append("Se procesó la información con la siguiente información:<br/> <table width='900px'><tr class='Titulos'><td>Serie</td><td>Folio</td><td>Fecha</td><td>Proveedor</td><td>Importe</td><td>Motivo</td><td>Correo</td><td>F. Recepción</td></tr>")
For Each dr As DataRow In DtNoRecibidas.FiltraParametros("", "Fecha DESC").Rows
@@ -2639,6 +2639,7 @@ Partial Class Compras_eFacturas
Protected Sub LnkAgregarPago_Click(sender As Object, e As EventArgs)
Dim sbSinIE As New StringBuilder
Dim TieneCompras As Boolean = False
HdnCveIE.Value = ""
MSGComplemento = ""
@@ -2809,7 +2810,12 @@ 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
Try
dRow2("CvePrePolizaDetalle") = drow("CvePrePolizaDetalle").ToString
Catch ex As Exception
dRow2("CvePrePolizaDetalle") = 0
End Try
If drow("CveIE").ToString.ToEntero > 0 Then
@@ -2836,6 +2842,15 @@ Partial Class Compras_eFacturas
GVPDocumentosRelacionadosPagos.DataBind()
If DTDocumentosRelacionados.MAX("CveCompra").ToString.ToEntero > 0 Then
TieneCompras = True
Else
TieneCompras = False
End If
For Each dRow2 As DataRow In DTDocumentosRelacionados.Rows
If dRow2("CveMetodoPago").ToString.ToEntero > 0 Then
If dRow2("CveMetodoPago").ToString.ToEntero = 1 Then
@@ -2942,27 +2957,41 @@ Partial Class Compras_eFacturas
ObjCompras.Dispose()
If Math.Abs(DiferenciaImportes) > 5 Then
TextoDiferenciaImporte = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
BtnVincularPago.Visible = False
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})"
If TieneCompras Then
If ImporteIES > 0 Then
If Math.Abs(DiferenciaImportes) > 5 Then
TextoDiferenciaImporte = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
BtnVincularPago.Visible = False
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})"
If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then
DivVincularPagoManualmente.Visible = True
If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then
DivVincularPagoManualmente.Visible = True
End If
End If
Else
TextoDiferenciaImporte = $"No se encontraron pagos "
BtnVincularPago.Visible = False
MSGComplemento = MSGComplemento & $" No se encontraron pagos "
If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then
DivVincularPagoManualmente.Visible = True
End If
End If
Else
'BtnVincularPago.Visible = True
'TextoDiferenciaImporte = ""
BtnVincularPago.Visible = False
MSGComplemento = MSGComplemento & $"No se encontraron compras relacionadas"
DivVincularPagoManualmente.Visible = False
End If
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero
LblPagosCantidad.Text = PagosCantidad.ToString
LblImporteIE.Text = ImporteIES.FormatoNumero
LblDiferencia.Text = If(DiferenciaImportes <> 0, DiferenciaImportes.FormatoNumero, "")
LblDiferencia.Text = If(DiferenciaImportes <> 0 And ImporteIES > 0, DiferenciaImportes.FormatoNumero, "")
If MSGComplemento.Trim.Length > 0 And CveComplementoPagoCompra <= 0 Then

View File

@@ -68,6 +68,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:UsuarioActual.CveEmpresa, CveTipoCuenta:2);
DdlCuenta.DataBind();
DdlCuenta.Items.Insert(0, new ListItem("Todos", "-1"));
}
public void Consulta()

View File

@@ -1275,7 +1275,7 @@ Partial Class Contratos_Default
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())
FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=If(DdlDiaFact.SelectedValue.ToEntero() < 0, 0, DdlDiaFact.SelectedValue.ToEntero()))
TieneError = Not GuardaFianzas(ObjContratos)
@@ -1364,7 +1364,7 @@ Partial Class Contratos_Default
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
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), FacturacionCicilica:=ChkAplicaFacCiclica.Checked, FacturacionCiclicaAutomatico:=ChkFacAutomatica.Checked, DiaMesFacturacion:=If(DdlDiaFact.SelectedValue.ToEntero() < 0, 0, DdlDiaFact.SelectedValue.ToEntero()), CvePeriodo:=DdlPeriodo.SelectedValue.ToEntero()) Then
TieneError = Not GuardaFianzas(ObjContratos)

View File

@@ -257,7 +257,7 @@
<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 ID="DDlContratosEstimaciones" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
@@ -303,59 +303,7 @@
</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">&times;</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>
@@ -370,12 +318,16 @@
<div class="text-center">
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
<asp:Button id="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false"/>
</div>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargarGenerado" />
</Triggers>
</asp:UpdatePanel>

View File

@@ -5,9 +5,10 @@ Imports Extensiones
Imports System.IO
Imports System.Data
Imports Newtonsoft.Json
Imports ClosedXML.Excel
Partial Class Contratos_ContratoAvance
Inherits ClsPaginas
Inherits ClsPaginas
#Region "Propiedades"
Private Property DtDatos As DataTable
Get
@@ -63,6 +64,34 @@ Partial Class Contratos_ContratoAvance
End Set
End Property
Property CveEstimacionNueva As Integer
Get
If ViewState("CveEstimacionNueva") Is Nothing Then
Return -1
Else
Return ViewState("CveEstimacionNueva").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveEstimacionNueva") = value
End Set
End Property
Property NuemeroEstimacionNuevo As Integer
Get
If ViewState("NuemeroEstimacionNuevo") Is Nothing Then
Return -1
Else
Return ViewState("NuemeroEstimacionNuevo").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("NuemeroEstimacionNuevo") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -74,15 +103,15 @@ Partial Class Contratos_ContratoAvance
End If
End Sub
End Sub
#Region "Filtros"
Private Sub CargaContrato()
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (4,30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DdlContratos.DataBind()
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (4,30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DDlContratosEstimaciones.DataBind()
@@ -96,21 +125,21 @@ Partial Class Contratos_ContratoAvance
DdlAvances.Items.Clear()
Dim ObjContratos As New ClsContratos()
If ObjContratos.GetContratosAvanceFecha(DdlContratos.SelectedValue.ToEntero, 2) Then
DdlAvances.DataSource = ObjContratos.DtResultados
DdlAvances.DataSource = ObjContratos.DtResultados
End If
ObjContratos.Dispose()
DdlAvances.DataBind()
DdlAvances.Items.Insert(0, New ListItem(" ---- ", "-1"))
End Sub
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CveContrato = DdlContratos.SelectedValue.ToEntero
CargaDatosAvance()
End Sub
Private Sub CargaDatosAvance()
GvAnexos.Visible = False
GvAnexos.Visible = False
Dim ObjContratos As New ClsContratos()
If DdlAvances.SelectedValue = "-1" Then
If ObjContratos.GetContratosAvanceTodos(CveContrato, 2) Then
@@ -121,7 +150,7 @@ Partial Class Contratos_ContratoAvance
btnanexogral.Visible = True
End If
End If
Else
Else
If ObjContratos.GetContratosAvanceHistoricos(CveContrato, 2, DdlAvances.SelectedValue) Then
fecha = DdlAvances.SelectedValue
DtDatos = ObjContratos.DtResultados
@@ -131,8 +160,8 @@ Partial Class Contratos_ContratoAvance
End If
ObjContratos.Dispose()
CargaGrid()
End Sub
End Sub
#Region "GV"
Private Sub CargaGrid()
If DtDatos IsNot Nothing Then
@@ -380,16 +409,19 @@ Partial Class Contratos_ContratoAvance
Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click
CveEstimacionNueva = -1
NuemeroEstimacionNuevo = -1
Dim ObjContratos As New ClsContratos()
Dim ErrorProceso As Boolean = False
Dim NuemeroEstimacion As Integer = -1
ObjContratos.IniciaTransacSQL()
If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
NuemeroEstimacion = ObjContratos.NumeroEstimacionNueva
CveEstimacionNueva = ObjContratos.CveEstimacionNueva
NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva
For Each GvRow As GridViewRow In GvEstimaciones.Rows
@@ -412,15 +444,306 @@ Partial Class Contratos_ContratoAvance
If Not ErrorProceso Then
ObjContratos.Commit()
Alert($"Estimación {NuemeroEstimacion} agregada correctamente.")
Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.")
BtnGuardarEstimacion.Visible = False
BtnDescargarGenerado.Visible = True
Else
ObjContratos.RollBack()
End If
ObjContratos.Dispose()
UpEstimaciones.Update()
End Sub
Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click
GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text)
End Sub
Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String)
Dim PlantillaAnexo As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Anexo.xlsx"
If Not System.IO.File.Exists(PlantillaAnexo) Then
Alert("No se encuentra la platilla de anexos.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim DtControl As New DataTable
Dim ObjContratos As New ClsContratos
Dim Lugar As String = ""
Dim DescripcionContrato As String = ""
If ObjContratos.GetContratosObraAvancesControlAcumulativo(CveContrato, CveEstimacion, UsuarioActual.CveEmpresa) Then
DtControl = ObjContratos.DtResultados
If DtControl.Rows.Count > 0 Then
Lugar = DtControl(0)("Lugar").ToString
DescripcionContrato = DtControl(0)("DescripcionContrato").ToString
End If
End If
ObjContratos.Dispose()
If DtControl.Rows.Count > 0 Then
Dim WBAnexo = New ClosedXML.Excel.XLWorkbook(PlantillaAnexo)
Dim WBAnexoSalvar = New ClosedXML.Excel.XLWorkbook
Dim WSControl = WBAnexo.Worksheet(1)
Dim WSDetalle = WBAnexo.Worksheet(2)
Dim CuerrentRow As Integer = 28
WSControl.Cell(17, 2).Value = NumeroEstimacion 'Estimacion
WSControl.Cell(20, 9).Value = FechaEstimacion.ToString("dd/MM/yyyy") 'Fecha estimacion
WSControl.Cell(19, 8).Value = "$ " & DtControl.SUM("Importe").ToString("###,###,###.00") 'Total
WSControl.Cell(19, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
WSControl.Cell(20, 6).Value = NumeroContrato
WSControl.Cell(18, 2).Value = Lugar
WSControl.Cell(18, 2).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left)
WSControl.Cell(18, 2).Style.Alignment.SetVertical(XLAlignmentVerticalValues.Top)
WSControl.Cell(17, 6).Value = "" 'Periodo Fecha Inicial
WSControl.Cell(17, 7).Value = "" 'Periuodo Fecha Final
WSControl.Cell(20, 2).Value = DescripcionContrato
WSControl.Cell(20, 2).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left)
WSControl.Cell(20, 2).Style.Alignment.SetVertical(XLAlignmentVerticalValues.Top)
WSControl.Cell(22, 7).Value = "" 'Presupuesto segun contrato
WSControl.Cell(19, 5).Value = "" 'Contrtatista
Dim RowCountControl As Integer = 1
For Each Drow As DataRow In DtControl.Rows
WSControl.Cell(CuerrentRow, 1).Value = Drow("Codigo").ToString
WSControl.Cell(CuerrentRow, 2).Value = Drow("PS").ToString
WSControl.Cell(CuerrentRow, 3).Value = Drow("Abreviatura").ToString
WSControl.Cell(CuerrentRow, 4).Value = Drow("Cantidad").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 5).Value = Drow("AcumuladoTotal").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 6).Value = Drow("AcumuladoAnterior").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 7).Value = Drow("CantidadActual").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 8).Value = Drow("PU").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 9).Value = Drow("Total").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
WSControl.Cell(CuerrentRow, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
'ultimo Row
If DtControl.Rows.Count = RowCountControl Then
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSControl.Cell(CuerrentRow + 1, 8).Value = "Total:"
WSControl.Cell(CuerrentRow + 1, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
WSControl.Cell(CuerrentRow + 1, 8).Style.Font.Bold = True
WSControl.Cell(CuerrentRow + 1, 9).Value = DtControl.SUM("Total")
WSControl.Cell(CuerrentRow + 1, 9).Style.Font.Bold = True
WSControl.Cell(CuerrentRow + 1, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
Dim range = WSControl.Range($"A{CuerrentRow + 3}:D{CuerrentRow + 3}")
range.Merge()
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range = WSControl.Range($"E{CuerrentRow + 3}:I{CuerrentRow + 3}")
range.Merge()
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range = WSControl.Range($"A{CuerrentRow + 4}:D{CuerrentRow + 4}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "ING. WALTER ROBERTO VILLEGAS LARES"
range = WSControl.Range($"E{CuerrentRow + 4}:I{CuerrentRow + 4}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "C. SALVADOR SUAREZ"
range = WSControl.Range($"A{CuerrentRow + 5}:D{CuerrentRow + 5}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "SERVICIOS ELECTRICOS Y CONTROL DE HERMOSILLO S.A. DE C.V."
range.Style.Font.Bold = True
range = WSControl.Range($"E{CuerrentRow + 5}:I{CuerrentRow + 5}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "GASERVICIO MATAMOROS SA DE CV"
range.Style.Font.Bold = True
End If
CuerrentRow = CuerrentRow + 1
RowCountControl = RowCountControl + 1
Next
WBAnexo.Worksheet(1).CopyTo(WBAnexoSalvar, "CONTROL")
For Each Drow As DataRow In DtControl.Rows
If Drow("CantidadActual").ToString.ToDecimal > 0 Then
WSDetalle.Cell(3, 6).Value = NumeroContrato
WSDetalle.Cell(4, 9).Value = "" 'Fecha de
WSDetalle.Cell(4, 10).Value = "" 'Fecha a
WSDetalle.Cell(4, 11).Value = NumeroEstimacion
WSDetalle.Cell(6, 6).Value = DescripcionContrato
WSDetalle.Cell(14, 2).Value = Drow("Codigo").ToString
WSDetalle.Cell(14, 3).Value = Drow("PS").ToString
WSDetalle.Cell(14, 4).Value = Drow("Abreviatura").ToString
WSDetalle.Cell(12, 3).Value = "" 'Concepto
WSDetalle.Cell(14, 10).Value = Drow("CantidadActual").ToString.ToDecimal
WSDetalle.Cell(14, 11).Value = Drow("CantidadActual").ToString.ToDecimal
'WSDetalle.Cell(61, 6).Value = "" 'Empresario
WSDetalle.Cell(61, 9).Value = Drow("Nombre").ToString 'Cliente
Dim objContrato As New ClsContratos
Dim DTArchivos As New DataTable
If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, Drow("Fecha").ToString, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
DTArchivos = objContrato.DtResultados
End If
objContrato.Dispose()
Dim Imagenes As New List(Of ClosedXML.Excel.Drawings.IXLPicture)
Dim CurrectRowImg As Integer = 19 'Row 19 primera imggen
Dim RowH As Double = WSDetalle.Row(19).Height
For Each drowArchivos As DataRow In DTArchivos.Rows
Dim Archivo As String = ""
Archivo = drowArchivos("Archivo").ToString
Dim RutaArchivo As String = $"{UsuarioActual.Empresa.Ruta}\Contrato\{CveContrato}\Anexos\{Archivo}"
If File.Exists(RutaArchivo) Then
Dim Imagen = WSDetalle.AddPicture(RutaArchivo).MoveTo(WSDetalle.Cell(CurrectRowImg, 3))
Imagen.Scale(WSDetalle.Column(3).Width / (Imagen.OriginalWidth * 0.145D))
Dim ImgWidth As Double = Imagen.Height
Dim nRowmas As Integer = (ImgWidth / RowH).ToEntero
CurrectRowImg = CurrectRowImg + nRowmas
Imagenes.Add(Imagen)
End If
Next
WBAnexo.Worksheet(2).CopyTo(WBAnexoSalvar, If(Drow("Codigo").ToString.Trim.Length > 0, Drow("Codigo").ToString, Drow("CvePS").ToString))
For Each img As ClosedXML.Excel.Drawings.IXLPicture In Imagenes
img.Delete()
Next
End If
Next
Dim msB = New MemoryStream()
WBAnexoSalvar.SaveAs(msB)
Dim BB As Byte() = msB.ToArray
msB.Dispose()
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment; filename=Anexo_Estimacion" & NumeroEstimacion & ".xlsx")
Response.ContentType = "application/vnd.ms-excel"
Response.BinaryWrite(BB)
Response.End()
Else
Alert("No se encontraron datos des control", TipoMensaje.MsgAdvertencia)
End If
End Sub
#End Region

View File

@@ -75,7 +75,7 @@
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li runat="server" id="liTerminarContrato" visible="false">
<%-- <li runat="server" id="liTerminarContrato" visible="false">
<asp:LinkButton ID="LBTerminarContrato" Visible="false" OnClick="LBTerminarContrato_Click" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="Esta seguro de terminar el contrato?" data-btn-ok-label="si"> <i class="fa fa-check"> </i> Concluir Contrato</asp:LinkButton>
</li>
<li runat="server" id="liCancelarContrato" visible="false">
@@ -155,7 +155,7 @@
<asp:LinkButton ID="LnkAjusteAF" Visible="true" runat="server" OnClick="LnkAjusteAF_Click"> <i class="fa fa-pencil" style="font-weight:bold;"></i>Habilitar Ajuste A.F.</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:UpdatePanel>--%>
<asp:UpdatePanel ID="UpAccionesPresupuestos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -185,7 +185,7 @@
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LbDescargarExcel" />
<%-- <asp:PostBackTrigger ControlID="LbDescargarExcel" />
<asp:PostBackTrigger ControlID="LBImprimir" />
<asp:PostBackTrigger ControlID="LBImprimirGastos" />
<asp:PostBackTrigger ControlID="LbImprimirSuministros" />
@@ -195,7 +195,7 @@
<asp:PostBackTrigger ControlID="LbImprmirAF" />
<asp:PostBackTrigger ControlID="LbImprmirAFExcel" />
<asp:PostBackTrigger ControlID="LbImprimirPedDev" />
<asp:PostBackTrigger ControlID="LbImprimirPedDevExcel" />
<asp:PostBackTrigger ControlID="LbImprimirPedDevExcel" />--%>
</Triggers>
</asp:UpdatePanel>
</asp:Content>
@@ -209,6 +209,7 @@
<%-- <asp:UpdatePanel ID="UPTipo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivTipoContrato" class="row" runat="server" visible="true">
<div class="col-md-12">
@@ -373,6 +374,13 @@
</div>
</div>
<div class="row" id="div3" runat="server">
<label class="col-md-2 truncate ">Lugar:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtLugar" runat="server" MaxLength="300" Width="400px"></asp:TextBox>
</div>
</div>
<%-- <div class="row" id="RowFlexible" runat="server">
<label class="col-md-2 truncate ">Flexible:</label>
<div class="col-md-10">
@@ -950,7 +958,8 @@
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">
<%-- <asp:TemplateField HeaderText="OC <br/> Cliente">
<ItemTemplate>
<asp:Literal ID="LbOCInternaEdit" Text='<%# Eval("OCInterna")%>' runat="server"></asp:Literal>
</ItemTemplate>
@@ -958,7 +967,9 @@
<asp:TextBox ID="TxtOCInternaEdit" MaxLength="15" runat="server" Text='<%# Eval("OCInterna") %>' Width="70px"></asp:TextBox>
</EditItemTemplate>
<ItemStyle Width="75px" />
</asp:TemplateField>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:Literal ID="LtCantidad" Text='<%# Eval("CantidadContratada")%>' runat="server"></asp:Literal>
@@ -978,7 +989,7 @@
</EditItemTemplate>
<ItemStyle Width="75px" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Clave Int. Cliente">
<%-- <asp:TemplateField HeaderText="Clave Int. Cliente">
<ItemTemplate>
<asp:Literal ID="LblNoIdentificacion" Text='<%# Eval("NoIdentificacion")%>' runat="server"></asp:Literal>
</ItemTemplate>
@@ -986,7 +997,7 @@
<asp:TextBox ID="TxtNoIdentificacion" MaxLength="15" runat="server" Text='<%# Eval("NoIdentificacion") %>' Width="70px"></asp:TextBox>
</EditItemTemplate>
<ItemStyle Width="75px" />
</asp:TemplateField>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
@@ -1216,7 +1227,7 @@
</EditItemTemplate>
<ItemStyle Width="75px" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Clave <br/> Interna">
<%-- <asp:TemplateField HeaderText="Clave <br/> Interna">
<ItemTemplate>
<asp:Literal ID="LblNoIdentificacion" Text='<%# Eval("NoIdentificacion")%>' runat="server"></asp:Literal>
</ItemTemplate>
@@ -1224,7 +1235,7 @@
<asp:TextBox ID="TxtNoIdentificacion" MaxLength="15" runat="server" Text='<%# Eval("NoIdentificacion") %>' Width="70px"></asp:TextBox>
</EditItemTemplate>
<ItemStyle Width="75px" />
</asp:TemplateField>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
@@ -1517,66 +1528,158 @@
<ajax:TabPanel ID="TabReporteAvance" Visible="false" runat="server" HeaderText="Avance">
<ContentTemplate>
<div class="row">
<div class="col-md-12" align="right">
<input type="text" id="TxtFiltra" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtFiltra','{0}')", GvDatosAvance.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtFiltra','{0}')", GvDatosAvance.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UpDatosAvance" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dvCa" style="width: 100%; top: 30px">
<table id="dTable" class="table Widthall ">
<tr>
<td width="30%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="15%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="15%" id="TH3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td>
<td width="15%" id="TH4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td>
<td width="15%" id="TH5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td>
<td width="10%" id="TH6" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Anticipo</strong> </td>
</tr>
</table>
</div>
<asp:GridView ID="GvDatosAvance" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-Width="30%" />
<ajax:TabContainer ID="TabEstimacion" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
<ajax:TabPanel ID="TabPanel1" Visible="true" runat="server" HeaderText="Estimación">
<ContentTemplate>
<div class="row">
<div class="col-md-12" align="right">
<input type="text" id="TxtFiltra" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtFiltra','{0}')", GvDatosAvance.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtFiltra','{0}')", GvDatosAvance.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UpDatosAvance" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dvCa" style="width: 100%; top: 30px">
<table id="dTable" class="table Widthall ">
<tr>
<td width="30%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="15%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="15%" id="TH3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td>
<td width="15%" id="TH4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td>
<td width="15%" id="TH5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td>
<td width="10%" id="TH6" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Anticipo</strong> </td>
</tr>
</table>
</div>
<asp:GridView ID="GvDatosAvance" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-Width="30%" />
<asp:BoundField HeaderText="Cantidad" DataField="ContratoCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="ContratoImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceCantidad" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceCantidad", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cantidad" DataField="FaltanteCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="FaltanteImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceXFacturarCantidad" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceXFacturarCantidad", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceXFacturarImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceXFacturarImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Importe $" DataField="Anticipos" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabInterno" Visible="true" runat="server" HeaderText="Interno">
<ContentTemplate>
<div class="row">
<div class="col-md-12" align="right">
<input type="text" id="TxtFiltra" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtFiltra','{0}')", GvDatosAvance.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtFiltra','{0}')", GvDatosAvance.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UpDatosAvanceControl" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dvCaCon" style="width: 100%; top: 30px">
<table id="dTable" class="table Widthall ">
<tr>
<td width="30%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="15%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="15%" id="TH3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td>
<td width="15%" id="TH4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td>
<%-- <td width="15%" id="TH5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td>
<td width="10%" id="TH6" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Anticipo</strong> </td>--%>
</tr>
</table>
</div>
<asp:GridView ID="GvDatosAvanceControl" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-Width="30%" />
<asp:BoundField HeaderText="Cantidad" DataField="ContratoCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="ContratoImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceCantidad" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceCantidad", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cantidad" DataField="FaltanteCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="FaltanteImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<%-- <asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceXFacturarCantidad" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceXFacturarCantidad", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceXFacturarImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceXFacturarImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Importe $" DataField="Anticipos" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="10%" />--%>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<asp:BoundField HeaderText="Cantidad" DataField="ContratoCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="ContratoImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceCantidad" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceCantidad", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cantidad" DataField="FaltanteCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="FaltanteImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceXFacturarCantidad" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceXFacturarCantidad", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceXFacturarImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceXFacturarImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Importe $" DataField="Anticipos" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>

View File

@@ -454,12 +454,12 @@ Partial Class Contratos_ContratoObra
If CveContrato > 0 Then
If UsuarioActual.TienePermisoProceso(164) Then
BtnEliminar.Visible = True
Gv.Columns(11).Visible = True
GvInsumos.Columns(9).Visible = True
Gv.Columns(9).Visible = True
GvInsumos.Columns(8).Visible = True
Else
BtnEliminar.Visible = False
Gv.Columns(11).Visible = False
GvInsumos.Columns(9).Visible = False
Gv.Columns(9).Visible = False
GvInsumos.Columns(8).Visible = False
End If
'If CveTipoContrato.Contiene(11, 25) Then 'ciclo comercial
@@ -469,8 +469,8 @@ Partial Class Contratos_ContratoObra
Else
TabPres.Visible = False
Gv.Columns(11).Visible = True
GvInsumos.Columns(9).Visible = True
Gv.Columns(9).Visible = True
GvInsumos.Columns(8).Visible = True
End If
@@ -993,7 +993,7 @@ Partial Class Contratos_ContratoObra
'RowPorcentajeComision.Visible = False
RowEstatus.Visible = False
'dvAddendum.Visible = False
liImprimir.Visible = True
'liImprimir.Visible = True
CargaPlantillas()
'TrContratoPlantilla.Visible = True
'DdlPeriodo.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CvePeriodo"))
@@ -1042,7 +1042,7 @@ Partial Class Contratos_ContratoObra
'TDObservacion.Visible = True
'tdObservaciones.Visible = True
TxtObservaciones.Text = ObjContratos.DtResultados.Rows(0)("Observaciones").ToString
Gv.Columns(6).Visible = True
Gv.Columns(4).Visible = True
'DdlPeriodo.SelectedValueExist(ObjContratos.DtResultados.Rows(0)("CvePeriodo").ToString)
End If
@@ -1073,6 +1073,7 @@ Partial Class Contratos_ContratoObra
TxtFechaInicial.Text = ObjContratos.FechaInicial.ToShortDateString
TxtUbicacion.Text = ObjContratos.Ubicacion
TxtResponsable.Text = ObjContratos.Responsable
TxtLugar.Text = ObjContratos.Lugar
TxtPorAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero
TxtPorAmortizacionAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero
TxtPorGarantia.Text = ObjContratos.PorGarantia.FormatoNumero
@@ -1100,8 +1101,8 @@ Partial Class Contratos_ContratoObra
If ObjContratos.TipoEstatus = 2 Then
DdlEstatus.Enabled = False
If UsuarioActual.TienePermisoProceso(173) Then
liVigenteContrato.Visible = True
LBVigenteContrato.Visible = True
'liVigenteContrato.Visible = True
'LBVigenteContrato.Visible = True
End If
Else
DdlEstatus.Items.Clear()
@@ -1110,17 +1111,17 @@ Partial Class Contratos_ContratoObra
DdlEstatus.DataBind()
Select Case ObjContratos.TipoEstatus
Case 1
If UsuarioActual.TienePermisoProceso(173) Then
liTerminarContrato.Visible = True
LBTerminarContrato.Visible = True
liCancelarContrato.Visible = True
LBCancelarContrato.Visible = True
If UsuarioActual.TienePermisoProceso(173) Then
' liTerminarContrato.Visible = True
'LBTerminarContrato.Visible = True
' liCancelarContrato.Visible = True
'LBCancelarContrato.Visible = True
End If
Case 2, 3 ' reactivar el contrato
If UsuarioActual.TienePermisoProceso(173) Then
liVigenteContrato.Visible = True
LBVigenteContrato.Visible = True
If UsuarioActual.TienePermisoProceso(173) Then
' liVigenteContrato.Visible = True
' LBVigenteContrato.Visible = True
End If
End Select
@@ -1315,7 +1316,7 @@ Partial Class Contratos_ContratoObra
TxtTipoCambio.Text.ToDouble, CveSucursalCliente:=DdlSucursalCliente.SelectedValue.ToEntero, CveAlmacenOrigen:=-1, CveAlmacenDestino:=-1,
PorcentajeComision:=0, TipoGarantia:=-1, Folio:=0, FechaVenc:=Nothing, EstatusFianza:=1,
CvePeriodo:=-1, CveCuentaEquipo:=-1, CveContratoPlantilla:=-1, CveVendedor:=-1,
Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=-1, AplicaImpuestosLocales:=False, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim())
Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=-1, AplicaImpuestosLocales:=False, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), Lugar:=TxtLugar.Text.Trim)
TieneError = Not GuardaFianzas(ObjContratos)
@@ -1414,7 +1415,7 @@ Partial Class Contratos_ContratoObra
CveAlmacenOrigen:=-1, CveAlmacenDestino:=-1, PorcentajeComision:=0,
TipoGarantia:=-1, Folio:=-1, FechaVenc:=Nothing, EstatusFianza:=-1, CveContratoPlantilla:=-1,
CveCuentaEquipo:=-1, CveVendedor:=-1, Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=-1, AplicaImpuestosLocales:=False,
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim()) Then
CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), Lugar:=TxtLugar.Text.Trim) Then
TieneError = Not GuardaFianzas(ObjContratos)
@@ -1840,11 +1841,11 @@ Partial Class Contratos_ContratoObra
Gv.DataSource = DtTemp
DtPresupuestos = DtTemp
Gv.DataBind()
If CveTipoContrato = 25 Then
Gv.Columns(0).Visible = False
Gv.Columns(2).Visible = False
Gv.Columns(3).Visible = False
Gv.Columns(9).Visible = False
If CveTipoContrato = 25 Then
' Gv.Columns(0).Visible = False
Gv.Columns(2).Visible = False
' Gv.Columns(3).Visible = False
Gv.Columns(7).Visible = False
End If
'If (Gv.Rows.Count > 0) Then
' Gv.UseAccessibleHeader = True
@@ -2581,7 +2582,7 @@ Partial Class Contratos_ContratoObra
End If
TabReporteAvance.Visible = True
lbImprimirAvance.Visible = True
'lbImprimirAvance.Visible = True
Dim Modalidad = IfNull(Request("Tipo"), 1, 2)
@@ -2600,16 +2601,32 @@ Partial Class Contratos_ContratoObra
Alert("Ocurrió un Error al obtener el Reporte de Avances. Por favor vuelva a intentar", TipoMensaje.MsgError)
End If
ObjContratos.Dispose()
'ObjContratos.Dispose()
GvDatosAvance.DataBind()
If (GvDatosAvance.Rows.Count > 0) Then
GvDatosAvance.UseAccessibleHeader = True
GvDatosAvance.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
UpGral.Update()
End If
If ObjContratos.GetReporteContratosAvancesDetalleControl(CveContrato, UsuarioActual.CveEmpresa) Then
GvDatosAvanceControl.DataSource = ObjContratos.DtResultados
Else
Alert("Ocurrió un Error al obtener el Reporte de Avances de control. Por favor vuelva a intentar", TipoMensaje.MsgError)
End If
GvDatosAvanceControl.DataBind()
ObjContratos.Dispose()
UpGral.Update()
End Sub
Protected Sub GvDatosAvance_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAvance.RowDataBound
@@ -2629,6 +2646,27 @@ Partial Class Contratos_ContratoObra
e.Row.FCLinkButton("LBAvanceXFacturarCantidad").CommandArgument = Liga2
e.Row.FCLinkButton("LBAvanceXFacturarImporte").CommandArgument = Liga2
End If
End Sub
Protected Sub GvDatosAvanceControl_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAvanceControl.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveClasificacion").ToString.ToEntero = 0 Then
e.Row.CssClass = "Totales white"
ElseIf e.Row.DBCampo("CvePS").ToString.ToEntero = 0 Then
e.Row.CssClass = "SubTotales"
End If
'Dim Liga1 = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|1"
'e.Row.FCLinkButton("LBAvanceCantidad").CommandArgument = Liga1
'e.Row.FCLinkButton("LBAvanceImporte").CommandArgument = Liga1
'Dim Liga2 = $"{e.Row.DBCampo("CveClasificacion").ToEntero}|{e.Row.DBCampo("Clasificacion")}|{e.Row.DBCampo("CvePS").ToEntero}|{e.Row.DBCampo("CodigoPS")}|2"
'e.Row.FCLinkButton("LBAvanceXFacturarCantidad").CommandArgument = Liga2
'e.Row.FCLinkButton("LBAvanceXFacturarImporte").CommandArgument = Liga2
End If
End Sub
Protected Sub MuestaModalVentasAvance(sender As Object, e As EventArgs)
@@ -2672,9 +2710,9 @@ Partial Class Contratos_ContratoObra
GVAvanceXDocumento.DataSource = ObjContratos.DtResultados
DtAvanceDocumento = ObjContratos.DtResultados
If DtAvanceDocumento.Rows.Count > 0 Then
LBImprimir.Visible = True
End If
LBImprimirInformacionG.Visible = True
'LBImprimir.Visible = True
End If
' LBImprimirInformacionG.Visible = True
Else
Alert("Ocurrió un error al obtener el Reporte de Avances por Documento. Por favor vuelva a intentar", TipoMensaje.MsgError)
End If
@@ -2871,7 +2909,7 @@ Partial Class Contratos_ContratoObra
If GvContratosGastos.Rows.Count > 0 Then
GvContratosGastos.HeaderRow.CssClass = "SinColor"
LBImprimirGastos.Visible = True
'LBImprimirGastos.Visible = True
End If
UpContratoGasto.Update()
@@ -2948,12 +2986,12 @@ Partial Class Contratos_ContratoObra
UpPedidosDevoluciones.Update()
End Sub
Protected Sub ImgExcelPedDev_Click(sender As Object, e As EventArgs) Handles LbImprimirPedDevExcel.Click
GenerarPDFPedDev("Excel")
End Sub
Protected Sub ImgImprimirPedDev_Click(sender As Object, e As EventArgs) Handles LbImprimirPedDev.Click
GenerarPDFPedDev()
End Sub
'Protected Sub ImgExcelPedDev_Click(sender As Object, e As EventArgs) Handles LbImprimirPedDevExcel.Click
' GenerarPDFPedDev("Excel")
'End Sub
'Protected Sub ImgImprimirPedDev_Click(sender As Object, e As EventArgs) Handles LbImprimirPedDev.Click
' GenerarPDFPedDev()
'End Sub
Private Sub GenerarPDFPedDev(Optional Formato As String = "PDF")
If DsDatosPedDev Is Nothing Then
Alert("No se pudieron consultar los pedidos y devoluciones", TipoMensaje.MsgAdvertencia)
@@ -3202,27 +3240,27 @@ Partial Class Contratos_ContratoObra
ObjInv.Dispose()
LnkAjusteAF.Visible = True
'LnkAjusteAF.Visible = True
DivHajusteAF.Visible = False
GvDatosAlmacen.Columns(6).Visible = False
CargaInventarios()
UPHajusteAF.Update()
UpHajusteAcciones.Update()
UPHajusteAF.Update()
' UpHajusteAcciones.Update()
End Sub
Protected Sub LnkAjusteAF_Click(sender As Object, e As EventArgs)
LnkAjusteAF.Visible = False
Protected Sub LnkAjusteAF_Click(sender As Object, e As EventArgs)
' LnkAjusteAF.Visible = False
DivHajusteAF.Visible = True
GvDatosAlmacen.Columns(6).Visible = True
CargaInventarios()
UPHajusteAF.Update()
UpHajusteAcciones.Update()
UPHajusteAF.Update()
' UpHajusteAcciones.Update()
UpAlmacen.Update()
End Sub
@@ -3425,9 +3463,9 @@ Partial Class Contratos_ContratoObra
Response.End()
End If
End Sub
Public Sub LbDescargarExcel_Click(sender As Object, e As EventArgs) Handles LbDescargarExcel.Click
DescargarFormato()
End Sub
'Public Sub LbDescargarExcel_Click(sender As Object, e As EventArgs) Handles LbDescargarExcel.Click
' DescargarFormato()
'End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
@@ -3702,9 +3740,9 @@ Partial Class Contratos_ContratoObra
#Region " IMPRESION "
#Region " IMPRIMIR AVANCE POR DOCUMENTO "
Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles LBImprimir.Click
GenerarPDF()
End Sub
'Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles LBImprimir.Click
' GenerarPDF()
'End Sub
Private Sub GenerarPDF(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -3730,66 +3768,67 @@ Partial Class Contratos_ContratoObra
End If
Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text)
ImprimirPDF("Empresas/Grales/Formatos/RepContratoAvanceDocumento.rdlc", dt, params, $"{Nombre}-AvanceDocumento", Formato:=Formato)
End Sub
Private Sub LBImprimirInformacionG_Click(sender As Object, e As EventArgs) Handles LBImprimirInformacionG.Click
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim dt As DataTable = DtAvanceDocumento
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Contrato", Titulo))
'DATOS DEL CONTRATO
params.Add(New ReportParameter("NoContrato", TxtNumeroContrato.Text.Trim))
params.Add(New ReportParameter("Descripcion", TxtDescripcionContrato.Text.Trim))
params.Add(New ReportParameter("Proveedor", If(TrProveedor.Visible = True, DdlContratista.SelectedItem.Text.Trim, "-")))
params.Add(New ReportParameter("Ubicacion", TxtUbicacion.Text.Trim))
params.Add(New ReportParameter("Responsable", TxtResponsable.Text.Trim))
params.Add(New ReportParameter("Almacen", "-"))
params.Add(New ReportParameter("Porcentaje", "-"))
'CENTRO DE COSTOS
params.Add(New ReportParameter("Proyecto", If(DVddlproyecto.Visible = True, DdlProyecto.SelectedItem.Text.Trim, "-")))
params.Add(New ReportParameter("SubProyecto", CveSubProyecto.ToString))
params.Add(New ReportParameter("Addendum", ""))
'INFORMACION
params.Add(New ReportParameter("Cliente", If(TrCliente.Visible = True, DdlCliente.SelectedItem.Text.Trim, "-")))
params.Add(New ReportParameter("Sucursal", If(TrClienteSucursal.Visible = True, DdlSucursalCliente.SelectedItem.Text.Trim, "-")))
params.Add(New ReportParameter("FechaInicial", TxtFechaInicial.Text.Trim))
params.Add(New ReportParameter("FechaFinal", TxtFechaFinal.Text.Trim))
params.Add(New ReportParameter("Moneda", DdlMoneda.SelectedItem.Text.Trim))
params.Add(New ReportParameter("TipoCambio", If(tipoCambio.Visible = True, TxtTipoCambio.Text.Trim, "-")))
params.Add(New ReportParameter("IVA", TxtPorIVA.Text.Trim))
params.Add(New ReportParameter("Anticipo", TxtPorAnticipo.Text.Trim))
params.Add(New ReportParameter("Amortizacion", TxtPorAmortizacionAnticipo.Text.Trim))
params.Add(New ReportParameter("Garantia", TxtPorGarantia.Text.Trim))
params.Add(New ReportParameter("Minimo", "-"))
params.Add(New ReportParameter("Maximo", "-"))
params.Add(New ReportParameter("Total", If(DvTotal.Visible = True, TxtTotal.Text.Trim, "-")))
'Estatus
params.Add(New ReportParameter("Estatus", DdlEstatus.SelectedItem.Text.Trim))
params.Add(New ReportParameter("TipoGarantia", ""))
params.Add(New ReportParameter("EstatusFianza", ""))
params.Add(New ReportParameter("Folio", "0"))
params.Add(New ReportParameter("FechaVencimiento", ""))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
ImprimirPDF("Empresas/Grales/Formatos/Contrato.rdlc", dt, params, $"Contrato-{Titulo}", Formato:="PDF")
End Sub
'Private Sub LBImprimirInformacionG_Click(sender As Object, e As EventArgs) Handles LBImprimirInformacionG.Click
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' Dim dt As DataTable = DtAvanceDocumento
' Dim params As New List(Of ReportParameter)
' params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
' params.Add(New ReportParameter("Contrato", Titulo))
' 'DATOS DEL CONTRATO
' params.Add(New ReportParameter("NoContrato", TxtNumeroContrato.Text.Trim))
' params.Add(New ReportParameter("Descripcion", TxtDescripcionContrato.Text.Trim))
' params.Add(New ReportParameter("Proveedor", If(TrProveedor.Visible = True, DdlContratista.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("Ubicacion", TxtUbicacion.Text.Trim))
' params.Add(New ReportParameter("Responsable", TxtResponsable.Text.Trim))
' params.Add(New ReportParameter("Almacen", "-"))
' params.Add(New ReportParameter("Porcentaje", "-"))
' 'CENTRO DE COSTOS
' params.Add(New ReportParameter("Proyecto", If(DVddlproyecto.Visible = True, DdlProyecto.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("SubProyecto", CveSubProyecto.ToString))
' params.Add(New ReportParameter("Addendum", ""))
' 'INFORMACION
' params.Add(New ReportParameter("Cliente", If(TrCliente.Visible = True, DdlCliente.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("Sucursal", If(TrClienteSucursal.Visible = True, DdlSucursalCliente.SelectedItem.Text.Trim, "-")))
' params.Add(New ReportParameter("FechaInicial", TxtFechaInicial.Text.Trim))
' params.Add(New ReportParameter("FechaFinal", TxtFechaFinal.Text.Trim))
' params.Add(New ReportParameter("Moneda", DdlMoneda.SelectedItem.Text.Trim))
' params.Add(New ReportParameter("TipoCambio", If(tipoCambio.Visible = True, TxtTipoCambio.Text.Trim, "-")))
' params.Add(New ReportParameter("IVA", TxtPorIVA.Text.Trim))
' params.Add(New ReportParameter("Anticipo", TxtPorAnticipo.Text.Trim))
' params.Add(New ReportParameter("Amortizacion", TxtPorAmortizacionAnticipo.Text.Trim))
' params.Add(New ReportParameter("Garantia", TxtPorGarantia.Text.Trim))
' params.Add(New ReportParameter("Minimo", "-"))
' params.Add(New ReportParameter("Maximo", "-"))
' params.Add(New ReportParameter("Total", If(DvTotal.Visible = True, TxtTotal.Text.Trim, "-")))
' 'Estatus
' params.Add(New ReportParameter("Estatus", DdlEstatus.SelectedItem.Text.Trim))
' params.Add(New ReportParameter("TipoGarantia", ""))
' params.Add(New ReportParameter("EstatusFianza", ""))
' params.Add(New ReportParameter("Folio", "0"))
' params.Add(New ReportParameter("FechaVencimiento", ""))
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", logouri))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/Contrato.rdlc", dt, params, $"Contrato-{Titulo}", Formato:="PDF")
'End Sub
#End Region
#Region "I M P R E S I O N D E G A S T O S"
Protected Sub ImgImprimirGastos_Click(sender As Object, e As EventArgs) Handles LBImprimirGastos.Click
GenerarPDFGastos()
End Sub
'Protected Sub ImgImprimirGastos_Click(sender As Object, e As EventArgs) Handles LBImprimirGastos.Click
' GenerarPDFGastos()
'End Sub
Private Sub GenerarPDFGastos(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -3819,22 +3858,22 @@ Partial Class Contratos_ContratoObra
End If
Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text)
ImprimirPDF("Empresas/Grales/Formatos/RepContratoGastos.rdlc", dt, params, $"{Nombre}-Gastos", Formato:=Formato)
End Sub
Private Sub LBAgregarGasto_Click(sender As Object, e As EventArgs) Handles LBAgregarGasto.Click
TxtDescripcion.Text = ""
TxtImporteC.Text = ""
TxtFecha.Text = ""
UpAgregarGastos.Update()
RegistraScript("$('#ModalAgregarGastos').modal();")
End Sub
'Private Sub LBAgregarGasto_Click(sender As Object, e As EventArgs) Handles LBAgregarGasto.Click
' TxtDescripcion.Text = ""
' TxtImporteC.Text = ""
' TxtFecha.Text = ""
' UpAgregarGastos.Update()
' RegistraScript("$('#ModalAgregarGastos').modal();")
'End Sub
#End Region
#Region "I M P R E S I O N D E S U M I N I S T R O S"
Protected Sub ImgImprimirSuministros_Click(sender As Object, e As EventArgs) Handles LbImprimirSuministros.Click
GenerarPDFSuministros()
End Sub
'Protected Sub ImgImprimirSuministros_Click(sender As Object, e As EventArgs) Handles LbImprimirSuministros.Click
' GenerarPDFSuministros()
'End Sub
Private Sub GenerarPDFSuministros(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -3863,9 +3902,9 @@ Partial Class Contratos_ContratoObra
#End Region
#Region "I M P R E S I O N D E A V A N C E "
Private Sub lbImprimirAvance_Click(sender As Object, e As EventArgs) Handles lbImprimirAvance.Click
GenerarPDFAvance()
End Sub
'Private Sub lbImprimirAvance_Click(sender As Object, e As EventArgs) Handles lbImprimirAvance.Click
' GenerarPDFAvance()
'End Sub
Private Sub GenerarPDFAvance(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -3895,9 +3934,9 @@ Partial Class Contratos_ContratoObra
#End Region
#Region "I M P R E S I O N D E P R E S U P U E S T O "
Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click
GenerarPDFPPresupuesto()
End Sub
'Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click
' GenerarPDFPPresupuesto()
'End Sub
Private Sub GenerarPDFPPresupuesto(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -3927,12 +3966,12 @@ Partial Class Contratos_ContratoObra
#End Region
#Region "I M P R E S I O N D E A C T I V O S F I J O S "
Private Sub LbImprmirAF_Click(sender As Object, e As EventArgs) Handles LbImprmirAF.Click
GenerarPDFActivosFijos()
End Sub
Private Sub LbImprmirAFExcel_Click(sender As Object, e As EventArgs) Handles LbImprmirAFExcel.Click
GenerarPDFActivosFijos("Excel")
End Sub
'Private Sub LbImprmirAF_Click(sender As Object, e As EventArgs) Handles LbImprmirAF.Click
' GenerarPDFActivosFijos()
'End Sub
'Private Sub LbImprmirAFExcel_Click(sender As Object, e As EventArgs) Handles LbImprmirAFExcel.Click
' GenerarPDFActivosFijos("Excel")
'End Sub
Private Sub GenerarPDFActivosFijos(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -4053,13 +4092,13 @@ Partial Class Contratos_ContratoObra
ObjGral.Dispose()
'DdlPlantillaContrato.DataSource = DtPlantillasContratos
'DdlPlantillaContrato.DataBind()
End Sub
Protected Sub BtnImprimirC_Click(sender As Object, e As EventArgs) Handles liImprimir.Click
' Dim docx As String = DtPlantillasContratos.FiltroPrimeroValor("URL", $"CveContratoPlantilla = {DdlPlantillaContrato.SelectedValue}")
' DescarFormato(docx)
End Sub
'Protected Sub BtnImprimirC_Click(sender As Object, e As EventArgs) Handles liImprimir.Click
' ' Dim docx As String = DtPlantillasContratos.FiltroPrimeroValor("URL", $"CveContratoPlantilla = {DdlPlantillaContrato.SelectedValue}")
' ' DescarFormato(docx)
'End Sub
#End Region

View File

@@ -28,7 +28,7 @@
<div class="titlefiltros caption">
<div class="row">
<div class="col-md-1">
<%-- <div class="col-md-1">
Fecha Inicio:
</div>
<div class="col-md-1">
@@ -46,9 +46,9 @@
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
<%--
<div class="col-md-1">
Fecha Fin:
</div>
@@ -65,7 +65,7 @@
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrConsulta"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
<div class="col-md-1">
Cliente:
@@ -92,6 +92,151 @@
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpGrafica" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-xs-4">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px; height: 141.8px!important">
<div class="display">
<div class="number" style="display: none!important">
<small>Contratos</small>
<h3 class="font-purple-soft">
<span>
<asp:Literal Text="0" ID="LtlGrafNumeroContratos" runat="server" /></span>
</h3>
</div>
<div class="number">
<small>Total</small>
<h3 class="font-purple-soft">
<span>$<asp:Literal Text="0" ID="LtlGrafTotal" runat="server" /></span>
</h3>
</div>
<div class="icon">
<i class="fa fa-list-ol"></i>
</div>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px;">
<div class="display">
<div class="number" style="width:80%!important">
<table style="width:100%!important">
<td>
<small>Avance</small>
<h3 class="font-green-sharp">
<span>
<asp:Literal Text="0" ID="LtlAvanceImporte" runat="server" />
</span>
<small class="font-green-sharp"></small>
</h3>
</td>
<td>
<small>Porcentaje</small>
<h3 class="font-green-sharp">
<span>
<asp:Literal Text="0" ID="LtlAvanceImporteProcentaje1" runat="server" />
</span>
<small class="font-green-sharp"></small>
</h3>
</td>
</table>
</div>
<div class="icon">
<i class="icon-pie-chart"></i>
</div>
</div>
<div class="progress-info">
<div class="progress">
<span runat="server" id="SPAvance1" style="width: 76%;" class="progress-bar progress-bar-success green-sharp">
<%--<span runat="server" id="SPAvance2" class="sr-only">76% Avance</span>--%>
</span>
</div>
<div class="status">
<div class="status-title">Avance </div>
<div class="status-number"> <asp:Literal Text="0" ID="LtlAvanceImporteProcentaje2" runat="server" /> </div>
</div>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px;">
<div class="display">
<div class="number" style="width:80%!important">
<table style="width:100%!important">
<td>
<small>Faltante</small>
<h3 class="font-red-haze">
<span>
<asp:Literal Text="0" ID="LtlFaltanteImporte" runat="server" />
</span>
<small class="font-red-haze"></small>
</h3>
</td>
<td>
<small>Porcentaje</small>
<h3 class="font-red-haze">
<span>
<asp:Literal Text="0" ID="LtlFaltanteImportePorcentaje1" runat="server" />
</span>
<small class="font-red-haze"></small>
</h3>
</td>
</table>
</div>
<div class="icon">
<i class="icon-pie-chart"></i>
</div>
</div>
<div class="progress-info">
<div class="progress">
<span runat="server" id="SPFaltante" style="width: 76%;" class="progress-bar progress-bar-success red-haze">
<%--<span class="sr-only">76% Avance</span>--%>
</span>
</div>
<div class="status">
<div class="status-title">Faltante </div>
<div class="status-number"><asp:Literal Text="0" ID="LtlFaltanteImportePorcentaje2" runat="server" /> </div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -116,45 +261,91 @@
DataKeyNames="CveContrato,NumeroContrato" ShowHeader="True"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Fecha I.">
<ItemTemplate>
<asp:Label ID="LitEst" runat="server" Text='<%# Eval("FechaInicial", "{0:dd/MM/yyyy}")%>' ></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente">
<ItemTemplate>
<asp:HyperLink ID="HplCliente" CssClass="Texto" runat="server" Text='<%# Eval("Nombre") %>' NavigateUrl='<%# Eval("CveCliente", "../Ventas/Clientes.aspx?CveCliente={0}")%>' Target="_blank" ></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="# Contrato">
<asp:TemplateField HeaderText="# Contrato">
<ItemTemplate>
<asp:HyperLink ID="HplContratado" CssClass="Texto" runat="server" Text='<%# Eval("NumeroContrato")%>' Target="_blank" ></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente">
<ItemTemplate>
<asp:HyperLink ID="HplCliente" CssClass="Texto" runat="server" Text='<%# Eval("Nombre") %>' NavigateUrl='<%# Eval("CveCliente", "../Ventas/Clientes.aspx?CveCliente={0}")%>' Target="_blank" ></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Descripción">
<ItemTemplate>
<asp:Label ID="LblDescripcion" CssClass="Texto" runat="server" Text='<%# Eval("DescripcionContrato")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha I.">
<ItemTemplate>
<asp:Label ID="LblFechaInicial" runat="server" Text='<%# Eval("FechaInicial", "{0:dd/MM/yyyy}")%>' ></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha F.">
<ItemTemplate>
<asp:Label ID="LblFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:dd/MM/yyyy}")%>' ></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Proyecto">
<ItemTemplate>
<asp:Label ID="LblProyecto" CssClass="Texto" runat="server" Text='<%# Eval("Proyecto")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Label ID="LblImporte" CssClass="Texto" runat="server" Text='<%# Eval("Importe", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Avance $">
<ItemTemplate>
<asp:Label ID="LblAvanceImporte" CssClass="Texto" runat="server" Text='<%# Eval("AvanceImporte", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Faltante $">
<ItemTemplate>
<asp:Label ID="LblFaltanteImporte" CssClass="Texto" runat="server" Text='<%# Eval("FaltanteImporte", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Avance %" >
<ItemTemplate>
<asp:Label ID="LblIAvancePorcentaje" runat="server" Text='<%# Eval("AvancePorcentaje", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Avance $">
<asp:TemplateField HeaderText="Faltante %" >
<ItemTemplate>
<asp:Label ID="HplOFA" CssClass="Texto" runat="server" Text='<%# Eval("AvanceImporte", "{0:N2}")%>'></asp:Label>
<asp:Label ID="LblFaltantePorcentaje" runat="server" Text='<%# Eval("FaltantePorcentaje", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>

View File

@@ -11,7 +11,7 @@ Partial Class RepContratosObraAvances
CargaClientes()
CargaContratos()
'CargaDatos()
CargaDatos()
End If
End Sub
@@ -20,9 +20,11 @@ Partial Class RepContratosObraAvances
Private Sub CargaDatos()
Dim Con As New ClsContratos
Dim DTDatos As New DataTable
If Con.GetContratosObraRepAvances(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, DdlContrato.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If Con.GetContratosObraRepAvances(MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, DdlContrato.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GVDatos.DataSource = Con.DtResultados
DTDatos = Con.DtResultados
Else
GVDatos.DataSource = Nothing
End If
@@ -30,8 +32,47 @@ Partial Class RepContratosObraAvances
Con.Dispose()
GVDatos.DataBind()
UpDatos.Update()
UpDatos.Update()
If DTDatos.Rows.Count > 0 Then
Indicadores(DTDatos)
End If
End Sub
Private Sub Indicadores(DTDatos As DataTable)
Dim NumeroContratos As Integer = DTDatos.Rows.Count
Dim TotalContratos As Decimal = DTDatos.SUM("Importe")
Dim TotalAvance As Decimal = DTDatos.SUM("AvanceImporte")
Dim TotalFaltante As Decimal = TotalContratos - TotalAvance
Dim TotalAvancePorcentaje As Decimal = (TotalAvance * 100) / TotalContratos
Dim TotalFaltantePorcentaje As Decimal = 100 - TotalAvancePorcentaje
LtlGrafNumeroContratos.Text = NumeroContratos.ToString
LtlGrafTotal.Text = TotalContratos.ToString("###,###,###.00")
LtlAvanceImporte.Text = $"$ {TotalAvance.ToString("###,###,###.00")}"
LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %"
LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%"
SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%")
LtlFaltanteImporte.Text = $"$ {TotalFaltante.ToString("###,###,###.00")}"
LtlFaltanteImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %"
LtlFaltanteImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%"
SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%")
UpGrafica.Update()
End Sub
#Region "C O M B O S"

View File

@@ -8,89 +8,159 @@
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte Contratos Avance Detalle
<asp:Label runat="server" ID="LblNumeroContrato"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<%-- <asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpGrafica" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle" >
<div class="row">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" CausesValidation="true" ValidationGroup="GrConsulta" />
</div>
<div class="titlefiltros caption">
<div class="row">
<div class="col-md-1">
Fecha Inicio:
</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: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrConsulta"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrConsulta"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<div class="col-xs-4">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px; height: 141.8px!important">
<div class="display">
</div>
<div class="number" style="display: none!important">
<small>Numero Estimaciones</small>
<h3 class="font-purple-soft">
<span>
<asp:Literal Text="0" ID="LtlGrafNumeroEstimaciones2" runat="server" /></span>
</h3>
</div>
<div class="number">
<small>Numero Estimaciones</small>
<h3 class="font-purple-soft">
<span><asp:Literal Text="0" ID="LtlGrafNumeroEstimaciones" runat="server" /></span>
</h3>
</div>
<div class="icon">
<i class="fa fa-list-ol"></i>
</div>
</div>
</div>
</div>
<div class="col-md-1">
Fecha Fin:
</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: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
<div class="col-xs-4">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px;">
<div class="display">
<div class="number" style="width:80%!important">
<table style="width:100%!important">
<td>
<small>Avance</small>
<h3 class="font-green-sharp">
<span>
<asp:Literal Text="0" ID="LtlAvanceImporte" runat="server" />
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrConsulta"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrConsulta"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<small class="font-green-sharp"></small>
</h3>
</td>
<td>
<small>Porcentaje</small>
<h3 class="font-green-sharp">
<span>
<asp:Literal Text="0" ID="LtlAvanceImporteProcentaje1" runat="server" />
</span>
<small class="font-green-sharp"></small>
</h3>
</td>
</table>
<div class="col-md-1">
Cliente:
</div>
<div class="col-md-1">
<asp:DropDownList ID="DdlCliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" Class="select2me" Width="100PX" ></asp:DropDownList>
</div>
</div>
<div class="icon">
<i class="icon-pie-chart"></i>
</div>
</div>
<div class="progress-info">
<div class="progress">
<span runat="server" id="SPAvance1" style="width: 76%;" class="progress-bar progress-bar-success green-sharp">
<%--<span runat="server" id="SPAvance2" class="sr-only">76% Avance</span>--%>
</span>
</div>
<div class="status">
<div class="status-title">Avance </div>
<div class="status-number"> <asp:Literal Text="0" ID="LtlAvanceImporteProcentaje2" runat="server" /> </div>
</div>
<div class="col-md-1">
Contrato:
</div>
<div class="col-md-1">
<asp:DropDownList ID="DdlContrato" runat="server" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="select2me" Width="100PX" ></asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="dashboard-stat2 " style="border: 2px solid #DDD; margin-bottom: 0px;height: 141.8px!important;">
<div class="display">
<div class="number" style="width:80%!important">
<table style="width:100%!important">
<td>
<small>Fecha Fin</small>
<h3 class="font-red-haze">
<span>
<asp:Literal Text="0" ID="LtlFechaFin" runat="server" />
</span>
<small class="font-red-haze"></small>
</h3>
</td>
<td>
<small>Dias Restantes</small>
<h3 class="font-red-haze">
<span>
<asp:Literal Text="0" ID="LtlDiasRestantes" runat="server" />
</span>
<small class="font-red-haze"></small>
</h3>
</td>
</table>
</div>
<div class="icon">
<i class="fa fa-calendar"></i>
</div>
</div>
<%-- <div class="progress-info">
<div class="progress">
<span runat="server" id="SPFaltante" style="width: 76%;" class="progress-bar progress-bar-success red-haze">
<span class="sr-only">76% Avance</span>
</span>
</div>
<div class="status">
<div class="status-title">Días </div>
<div class="status-number"><asp:Literal Text="" ID="LtlFaltanteImportePorcentaje2" runat="server" /> </div>
</div>
</div>--%>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:UpdatePanel>
@@ -99,11 +169,11 @@
<div class="row">
<div class="col-md-3" style="text-align:left!important">
<strong><asp:Label runat="server" ID="LblNumeroContrato"></asp:Label></strong>
<div class="col-md-6" style="text-align:left!important">
<strong></strong>
</div>
<div class="col-md-3" style="text-align:right!important">
<div class="col-md-6" style="text-align:right!important">
<div style="display: inline-block">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
@@ -115,10 +185,10 @@
<div class="row">
<div class="col-md-6">
<div class="col-md-12">
<asp:GridView ID="GVDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron contratos con los Filtros seleccionados"
DataKeyNames="CveEstimacion,NumeroEstimacion" ShowHeader="True"
DataKeyNames="CveEstimacion,NumeroEstimacion,FechaEstimacion,NumeroContrato" ShowHeader="True"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="# Estimación">
@@ -162,6 +232,14 @@
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText=" ">
<ItemTemplate>
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="LnkAnexo_Click" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-table'></i>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>

View File

@@ -1,12 +1,13 @@
Imports Extensiones
Imports System.Data
Imports System.IO
Imports ClosedXML.Excel
Partial Class RepContratosObraAvancesDetalle
Inherits ClsPaginas
Property CveContrato As Integer
Get
If ViewState("CveContrato") Is Nothing Then
Return -1
@@ -16,17 +17,30 @@ Partial Class RepContratosObraAvancesDetalle
End Get
Set(value As Integer)
ViewState("CveContrato") = value
End Set
End Property
End Set
End Property
Property NumeroContrato As String
Get
If ViewState("NumeroContrato") Is Nothing Then
Return ""
Else
Return ViewState("NumeroContrato").ToString
End If
End Get
Set(value As String)
ViewState("NumeroContrato") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CveContrato = If(Request("CveContrato") IsNot Nothing AndAlso Request("CveContrato").ToString.ToEntero > 0, Request("CveContrato").ToString.ToEntero, -1)
LblNumeroContrato.Text = If(Request("NumeroContrato") IsNot Nothing AndAlso Request("NumeroContrato").ToString.Length > 0, $"Numero Contrato: {Request("NumeroContrato").ToString}", "")
NumeroContrato = If(Request("NumeroContrato") IsNot Nothing AndAlso Request("NumeroContrato").ToString.Length > 0, $"{Request("NumeroContrato").ToString}", "")
LblNumeroContrato.Text = If(Request("NumeroContrato") IsNot Nothing AndAlso Request("NumeroContrato").ToString.Length > 0, $"Estimaciones del Contrato: {Request("NumeroContrato").ToString}", "")
If CveContrato > 0 Then
CargaDatos()
@@ -38,63 +52,385 @@ Partial Class RepContratosObraAvancesDetalle
Private Sub CargaDatos()
Dim Con As New ClsContratos
Dim DTDatos As DataTable = New DataTable
Dim DTContrato As DataTable = New DataTable
If Con.GetContratosObraRepAvancesDetalle(CveContrato, UsuarioActual.CveEmpresa) Then
GVDatos.DataSource = Con.DtResultados
DTDatos = Con.DtResultados
If Con.DtResultados.Rows.Count = 0 Then
Alert("No se encontraron estimaciones.", TipoMensaje.MsgAdvertencia)
End If
Else
GVDatos.DataSource = Nothing
End If
If Con.GetContratosObraRepAvances(MinFecha, MaxFecha, -1, CveContrato, UsuarioActual.CveEmpresa) Then
DTContrato = Con.DtResultados
If DTContrato.Rows.Count > 0 Then
Indicadores(DTContrato, DTDatos.Rows.Count)
End If
End If
Con.Dispose()
GVDatos.DataBind()
UpDatos.Update()
UpDatos.Update()
End Sub
'#Region "C O M B O S"
Private Sub Indicadores(DTDatos As DataTable, NumeroEstimaciones As Integer)
LtlGrafNumeroEstimaciones.Text = NumeroEstimaciones
' Private Sub CargaContratos()
' DdlContrato.DataSource = GlobalDTContratos.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveContratoTipo IN(30,31) ")
' DdlContrato.DataBind()
' DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
' End Sub
Dim AvanceImporte As Decimal = DTDatos(0)("AvanceImporte").ToString.ToDecimal
Dim TotalContratos As Decimal = DTDatos(0)("Importe").ToString.ToDecimal
Dim TotalAvancePorcentaje As Decimal = (AvanceImporte * 100) / TotalContratos
Dim TotalFaltantePorcentaje As Decimal = 100 - TotalAvancePorcentaje
Dim FechaFinal As Date = DTDatos(0)("FechaFinal").ToString.ToDate
Dim Dias As Integer = (FechaFinal - Now).Days
Dias = If(Dias < 0, 0, Dias)
LtlAvanceImporte.Text = $"$ {AvanceImporte.ToString("###,###,###.00")}"
LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %"
LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%"
SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%")
LtlFechaFin.Text = FechaFinal.ToString("dd/MM/yyyy")
LtlDiasRestantes.Text = Dias.ToString("###,###")
UpGrafica.Update()
End Sub
' Private Sub CargaClientes()
' Dim dt As DataTable = Nothing
' Dim Cli As New ClsClientes
' If Cli.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
' dt = Cli.DtResultados
' End If
' Cli.Dispose()
' DdlCliente.DataSource = dt
' DdlCliente.DataBind()
' DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
' End Sub
'#End Region
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim HplNumeroEstimacion As HyperLink = e.Row.FCHyperLink("HplNumeroEstimacion")
HplNumeroEstimacion.NavigateUrl = $"./RepContratosObraAvancesPartida.aspx?CveEstimacion={e.Row.DataKey("CveEstimacion")}&NumeroEstimacion={ e.Row.DataKey("NumeroEstimacion")}&CveContrato={ CveContrato }"
HplNumeroEstimacion.NavigateUrl = $"./RepContratosObraAvancesPartida.aspx?CveEstimacion={e.Row.DataKey("CveEstimacion")}&NumeroEstimacion={ e.Row.DataKey("NumeroEstimacion")}&CveContrato={ CveContrato }&NumeroContrato={NumeroContrato}"
Dim LnkAnexo As LinkButton = e.Row.FCLinkButton("LnkAnexo")
ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkAnexo)
' NavigateUrl='<%# Eval("CveEstimacion", "RepContratosObraAvancesPartida.aspx?CveEstimacion={0}")%>'
End If
End Sub
'Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
' CargaDatos()
'End Sub
End Sub
Protected Sub LnkAnexo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveEstimacion As Integer = GvRow.DataKey("CveEstimacion").ToEntero
Dim NumeroEstimacion As Integer = GvRow.DataKey("NumeroEstimacion").ToEntero
Dim FechaEstimacion As Date = GvRow.DataKey("FechaEstimacion").ToDate
Dim NumeroContrato As String = GvRow.DataKey("NumeroContrato")
If CveEstimacion > 0 Then
GeneraAnexo(CveEstimacion, NumeroEstimacion, FechaEstimacion, NumeroContrato)
End If
End Sub
Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String)
Dim PlantillaAnexo As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Anexo.xlsx"
If Not System.IO.File.Exists(PlantillaAnexo) Then
Alert("No se encuentra la platilla de anexos.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim DtControl As New DataTable
Dim ObjContratos As New ClsContratos
Dim Lugar As String = ""
Dim DescripcionContrato As String = ""
If ObjContratos.GetContratosObraAvancesControlAcumulativo(CveContrato, CveEstimacion, UsuarioActual.CveEmpresa) Then
DtControl = ObjContratos.DtResultados
If DtControl.Rows.Count > 0 Then
Lugar = DtControl(0)("Lugar").ToString
DescripcionContrato = DtControl(0)("DescripcionContrato").ToString
End If
End If
ObjContratos.Dispose()
If DtControl.Rows.Count > 0 Then
Dim WBAnexo = New ClosedXML.Excel.XLWorkbook(PlantillaAnexo)
Dim WBAnexoSalvar = New ClosedXML.Excel.XLWorkbook
Dim WSControl = WBAnexo.Worksheet(1)
Dim WSDetalle = WBAnexo.Worksheet(2)
Dim CuerrentRow As Integer = 28
WSControl.Cell(17, 2).Value = NumeroEstimacion 'Estimacion
WSControl.Cell(20, 9).Value = FechaEstimacion.ToString("dd/MM/yyyy") 'Fecha estimacion
WSControl.Cell(19, 8).Value = "$ " & DtControl.SUM("Importe").ToString("###,###,###.00") 'Total
WSControl.Cell(19, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
WSControl.Cell(20, 6).Value = NumeroContrato
WSControl.Cell(18, 2).Value = Lugar
WSControl.Cell(18, 2).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left)
WSControl.Cell(18, 2).Style.Alignment.SetVertical(XLAlignmentVerticalValues.Top)
WSControl.Cell(17, 6).Value = "" 'Periodo Fecha Inicial
WSControl.Cell(17, 7).Value = "" 'Periuodo Fecha Final
WSControl.Cell(20, 2).Value = DescripcionContrato
WSControl.Cell(20, 2).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left)
WSControl.Cell(20, 2).Style.Alignment.SetVertical(XLAlignmentVerticalValues.Top)
WSControl.Cell(22, 7).Value = "" 'Presupuesto segun contrato
WSControl.Cell(19, 5).Value = "" 'Contrtatista
Dim RowCountControl As Integer = 1
For Each Drow As DataRow In DtControl.Rows
WSControl.Cell(CuerrentRow, 1).Value = Drow("Codigo").ToString
WSControl.Cell(CuerrentRow, 2).Value = Drow("PS").ToString
WSControl.Cell(CuerrentRow, 3).Value = Drow("Abreviatura").ToString
WSControl.Cell(CuerrentRow, 4).Value = Drow("Cantidad").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 5).Value = Drow("AcumuladoTotal").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 6).Value = Drow("AcumuladoAnterior").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 7).Value = Drow("CantidadActual").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 8).Value = Drow("PU").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 9).Value = Drow("Total").ToString.ToDecimal
WSControl.Cell(CuerrentRow, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
WSControl.Cell(CuerrentRow, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
'ultimo Row
If DtControl.Rows.Count = RowCountControl Then
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 1).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 2).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 3).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 4).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 5).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 7).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 8).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
WSControl.Cell(CuerrentRow + 1, 9).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSControl.Cell(CuerrentRow + 1, 8).Value = "Total:"
WSControl.Cell(CuerrentRow + 1, 8).Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Right)
WSControl.Cell(CuerrentRow + 1, 8).Style.Font.Bold = True
WSControl.Cell(CuerrentRow + 1, 9).Value = DtControl.SUM("Total")
WSControl.Cell(CuerrentRow + 1, 9).Style.Font.Bold = True
WSControl.Cell(CuerrentRow + 1, 9).Style.NumberFormat.Format = "$ ###,###,###.00"
Dim range = WSControl.Range($"A{CuerrentRow + 3}:D{CuerrentRow + 3}")
range.Merge()
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range = WSControl.Range($"E{CuerrentRow + 3}:I{CuerrentRow + 3}")
range.Merge()
range.Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range = WSControl.Range($"A{CuerrentRow + 4}:D{CuerrentRow + 4}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "ING. WALTER ROBERTO VILLEGAS LARES"
range = WSControl.Range($"E{CuerrentRow + 4}:I{CuerrentRow + 4}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "C. SALVADOR SUAREZ"
range = WSControl.Range($"A{CuerrentRow + 5}:D{CuerrentRow + 5}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "SERVICIOS ELECTRICOS Y CONTROL DE HERMOSILLO S.A. DE C.V."
range.Style.Font.Bold = True
range = WSControl.Range($"E{CuerrentRow + 5}:I{CuerrentRow + 5}")
range.Merge()
range.Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
range.Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
range.Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
range.Value = "GASERVICIO MATAMOROS SA DE CV"
range.Style.Font.Bold = True
End If
CuerrentRow = CuerrentRow + 1
RowCountControl = RowCountControl + 1
Next
WBAnexo.Worksheet(1).CopyTo(WBAnexoSalvar, "CONTROL")
For Each Drow As DataRow In DtControl.Rows
If Drow("CantidadActual").ToString.ToDecimal > 0 Then
WSDetalle.Cell(3, 6).Value = NumeroContrato
WSDetalle.Cell(4, 9).Value = "" 'Fecha de
WSDetalle.Cell(4, 10).Value = "" 'Fecha a
WSDetalle.Cell(4, 11).Value = NumeroEstimacion
WSDetalle.Cell(6, 6).Value = DescripcionContrato
WSDetalle.Cell(14, 2).Value = Drow("Codigo").ToString
WSDetalle.Cell(14, 3).Value = Drow("PS").ToString
WSDetalle.Cell(14, 4).Value = Drow("Abreviatura").ToString
WSDetalle.Cell(12, 3).Value = "" 'Concepto
WSDetalle.Cell(14, 10).Value = Drow("CantidadActual").ToString.ToDecimal
WSDetalle.Cell(14, 11).Value = Drow("CantidadActual").ToString.ToDecimal
'WSDetalle.Cell(61, 6).Value = "" 'Empresario
WSDetalle.Cell(61, 9).Value = Drow("Nombre").ToString 'Cliente
Dim objContrato As New ClsContratos
Dim DTArchivos As New DataTable
If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, Drow("Fecha").ToString, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
DTArchivos = objContrato.DtResultados
End If
objContrato.Dispose()
Dim Imagenes As New List(Of ClosedXML.Excel.Drawings.IXLPicture)
Dim CurrectRowImg As Integer = 19 'Row 19 primera imggen
Dim RowH As Double = WSDetalle.Row(19).Height
For Each drowArchivos In DTArchivos.Rows
Dim Archivo As String = drowArchivos("Archivo").ToString
Dim RutaArchivo As String = $"{UsuarioActual.Empresa.Ruta}\Contrato\{CveContrato}\Anexos\{Archivo}"
If File.Exists(RutaArchivo) Then
Dim Imagen = WSDetalle.AddPicture(RutaArchivo).MoveTo(WSDetalle.Cell(CurrectRowImg, 3))
Imagen.Scale(WSDetalle.Column(3).Width / (Imagen.OriginalWidth * 0.145D))
Dim ImgWidth As Double = Imagen.Height
Dim nRowmas As Integer = (ImgWidth / RowH).ToEntero
CurrectRowImg = CurrectRowImg + nRowmas
Imagenes.Add(Imagen)
End If
Next
WBAnexo.Worksheet(2).CopyTo(WBAnexoSalvar, If(Drow("Codigo").ToString.Trim.Length > 0, Drow("Codigo").ToString, Drow("CvePS").ToString))
For Each img As ClosedXML.Excel.Drawings.IXLPicture In Imagenes
img.Delete()
Next
End If
Next
Dim msB = New MemoryStream()
WBAnexoSalvar.SaveAs(msB)
Dim BB As Byte() = msB.ToArray
msB.Dispose()
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment; filename=Anexo_Estimacion" & NumeroEstimacion & ".xlsx")
Response.ContentType = "application/vnd.ms-excel"
Response.BinaryWrite(BB)
Response.End()
Else
Alert("No se encontraron datos des control", TipoMensaje.MsgAdvertencia)
End If
End Sub
End Class

View File

@@ -8,45 +8,14 @@
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte Contratos Avance por partida
<asp:Label runat="server" ID="LblEstimacion"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<%-- <asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="PnlFiltros" runat="server" DefaultButton="CmdConsultar">
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline" id="TrProgramar" runat="server">
<li>Cliente:
<asp:DropDownList ID="DdlCliente" runat="server" AutoPostBack="true" DataTextField="NombreComercial" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 250px !important;"></asp:DropDownList>
</li>
<li>Contratos:
<asp:DropDownList ID="DdlContrato" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
</li>
<li style="display: none;">Sección:
<asp:DropDownList ID="DdlSeccion" runat="server" AutoPostBack="false" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
</li>
<li>Partida:
<asp:DropDownList ID="DdlClasificacion" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
</li>
<li>Productos y Servicios:
<asp:DropDownList ID="DdlPS" runat="server" AutoPostBack="true" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"></asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="CmdConsultar" runat="server" Text="Consultar" class="btn btn-primary" CausesValidation="true" ValidationGroup="GrConsulta" />
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
@@ -56,7 +25,7 @@
<div class="row">
<div class="col-md-3" style="text-align:left!important">
<strong> <asp:Label runat="server" ID="LblEstimacion"></asp:Label></strong>
<strong> </strong>
</div>
<div class="col-md-3" style="text-align:right!important">

View File

@@ -25,7 +25,6 @@ Partial Class RepContratosObraAvancesPartida
Property CveContrato As Integer
Get
If ViewState("CveContrato") Is Nothing Then
Return -1
@@ -36,8 +35,20 @@ Partial Class RepContratosObraAvancesPartida
Set(value As Integer)
ViewState("CveContrato") = value
End Set
End Property
Property NumeroContrato As String
Get
If ViewState("NumeroContrato") Is Nothing Then
Return ""
Else
Return ViewState("NumeroContrato").ToString
End If
End Get
Set(value As String)
ViewState("NumeroContrato") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -46,8 +57,9 @@ Partial Class RepContratosObraAvancesPartida
CveEstimacion = If(Request("CveEstimacion") IsNot Nothing AndAlso Request("CveEstimacion").ToString.ToEntero > 0, Request("CveEstimacion").ToString.ToEntero, -1)
CveContrato = If(Request("CveContrato") IsNot Nothing AndAlso Request("CveContrato").ToString.ToEntero > 0, Request("CveContrato").ToString.ToEntero, -1)
NumeroContrato = If(Request("NumeroContrato") IsNot Nothing AndAlso Request("NumeroContrato").ToString.Length > 0, $"{Request("NumeroContrato").ToString}", "")
LblEstimacion.Text = If(Request("NumeroEstimacion") IsNot Nothing AndAlso Request("NumeroEstimacion").ToString.Length > 0, $"Numero Estimacion: {Request("NumeroEstimacion").ToString}", "")
LblEstimacion.Text = If(Request("NumeroEstimacion") IsNot Nothing AndAlso Request("NumeroEstimacion").ToString.Length > 0, $"Contgrato { NumeroContrato } Estimacion {Request("NumeroEstimacion").ToString}", "")
If CveEstimacion > 0 Then

View File

@@ -12,10 +12,16 @@
<Width>1.5586cm</Width>
</TablixColumn>
<TablixColumn>
<Width>11.45281cm</Width>
<Width>9.58751cm</Width>
</TablixColumn>
<TablixColumn>
<Width>5.42617cm</Width>
<Width>3.627cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.8653cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.79919cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
@@ -254,6 +260,122 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>P. U.</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<BackgroundColor>#008204</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Total</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>LightGrey</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<BackgroundColor>#008204</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
@@ -477,6 +599,75 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Importe">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Importe.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Importe</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>1pt</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Total">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Total.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>8pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Total</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>1pt</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
@@ -487,6 +678,16 @@
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember>
<Visibility>
<Hidden>=IIF(Parameters!TipoProveedor.Value = "1",true,false)</Hidden>
</Visibility>
</TablixMember>
<TablixMember>
<Visibility>
<Hidden>=IIF(Parameters!TipoProveedor.Value = "1",true,false)</Hidden>
</Visibility>
</TablixMember>
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
@@ -503,7 +704,7 @@
<Top>4.58198cm</Top>
<Left>0.20457cm</Left>
<Height>0.96717cm</Height>
<Width>20.2584cm</Width>
<Width>20.25842cm</Width>
<Style>
<Border>
<Color>LightGrey</Color>
@@ -1875,7 +2076,7 @@
<Height>4.17138in</Height>
<Style />
</Body>
<Width>8.10629in</Width>
<Width>8.0563in</Width>
<Page>
<PageFooter>
<Height>0.66146cm</Height>
@@ -1893,18 +2094,21 @@
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
<Format>dd/MM/yyyy</Format>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontSize>8pt</FontSize>
<Format>dd/MM/yyyy</Format>
</Style>
</TextRun>
<TextRun>
<Value>=Today</Value>
<Style>
<FontSize>8pt</FontSize>
<Format>dd/MM/yyyy</Format>
</Style>
</TextRun>
</TextRuns>
@@ -2276,6 +2480,12 @@
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="TipoProveedor">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<EmbeddedImages>
<EmbeddedImage Name="Logo119">

View File

@@ -1237,14 +1237,15 @@ Partial Class General_SaldosIniciales
Dim TipoDocto As String = Row("Tipo Documento").ToString
Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
GuardaLog(Sucursal + " - " + Row("Sucursal").ToString)
Dim RetIVA As Double = Row("Ret IVA").ToString.ToDouble
Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble
Dim RetIVA As Decimal = Row("Ret IVA").ToString.ToDecimal
Dim RetISR As Decimal = Row("Ret ISR").ToString.ToDecimal
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
Dim Moneda As String = Row("Moneda").ToString
Dim TipoCambio As String = Row("Tipo Cambio").ToString
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
Dim CveMoneda As Integer = 1
Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString.ToEntero
Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True
@@ -1252,7 +1253,7 @@ Partial Class General_SaldosIniciales
If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For
If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1
TipoDocto = IIf(TipoDocto.ToUpper = "INGRESOS", "Fac", "NC").ToString
TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING"), "Fac", "NC").ToString
'Temporalmente SE BORRARA
@@ -1261,9 +1262,9 @@ Partial Class General_SaldosIniciales
Dim CodProvee As String = "" 'Row("CodProvee2").ToString
'Moneda
If Moneda = "Pesos" Then
If Moneda.ToUpper.Contiene("PESOS", "PESO", "MXN") Then
CveMoneda = 1
ElseIf Moneda = "Dólares" Then
ElseIf Moneda.ToUpper.Contiene("DOLARES", "DOLAR", "USD", "DÓLARES") Then
CveMoneda = 2
End If
@@ -1287,7 +1288,7 @@ Partial Class General_SaldosIniciales
'Compra
If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero, SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDouble, FechaVencimiento,
False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal,
NumeroReembolso:=Transaccion, PorcentajeIVA:=0.16) Then
NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal) Then
ErrorCompras = True
Exit For
End If
@@ -1308,6 +1309,10 @@ Partial Class General_SaldosIniciales
If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, Folio, 25, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IEPS, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio, 15, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetIVA, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
If RetISR > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, Folio, 16, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetISR, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
'Saldo
If Saldo < Total Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio, 17, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total - Saldo) Then ErrorCompras = True : Exit For

View File

@@ -73,7 +73,7 @@
<asp:BoundField HeaderText="Producto" DataField="PS" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Sección Actual" DataField="SeccionAlmacen" ItemStyle-Width="15%" />
<%--<asp:BoundField HeaderText="Existencia" DataField="Existencia" DataFormatString="{0:#,###.##}" ItemStyle-Width="5%" />--%>
<asp:TemplateField ItemStyle-Width="7%">
@@ -91,7 +91,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Nuevo Lote" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtLote" Text='<%# Eval("Lote").ToString()%>' CssClass="form-control" ClientIDMode="Static" />
<asp:TextBox runat="server" ID="TxtLote" Text='<%# Eval("Lote").ToString()%>' CssClass="form-control input-sm" ClientIDMode="Static" />
</ItemTemplate>
</asp:TemplateField>
@@ -102,8 +102,8 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Nueva Fecha Cad." ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox runat="server" ID="TxtFechaCadNueva" Text='<%# Eval("FechaCaducidad").ToString()%>' CssClass="form-control" ClientIDMode="Static" />
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 113px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox runat="server" ID="TxtFechaCadNueva" Text='<%# Eval("FechaCaducidad", "{0:d}").ToString()%>' CssClass="form-control input-sm" ClientIDMode="Static" />
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFecha" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>

View File

@@ -595,9 +595,9 @@ Partial Class Inventarios_Consignaciones
Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero
Dim SeccionAlmacen As String = DdlSeccionAlmacen.SelectedItem.Text
Dim Serie As String = If(TxtSerie.Text = "", "-1", TxtSerie.Text)
Dim Lote As String = If(TxtLote.Text = "", "-1", TxtLote.Text)
Dim Caducidad As String = If(TxtCaducidad.Text = "", "-1", TxtCaducidad.Text)
Dim Serie As String = If(TxtSerie.Text = "", "", TxtSerie.Text)
Dim Lote As String = If(TxtLote.Text = "", "", TxtLote.Text)
Dim Caducidad As String = If(TxtCaducidad.Text = "", MinFecha.ToShortDateString, TxtCaducidad.Text)
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=PSSelected).FiltroPrimero("")
@@ -634,6 +634,15 @@ Partial Class Inventarios_Consignaciones
GvDatos.DataSource = DtMovimientos
GvDatos.DataBind()
If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
GvDatos.Columns(7).Visible = DtMovimientos.MAX("CveSeccionAlmacen").ToEntero > 0
GvDatos.Columns(8).Visible = DtMovimientos.MAX("Serie") <> ""
GvDatos.Columns(9).Visible = DtMovimientos.MAX("Lote") <> ""
GvDatos.Columns(10).Visible = DtMovimientos.MAX("FechaCaducidad").ToDate > MinFecha
End If
TxtCantidad.Text = ""
TxtPU.Text = ""
LbTotal.Text = ""
@@ -849,7 +858,7 @@ Partial Class Inventarios_Consignaciones
'AGREGAMOS MOVIMIENTO
If MovtoNew Then
Folio = ObjInventario.GetFolioSiguiente(ConceptoDevolucion, UsuarioActual.CveEmpresa)
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, ConceptoDevolucion, DdlMoneda.SelectedValue.ToEntero, Fecha, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveConsignacion:=CveConsignacion, Observaciones:=TxtObservacionesDevolucion.Text.Trim)
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, ConceptoDevolucion, DdlMoneda.SelectedValue.ToEntero, Fecha, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveConsignacion:=CveConsignacion, Observaciones:=TxtObservacionesDevolucion.Text.Trim, Modulo:="Consig")
End If
If CveMovimiento > 0 Then

View File

@@ -1259,6 +1259,13 @@ Partial Class Inventarios_EntradasSalidas
Alert("El producto requiere Serie", TipoMensaje.MsgAdvertencia)
End If
If RowPS("VentaMinima").ToString.ToDecimal > 0 Then
If Cantidad Mod RowPS("VentaMinima").ToString().ToDecimal <> 0 Then
Alert(String.Format("El producto se vende solo en cantidades de {0}", RowPS("VentaMinima").ToString()))
Valido = False
End If
End If
'salida
If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen

View File

@@ -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 input-sm" runat="server" Visible="false"></asp:TextBox>
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="F.Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">

View File

@@ -851,6 +851,7 @@ Partial Class Inventarios_EntregaAlmacen
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")
SugerirFechaLote()
End If
GvDatos.DataSource = DtDatos
@@ -2466,25 +2467,34 @@ Partial Class Inventarios_EntregaAlmacen
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato,
CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(), Modulo:="RE/G8")
FolioEntrada = ObjInventario.Folio
Dim ImporteAlmacen As Decimal = 0
If CveMovimientoEntrada <= 0 Then
TextoError.AppendFormat("No se pudo generar el movimiento de entrada correctamente")
ErrorMovInv = True
Else
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
ImporteAlmacen = ObjInventario.DtResultados.SUMD("Total")
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero()) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de entrada")
Exit For
End If
Next
Next
Else
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de entrada")
End If
End If
'se registra
If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, ImporteAlmacen, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True) <= 0 Then
ErrorMovInv = True
End If
Else 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN - SALIDA ALMACEN
ErrorMovInv = Not GenerarPrePoliza(ObjInventario, ObjVentas, ObjConta, CveMovimiento, TextoError)
End If
@@ -3810,5 +3820,85 @@ Partial Class Inventarios_EntregaAlmacen
End Sub
#End Region
#Region "sugerir caducidad"
Private Sub SugerirFechaLote()
Dim ObjInventarios As New ClsInventarios()
Dim FechasExcluidas As New List(Of String)
FechasExcluidas.Add(MinFecha.ToDate.ToString)
Dim MaxRows As Integer = DtDatos.Rows.Count - 1
For contador As Integer = 0 To MaxRows
Dim DtRow As DataRow = DtDatos.Rows(contador)
Dim AplicaCaducidad As Boolean = DtRow.Item("AplicaCaducidad").ToString = "True"
Dim AplicaLote As Boolean = DtRow.Item("AplicaLote").ToString = "True"
Dim Cantidad As Integer = DtRow.Item("CantidadC").ToString.ToEntero
Dim FechasExcluidasFiltro As String = String.Format("FechaCaducidad NOT IN('{0}')", String.Join("','", FechasExcluidas))
If AplicaCaducidad Or AplicaLote Then
Dim CvePS As Integer = DtRow.Item("CvePS").ToString.ToEntero
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjInventarios.DtResultados.Rows.Count > 0 Then
Dim MinimumRow As DataRow = ObjInventarios.DtResultados.FiltroPrimero(FechasExcluidasFiltro, "FechaCaducidad")
DtRow.Item("FechaCaducidad") = MinimumRow.Item("FechaCaducidad").ToString
DtRow.Item("Lote") = MinimumRow.Item("Lote").ToString
Dim CantidadDisponible As Integer = MinimumRow.Item("Cantidad").ToString.ToEntero
DtRow.Item("CantidadF") = CantidadDisponible
DtRow.Item("CantidadS") = CantidadDisponible
If Cantidad > CantidadDisponible Then
Dim RowFaltante As DataRow = DtDatos.NewRow()
Dim CantidadFaltante As Integer = (Cantidad - CantidadDisponible)
RowFaltante.Item("CantidadC") = CantidadFaltante
RowFaltante.Item("CantidadF") = CantidadFaltante
RowFaltante.Item("CantidadS") = CantidadFaltante
DtRow.Item("CantidadC") = CantidadDisponible
For Each Column As DataColumn In DtDatos.Columns
If Not Column.ColumnName.Contiene("CantidadC", "CantidadF", "CantidadS") Then
RowFaltante.Item(Column.ColumnName) = DtRow.Item(Column.ColumnName)
End If
Next
FechasExcluidas.Add(MinimumRow.Item("FechaCaducidad").ToString)
DtDatos.Rows.Add(RowFaltante)
MaxRows += 1
Else
DtRow.Item("CantidadF") = Cantidad
End If
End If
End If
End If
Next
'For Each DtRow As DataRow In DtDatos.Rows
' Dim AplicaCaducidad As Boolean = DtRow.Item("AplicaCaducidad").ToString = "True"
' Dim AplicaLote As Boolean = DtRow.Item("AplicaLote").ToString = "True"
' Dim Cantidad As Integer = DtRow.Item("CantidadC").ToString.ToEntero
' Dim FechasExcluidasFiltro As String = String.Format("FechaCaducidad NOT IN('{0}')", String.Join("','", FechasExcluidas))
' If AplicaCaducidad Or AplicaLote Then
' Dim CvePS As Integer = DtRow.Item("CvePS").ToString.ToEntero
' If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' Dim MinimumRow As DataRow = ObjInventarios.DtResultados.FiltroPrimero(FechasExcluidasFiltro, "FechaCaducidad")
' DtRow.Item("FechaCaducidad") = MinimumRow.Item("FechaCaducidad").ToString
' DtRow.Item("Lote") = MinimumRow.Item("Lote").ToString
' Dim CantidadDisponible As Integer = MinimumRow.Item("Cantidad").ToString.ToEntero
' DtRow.Item("CantidadF") = CantidadDisponible
' If Cantidad > CantidadDisponible Then
' Dim RowFaltante As DataRow = DtDatos.NewRow()
' RowFaltante.Item("CantidadC") = (Cantidad - CantidadDisponible)
' RowFaltante.Item("CantidadF") = (Cantidad - CantidadDisponible)
' RowFaltante.Item("CantidadS") = (Cantidad - CantidadDisponible)
' For Each Column As DataColumn In DtDatos.Columns
' If Not Column.ColumnName.Contiene("CantidadC", "CantidadF", "CantidadS") Then
' RowFaltante.Item(Column.ColumnName) = DtRow.Item(Column.ColumnName)
' End If
' Next
' DtDatos.Rows.Add(RowFaltante)
' End If
' End If
' End If
'Next
ObjInventarios.Dispose()
End Sub
#End Region
End Class

View File

@@ -4,6 +4,11 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
@@ -119,10 +124,10 @@
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional" >
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgImprimir" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
<asp:LinkButton ID="ImgImprimir" runat="server"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkSeries" Visible="false" runat="server"><i class="fa fa-list"></i> Series Disponibles</asp:LinkButton>
@@ -131,9 +136,18 @@
<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">&nbsp;</a>
<asp:HyperLink runat="server" ID="HlAyuda" NavigateUrl="/Documentacion/DocumentacionInventarios.aspx#Kardex"><i class="fa fa-question-circle"></i> Ayuda</asp:HyperLink>
<%--<div>
&nbsp;<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#Kardex">&nbsp;&nbsp;</a>
</div>--%>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgImprimir" />
<asp:PostBackTrigger ControlID="LnkExportar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
@@ -159,8 +173,7 @@
<label class="col-md-1 truncate" style="max-width: 80px;">Almacén:</label>
<div class="col-md-2">
<%--<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me " Style="width: 175px !important;" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>--%>
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"
DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
</div>
@@ -370,7 +383,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Concepto" ItemStyle-Width="170px" HeaderText="Movimiento" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Almacen" ItemStyle-Width="140px" HeaderText="Almacen" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Almacen" ItemStyle-Width="140px" HeaderText="Almacén" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Folio">
<ItemTemplate>
<asp:HyperLink ID="hlFolio" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" NavigateUrl='<%# Eval("CveMovimiento", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}")%>' Target="_blank" />

View File

@@ -236,10 +236,10 @@ Partial Class Inventarios_Kardex
LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del dia <b> $ {TC.FormatoNumero(4)} </b>"
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del día <b> $ {TC.FormatoNumero(4)} </b>"
If TxtSerie.Text <> "" Then
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por numero de serie: <b> {TxtSerie.Text} </b>"
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por número de serie: <b> {TxtSerie.Text} </b>"
Else
LtIndicador_MensajeSerie.Text = ""
End If

View File

@@ -393,6 +393,7 @@ Partial Class Inventarios_KardexAlmacen
Private Sub AgregarProyeccion(dt As DataTable)
Dim TieneError As Boolean = False
Dim StrCodigo As New StringBuilder
Dim ObjInventarios As New ClsInventarios
ObjInventarios.IniciaTransacSQL()
@@ -400,25 +401,36 @@ Partial Class Inventarios_KardexAlmacen
Dim DtProductosEmpresas As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
For Each dtRow As DataRow In dt.Rows
Dim Codigo As String = dtRow("Código").ToString
Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo))
Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal
If Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then
TieneError = True
Exit For
If Codigo <> "" Then
Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo)).ToEntero
Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal
If CvePS <= 0 Then
TieneError = True
StrCodigo.AppendFormat(" {0}<br/>", Codigo)
Exit For
ElseIf Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then
TieneError = True
StrCodigo.Append("Ocurrio un error al registrar")
Exit For
End If
End If
Next
Else
TieneError = True
End If
If TieneError Then
Alert("Ocurrio un error al registrar el Código no encontrado: " & StrCodigo.ToString, TipoMensaje.MsgError)
ObjInventarios.RollBack()
Else
ObjInventarios.Commit()
Alert("Se ha agregado la proyección de productos correctamente")
End If
ObjInventarios.Dispose()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivProyeccion"))
Alert("Se ha agregado la proyección de productos correctamente")
End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable

View File

@@ -2621,7 +2621,13 @@ Partial Class Inventarios_RecepcionAlmacen
MovtosSalidaDirecta.Add(MovSalidaExA.CveMovimiento)
FoliosSalidaDirecta.Add(MovSalidaExA.Folio)
Dim MovEntradaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 9, ObjFactura.CveVenta, MovSalidaExA.CveMovimiento, DtDetalleMovimiento, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R2")
Dim dttexa As DataTable = DtDetalleMovimiento.Copy
'se limpia la seccion, para que lo tome automaticamente
For Each drr As DataRow In dttexa.Rows
drr("CveSeccionAlmacen") = -3
Next
Dim MovEntradaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 9, ObjFactura.CveVenta, MovSalidaExA.CveMovimiento, dttexa, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R2")
ErrorMovInv = MovEntradaExA.CveMovimiento <= 0

View File

@@ -131,18 +131,7 @@
<script type="text/javascript" src="/Metronic/assets/global/scripts/JSNoCustom"></script>
<%--<script type="text/javascript" src="/Scripts/Notificaciones.js"></script>--%>
<script>
function opennewlocation(returnurl,token) {
//let fram = $('#framexd');
//let Pagina =
// "http://localhost:2536/auth/login?authtoken=" + token;
// Metronic.blockUI();
//fram.unbind("load");
//fram.load(function () {
// setTimeout(function () { document.location = returnurl; },1500)
// Metronic.unblockUI();
//});
//fram.prop('src', Pagina);
function opennewlocation(returnurl,token) {
document.location = returnurl;
}
// aqui debe de llammarse siganalr, para desconectar

View File

@@ -250,26 +250,7 @@ Partial Class LogIn
Dim cookie = FormsAuthentication.GetAuthCookie(Usuario.CveUsuario, False)
Response.Cookies.Add(cookie)
'RegistraScript(String.Format("iniciaSesion('{0}')", ReturnUrl.Replace("'", "\'")))
'Public Property CveUsuario As Integer
'Public Property Mail As String
'Public Property Nombre As String
'Public Property Contraseña As String
'Public Property CvePerfil As Integer
'Public Property CveUsuarioModifico As Integer
'Public Property CveEmpresa As Integer
'Public Property CveUsuarioRegistro As Integer
Dim userm As New UserModel()
userm.CveUsuario = Usuario.CveUsuario
userm.Mail = Usuario.Usuario
userm.Nombre = Usuario.Nombre
userm.Contraseña = Usuario.Contraseña
userm.CvePerfil = Usuario.CveRol
userm.CveEmpresa = 119 'Usuario.CveEmpresa
userm.CveUsuarioModifico = Usuario.CveEmpresa
userm.CveUsuarioRegistro = Usuario.CveEmpresa
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, GenerateJSONWebToken(userm)))
RegistraScript(String.Format("opennewlocation('{0}','{1}')", ReturnUrl, ""))
'Response.Redirect(ReturnUrl, True)
Else
Alert("El usuario no esta autorizado en este equipo, favor de contactar al administrador de usuarios.", TipoMensaje.MsgAdvertencia)

View File

@@ -47,6 +47,10 @@
<li style="text-align: left!important" runat="server" id="LiLnkGuias" visible="true">
<asp:LinkButton runat="server" ID="LnkAgregarGuia" CssClass="" data-toggle="tooltip" data-placement="left" OnClick="LnkAgregarGuia_Click" title="Paquetería Guías." Text="<i class='fa fa-truck'></i> Paqueteria Guías" Visible="false"></asp:LinkButton>
</li>
<li style="text-align: left!important" runat="server" id="LIContratos" visible="false">
<asp:LinkButton runat="server" ID="LnkAcontratos" CssClass="" data-toggle="tooltip" data-placement="left" OnClick="LnkAcontratos_Click" title="Contratos" Text="<i class='fa fa-file-text'></i> Contratos"></asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LbDescargarExcel" />
@@ -2642,6 +2646,7 @@
</div>
</div>
</div>
<div id="DivCambiarMoneda" class="modal ADS fade">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpdatePanel3" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
@@ -2677,6 +2682,103 @@
</asp:UpdatePanel>
</div>
</div>
<div id="DivmodalConmtrato" class="modal ADS fade">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalContrato" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4>
<asp:Label Text="Contratos" ID="LblTituloContrato" runat="server" />
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList runat="server" ID="DdlContratosObra" AutoPostBack="true" OnSelectedIndexChanged="DdlContratosCompras_SelectedIndexChanged" DataTextField="ContratoCompleto" DataValueField="CveContrato" CssClass="form-control input-sm select2me" Width="100%">
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlContratosObra.ClientID.ToString()%>">Contrato:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoGasto" runat="server" DataTextField="TipoGasto" DataValueField="CveTipoGasto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipoGasto.ClientID.ToString()%>">Tipo de Gasto:</label>
<asp:RequiredFieldValidator runat="server" Enabled="true" InitialValue="-1" Display="None" ID="RFVDdlTipoGasto" ControlToValidate="DdlTipoGasto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Gasto''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpAplicaContrato"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CERFVDdlTipoGasto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlTipoGasto" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvContratosControl" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas"
DataKeyNames="CveContratoDetalle,CvePS,PS,Cantidad,PU,CantidadMax,CveUnidadMedida,Abreviatura,CveSubProyecto,SubProyecto,Codigo,CveProyecto,Proyecto,IVA,RetISR,RetIVA,IEPSPorcentaje,IEPSGrabaIVA,CveClasificacion,Clasificacion"
CssClass="table GVEstimacion table-advance table-hover" GridLines="None" Width="100%">
<Columns>
<asp:TemplateField HeaderText="Producto">
<ItemTemplate>
<asp:Label ID="LblPS" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Width="250px"></asp:Label>
</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="PU">
<ItemTemplate>
<span><%# Eval("PU", "{0:N2}")%></span>
</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" onkeydown="keydownenabledtab(event)"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAplicarContrato" runat="server" Text="Aceptar" ClientIDMode="Static" CssClass="btn btn-success" OnClick="BtnAplicarContrato_Click" Visible="false" ValidationGroup="GrpAplicaContrato" CausesValidation="true" />
<button type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="server">
@@ -3056,6 +3158,36 @@
}
function ValidateCant(variable) {
var txt = $(variable);
var max = txt.data('cantidad');
var value = parseInt(txt.val());
if (value > max) {
txt.val(max);
}
if (value < 0) {
txt.val(0);
}
var importe = $('.txtimporte[data-cve="' + txt.data('cve') + '"]');
importe.val(parseFloat(txt.val()) * parseFloat(txt.data('pu')));
}
function keydownenabledtab(event) {
var key = event.keyCode;
if (key == 9) {
return true;
} else {
event.preventDefault();
}
}
</script>

View File

@@ -547,9 +547,27 @@ Partial Class OC
End Set
End Property
Private Property ContratoObraAplciado As Boolean
Get
If ViewState("ContratoObraAplciado") Is Nothing Then
Return False
Else
Return Boolean.Parse(ViewState("ContratoObraAplciado").ToString)
End If
End Get
Set(value As Boolean)
ViewState("ContratoObraAplciado") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatosAgregarPS()
@@ -582,6 +600,7 @@ Partial Class OC
CargaDatos(CveOrdenCompra)
Else
LIContratos.Visible = True
EsNuevo = True
InicializarValores()
HlAgregarExcel.Visible = True
@@ -1065,6 +1084,8 @@ Partial Class OC
DtDetalle.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
DtDetalle.Columns.Add("CveTipoGastoObra", GetType(Integer))
'DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
' DtDetalle.Columns.Add("ClasificacionOG", GetType(String))
@@ -2150,7 +2171,7 @@ Partial Class OC
Private Sub AddPS(Cantidad As String, CvePS As Integer, PS As String, Observaciones As String, Importe As Double, Descuento As Double, Total As Double, CveUnidadMedida As Integer, IVAPS As Double, IEPSPS As Double, IEPSPSIVA As Double, CveClasificacion As Integer,
UM As String, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, CodigoAF As String, CveActivoFijo As Integer, TipoDato As Integer,
CveOrdenCompraDetalle As Integer, CveOrdenCompra As Integer, IdCuentaPorEjercer As Integer, IdCuentaComprometido As Integer, CveProgramaOperativo As Integer, CveUnidadAdministrativa As Integer,
CveFuenteFinanciamiento As Integer, CveTipoGasto As Integer, CveClasificacionOG As Integer, RetIVA As Double, RetISR As Double, Optional CveContratoDetalle As Integer = 0)
CveFuenteFinanciamiento As Integer, CveTipoGasto As Integer, CveClasificacionOG As Integer, RetIVA As Double, RetISR As Double, Optional CveContratoDetalle As Integer = -1, Optional CveTipoGastoObra As Integer = -1)
If DtDetalle IsNot Nothing Then
Dim dr As DataRow = DtDetalle.NewRow
@@ -2206,6 +2227,8 @@ Partial Class OC
dr("CveTipoGasto") = CveTipoGasto
dr("CveClasificacionOG") = CveClasificacionOG
dr("CveContratoDetalle") = CveContratoDetalle
dr("CveTipoGastoObra") = CveTipoGastoObra
DtDetalle.Rows.Add(dr)
DtDetalle.AcceptChanges()
@@ -2488,7 +2511,7 @@ Partial Class OC
IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble,
RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble,
RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble,
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then
TieneError = True
Exit For
End If
@@ -2566,7 +2589,7 @@ Partial Class OC
dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, pCveOrdenCompraPadre:=CveOrdenCompraPadre, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble,
IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero,
IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble,
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero()) Then
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero(), CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then
TieneError = True
Exit For
End If
@@ -2679,7 +2702,7 @@ Partial Class OC
'inserto los nuevos detalles
If Not TieneError Then
For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato = 0").Rows
If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then
If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then
TieneError = True
Exit For
Else
@@ -3158,7 +3181,8 @@ Partial Class OC
RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble,
CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble,
RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble,
IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then
IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble,
CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then
HuboError = True
Exit For
End If
@@ -3199,7 +3223,7 @@ Partial Class OC
'CveOrdenCompra = objOrdenCompra.CveOrdenCompra
If Not HuboError Then
For Each dr As DataRow In DtDetalle.Rows
If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then
If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then
HuboError = True
Exit For
End If
@@ -3740,7 +3764,7 @@ Partial Class OC
GvD.EditIndex = e.NewEditIndex
CargaDatosDetalles()
Dim EditingRow As GridViewRow = GvD.Rows(e.NewEditIndex)
If Not EsCreaApartirDe Then
If Not EsCreaApartirDe AndAlso Not UsuarioActual.TienePermisoProceso(131) Then 'si tiene el proce 131, e va a permitir, sino que lo bloquee
If EditingRow.DataKey("TipoDato").ToEntero = 2 Or EditingRow.DataKey("CantidadNoEditable").ToDecimal > 0 Then
EditingRow.FCDropDownList("DdlClasificacion").Enabled = False
EditingRow.FCDropDownList("DdlPS").Enabled = False
@@ -3751,6 +3775,15 @@ Partial Class OC
End If
End If
If ContratoObraAplciado Then
EditingRow.FCDropDownList("DdlClasificacion").Enabled = False
EditingRow.FCDropDownList("DdlPS").Enabled = False
EditingRow.FCDropDownList("CboUnidadMedidaEdit").Enabled = False
EditingRow.FCDropDownList("DdlProyectoEdit").Enabled = False
EditingRow.FCDropDownList("DdlSubProyectoEdit").Enabled = False
EditingRow.FCTextBox("LblEditCodigo").Enabled = False
End If
End Sub
Protected Sub GvD_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvD.RowUpdating
Dim Cantidad, Importe, Descuento As Double
@@ -7296,6 +7329,9 @@ Partial Class OC
End If
End If
DdlContratos.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpContrato.Update()
End Sub
@@ -8230,4 +8266,118 @@ Partial Class OC
Protected Sub LnkAcontratos_Click(sender As Object, e As EventArgs)
DdlContratosObra.Items.Clear()
DdlContratosObra.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DdlContratosObra.DataBind()
DdlContratosObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoGasto.Items.Clear()
DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
DdlTipoGasto.DataBind()
DdlTipoGasto.Items.Insert(0, New ListItem("Seleccione", "-1"))
RegistraScript("$('#DivmodalConmtrato').modal('show')")
UpModalContrato.Update()
End Sub
Protected Sub DdlContratosCompras_SelectedIndexChanged(sender As Object, e As EventArgs)
If DdlContratosObra.SelectedValue.ToEntero > 0 Then
Dim ObjContratos As New ClsContratos()
If ObjContratos.GetContratosObraCompras(DdlContratosObra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If ObjContratos.DtResultados.Rows.Count > 0 Then
GvContratosControl.DataSource = ObjContratos.DtResultados
BtnAplicarContrato.Visible = True
Else
GvContratosControl.DataSource = Nothing
BtnAplicarContrato.Visible = False
End If
End If
ObjContratos.Dispose()
GvContratosControl.DataBind()
UpModalContrato.Update()
End If
End Sub
Protected Sub BtnAplicarContrato_Click(sender As Object, e As EventArgs)
DtDetalle.Rows.Clear()
Dim CveTipoGastoObra As Integer = DdlTipoGasto.SelectedValue.ToEntero
For Each GvRow As GridViewRow In GvContratosControl.Rows
Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero
Dim Cantidad As Double = GvRow.FCTextBox("TxtCantidad").Text.ToDouble
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
Dim PS As String = GvRow.DataKey("PS")
Dim PU As Double = GvRow.DataKey("PU").ToDouble
Dim TotalPS As Double = GvRow.FCTextBox("TxtImporte").Text.ToDouble
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida")
Dim UMAbreviatura As String = GvRow.DataKey("Abreviatura").ToString
Dim SubProyecto As Integer = GvRow.DataKey("SubProyecto")
Dim CveSubProyecto As Integer = GvRow.DataKey("CveSubProyecto").ToEntero
Dim Codigo As String = "" 'GvRow.DataKey("Codigo")
Dim Proyecto As String = GvRow.DataKey("Proyecto")
Dim CveProyecto As Integer = GvRow.DataKey("CveProyecto").ToEntero
Dim RetISR As Double = GvRow.DataKey("RetISR").ToString.ToDouble
Dim RetIVA As Double = GvRow.DataKey("RetIVA").ToString.ToDouble
Dim IvaPS As Double = GvRow.DataKey("IVA").ToString.ToDouble
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero
Dim Clasificacion As String = GvRow.DataKey("Clasificacion")
Dim IEPSPS As Double = GvRow.DataKey("IEPSPorcentaje").ToString.ToDouble
Dim IEPSPSIVA As Double = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0)
Dim IdCuentaPorEjercer As Integer = -1
Dim IdCuentaComprometido As Integer = -1
If Cantidad > 0 Then
AddPS(Cantidad, CvePS, PS, PS, PU, 0, TotalPS,
CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UMAbreviatura, Clasificacion, CveProyecto, Proyecto,
CveSubProyecto, SubProyecto, Codigo, -1, 0, -1, -1, IdCuentaPorEjercer,
IdCuentaComprometido, -1, -1, -1, -1,
-1, RetIVA, RetISR, CveContratoDetalle:=CveContratoDetalle, CveTipoGastoObra:=CveTipoGastoObra)
ContratoObraAplciado = True
End If
Next
CargaSuperior()
CargaDatosDetalles()
RegistraScript("$('#DivmodalConmtrato').modal('hide')")
UPPDetalle.Update()
End Sub
End Class

View File

@@ -1238,7 +1238,7 @@ Partial Class ProductosyServicios
End If
Next
End If
If UsuarioActual.CveEmpresa = 141 Then
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True)
End If
@@ -1304,7 +1304,7 @@ Partial Class ProductosyServicios
Next
End If
If UsuarioActual.CveEmpresa = 141 Then
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False)
End If
@@ -2763,7 +2763,8 @@ Partial Class ProductosyServicios
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}
Dim StrEmpresas As String = UsuarioActual.Empresa.Funcionalidad(563)
Dim EmpresasFranquicia As List(Of Integer) = StrEmpresas.Split(","c).ToList().ConvertAll(Function(x) Convert.ToInt32(x))
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

View File

@@ -15959,10 +15959,15 @@ Partial Class Ventas
Return False
End If
If UsuarioActual.CveEmpresa = 72 AndAlso DrPS("SATClavePS").ToString() = "01010101" Then
MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: El producto/servicio no existe en el catálogo del SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
Return False
End If
'If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) AndAlso DrPS("SATClavePS").ToString() = "01010101" Then
' MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: El producto/servicio no existe en el catálogo del SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
' Return False
'End If
End If
Else
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) AndAlso DrPS("SATClavePS").ToString() = "01010101" Then
MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: El producto/servicio no existe en el catálogo del SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
Return False
End If
End If

View File

@@ -130,6 +130,10 @@