GDiaz - Compras Prontos Pagos
This commit is contained in:
@@ -317,6 +317,9 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
chkaplicaDescuento.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
tmpValida()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1607,10 +1610,10 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
#End Region
|
||||
|
||||
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().ToShortDateString
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MinimumValue = NowADS().AddMonths(-38).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().ToShortDateString
|
||||
Calendario.EndDate = NowADS()
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
Calendario.EndDate = NowADS().AddDays(2)
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -1620,17 +1623,17 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior 2 días de la fecha actual"
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 6 meses de la fecha actual"
|
||||
|
||||
Calendario.EndDate = NowADS().AddDays(2)
|
||||
|
||||
If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 16) Then
|
||||
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(30).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(30).ToShortDateString
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior 30 días de la fecha actual"
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(182).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(182).ToShortDateString
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 6 meses de la fecha actual"
|
||||
|
||||
Calendario.EndDate = NowADS().AddDays(30)
|
||||
Calendario.EndDate = NowADS().AddDays(182)
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
@@ -1645,5 +1648,75 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
UPCompras.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub tmpValida()
|
||||
|
||||
Dim ValidaSAT As Boolean = True
|
||||
Dim ImporteSeleccionado As Decimal = 0
|
||||
'If UsuarioActual.Empresa.Funcionalidad(529) = "1" OrElse ChkNoValidaSAT.Checked Then ValidaSAT = False
|
||||
|
||||
If ValidaSAT Then
|
||||
Dim Validada As Boolean = False
|
||||
Dim MsgValidadas As New StringBuilder
|
||||
Dim Valida As New ClsValidaCFDi()
|
||||
'verifico ante el SAT las compras que voy a pagar
|
||||
For Each gvr As GridViewRow In GvCxP.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
|
||||
ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
If gvr.DataKey("UUID") <> "" Then
|
||||
|
||||
Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal)
|
||||
|
||||
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then
|
||||
Valida.EsValida = 1
|
||||
End If
|
||||
|
||||
If Valida.EsValida <> 1 Then
|
||||
|
||||
Validada = False
|
||||
If Valida.EsValida = 2 Then 'Cancelada
|
||||
'estatus inventario, no surtida
|
||||
If gvr.DataKey("EstatusInventario") = "1" Then
|
||||
MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} , relacione su factura nueva para descontar saldo<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
|
||||
Else
|
||||
MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} con movimientos de almacen, relacione su factura nueva para descontar saldo<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
|
||||
End If
|
||||
Else
|
||||
MsgValidadas.AppendFormat("Factura No se pudo Validar: {0} - {1}<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Valida.Dispose()
|
||||
|
||||
'verificacion doble, si no la han cancelado, ya tiene una validaci[on para que llegue aqui
|
||||
|
||||
If MsgValidadas.Length > 0 Then
|
||||
Alert(String.Format("<br>Las Facturas presentan la siguiente situación ante el SAT. <br>{0}", MsgValidadas.ToString), TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
For Each gvr As GridViewRow In GvCxP.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ImporteSeleccionado <= 0 Then
|
||||
Alert("Seleccione facturas", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub Button1_Click(sender As Object, e As EventArgs)
|
||||
tmpValida()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user