Validaciones fecha pago
This commit is contained in:
@@ -1389,8 +1389,22 @@ Partial Class Bancos_PopIECompras
|
|||||||
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||||
|
|
||||||
|
|
||||||
If FechaCompra.ToString("dd/MM/yyyy").ToDate > TxtFechaDocumento.Text.ToDate Then
|
|
||||||
Alert($"La fecha de compra no puede ser mayor que la fecha de pago <br/> Fecha de compra: { FechaCompra.ToString("dd/MM/yyyy") } ", TipoMensaje.MsgAdvertencia)
|
|
||||||
|
Dim FechaFactura As Date = FechaCompra
|
||||||
|
Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate
|
||||||
|
|
||||||
|
Dim AnioFactura As Integer = FechaFactura.Year
|
||||||
|
Dim MesFactura As Integer = FechaFactura.Month
|
||||||
|
|
||||||
|
Dim AnioDocumento As Integer = FechaDocumentoPago.Year
|
||||||
|
Dim MesDocumento As Integer = FechaDocumentoPago.Month
|
||||||
|
|
||||||
|
If AnioFactura > AnioDocumento Then
|
||||||
|
Alert($"El mes de la fecha de compra no puede ser mayor al mes de la la fecha de pago <br/> Fecha de compra: { FechaCompra.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then
|
||||||
|
Alert($"El mes de la fecha de compra no puede ser mayor al mes de la la fecha de pago <br/> Fecha de compra: { FechaCompra.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -1390,12 +1390,25 @@ Partial Class Bancos_PopIEVentas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
If FechaVenta.ToString("dd/MM/yyyy").ToDate > TxtFechaDocumento.Text.ToDate Then
|
Dim FechaFactura As Date = FechaVenta
|
||||||
Alert($"La fecha de venta no puede ser mayor que la fecha de pago <br/> Fecha de venta: { FechaVenta.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia)
|
Dim FechaDocumentoPago As Date = TxtFechaDocumento.Text.ToDate
|
||||||
|
|
||||||
|
Dim AnioFactura As Integer = FechaFactura.Year
|
||||||
|
Dim MesFactura As Integer = FechaFactura.Month
|
||||||
|
|
||||||
|
Dim AnioDocumento As Integer = FechaDocumentoPago.Year
|
||||||
|
Dim MesDocumento As Integer = FechaDocumentoPago.Month
|
||||||
|
|
||||||
|
If AnioFactura > AnioDocumento Then
|
||||||
|
Alert($"El mes de la fecha de venta no puede ser mayor al mes de la la fecha de pago <br/> Fecha de venta: { FechaVenta.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then
|
||||||
|
Alert($"El mes de la fecha de venta no puede ser mayor al mes de la la fecha de pago <br/> Fecha de venta: { FechaVenta.ToString("dd/MM/yyyy") }", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'VALIDACION PARA LOS IMPORTES CUANDO SE QUIERE PAGAR EN DIFERENTE MONEDA
|
'VALIDACION PARA LOS IMPORTES CUANDO SE QUIERE PAGAR EN DIFERENTE MONEDA
|
||||||
If Not Page.IsValid Then
|
If Not Page.IsValid Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
|
|||||||
@@ -716,13 +716,27 @@ Partial Class Bancos_ProveedoresAbonar
|
|||||||
Dim ValFechaDocumento As Boolean = False
|
Dim ValFechaDocumento As Boolean = False
|
||||||
Dim FoliosFechasValFechaDocumento As New StringBuilder
|
Dim FoliosFechasValFechaDocumento As New StringBuilder
|
||||||
|
|
||||||
FoliosFechasValFechaDocumento.AppendLine("Se seleccionaron facturas con fecha superior a la fecha de pago: <br/>")
|
FoliosFechasValFechaDocumento.AppendLine("Se seleccionaron facturas con fecha de mes superior al mes del pago: <br/>")
|
||||||
|
|
||||||
For Each gvRowVal As GridViewRow In GvCxP.Rows
|
For Each gvRowVal As GridViewRow In GvCxP.Rows
|
||||||
|
|
||||||
If gvRowVal.FCCheckBox("Chk").Checked Then
|
If gvRowVal.FCCheckBox("Chk").Checked Then
|
||||||
If gvRowVal.DataKey("Fecha").ToDate > TxtFechaDocumento.Text.ToDate Then
|
|
||||||
FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy") }<br/>")
|
|
||||||
|
Dim FechaFactura As Date = gvRowVal.DataKey("Fecha").ToDate
|
||||||
|
Dim FechaDocumento As Date = TxtFechaDocumento.Text.ToDate
|
||||||
|
|
||||||
|
Dim AnioFactura As Integer = FechaFactura.Year
|
||||||
|
Dim MesFactura As Integer = FechaFactura.Month
|
||||||
|
|
||||||
|
Dim AnioDocumento As Integer = FechaDocumento.Year
|
||||||
|
Dim MesDocumento As Integer = FechaDocumento.Month
|
||||||
|
|
||||||
|
If AnioFactura > AnioDocumento Then
|
||||||
|
FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy") } <br/>")
|
||||||
|
ValFechaDocumento = True
|
||||||
|
ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then
|
||||||
|
FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy") } <br/>")
|
||||||
ValFechaDocumento = True
|
ValFechaDocumento = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -735,6 +749,7 @@ Partial Class Bancos_ProveedoresAbonar
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If DdlTipoTransaccion.SelectedValue.ToEntero < 0 Then
|
If DdlTipoTransaccion.SelectedValue.ToEntero < 0 Then
|
||||||
Alert("Seleccione un tipo de transacción", TipoMensaje.MsgAdvertencia)
|
Alert("Seleccione un tipo de transacción", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
|
|||||||
@@ -3189,9 +3189,9 @@ Partial Class Ventas_PortalCliente
|
|||||||
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
||||||
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
||||||
|
|
||||||
ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
|
ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33
|
||||||
If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows.Count > 0 Then
|
If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago33 = {ObjCliente.CveMetodoPago33}").Rows.Count > 0 Then
|
||||||
ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows(0)("MetodoPago").ToString
|
ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago33 = {ObjCliente.CveMetodoPago33}").Rows(0)("MetodoPago").ToString
|
||||||
Else
|
Else
|
||||||
ObjFactura.CveMetodoPago = 1
|
ObjFactura.CveMetodoPago = 1
|
||||||
ObjFactura.MetodoPago = "Efectivo"
|
ObjFactura.MetodoPago = "Efectivo"
|
||||||
|
|||||||
@@ -657,18 +657,32 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Dim ValFechaDocumento As Boolean = False
|
Dim ValFechaDocumento As Boolean = False
|
||||||
Dim FoliosFechasValFechaDocumento As New StringBuilder
|
Dim FoliosFechasValFechaDocumento As New StringBuilder
|
||||||
|
|
||||||
FoliosFechasValFechaDocumento.AppendLine("Se seleccionaron facturas con fecha superior a la fecha de pago: <br/>")
|
FoliosFechasValFechaDocumento.AppendLine("Se seleccionaron facturas con fecha de mes superior al mes del pago: <br/>")
|
||||||
|
|
||||||
For Each gvRowVal As GridViewRow In GvCxC.Rows
|
For Each gvRowVal As GridViewRow In GvCxC.Rows
|
||||||
|
|
||||||
If gvRowVal.FCCheckBox("Chk").Checked Then
|
If gvRowVal.FCCheckBox("Chk").Checked Then
|
||||||
If gvRowVal.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy").ToDate > TxtFechaDocumento.Text.ToDate Then
|
|
||||||
|
Dim FechaFactura As Date = gvRowVal.DataKey("Fecha").ToDate
|
||||||
|
Dim FechaDocumento As Date = TxtFechaDocumento.Text.ToDate
|
||||||
|
|
||||||
|
Dim AnioFactura As Integer = FechaFactura.Year
|
||||||
|
Dim MesFactura As Integer = FechaFactura.Month
|
||||||
|
|
||||||
|
Dim AnioDocumento As Integer = FechaDocumento.Year
|
||||||
|
Dim MesDocumento As Integer = FechaDocumento.Month
|
||||||
|
|
||||||
|
If AnioFactura > AnioDocumento Then
|
||||||
|
FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy") } <br/>")
|
||||||
|
ValFechaDocumento = True
|
||||||
|
ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then
|
||||||
FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy") } <br/>")
|
FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy") } <br/>")
|
||||||
ValFechaDocumento = True
|
ValFechaDocumento = True
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
If ValFechaDocumento Then
|
If ValFechaDocumento Then
|
||||||
|
|||||||
Reference in New Issue
Block a user