se agregó otra pestaña

This commit is contained in:
Antonio Gonzalez
2020-07-24 20:03:24 -07:00
parent 708a0ddb4c
commit 039e520fe1
2 changed files with 496 additions and 166 deletions

View File

@@ -1710,6 +1710,31 @@ Partial Class Ventas
#End Region
#Region "AuxiliarConta"
Property CvePrePolizaNegativa As Integer
Get
If ViewState("CvePrePolizaNegativa") Is Nothing Then
Return -1
Else
Return ViewState("CvePrePolizaNegativa").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CvePrePolizaNegativa") = value
End Set
End Property
Private Property DTDatos As DataTable
Get
Return CType(ViewState("DTDatos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTDatos") = value
End Set
End Property
#End Region
#Region " A C U M U L A D O R E S"
Private Property ClienteEsDistribuidor As Boolean
@@ -3642,7 +3667,7 @@ Partial Class Ventas
HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675"
HlCuentaTerminal.Visible = True
End If
CargarSaldoAuxiliar(CveCliente)
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then ' si tiene acceso en el subproyecto
'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175)
@@ -26096,4 +26121,123 @@ Partial Class Ventas
End If
ObjVentas.Dispose()
End Sub
#Region "Auxiliar"
Private Sub CargarSaldoAuxiliar(CveCliente As Integer)
CargaAuxiliarClienteCxC(CveCliente, CveVenta)
End Sub
Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveVenta As Integer)
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveVenta) Then
DtDatos = ObjMovtos.DtResultados
GVAuxiliar.DataSource = ObjMovtos.DtResultados
Else
GVAuxiliar.DataSource = Nothing
End If
ObjMovtos.Dispose()
GVAuxiliar.DataBind()
End Sub
Protected Sub BtnCancelarAux_Click(sender As Object, e As EventArgs)
AgregaPolizaNegativo(CvePrePolizaNegativa)
End Sub
Private Sub AgregaPolizaNegativo(CvePrePoliza As Integer)
Dim ObjContabilidad As New ClsContabilidad
Dim TieneError As Boolean = False
ObjContabilidad.IniciaTransacSQL()
Dim CvePrePolizaNueva As Integer = ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate)
If Not CvePrePolizaNueva > 0 Then
TieneError = True
End If
If Not TieneError Then
ObjContabilidad.Commit()
Dim Str As New StringBuilder
Str.Append("Se agrego la póliza de cancelación correctamente.<br/>")
RegistraScript(" $('#DivCancelar').modal('hide'); ")
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If ObjContabilidad.ContabilizarPrePoliza(CvePrePolizaNueva, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
Str.AppendFormat("<a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", ObjContabilidad.ContaIdPoliza)
End If
End If
Alert(Str.ToString)
Else
ObjContabilidad.RollBack()
End If
ObjContabilidad.Dispose()
CargarSaldoAuxiliar(CveCliente)
End Sub
Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAuxiliar.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.BackColor = Drawing.Color.LightGray
e.Row.FCLiteral("LtlFechaMovto").Text = "Totales:&nbsp;"
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(0).ColumnSpan = 2
e.Row.Cells(1).Visible = False
e.Row.Cells(4).ColumnSpan = 3
e.Row.Cells(5).Visible = False
e.Row.Cells(6).Visible = False
e.Row.Cells(7).Visible = False
e.Row.Cells(8).Visible = False
ElseIf e.Row.RowIndex = 1 Then
e.Row.Cells(0).Width = Unit.Pixel(95)
e.Row.Cells(1).Width = Unit.Pixel(180)
e.Row.Cells(2).Width = Unit.Pixel(80)
e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(83)
e.Row.Cells(5).Width = Unit.Pixel(93)
e.Row.Cells(6).Width = Unit.Pixel(85)
e.Row.Cells(7).Width = Unit.Pixel(95)
e.Row.Cells(8).Width = Unit.Pixel(70)
End If
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
If e.Row.FCLiteral("LtlContabilizado").Text = "Si" Then
Dim Liga As String = String.Format("<a class=""Texto"" href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">", e.Row.DBCampo("IdPoliza"))
e.Row.FCLiteral("LtlPoliza").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("Poliza"))
End If
If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(2) AndAlso e.Row.DBCampo("CvePersonal").ToEntero > 0 Then
Dim Liga As String = String.Format("<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal={0}"">", e.Row.DBCampo("CvePersonal"))
e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable"))
End If
If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DBCampo("CveReferencia").ToEntero}"
ElseIf e.Row.DBCampo("TipoReferencia").ToEntero = 2 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveReferencia").ToEntero}"
End If
If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(275) AndAlso e.Row.DBCampo("CveVenta").ToEntero > 0 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta").ToEntero}"
End If
End If
End Sub
#End Region
End Class