-- cambio en presupuesto
This commit is contained in:
@@ -4193,10 +4193,21 @@ Partial Class Compras_Compras
|
||||
|
||||
'------------------ INICIA VALIDACIONES ------------------
|
||||
|
||||
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then
|
||||
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
'comentado RMF.2024.05.21. en anticipos parciales, está bloquenado
|
||||
'If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
|
||||
|
||||
' 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()
|
||||
|
||||
@@ -13096,11 +13107,15 @@ Partial Class Compras_Compras
|
||||
Dim objcompras As New ClsCompras()
|
||||
If objcompras.GetCompraParaDevolucion(CveProveedor, UsuarioActual.CveEmpresa, SubTotal) Then
|
||||
DDLDevolucion.Items.Clear()
|
||||
DDLDevolucion.DataSource = objcompras.DtResultados
|
||||
DDLDevolucion.DataBind()
|
||||
Dim dtt As DataTable = objcompras.DtResultados
|
||||
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"))
|
||||
End If
|
||||
objcompras.Dispose()
|
||||
DDLDevolucion.DataBind()
|
||||
UPDevolucion.Update()
|
||||
|
||||
End Sub
|
||||
@@ -13113,9 +13128,9 @@ Partial Class Compras_Compras
|
||||
Dim objcompras As New ClsCompras()
|
||||
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
|
||||
GVDevolucion.DataSource = objcompras.DtResultados
|
||||
GVDevolucion.DataBind()
|
||||
End If
|
||||
objcompras.Dispose()
|
||||
GVDevolucion.DataBind()
|
||||
Dim CveAlmacen As Integer = -1
|
||||
For Each GvRow As GridViewRow In GVDevolucion.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
@@ -20678,8 +20693,6 @@ Partial Class Compras_Compras
|
||||
Return True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
|
||||
Dim ObjCon As New ClsContratos
|
||||
@@ -20687,7 +20700,7 @@ Partial Class Compras_Compras
|
||||
Dim Autorizado 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
|
||||
|
||||
@@ -20696,27 +20709,8 @@ Partial Class Compras_Compras
|
||||
FechaCompra <= row.Field(Of Date)("FechaFin")
|
||||
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
|
||||
|
||||
|
||||
|
||||
''.TotalSum = Group.Sum(Function(r) r.Field(Of Decimal)("Total"))
|
||||
If Opcion = 1 Then
|
||||
|
||||
@@ -20749,29 +20743,8 @@ Partial Class Compras_Compras
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
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 = (
|
||||
From row In TmpDT.AsEnumerable()
|
||||
Group row By
|
||||
@@ -20793,22 +20766,15 @@ Partial Class Compras_Compras
|
||||
}
|
||||
).ToList()
|
||||
|
||||
|
||||
For Each item In EnumAgrupado
|
||||
|
||||
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
||||
|
||||
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()
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
If(row.IsNull("CveClasificacion"),
|
||||
0,
|
||||
If(row.IsNull("CveClasificacion"), 0,
|
||||
row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
|
||||
@@ -20835,29 +20801,18 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
ObjCon.Dispose()
|
||||
|
||||
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Return respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user