nominas en reporte de presupuestos, correciones de reporte af,correciones en traspasos y ventas

This commit is contained in:
2023-04-20 11:02:24 -07:00
parent 2c3bc02ab6
commit 7d1885fd20
12 changed files with 875 additions and 804 deletions

View File

@@ -5,10 +5,10 @@ Imports System.Data
Imports Extensiones
Partial Class Contratos_Presupuestos
Inherits ClsPaginas
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Public Property CvePresupuesto() As Integer
Get
Return ViewState("CvePresupuesto").ToString.ToEntero
@@ -37,10 +37,10 @@ Partial Class Contratos_Presupuestos
Set(ByVal value As DataTable)
ViewState("DtClasificaciones") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CvePresupuesto = IfNull(Request("CvePresupuesto"), -1).ToString.ToEntero
@@ -56,8 +56,8 @@ Partial Class Contratos_Presupuestos
UpGvClasificaciones.Update()
UpIndicadores.Update()
End If
End Sub
End Sub
#Region "I N I C I A L I Z A - V A L O R E S"
Private Sub InicializaValores()
TxtFechaI.Text = $"01/01/{Now.Year}"
@@ -125,13 +125,13 @@ Partial Class Contratos_Presupuestos
End Select
End If
If e.Row.RowType = DataControlRowType.Footer Then
Dim Importe = DtClasificaciones.SUM("Importe", "CveClasificacion IS NOT NULL")
Dim Importe = DtClasificaciones.SUM("Importe", "CveAgrupador IS NOT NULL")
e.Row.FCLabel("LblTotal").Text = String.Format("{0:C}", Importe)
End If
End Sub
End Sub
#End Region
#Region "C A R G A - D A T O S"
Private Sub CargaDatos()
CargaMoneda()
@@ -245,9 +245,9 @@ Partial Class Contratos_Presupuestos
HlModificar.Visible = True
HlModificar.NavigateUrl = $"/Contratos/ModificarPresupuesto.aspx?CvePresupuesto={CvePresupuesto}"
End If
End Sub
End Sub
#End Region
#Region "G U A R D A R "
Private Function ValidaDatos() As Boolean
If String.IsNullOrEmpty(TxtPresupuesto.Text.Trim) Then
@@ -327,23 +327,39 @@ Partial Class Contratos_Presupuestos
For Each GvRow As GridViewRow In GvPresupuestos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Dim CveClasificacion = GvRow.DataKey("CveClasificacion").ToEntero
Dim CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero
Dim CveAgrupador = GvRow.DataKey("CveAgrupador").ToEntero
Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero
Dim CveTipoGasto = -1
Dim CveClasificacion As Integer = -1
Dim CveConceptoContableNom As Integer = -1
If Tipo = 1 Then
CveClasificacion = CveAgrupador
CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero
End If
If Tipo = 2 Then
CveConceptoContableNom = CveAgrupador
End If
Dim CvePresupuestoDetalle = GvRow.DataKey("CvePresupuestoDetalle").ToEntero
Dim Importe = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal
Dim Obs = GvRow.FCTextBox("TxtObservacion").Text.Trim
'ACTUALIZA EL REGISTRO EXISTENTE
If CvePresupuestoDetalle > 0 Then
TieneError = Not ObjCont.UpdatePresupuestosDetalle(CvePresupuestoDetalle, CveClasificacion, Importe, Obs)
TieneError = Not ObjCont.UpdatePresupuestosDetalle(CvePresupuestoDetalle, CveClasificacion, Importe, Obs, CveConceptoContableNom:=CveConceptoContableNom)
If TieneError Then
Exit For
End If
'AGREGA LA CLASIFICACION SI NO EXISTE EN EN EL DT DETALLE
Else
If Importe > 0 And CveClasificacion > 0 Then
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuesto, CveClasificacion, CveTipoGasto, Importe, Obs)
If Importe > 0 And CveAgrupador > 0 Then
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuesto, CveClasificacion, CveTipoGasto, Importe, Obs, CveConceptoContableNom:=CveConceptoContableNom)
If TieneError Then
Exit For
End If
@@ -385,18 +401,33 @@ Partial Class Contratos_Presupuestos
If CvePresupuestoNuevo > 0 Then
Dim ImporteClasi = 0.0D
Dim CveClasificacion = -1
Dim ObsDetalle = ""
For Each GvRow As GridViewRow In GvPresupuestos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
ImporteClasi = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal
CveClasificacion = GvRow.DataKey("CveClasificacion").ToEntero
Dim CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero
ImporteClasi = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal
ObsDetalle = GvRow.FCTextBox("TxtObservacion").Text.Trim
Dim CveAgrupador = GvRow.DataKey("CveAgrupador").ToEntero
Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero
Dim CveClasificacion As Integer = -1
Dim CveConceptoContableNom As Integer = -1
Dim CveTipoGasto As Integer = -1
If Tipo = 1 Then
CveClasificacion = CveAgrupador
CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero
End If
If Tipo = 2 Then
CveConceptoContableNom = CveAgrupador
End If
If CveClasificacion > 0 Then
If ImporteClasi > 0 Then
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuestoNuevo, CveClasificacion, CveTipoGasto, ImporteClasi, ObsDetalle)
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuestoNuevo, CveClasificacion, CveTipoGasto, ImporteClasi, ObsDetalle, CveConceptoContableNom:=CveConceptoContableNom)
If TieneError Then
Exit For
End If
@@ -427,11 +458,11 @@ Partial Class Contratos_Presupuestos
Alert("Se agregó el presupuesto correctamente.", TipoMensaje.MsgInformacion, Liga)
End If
End Sub
End Sub
#End Region
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs) Handles LnkAutorizar.Click
If ValidaDatos() Then
If ActualizarPresupuesto() Then