Contratos Autorizacion
This commit is contained in:
@@ -357,6 +357,40 @@ Partial Class Contratos_ContratoObra
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Property TotalAvanceVentas As Decimal
|
||||
Get
|
||||
|
||||
If ViewState("TotalAvanceVentas") Is Nothing Then
|
||||
Return 0D
|
||||
Else
|
||||
Return ViewState("TotalAvanceVentas").ToString.ToDecimal
|
||||
End If
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("TotalAvanceVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Property TotalAvanceInterno As Decimal
|
||||
Get
|
||||
|
||||
If ViewState("TotalAvanceInterno") Is Nothing Then
|
||||
Return 0D
|
||||
Else
|
||||
Return ViewState("TotalAvanceInterno").ToString.ToDecimal
|
||||
End If
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("TotalAvanceInterno") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
@@ -417,6 +451,8 @@ Partial Class Contratos_ContratoObra
|
||||
|
||||
End If
|
||||
|
||||
Indicadores()
|
||||
|
||||
Else
|
||||
'Configuración de Modalidad Insert
|
||||
LblFechaCaptura.Text = Now.ToShortDateString()
|
||||
@@ -440,7 +476,7 @@ Partial Class Contratos_ContratoObra
|
||||
CargaPS()
|
||||
CargaPSInsumos()
|
||||
ConfiguraTipos()
|
||||
CargaDatosEncabezado()
|
||||
'CargaDatosEncabezado()
|
||||
|
||||
|
||||
End If
|
||||
@@ -620,9 +656,9 @@ Partial Class Contratos_ContratoObra
|
||||
DvTotal.Visible = True
|
||||
|
||||
|
||||
If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
|
||||
TableDatosCabecera.Visible = True
|
||||
End If
|
||||
'If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
|
||||
' TableDatosCabecera.Visible = True
|
||||
'End If
|
||||
|
||||
If CveTipoContrato = 25 Then
|
||||
|
||||
@@ -638,9 +674,9 @@ Partial Class Contratos_ContratoObra
|
||||
DvTotal.Visible = True
|
||||
|
||||
|
||||
If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
|
||||
TableDatosCabecera.Visible = True
|
||||
End If
|
||||
'If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
|
||||
' TableDatosCabecera.Visible = True
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
@@ -668,8 +704,8 @@ Partial Class Contratos_ContratoObra
|
||||
msjpresupuestos.Visible = False
|
||||
|
||||
If ArchivoUpdate = ObjContratos.Archivo.ToString Then
|
||||
LinkArchivo.Visible = True
|
||||
LinkArchivo.HRef = String.Format("{0}{1}", Ruta, ObjContratos.Archivo.ToString)
|
||||
'LinkArchivo.Visible = True
|
||||
'LinkArchivo.HRef = String.Format("{0}{1}", Ruta, ObjContratos.Archivo.ToString)
|
||||
End If
|
||||
Titulo = $"{ObjContratos.NumeroContrato} - {ObjContratos.DescripcionContrato} ({ObjContratos.DtResultados.Rows(0)("ContratoTipo")})"
|
||||
TituloCorto = $"{ObjContratos.NumeroContrato} - {ObjContratos.DescripcionContrato} "
|
||||
@@ -719,7 +755,7 @@ Partial Class Contratos_ContratoObra
|
||||
TabPVInsumos.Visible = False
|
||||
RowEstatus.Visible = False
|
||||
TabPres.HeaderText = "Partidas"
|
||||
TableDatosCabecera.Visible = False
|
||||
'TableDatosCabecera.Visible = False
|
||||
TabAvanveDocumento.Visible = False
|
||||
TabSistema.Visible = False
|
||||
TabContratosGastos.Visible = False
|
||||
@@ -862,9 +898,15 @@ Partial Class Contratos_ContratoObra
|
||||
|
||||
UpGV.Update()
|
||||
UpGVInsumos.Update()
|
||||
UPGVInt.Update()
|
||||
UPGVInt.Update()
|
||||
|
||||
|
||||
TotalAvanceVentas = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").ToDecimal
|
||||
TotalAvanceInterno = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").ToDecimal
|
||||
|
||||
LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero()
|
||||
LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero()
|
||||
|
||||
LbTotalGeneralInt.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero()
|
||||
'LblImporte.Text = "$" & TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero()
|
||||
End If
|
||||
@@ -1116,7 +1158,7 @@ Partial Class Contratos_ContratoObra
|
||||
LblProyecto.Visible = True
|
||||
|
||||
|
||||
LblCentroCosto.Text = LblSubProyectoTitulo.Text
|
||||
'LblCentroCosto.Text = LblSubProyectoTitulo.Text
|
||||
LblSubProyectoTitulo.Text = LblSubProyectoTitulo.Text & ":"
|
||||
|
||||
'If UsuarioActual.Empresa.GralSoloProyecto Then
|
||||
@@ -2841,22 +2883,22 @@ Partial Class Contratos_ContratoObra
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub CargaDatosEncabezado()
|
||||
|
||||
TablaUtilidad.Visible = True
|
||||
LblUtilidad.Text = $"$ {(SumaAvance - SumaGasto).ToString.FormatoNumero()}"
|
||||
|
||||
If (SumaAvance - SumaGasto) < 0 Then LblUtilidad.ForeColor = Drawing.Color.Red
|
||||
LblFacturado.Text = SumaAvance.FormatoNumero
|
||||
LblPorFacturar.Text = (LblImporte.Text.ToDouble - SumaAvance).FormatoNumero
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
'Public Sub CargaDatosEncabezado()
|
||||
|
||||
' TablaUtilidad.Visible = True
|
||||
' LblUtilidad.Text = $"$ {(SumaAvance - SumaGasto).ToString.FormatoNumero()}"
|
||||
|
||||
' If (SumaAvance - SumaGasto) < 0 Then LblUtilidad.ForeColor = Drawing.Color.Red
|
||||
' LblFacturado.Text = SumaAvance.FormatoNumero
|
||||
' LblPorFacturar.Text = (LblImporte.Text.ToDouble - SumaAvance).FormatoNumero
|
||||
|
||||
'End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#End Region
|
||||
@@ -3063,176 +3105,10 @@ Partial Class Contratos_ContratoObra
|
||||
End While
|
||||
|
||||
Return dataTable
|
||||
End Function
|
||||
|
||||
'Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||
' Dim dt As New DataTable
|
||||
' dt = ReadExcelFile(Ruta + FileName, True)
|
||||
' Dim ErrorArchivo = False
|
||||
|
||||
' 'Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||
' 'Try
|
||||
' ' Select Case Tipo
|
||||
' ' Case "EXCEL"
|
||||
' ' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
' ' Conexion.Open()
|
||||
' ' Dim cmd = Conexion.CreateCommand()
|
||||
' ' cmd.CommandType = CommandType.Text
|
||||
' ' cmd.CommandText = "SELECT * FROM [Hoja1$]"
|
||||
' ' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
' ' DataAdapter.Fill(dt)
|
||||
' ' Case Else
|
||||
' ' Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||
' ' Exit Sub
|
||||
' ' End Select
|
||||
' 'Catch ex As Exception
|
||||
' ' ErrorArchivo = True
|
||||
' ' OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||
' 'End Try
|
||||
' 'Conexion.Close()
|
||||
' If Not ErrorArchivo AndAlso dt IsNot Nothing Then
|
||||
' If Not dt.Columns(0).ColumnName = "OC Interna" Then
|
||||
' Alert("El nombre de la primera columna debe ser 'OC Interna'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' If Not dt.Columns(1).ColumnName = "Cantidad" Then
|
||||
' Alert("El nombre de la primera columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' If Not dt.Columns(2).ColumnName = "Clave Interna Cliente" Then
|
||||
' Alert("El nombre de la segunda columna debe ser 'Clave Interna'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' If Not dt.Columns(3).ColumnName = "Código" Then
|
||||
' Alert("El nombre de la tercera columna debe ser 'Código'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' If Not dt.Columns(4).ColumnName = "Código Barras" Then
|
||||
' Alert("El nombre de la cuarta columna debe ser 'Código Barras'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' If Not dt.Columns(5).ColumnName = "Producto/Servicio" Then
|
||||
' Alert("El nombre de la quinta columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' If Not dt.Columns(6).ColumnName = "UM" Then
|
||||
' Alert("El nombre de la sexta columna debe ser 'U.M'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' If Not dt.Columns(7).ColumnName = "Precio Unitario" Then
|
||||
' Alert("El nombre de la septima columna debe ser 'Precio Unitario'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' dt.TableName = "Datos"
|
||||
|
||||
' If Not ErrorArchivo Then
|
||||
' NumRow = 1
|
||||
' Dim RowNoEncontrados As String = String.Empty
|
||||
' Dim NumAgregados As Integer = 0
|
||||
' For Each Row As DataRow In dt.Rows
|
||||
' Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero
|
||||
' Dim Codigo As String = Row("Código").ToString.Trim.ToUpper
|
||||
' Dim CodigoBarras As String = Row("Código Barras").ToString.Trim.ToUpper
|
||||
' Dim UM As String = Row("UM").ToString
|
||||
' Dim ClaveInterna As String = Row("Clave Interna Cliente").ToString.Trim.ToUpper
|
||||
' Dim OCInterna As String = Row("OC Interna").ToString.Trim.ToUpper
|
||||
' Dim ProductoServicio As String = Row("Producto/Servicio").ToString.Trim.ToUpper
|
||||
' Dim PrecioUnitario As Double = Row("Precio Unitario").ToString.ToDouble
|
||||
' Dim CvePS As Integer = 0
|
||||
' Dim CveUM As Integer = 0 ' GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"CvePS = '{CvePS}'").ToString.ToEntero
|
||||
' Dim CodigoPS As Integer = 0
|
||||
' Dim Total As Double = (Cantidad * PrecioUnitario)
|
||||
|
||||
|
||||
' NumRow = NumRow + 1
|
||||
|
||||
' If Codigo.Length > 0 Then
|
||||
' Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
|
||||
' If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
' End If
|
||||
' ElseIf CodigoBarras.Length > 0 Then
|
||||
' Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c)
|
||||
' If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
' End If
|
||||
' ElseIf ProductoServicio.Length > 0 Then
|
||||
' Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c)
|
||||
' If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' RowNoEncontrados &= "<\BR> - En la fila " & NumRow & " no se especificó código, código de barras ó descripción."
|
||||
' End If
|
||||
' CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
|
||||
|
||||
' If TmpDT IsNot Nothing AndAlso CvePS > 0 Then
|
||||
' Dim dr As DataRow = TmpDT.NewRow
|
||||
' dr("Cantidad") = Cantidad
|
||||
' dr("CantidadContratada") = Cantidad
|
||||
' dr("CveUM") = CveUM
|
||||
' dr("UM") = UM
|
||||
' dr("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
|
||||
' dr("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{dr("CveClasificacion")}'").ToString
|
||||
' dr("CvePS") = CvePS
|
||||
' dr("PS") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("PS", "").ToString
|
||||
' dr("CodigoPS") = dr("PS")
|
||||
' dr("PU") = PrecioUnitario
|
||||
' dr("Total") = Cantidad * PrecioUnitario
|
||||
' dr("CveTipoPresupuesto") = 2
|
||||
' dr("NoIdentificacion") = ClaveInterna
|
||||
' dr("OCInterna") = OCInterna
|
||||
' dr("LimitarCantidad") = 0
|
||||
|
||||
' If CvePS > 0 Then
|
||||
' Dim ObjContratos As New ClsContratos
|
||||
' If ObjContratos.AddContratosDetalle(CveContrato, dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, dr("PU").ToString.ToDouble, UsuarioActual.CveUsuario, dr("CveTipoPresupuesto").ToString.ToEntero, dr("NoIdentificacion").ToString, dr("LimitarCantidad").ToString.ToEntero = 1, dr("OCInterna").ToString) Then
|
||||
' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", dr("Cantidad"), dr("UM"), dr("PS"), dr("PU"))
|
||||
' guardarBitacora(msj)
|
||||
' dr("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
|
||||
' TmpDT.Rows.Add(dr)
|
||||
' Dim TotalRow = dr("Total").ToString.ToDouble
|
||||
|
||||
' CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
|
||||
' LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
|
||||
' LblImporte.Text = LbTotalGeneral.Text
|
||||
' Else
|
||||
' Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError)
|
||||
' End If
|
||||
' ObjContratos.Dispose()
|
||||
' End If
|
||||
|
||||
|
||||
' End If
|
||||
' Next
|
||||
' 'Cargo el GridView
|
||||
' Gv.DataSource = TmpDT
|
||||
' Gv.DataBind()
|
||||
' UpGV.Update()
|
||||
|
||||
|
||||
' If RowNoEncontrados.Length > 0 Then
|
||||
' Alert("Los siguientes Productos o Servicios no se encontraron en la Base de Datos.<\BR>" & RowNoEncontrados, TipoMensaje.MsgAdvertencia)
|
||||
' Else
|
||||
' Alert("Se Cargaron " & NumRow & " Productos o Servicios correctamente.")
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Function GetPS(Opt As String, Valor As String) As String
|
||||
Dim StrReturn As String = String.Empty
|
||||
Dim CvePS As Integer = 0
|
||||
@@ -3260,34 +3136,7 @@ Partial Class Contratos_ContratoObra
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " GPS "
|
||||
'Private Sub CargaCuentasEquipos()
|
||||
|
||||
' Dim GPS As New ClsGPS
|
||||
' If GPS.DispositivosGet(-1, -1, DdlCliente.SelectedValue.ToEntero) Then
|
||||
' DdlCuentaEquipo.DataSource = GPS.DtResultados
|
||||
' Else
|
||||
' DdlCuentaEquipo.DataSource = Nothing
|
||||
' End If
|
||||
' GPS.Dispose()
|
||||
' DdlCuentaEquipo.DataBind()
|
||||
' UpGral.Update()
|
||||
|
||||
'End Sub
|
||||
|
||||
'Private Sub CargaPeriodos()
|
||||
' Dim ObjContratos As New ClsContratos
|
||||
' If ObjContratos.GetPeriodos(-1, UsuarioActual.CveEmpresa) Then
|
||||
' DtPeriodo = ObjContratos.DtResultados
|
||||
' Else
|
||||
' DtPeriodo = Nothing
|
||||
' End If
|
||||
' DdlPeriodo.DataSource = DtPeriodo
|
||||
' ObjContratos.Dispose()
|
||||
' DdlPeriodo.DataBind()
|
||||
' UpGral.Update()
|
||||
'End Sub
|
||||
#End Region
|
||||
|
||||
#Region " IMPRESION "
|
||||
|
||||
@@ -3322,57 +3171,7 @@ Partial Class Contratos_ContratoObra
|
||||
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
|
||||
|
||||
|
||||
#End Region
|
||||
@@ -3384,10 +3183,10 @@ Partial Class Contratos_ContratoObra
|
||||
Private Sub GenerarPDFGastos(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)
|
||||
Dim UtilidadGastos As String = IIf(LblUtilidad.Text <> "", LblUtilidad.Text, "-").ToString
|
||||
|
||||
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
' Dim UtilidadGastos As String = IIf(LblUtilidad.Text <> "", LblUtilidad.Text, "-").ToString
|
||||
|
||||
|
||||
Dim dt As DataTable = DtGastos
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
@@ -3400,9 +3199,9 @@ Partial Class Contratos_ContratoObra
|
||||
params.Add(New ReportParameter("FechaInicio", TxtFechaInicial.Text.Trim))
|
||||
params.Add(New ReportParameter("FechaFin", TxtFechaFinal.Text.Trim))
|
||||
params.Add(New ReportParameter("TipoContrato", TipoDocumento))
|
||||
params.Add(New ReportParameter("TotalContrato", LblImporte.Text))
|
||||
params.Add(New ReportParameter("Utilidad", UtilidadGastos))
|
||||
|
||||
params.Add(New ReportParameter("TotalContrato", LblImporte.Text))
|
||||
' params.Add(New ReportParameter("Utilidad", UtilidadGastos))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
@@ -3898,59 +3697,12 @@ Partial Class Contratos_ContratoObra
|
||||
LnkDescargar.Visible = False
|
||||
'BtnGuardarFianza.Text = "Guardar"
|
||||
UPModalFianza.Update()
|
||||
Me.RegistraScript("$('#DvModalFianza').modal();")
|
||||
'GvFianzas.DataSource = DtTmpFianzas
|
||||
'GvFianzas.DataBind()
|
||||
'UpGvFianzas.Update()
|
||||
End Sub
|
||||
'Protected Sub BtnGuardarFianza_Click(sender As Object, e As EventArgs)
|
||||
|
||||
' Dim dr As DataRow = DtTmpFianzas.NewRow()
|
||||
|
||||
' Dim Folio As String = txtFolioFianza.Text
|
||||
' Dim CveEstatus As Integer = DdlFianza.SelectedValue.ToEntero()
|
||||
' Dim Estatus As String = DdlFianza.SelectedItem.Text
|
||||
|
||||
' Dim TieneError As Boolean = False
|
||||
|
||||
' Dim Adjunto As String = ""
|
||||
' If TxtModalAdjuntoArchivo.getfiles.Archivos.Count > 0 Then
|
||||
' Dim ArchivoAdjunto As Archivo = TxtModalAdjuntoArchivo.getfiles.Archivos(0)
|
||||
' Adjunto = ArchivoAdjunto.filenameO
|
||||
' End If
|
||||
|
||||
|
||||
' If EsEditarFianza Then
|
||||
' DtTmpFianzas.Rows.RemoveAt(IndexFianzaEditar)
|
||||
' dr("CveContratoFianza") = GvFianzas.Rows(IndexFianzaEditar).DataKey("CveContratoFianza").ToString
|
||||
' dr("Folio") = Folio
|
||||
' dr("EstatusFianza") = Estatus
|
||||
' dr("CveEstatusFianza") = CveEstatus
|
||||
' dr("FechaVencimiento") = txtFechaVenFianza.Text
|
||||
' dr("Adjunto") = If(Adjunto = "", GvFianzas.Rows(IndexFianzaEditar).DataKey("Adjunto").ToString, Adjunto)
|
||||
' Else
|
||||
' dr("CveContratoFianza") = "-1"
|
||||
' dr("Folio") = Folio
|
||||
' dr("EstatusFianza") = Estatus
|
||||
' dr("CveEstatusFianza") = CveEstatus
|
||||
' dr("FechaVencimiento") = txtFechaVenFianza.Text
|
||||
' dr("Adjunto") = Adjunto
|
||||
' End If
|
||||
|
||||
' DtTmpFianzas.Rows.Add(dr)
|
||||
' GuardaAdjunto($"{Folio} - {txtFechaVenFianza.Text}")
|
||||
|
||||
' GvFianzas.DataSource = DtTmpFianzas
|
||||
' GvFianzas.DataBind()
|
||||
' UpGvFianzas.Update()
|
||||
|
||||
' LimpiarCamposModalFianzas()
|
||||
' Me.RegistraScript("$('#DvModalFianza').modal('hide');")
|
||||
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
Me.RegistraScript("$('#DvModalFianza').modal();")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GuardaAdjunto(FolioFechaVencimiento As String)
|
||||
If Not TxtModalAdjuntoArchivo.getfiles.Archivos.Count > 0 Then
|
||||
Exit Sub
|
||||
@@ -3972,39 +3724,13 @@ Partial Class Contratos_ContratoObra
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al guardar el archivo Adjunto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End Try
|
||||
End Sub
|
||||
'Private Sub DescargarAdjunto()
|
||||
' Dim filename As String = GvFianzas.Rows(IndexFianzaEditar).DataKey("Adjunto").ToString
|
||||
' If Not String.IsNullOrEmpty(filename) Then
|
||||
' Dim rutaAplicacion As String = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath)
|
||||
' Dim Path As String = String.Format("{0}\\{1}\\{2}\\{3}", UsuarioActual.Empresa.Ruta, "Contratos", "Fianzas", $"{GvFianzas.Rows(IndexFianzaEditar).DataKey("Folio").ToString} - {GvFianzas.Rows(IndexFianzaEditar).DataKey("FechaVencimiento").ToDate.ToShortDateString}")
|
||||
' Dim ArchivoDestino As String = String.Format("{0}\\{1}", Path, GvFianzas.Rows(IndexFianzaEditar).DataKey("Adjunto").ToString)
|
||||
' Dim toDownload As System.IO.FileInfo = New System.IO.FileInfo(ArchivoDestino)
|
||||
' If toDownload.Exists Then
|
||||
' Response.ClearContent()
|
||||
' Response.ClearHeaders()
|
||||
' Response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
|
||||
' Response.ContentType = "application/octet-stream"
|
||||
' Response.WriteFile(ArchivoDestino)
|
||||
' Response.Flush()
|
||||
' Response.Close()
|
||||
' Response.End()
|
||||
' HttpContext.Current.ApplicationInstance.CompleteRequest()
|
||||
' End If
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkDescargar_Click(sender As Object, e As EventArgs)
|
||||
'DescargarAdjunto()
|
||||
End Sub
|
||||
'Protected Sub GvFianzas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
|
||||
|
||||
' DtTmpFianzas.Rows.RemoveAt(e.RowIndex)
|
||||
' GvFianzas.DataSource = DtTmpFianzas
|
||||
' GvFianzas.DataBind()
|
||||
' UpGvFianzas.Update()
|
||||
|
||||
'End Sub
|
||||
End Sub
|
||||
|
||||
Protected Sub imgEFianzaGv_Click(sender As Object, e As EventArgs)
|
||||
LimpiarCamposModalFianzas()
|
||||
EsEditarFianza = True
|
||||
@@ -4018,13 +3744,11 @@ Partial Class Contratos_ContratoObra
|
||||
txtFechaVenFianza.Text = GvRow.DataKey("FechaVencimiento").ToString()
|
||||
LnkDescargar.Visible = GvRow.DataKey("Adjunto").ToString <> ""
|
||||
|
||||
txth4Fianza.InnerText = "Editar Fianza"
|
||||
'BtnGuardarFianza.Text = "Actualizar"
|
||||
txth4Fianza.InnerText = "Editar Fianza"
|
||||
|
||||
UPModalFianza.Update()
|
||||
Me.RegistraScript("$('#DvModalFianza').modal();")
|
||||
'GvFianzas.DataSource = DtTmpFianzas
|
||||
'GvFianzas.DataBind()
|
||||
'UpGvFianzas.Update()
|
||||
Me.RegistraScript("$('#DvModalFianza').modal();")
|
||||
|
||||
End Sub
|
||||
Protected Sub CreaDtTmpFianzas()
|
||||
DtTmpFianzas = New DataTable()
|
||||
@@ -4037,11 +3761,8 @@ Partial Class Contratos_ContratoObra
|
||||
DtTmpFianzas.Columns.Add("FechaVencimiento", GetType(String))
|
||||
DtTmpFianzas.Columns.Add("Adjunto", GetType(String))
|
||||
|
||||
DtTmpFianzasInicial = DtTmpFianzas.Copy
|
||||
|
||||
'GvFianzas.DataSource = DtTmpFianzas
|
||||
'GvFianzas.DataBind()
|
||||
'UpGvFianzas.Update()
|
||||
DtTmpFianzasInicial = DtTmpFianzas.Copy
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Function GuardaFianzas(ObjContrato As ClsContratos) As Boolean
|
||||
@@ -4853,9 +4574,65 @@ Partial Class Contratos_ContratoObra
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Indicadores()
|
||||
|
||||
|
||||
|
||||
Dim Con As New ClsContratos
|
||||
Dim DTDatos As New DataTable
|
||||
|
||||
If Con.GetContratosObraRepAvances(MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
DTDatos = Con.DtResultados
|
||||
End If
|
||||
|
||||
Con.Dispose()
|
||||
|
||||
|
||||
If DTDatos.Rows.Count > 0 Then
|
||||
|
||||
Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal
|
||||
Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal
|
||||
Dim TotalAvancePorcentaje As Decimal = (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2)
|
||||
|
||||
Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal
|
||||
Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal
|
||||
Dim TotalFaltantePorcentaje As Decimal = (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2)
|
||||
|
||||
|
||||
LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }"
|
||||
LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %"
|
||||
LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%"
|
||||
SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%")
|
||||
|
||||
|
||||
LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||
LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %"
|
||||
LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%"
|
||||
SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'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).RoundAD(2)
|
||||
'Dim TotalFaltantePorcentaje As Decimal = (100 - TotalAvancePorcentaje).RoundAD(2)
|
||||
|
||||
|
||||
' LtlGrafNumeroContratos.Text = NumeroContratos.ToString
|
||||
'LtlGrafTotal.Text = TotalContratos.ToString("###,###,###.00")
|
||||
|
||||
|
||||
DVGraficas.Visible = True
|
||||
|
||||
UpGrafica.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user