Compras Contratos
This commit is contained in:
@@ -1478,6 +1478,10 @@ Partial Class Compras_Compras
|
||||
UpLnkPaqueteriaGuias.Update()
|
||||
End If
|
||||
|
||||
If Not CveCompra > 0 And UsuarioActual.CveRol = 1 Then
|
||||
LIContratos.Visible = True
|
||||
End If
|
||||
|
||||
'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
|
||||
LblSaldoFactura.Text = If(CveCompra > 0, Saldo.FormatoNumero, TxtTotal.Text.FormatoNumero)
|
||||
'cuando es factura con amortizacion, el importe a descontar es el saldo que se debe de aplicar para la amortizacion
|
||||
@@ -20821,10 +20825,128 @@ Partial Class Compras_Compras
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAplicarContrato_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
#Region "Contratos Obra"
|
||||
|
||||
Protected Sub LnkAcontratos_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
DdlContratosObra.Items.Clear()
|
||||
DdlContratosObra.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||
DdlContratosObra.DataBind()
|
||||
DdlContratosObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
|
||||
DdlTipoGastoContrato.Items.Clear()
|
||||
DdlTipoGastoContrato.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
|
||||
DdlTipoGastoContrato.DataBind()
|
||||
DdlTipoGasto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
RegistraScript("$('#DivmodalConmtrato').modal('show')")
|
||||
UpModalContrato.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlContratosCompras_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If DdlContratosObra.SelectedValue.ToEntero > 0 Then
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
|
||||
If ObjContratos.GetContratosObraCompras(DdlContratosObra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjContratos.DtResultados.Rows.Count > 0 Then
|
||||
GvContratosControl.DataSource = ObjContratos.DtResultados
|
||||
BtnAplicarContrato.Visible = True
|
||||
Else
|
||||
GvContratosControl.DataSource = Nothing
|
||||
BtnAplicarContrato.Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
ObjContratos.Dispose()
|
||||
|
||||
GvContratosControl.DataBind()
|
||||
|
||||
UpModalContrato.Update()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnAplicarContrato_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
TmpDT.Rows.Clear()
|
||||
|
||||
Dim CveTipoGastoObra As Integer = DdlTipoGastoContrato.SelectedValue.ToEntero
|
||||
Dim TuipoGasto As String = DdlTipoGastoContrato.SelectedItem.Text
|
||||
|
||||
For Each GvRow As GridViewRow In GvContratosControl.Rows
|
||||
|
||||
Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero
|
||||
|
||||
Dim Cantidad As Double = GvRow.FCTextBox("TxtCantidad").Text.ToDouble
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
Dim PS As String = GvRow.DataKey("PS")
|
||||
Dim PU As Double = GvRow.DataKey("PU").ToDouble
|
||||
Dim TotalPS As Double = GvRow.FCTextBox("TxtImporte").Text.ToDouble
|
||||
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||
Dim UMAbreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||
|
||||
Dim SubProyecto As String = GvRow.DataKey("SubProyecto")
|
||||
Dim CveSubProyecto As Integer = GvRow.DataKey("CveSubProyecto").ToEntero
|
||||
Dim Codigo As String = "" 'GvRow.DataKey("Codigo")
|
||||
|
||||
Dim Proyecto As String = GvRow.DataKey("Proyecto")
|
||||
Dim CveProyecto As Integer = GvRow.DataKey("CveProyecto").ToEntero
|
||||
|
||||
Dim RetISR As Double = GvRow.DataKey("RetISR").ToString.ToDouble
|
||||
Dim RetIVA As Double = GvRow.DataKey("RetIVA").ToString.ToDouble
|
||||
Dim IvaPS As Double = GvRow.DataKey("IVA").ToString.ToDouble
|
||||
|
||||
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero
|
||||
Dim Clasificacion As String = GvRow.DataKey("Clasificacion")
|
||||
|
||||
|
||||
Dim IEPSPS As Double = GvRow.DataKey("IEPSPorcentaje").ToString.ToDouble
|
||||
Dim IEPSPSIVA As Double = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0)
|
||||
|
||||
Dim IdCuentaPorEjercer As Integer = -1
|
||||
Dim IdCuentaComprometido As Integer = -1
|
||||
|
||||
|
||||
|
||||
|
||||
If Cantidad > 0 Then
|
||||
|
||||
AddPS(Cantidad, CveUnidadMedida, UMAbreviatura, CveClasificacion, Clasificacion, CvePS, PS, 1, CveSubProyecto.ToString, SubProyecto, Proyecto, CveProyecto.ToString, "", PU, PU * Cantidad, IvaPS, RetIVA, RetISR, IEPSPS, IEPSPSIVA, 0, CveContratoDetalle:=CveContratoDetalle,
|
||||
CveTipoGasto:=CveTipoGastoObra, TipoGasto:=TuipoGasto)
|
||||
|
||||
|
||||
'ContratoObraAplciado = True
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
AddPS2()
|
||||
|
||||
|
||||
RegistraScript("$('#DivmodalConmtrato').modal('hide')")
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub ChkMostrarTodos_CheckedChanged(sender As Object, e As EventArgs)
|
||||
CargaNCINV(ShowAllPendientes:=True)
|
||||
UpFacturaNC.Update()
|
||||
|
||||
Reference in New Issue
Block a user