Cambios en facturacion masiva de contratos

This commit is contained in:
2020-09-24 10:17:08 -07:00
parent a4f768d18a
commit ab8db929bc
5 changed files with 2600 additions and 2525 deletions

View File

@@ -1199,13 +1199,16 @@ Partial Class Contratos_Default
GvFianzas.DataBind()
UpGvFianzas.Update()
End Sub
End Sub
#End Region
#Region " GUARDAR "
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim ObjContratos As New ClsContratos
Dim ObjInventarios As New ClsInventarios(ObjContratos.IniciaTransacSQL)
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then
Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim TieneError = False
Dim Modificado = False
@@ -1221,21 +1224,30 @@ Partial Class Contratos_Default
Maximo = txtMaximo.Text.ToDouble
Total = TxtTotal.Text.ToDouble
If DdlTipoContrato.SelectedValue = "25" AndAlso DdlPeriodo.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar el periodo de facturación.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DdlMoneda.SelectedIndex > 0 Then
If TxtTipoCambio.Text.Trim.Length = 0 Or TxtTipoCambio.Text.Trim.ToDouble = 0.0 Then
Alert("Cuando seleccione una moneda diferente a peso debe especificar el tipo de cambio.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'Crear Contrato
If Not CveContrato > 0 Then
End If
If CveContrato > 0 Then
If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then
Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
Dim ObjContratos As New ClsContratos
Dim ObjInventarios As New ClsInventarios(ObjContratos.IniciaTransacSQL)
'Crear Contrato
If Not CveContrato > 0 Then
CveContrato = ObjContratos.AddContratos(TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate,
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
@@ -1323,18 +1335,9 @@ Partial Class Contratos_Default
TieneError = True
End If
Else
Modificado = True
If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then
Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ArchivoUpdate As String = "-1"
If Session("FileExtension").ToString <> "" Then
@@ -1433,16 +1436,8 @@ Partial Class Contratos_Default
End If
End If
'If Not TieneError Then
' TieneError = GuardarAlmacen(ObjInventarios)
'End If
If TieneError Then
ObjContratos.RollBack()
Else
@@ -1461,12 +1456,11 @@ Partial Class Contratos_Default
End If
UpGral.Update()
ObjContratos.Dispose()
End Sub
End Sub
#End Region
#Region " ELIMINAR "
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click
Dim objContratos As New ClsContratos