Crear opción para editar la forma de pago en PVCobranza
This commit is contained in:
@@ -17,6 +17,8 @@ Partial Class Ventas_PVCobranza
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Property DineroCaja As Double
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DineroCaja")), 0, ViewState("DineroCaja").ToString().ToDecimal())
|
||||
@@ -24,12 +26,51 @@ Partial Class Ventas_PVCobranza
|
||||
Set(value As Double)
|
||||
ViewState("DineroCaja") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveIE As Integer
|
||||
Get
|
||||
If ViewState("CveIE") Is Nothing Then
|
||||
ViewState("CveIE") = -1
|
||||
End If
|
||||
Return ViewState("CveIE").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveIE") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveTipoTransaccionOriginal As Integer
|
||||
Get
|
||||
If ViewState("CveTipoTransaccionOriginal") Is Nothing Then
|
||||
ViewState("CveTipoTransaccionOriginal") = -1
|
||||
End If
|
||||
Return ViewState("CveTipoTransaccionOriginal").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveTipoTransaccionOriginal") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtCortesVentas As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("DtCortesVentas") Is Nothing Then
|
||||
ViewState("DtCortesVentas") = New DataTable
|
||||
End If
|
||||
Return CType(ViewState("DtCortesVentas"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCortesVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CveCorte = 0
|
||||
CargaFiltros()
|
||||
CargaDdlPagos()
|
||||
If UsuarioActual.TienePermisoProceso(371) Then
|
||||
CargaCorteCaja()
|
||||
End If
|
||||
@@ -210,12 +251,25 @@ Partial Class Ventas_PVCobranza
|
||||
TxtImporteOtrosContado.Text = ""
|
||||
TxtCambio.Text = ""
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
|
||||
If ChkMostrarSoloPagados.Checked Then
|
||||
DVCobraza.Visible = False
|
||||
DVPagado.Visible = True
|
||||
CargaDatosPagos()
|
||||
Else
|
||||
DVCobraza.Visible = True
|
||||
DVPagado.Visible = False
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
@@ -663,4 +717,105 @@ Partial Class Ventas_PVCobranza
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region "PAGOS"
|
||||
|
||||
Public Sub CargaDatosPagos()
|
||||
|
||||
Dim FechaI As Date = If(txtFechaI.Text <> "", txtFechaI.Text.ToDate, MinFecha)
|
||||
Dim FechaF As Date = If(txtFechaF.Text <> "", txtFechaF.Text.ToDate, MaxFecha)
|
||||
|
||||
Dim ObjPuntoVenta As New ClsPuntoVenta
|
||||
|
||||
If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then
|
||||
GvD.DataSource = ObjPuntoVenta.DtResultados
|
||||
DtCortesVentas = ObjPuntoVenta.DtResultados
|
||||
End If
|
||||
|
||||
ObjPuntoVenta.Dispose()
|
||||
|
||||
GvD.DataBind()
|
||||
UpL.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvD_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvD.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveVenta").ToString = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
If e.Row.DBCampo("ImportePagado").ToDecimal() < 0 Then
|
||||
e.Row.FCLabel("LblTotal").CssClass = "badge badge-danger"
|
||||
End If
|
||||
If e.Row.DataKey("CveIE").ToEntero > 0 Then
|
||||
e.Row.FCLinkButton("LnkEditarPago").Visible = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub CargaDdlPagos()
|
||||
|
||||
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'")
|
||||
DdlTipoTransaccion.DataBind()
|
||||
DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1"))
|
||||
|
||||
|
||||
DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlCuenta.DataBind()
|
||||
DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEditarPago_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
|
||||
CveIE = GvRow.DataKey("CveIE").ToEntero
|
||||
CveTipoTransaccionOriginal = GvRow.DataKey("CveTipoTransaccion").ToEntero
|
||||
|
||||
Dim CveTipoTransaccion As Integer = GvRow.DataKey("CveTipoTransaccion").ToEntero
|
||||
Dim CveCuenta As Integer = GvRow.DataKey("CveCuenta").ToEntero
|
||||
|
||||
LblModalPagoTitulo.Text = $"Editar Pago {GvRow.DataKey("SerieFolio")}"
|
||||
DdlTipoTransaccion.SelectedValueExist(CveTipoTransaccion)
|
||||
DdlCuenta.SelectedValueExist(CveCuenta)
|
||||
|
||||
UpModalPago.Update()
|
||||
|
||||
RegistraScript("$('#DVModalPagos').modal('show');")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkDvModalPagoAceptar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
If CveTipoTransaccionOriginal <> DdlTipoTransaccion.SelectedValue.ToEntero Then
|
||||
|
||||
Dim Folio As Long
|
||||
Dim objBanco As New ClsBancos
|
||||
Folio = objBanco.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero)
|
||||
|
||||
If Not objBanco.UpdateBancosIECobranza(CveIE, DdlTipoTransaccion.SelectedValue.ToEntero, Folio.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
objBanco.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
CargaDatosPagos()
|
||||
Alert("Movimiento actualizado correctamente")
|
||||
RegistraScript("$('#DVModalPagos').modal('hide');")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user