Contratos, regsitro Ventas estado de cuenta
This commit is contained in:
@@ -2743,8 +2743,20 @@
|
||||
<ContentTemplate>
|
||||
|
||||
<div id="DivEstimaciones" runat="server" visible="true">
|
||||
Contrato:
|
||||
<asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato"></asp:DropDownList>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Contrato:</td>
|
||||
<td><asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="select2me" ></asp:DropDownList></td>
|
||||
</tr>
|
||||
<tr runat="server" id="DVEstimacionesObra" visible="false">
|
||||
<td> Estimacion:</td>
|
||||
<td><asp:DropDownList ID="DdlEstimacionesObra" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroEstimacion" DataValueField="CveEstimacion" CssClass="select2me"></asp:DropDownList></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:HyperLink ID="HLContrato" Target="_blank" CssClass="Texto" runat="server" Text="" Font-Bold="true"></asp:HyperLink>
|
||||
<asp:GridView ID="GvEst" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Estimaciones para este cliente" Width="100%" DataKeyNames="CveContrato,CveFamilias,CveSubFamilias,CveContratoAvance,Name,Importe,NumeroContrato,CveSubProyecto,FechaInicial" SelectedRowStyle-BackColor="#CCFF66" CssClass="table GvEst table-advance table-hover" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
@@ -4295,6 +4307,7 @@
|
||||
<asp:RadioButtonList ID="RblOpcionContrato" runat="server" CssClass="rbl" RepeatDirection="Horizontal" RepeatLayout="Table">
|
||||
<asp:ListItem Text="Si" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Obra" Value="3"></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
|
||||
<asp:LinkButton ID="BtnIniciarContrato" runat="server" CssClass="btn btn-success" Text="Aceptar" />
|
||||
|
||||
@@ -3030,7 +3030,27 @@ Partial Class Ventas
|
||||
TieneContrato = True
|
||||
LnkOCs.Visible = True
|
||||
UpnTools.Update()
|
||||
|
||||
ElseIf RblOpcionContrato.SelectedValue = "3" Then
|
||||
|
||||
DivEstimaciones.Visible = True
|
||||
DVEstimacionesObra.Visible = True
|
||||
|
||||
DdlContrato.DataSource = DtContratos.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
|
||||
DdlContrato.DataBind()
|
||||
DdlContrato.Items.Insert(0, New ListItem("Seleccione", "0"))
|
||||
|
||||
|
||||
BtnEstimacion.Visible = False
|
||||
GvEst.Visible = False
|
||||
|
||||
|
||||
UPEstimaciones.Update()
|
||||
|
||||
Else
|
||||
BtnEstimacion.Visible = True
|
||||
GvEst.Visible = True
|
||||
|
||||
DdlContratosOC.Items.Clear()
|
||||
DdlContratosOC.DataSource = DtContratos
|
||||
DdlContratosOC.DataBind()
|
||||
@@ -10491,6 +10511,14 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
|
||||
If ErrorList.Count = 0 AndAlso RblOpcionContrato.SelectedValue = "3" And DdlEstimacionesObra.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
If Not ObjContr.UpdateContratosAvanceEstimacionVentas(DdlEstimacionesObra.SelectedValue.ToEntero, ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
ErrorList.Add("Ocurrió un error al actualizar la estimación")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If ErrorList.Count = 0 Then
|
||||
'prepoliza
|
||||
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDescuento, ObjInventario:=ObjInventario)
|
||||
@@ -18076,25 +18104,73 @@ Partial Class Ventas
|
||||
BtnEstimacion.Visible = True
|
||||
End If
|
||||
|
||||
If RblOpcionContrato.SelectedValue = "3" Then
|
||||
|
||||
|
||||
GvEst.DataSource = Nothing
|
||||
GvEst.DataBind()
|
||||
BtnEstimacion.Visible = False
|
||||
|
||||
BtnCargarContratoDetalles.Visible = False
|
||||
BtnCancelarContratoDetalles.Visible = False
|
||||
|
||||
UPEstimaciones.Update()
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaDatosEstimaciones(CveCliente As Integer)
|
||||
If CveVenta > 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
|
||||
GvEst.DataSource = Con.DtResultados
|
||||
If Con.DtResultados.Rows.Count > 0 Then
|
||||
'BtnEstimacion.Visible = True
|
||||
DdlContrato.Items.Clear()
|
||||
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
|
||||
DdlContrato.DataSource = Con.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
|
||||
|
||||
|
||||
|
||||
If RblOpcionContrato.SelectedValue = "3" Then
|
||||
|
||||
DdlEstimacionesObra.Items.Clear()
|
||||
|
||||
If Con.GetContratosAvanceEstimacionVentas(DdlContrato.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then
|
||||
|
||||
DdlEstimacionesObra.DataSource = Con.DtResultados
|
||||
DdlEstimacionesObra.DataBind()
|
||||
DdlEstimacionesObra.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
Else
|
||||
|
||||
DdlEstimacionesObra.DataSource = Nothing
|
||||
DdlEstimacionesObra.DataBind()
|
||||
|
||||
End If
|
||||
|
||||
|
||||
UPEstimaciones.Update()
|
||||
|
||||
Else
|
||||
|
||||
If Con.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
|
||||
GvEst.DataSource = Con.DtResultados
|
||||
If Con.DtResultados.Rows.Count > 0 Then
|
||||
'BtnEstimacion.Visible = True
|
||||
DdlContrato.Items.Clear()
|
||||
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
|
||||
DdlContrato.DataSource = Con.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
UPEstimaciones.Update()
|
||||
Con.Dispose()
|
||||
DdlContrato.DataBind()
|
||||
GvEst.DataBind()
|
||||
|
||||
End If
|
||||
UPEstimaciones.Update()
|
||||
Con.Dispose()
|
||||
DdlContrato.DataBind()
|
||||
GvEst.DataBind()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub GVEst_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEst.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Reference in New Issue
Block a user