This commit is contained in:
Antonio Gonzalez
2020-06-01 18:46:41 -07:00
37 changed files with 651 additions and 403 deletions

View File

@@ -19,6 +19,15 @@ Partial Class Contratos_FacturacionMasiva
ViewState("DTCicloComercial") = value
End Set
End Property
Private Property FolioVigentes As Boolean
Get
Return CType(ViewState("FolioVigentes"), Boolean)
End Get
Set(value As Boolean)
ViewState("FolioVigentes") = value
End Set
End Property
Private Property Mensaje As String
Get
Return CType(ViewState("Mensaje"), String)
@@ -100,6 +109,7 @@ Partial Class Contratos_FacturacionMasiva
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
FolioVigentes = False
CargaCombos()
txtFechaI.Text = DateTime.Today.ToString("d")
txtFechaF.Text = DateTime.Today.ToString("d")
@@ -118,6 +128,8 @@ Partial Class Contratos_FacturacionMasiva
DdlSucursal.DataBind()
End Sub
Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer)
ValidaFolio()
Dim ObjContratos As New ClsContratos
If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then
DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0")
@@ -127,9 +139,21 @@ Partial Class Contratos_FacturacionMasiva
GvCiclosComerciales.DataBind()
UpGv.Update()
End Sub
Private Sub ValidaFolio()
Dim ObjFolios As New ClsGralFolios
If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then
If ObjFolios.DtResultados.Rows.Count > 0 Then
FolioVigentes = True
End If
End If
ObjFolios.Dispose()
End Sub
Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then
'' Pendiente de aplicar validacion
If Not FolioVigentes Then
e.Row.FCCheckBox("chkDis").Enabled = False
e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios"
End If

View File

@@ -134,7 +134,7 @@
<asp:BoundField runat="server" HeaderText="Contrato Externo" DataField="ContratoExterno" />
<asp:BoundField runat="server" HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField runat="server" HeaderText="PS" DataField="CodigoPS" />
<asp:BoundField runat="server" HeaderText="Serie" DataField="SerieLote" />
<asp:BoundField runat="server" HeaderText="Serie" DataField="Serie" />
<asp:BoundField runat="server" HeaderText="Costo Almacén" DataField="Surtido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>