-- cambio en presupuesto
This commit is contained in:
@@ -4193,10 +4193,21 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
'------------------ INICIA VALIDACIONES ------------------
|
'------------------ INICIA VALIDACIONES ------------------
|
||||||
|
|
||||||
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then
|
'comentado RMF.2024.05.21. en anticipos parciales, está bloquenado
|
||||||
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
|
'If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
|
||||||
Exit Sub
|
|
||||||
End If
|
' Dim ImporteAnticipoComision As Decimal = 0
|
||||||
|
' If ArrAnticipos.Count > 0 Then
|
||||||
|
' For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
|
||||||
|
' ImporteAnticipoComision += Ant.ImporteComision
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then
|
||||||
|
' Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
|
||||||
|
' Exit Sub
|
||||||
|
' End If
|
||||||
|
'End If
|
||||||
|
|
||||||
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
|
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
|
||||||
|
|
||||||
@@ -13096,11 +13107,15 @@ Partial Class Compras_Compras
|
|||||||
Dim objcompras As New ClsCompras()
|
Dim objcompras As New ClsCompras()
|
||||||
If objcompras.GetCompraParaDevolucion(CveProveedor, UsuarioActual.CveEmpresa, SubTotal) Then
|
If objcompras.GetCompraParaDevolucion(CveProveedor, UsuarioActual.CveEmpresa, SubTotal) Then
|
||||||
DDLDevolucion.Items.Clear()
|
DDLDevolucion.Items.Clear()
|
||||||
DDLDevolucion.DataSource = objcompras.DtResultados
|
Dim dtt As DataTable = objcompras.DtResultados
|
||||||
DDLDevolucion.DataBind()
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then 'solo los últimos 3 meses
|
||||||
|
dtt = dtt.FiltraParametros($"Fecha >= #{NowADS.AddMonths(-3).ToString("yyyy/MM/dd")}#")
|
||||||
|
End If
|
||||||
|
DDLDevolucion.DataSource = dtt
|
||||||
DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
End If
|
End If
|
||||||
objcompras.Dispose()
|
objcompras.Dispose()
|
||||||
|
DDLDevolucion.DataBind()
|
||||||
UPDevolucion.Update()
|
UPDevolucion.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -13113,9 +13128,9 @@ Partial Class Compras_Compras
|
|||||||
Dim objcompras As New ClsCompras()
|
Dim objcompras As New ClsCompras()
|
||||||
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
|
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
|
||||||
GVDevolucion.DataSource = objcompras.DtResultados
|
GVDevolucion.DataSource = objcompras.DtResultados
|
||||||
GVDevolucion.DataBind()
|
|
||||||
End If
|
End If
|
||||||
objcompras.Dispose()
|
objcompras.Dispose()
|
||||||
|
GVDevolucion.DataBind()
|
||||||
Dim CveAlmacen As Integer = -1
|
Dim CveAlmacen As Integer = -1
|
||||||
For Each GvRow As GridViewRow In GVDevolucion.Rows
|
For Each GvRow As GridViewRow In GVDevolucion.Rows
|
||||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||||
@@ -20678,8 +20693,6 @@ Partial Class Compras_Compras
|
|||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||||
|
|
||||||
Dim ObjCon As New ClsContratos
|
Dim ObjCon As New ClsContratos
|
||||||
@@ -20687,7 +20700,7 @@ Partial Class Compras_Compras
|
|||||||
Dim Autorizado As Double = 0
|
Dim Autorizado As Double = 0
|
||||||
Dim Ejercido As Double = 0
|
Dim Ejercido As Double = 0
|
||||||
|
|
||||||
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, 1) Then
|
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, TxtFecha.Text.ToDate.FirstDayOfMonth, TxtFecha.Text.ToDate.LastDayOfMonth, 1) Then
|
||||||
|
|
||||||
Dim FechaCompra As Date = TxtFecha.Text.ToDate
|
Dim FechaCompra As Date = TxtFecha.Text.ToDate
|
||||||
|
|
||||||
@@ -20696,27 +20709,8 @@ Partial Class Compras_Compras
|
|||||||
FechaCompra <= row.Field(Of Date)("FechaFin")
|
FechaCompra <= row.Field(Of Date)("FechaFin")
|
||||||
Select row
|
Select row
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Dim dataTable As New DataTable
|
|
||||||
'Dim rowFilter As String = ""
|
|
||||||
'Dim orderby As String = ""
|
|
||||||
'Dim groupByColumns As String()() = {New String() {"SubProyecto", "CveSubProyecto", "Clasificacion", "CveClasificacion", "TipoGasto", "CveTipoGasto"}}
|
|
||||||
'Dim sumColumns As String() = {"Total"}
|
|
||||||
|
|
||||||
|
|
||||||
'Dim resultDataTable As DataTable = GroupByDT(TmpDT, rowFilter, orderby, groupByColumns, sumColumns)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If resultadosFiltrados.Count > 0 Then
|
If resultadosFiltrados.Count > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
''.TotalSum = Group.Sum(Function(r) r.Field(Of Decimal)("Total"))
|
''.TotalSum = Group.Sum(Function(r) r.Field(Of Decimal)("Total"))
|
||||||
If Opcion = 1 Then
|
If Opcion = 1 Then
|
||||||
|
|
||||||
@@ -20749,29 +20743,8 @@ Partial Class Compras_Compras
|
|||||||
Else
|
Else
|
||||||
respuesta = True
|
respuesta = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
'Dim EnumAgrupado = (From row In TmpDT.AsEnumerable()
|
|
||||||
' Group row By
|
|
||||||
' SubProyecto = row.Field(Of String)("SubProyecto"),
|
|
||||||
' CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"),
|
|
||||||
' Clasificacion = row.Field(Of String)("Clasificacion"),
|
|
||||||
' CveClasificacion = row.Field(Of Integer)("CveClasificacion"),
|
|
||||||
' TipoGasto = row.Field(Of String)("TipoGasto"),
|
|
||||||
' CveTipoGasto = row.Field(Of Integer)("CveTipoGasto")
|
|
||||||
' Into Group
|
|
||||||
' Select New With {
|
|
||||||
' .SubProyecto = SubProyecto,
|
|
||||||
' .CveSubProyecto = CveSubProyecto,
|
|
||||||
' .Clasificacion = Clasificacion,
|
|
||||||
' .CveClasificacion = CveClasificacion,
|
|
||||||
' .CveTipoGasto = CveTipoGasto,
|
|
||||||
' .TipoGasto = TipoGasto,
|
|
||||||
' .TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total"))))
|
|
||||||
' }).ToList()
|
|
||||||
|
|
||||||
Dim EnumAgrupado = (
|
Dim EnumAgrupado = (
|
||||||
From row In TmpDT.AsEnumerable()
|
From row In TmpDT.AsEnumerable()
|
||||||
Group row By
|
Group row By
|
||||||
@@ -20793,22 +20766,15 @@ Partial Class Compras_Compras
|
|||||||
}
|
}
|
||||||
).ToList()
|
).ToList()
|
||||||
|
|
||||||
|
|
||||||
For Each item In EnumAgrupado
|
For Each item In EnumAgrupado
|
||||||
|
|
||||||
|
|
||||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
||||||
|
|
||||||
If tieneRegistrosConCveSubProyecto Then
|
If tieneRegistrosConCveSubProyecto Then
|
||||||
'Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
|
||||||
' Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
|
||||||
' row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
|
||||||
' Select row.Field(Of Decimal)("Saldo")).Sum()
|
|
||||||
|
|
||||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados.AsEnumerable()
|
Dim saldoTotal As Decimal = (From row In resultadosFiltrados.AsEnumerable()
|
||||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||||
If(row.IsNull("CveClasificacion"),
|
If(row.IsNull("CveClasificacion"), 0,
|
||||||
0,
|
|
||||||
row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion
|
row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion
|
||||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||||
|
|
||||||
@@ -20835,29 +20801,18 @@ Partial Class Compras_Compras
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||||
respuesta = True
|
respuesta = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||||
respuesta = False
|
respuesta = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjCon.Dispose()
|
ObjCon.Dispose()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
respuesta = True
|
respuesta = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Return respuesta
|
Return respuesta
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
Reference in New Issue
Block a user