-- mejoras en presupuesto EMD
This commit is contained in:
@@ -330,9 +330,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;">Agrupador</td>
|
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;">Agrupador</td>
|
||||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 10%; border-right: 3px solid white;">Autorizado</td>
|
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 10%; border-right: 3px solid white;">Autorizado</td>
|
||||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 10%; border-right: 3px solid white;">Comprometido</td>
|
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;" runat="server" id="thComprometido" visible="false">En proceso de compra</td>
|
||||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 25%; border-right: 3px solid white;">Ejercido</td>
|
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;"><asp:Literal ID="LtlthEjercido" runat="server" Text="Ejercido"></asp:Literal></td>
|
||||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 25%; border-right: 3px solid white;">Por Ejercer</td>
|
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;">Por Ejercer</td>
|
||||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 15%; border-right: 3px solid white;">Pagado</td>
|
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 15%; border-right: 3px solid white;">Pagado</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -343,11 +343,11 @@
|
|||||||
<%--<asp:HyperLinkField HeaderText="Descripcion" DataTextField="Agrupador" ItemStyle-Width="20%"--%>
|
<%--<asp:HyperLinkField HeaderText="Descripcion" DataTextField="Agrupador" ItemStyle-Width="20%"--%>
|
||||||
<asp:BoundField HeaderText="Descripción" DataField="Agrupador" ItemStyle-Width="20%" />
|
<asp:BoundField HeaderText="Descripción" DataField="Agrupador" ItemStyle-Width="20%" />
|
||||||
<asp:BoundField HeaderText="Importe" DataField="Autorizado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Importe" DataField="Autorizado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
||||||
<asp:BoundField HeaderText="Importe" DataField="Comprometido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Importe" DataField="Comprometido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" Visible="false" />
|
||||||
<asp:BoundField HeaderText="Importe" DataField="Ejercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
|
<asp:BoundField HeaderText="Importe" DataField="Ejercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
|
||||||
<asp:BoundField HeaderText="%" DataField="EjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="%" DataField="EjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" ItemStyle-Font-Size="7pt" ItemStyle-Font-Italic="true" />
|
||||||
<asp:BoundField HeaderText="Importe" DataField="PorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
|
<asp:BoundField HeaderText="Importe" DataField="PorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
|
||||||
<asp:BoundField HeaderText="%" DataField="PorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="%" DataField="PorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" ItemStyle-Font-Size="7pt" ItemStyle-Font-Italic="true" />
|
||||||
<asp:BoundField HeaderText="Importe" DataField="Pagado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
|
<asp:BoundField HeaderText="Importe" DataField="Pagado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
Option Strict On
|
Option Strict On
|
||||||
|
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports Newtonsoft.Json
|
|
||||||
Imports Newtonsoft.Json.Linq
|
Imports Newtonsoft.Json.Linq
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
@@ -20,6 +19,15 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public Property UsaComprometido() As Boolean
|
||||||
|
Get
|
||||||
|
Return DirectCast(ViewState("UsaComprometido"), Boolean)
|
||||||
|
End Get
|
||||||
|
Set(ByVal value As Boolean)
|
||||||
|
ViewState("UsaComprometido") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
@@ -29,7 +37,7 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
|
|
||||||
#Region " INICIALIZA VALORES "
|
#Region " INICIALIZA VALORES "
|
||||||
Private Sub InicializaValores()
|
Private Sub InicializaValores()
|
||||||
|
UsaComprometido = False
|
||||||
If UsuarioActual.Empresa.Funcionalidad(267) = "1" Then 'emp citrícola
|
If UsuarioActual.Empresa.Funcionalidad(267) = "1" Then 'emp citrícola
|
||||||
TxtFiltrosFechaInicio.Text = $"01/08/{NowADS().Year - 1}"
|
TxtFiltrosFechaInicio.Text = $"01/08/{NowADS().Year - 1}"
|
||||||
TxtFiltrosFechaFin.Text = $"31/07/{NowADS().Year}"
|
TxtFiltrosFechaFin.Text = $"31/07/{NowADS().Year}"
|
||||||
@@ -54,6 +62,8 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
DdlProyecto.DataBind()
|
DdlProyecto.DataBind()
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then UsaComprometido = True
|
||||||
|
|
||||||
CargaSubProyecto()
|
CargaSubProyecto()
|
||||||
UpFiltros.Update()
|
UpFiltros.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -78,7 +88,13 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
Dim Agrupador = DdlAgrupador.SelectedValue.ToEntero
|
Dim Agrupador = DdlAgrupador.SelectedValue.ToEntero
|
||||||
Dim FechaInicio = If(IsDate(TxtFiltrosFechaInicio.Text), TxtFiltrosFechaInicio.Text.ToDate, MinFecha)
|
Dim FechaInicio = If(IsDate(TxtFiltrosFechaInicio.Text), TxtFiltrosFechaInicio.Text.ToDate, MinFecha)
|
||||||
Dim FechaFin = If(IsDate(TxtFiltrosFechaFin.Text), TxtFiltrosFechaFin.Text.ToDate, MaxFecha)
|
Dim FechaFin = If(IsDate(TxtFiltrosFechaFin.Text), TxtFiltrosFechaFin.Text.ToDate, MaxFecha)
|
||||||
Dim EsMensual = ChkMensual.Checked
|
Dim EsMensual = ChkMensual.Checked
|
||||||
|
|
||||||
|
If UsaComprometido Then
|
||||||
|
thComprometido.Visible = True
|
||||||
|
GvDatos.Columns(2).Visible = True
|
||||||
|
LtlthEjercido.Text = "Facturado"
|
||||||
|
End If
|
||||||
|
|
||||||
If Not EsMensual Then
|
If Not EsMensual Then
|
||||||
Dim ObjPresupuestos As New ClsContratos
|
Dim ObjPresupuestos As New ClsContratos
|
||||||
@@ -127,7 +143,6 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
If EsMensual Then
|
If EsMensual Then
|
||||||
RegistraScript($"CargaChartMensual({HdnJsonProyecto.Value},{HdnJsonGraficos.Value});", "2")
|
RegistraScript($"CargaChartMensual({HdnJsonProyecto.Value},{HdnJsonGraficos.Value});", "2")
|
||||||
Else
|
Else
|
||||||
|
|
||||||
RegistraScript($"CargaChartProyecto({HdnJsonProyecto.Value});", "2")
|
RegistraScript($"CargaChartProyecto({HdnJsonProyecto.Value});", "2")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -286,27 +301,35 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
Else
|
Else
|
||||||
Dim DrPresupuesto = DtPresupuestos.FiltroPrimero("Tipo = 0 AND CveAgrupador IS NULL")
|
Dim DrPresupuesto = DtPresupuestos.FiltroPrimero("Tipo = 0 AND CveAgrupador IS NULL")
|
||||||
|
|
||||||
Dim Autorizado = DrPresupuesto("Autorizado").ToString.ToDecimal
|
Dim Autorizado As Decimal = DrPresupuesto("Autorizado").ToString.ToDecimal
|
||||||
Dim Ejercido = DrPresupuesto("Ejercido").ToString.ToDecimal
|
Dim Ejercido As Decimal = DrPresupuesto("Ejercido").ToString.ToDecimal
|
||||||
Dim PorEjercer = DrPresupuesto("PorEjercer").ToString.ToDecimal
|
Dim PorEjercer As Decimal = DrPresupuesto("PorEjercer").ToString.ToDecimal
|
||||||
|
Dim EjercidoPorcentaje = DrPresupuesto("EjercidoPorcentaje").ToString.ToDecimal
|
||||||
Dim EjercidoPorcentaje = DrPresupuesto("EjercidoPorcentaje").ToString.ToDecimal
|
Dim PorEjercerPorcentaje = DrPresupuesto("PorEjercerPorcentaje").ToString.ToDecimal
|
||||||
Dim PorEjercerPorcentaje = DrPresupuesto("PorEjercerPorcentaje").ToString.ToDecimal
|
|
||||||
|
If UsaComprometido Then
|
||||||
LtlAutorizado.Text = Autorizado.FormatoNumero
|
Ejercido = DrPresupuesto("Comprometido").ToString.ToDecimal
|
||||||
LtlEjercido.Text = Ejercido.FormatoNumero
|
PorEjercer = Autorizado - Ejercido
|
||||||
LtlPorEjercer.Text = PorEjercer.FormatoNumero
|
EjercidoPorcentaje = Ejercido / Autorizado * 100
|
||||||
|
PorEjercerPorcentaje = PorEjercer / Autorizado * 100
|
||||||
PBEjercido.Style.Remove("width")
|
thComprometido.Visible = True
|
||||||
PBEjercido.Style.Add("width", $"{EjercidoPorcentaje.ToString}%")
|
GvDatos.Columns(2).Visible = True
|
||||||
|
End If
|
||||||
PBPorEjercer.Style.Remove("width")
|
|
||||||
PBPorEjercer.Style.Add("width", $"{PorEjercerPorcentaje.ToString}%")
|
LtlAutorizado.Text = Autorizado.FormatoNumero
|
||||||
|
LtlEjercido.Text = Ejercido.FormatoNumero
|
||||||
LtlPorcentajeEjercido.Text = EjercidoPorcentaje.FormatoNumero + " %"
|
LtlPorEjercer.Text = PorEjercer.FormatoNumero
|
||||||
LtlPorcentajePorEjercer.Text = PorEjercerPorcentaje.FormatoNumero + " %"
|
|
||||||
|
PBEjercido.Style.Remove("width")
|
||||||
Dim json = New JArray(
|
PBEjercido.Style.Add("width", $"{EjercidoPorcentaje.ToString}%")
|
||||||
|
|
||||||
|
PBPorEjercer.Style.Remove("width")
|
||||||
|
PBPorEjercer.Style.Add("width", $"{PorEjercerPorcentaje.ToString}%")
|
||||||
|
|
||||||
|
LtlPorcentajeEjercido.Text = EjercidoPorcentaje.FormatoNumero + " %"
|
||||||
|
LtlPorcentajePorEjercer.Text = PorEjercerPorcentaje.FormatoNumero + " %"
|
||||||
|
|
||||||
|
Dim json = New JArray(
|
||||||
From dr In DtDatos
|
From dr In DtDatos
|
||||||
Select New JObject(
|
Select New JObject(
|
||||||
New JProperty("Agrupador", dr("Agrupador").ToString()),
|
New JProperty("Agrupador", dr("Agrupador").ToString()),
|
||||||
@@ -316,13 +339,13 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
New JProperty("AutorizadoProporcion", 100),
|
New JProperty("AutorizadoProporcion", 100),
|
||||||
New JProperty("EjercidoProporcion", dr("EjercidoPorcentaje").ToString().ToDecimal()),
|
New JProperty("EjercidoProporcion", dr("EjercidoPorcentaje").ToString().ToDecimal()),
|
||||||
New JProperty("PorEjercerProporcion", dr("PorEjercerPorcentaje").ToString().ToDecimal()))
|
New JProperty("PorEjercerProporcion", dr("PorEjercerPorcentaje").ToString().ToDecimal()))
|
||||||
)
|
)
|
||||||
|
|
||||||
HdnJsonProyecto.Value = json.ToString
|
HdnJsonProyecto.Value = json.ToString
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
LtlAutorizado.Text = ""
|
LtlAutorizado.Text = ""
|
||||||
LtlEjercido.Text = ""
|
LtlEjercido.Text = ""
|
||||||
LtlPorEjercer.Text = ""
|
LtlPorEjercer.Text = ""
|
||||||
@@ -342,21 +365,24 @@ Partial Class Contratos_RepPresupuestos
|
|||||||
If e.Row.DBCampo("Autorizado").ToDecimal = 0 Then
|
If e.Row.DBCampo("Autorizado").ToDecimal = 0 Then
|
||||||
e.Row.Cells(1).Text = "-"
|
e.Row.Cells(1).Text = "-"
|
||||||
End If
|
End If
|
||||||
If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then
|
If e.Row.DBCampo("Comprometido").ToDecimal = 0 Then
|
||||||
e.Row.Cells(2).Text = "-"
|
e.Row.Cells(1).Text = "-"
|
||||||
End If
|
End If
|
||||||
If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then
|
If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then
|
||||||
e.Row.Cells(3).Text = "-"
|
e.Row.Cells(3).Text = "-"
|
||||||
End If
|
End If
|
||||||
If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then
|
If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then
|
||||||
e.Row.Cells(4).Text = "-"
|
e.Row.Cells(4).Text = "-"
|
||||||
End If
|
End If
|
||||||
If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then
|
If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then
|
||||||
e.Row.Cells(5).Text = "-"
|
e.Row.Cells(5).Text = "-"
|
||||||
End If
|
End If
|
||||||
If e.Row.DBCampo("Pagado").ToDecimal = 0 Then
|
If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then
|
||||||
e.Row.Cells(6).Text = "-"
|
e.Row.Cells(6).Text = "-"
|
||||||
End If
|
End If
|
||||||
|
If e.Row.DBCampo("Pagado").ToDecimal = 0 Then
|
||||||
|
e.Row.Cells(7).Text = "-"
|
||||||
|
End If
|
||||||
|
|
||||||
If e.Row.RowIndex > 0 Then
|
If e.Row.RowIndex > 0 Then
|
||||||
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
|
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
|
||||||
|
|||||||
Reference in New Issue
Block a user