GDiaz - Compras Prontos Pagos

This commit is contained in:
rakcsle
2024-04-10 09:26:09 -07:00
parent f4a5119a60
commit a3f7ad70cd
8 changed files with 293 additions and 35 deletions

View File

@@ -524,7 +524,7 @@
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 133px !important; margin-top: -5px; margin-left: -10px;">
<asp:TextBox ID="TxtFechaDocumento" runat="server" CssClass="form-control" Width="99%"></asp:TextBox>
<span class="input-group-btn">
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default" ><i class="fa fa-calendar"></i></asp:LinkButton>
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default" type="button" ><i class="fa fa-calendar"></i></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>

View File

@@ -1679,13 +1679,6 @@ Partial Class Bancos_PopIECompras
UpGuardar.Update()
End Sub
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = NowADS().ToShortDateString
Calendario.EndDate = NowADS()
End Sub
Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs)
@@ -1721,15 +1714,22 @@ Partial Class Bancos_PopIECompras
End Sub
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
Calendario.EndDate = NowADS().AddDays(2)
End Sub
Private Sub ValidaFechaDocumentoDiasPosteriores()
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
Calendario.EndDate = NowADS().AddDays(2)
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"
If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 16) Then
RVTxtFechaDocumento.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 a 6 meses de la fecha actual"
Calendario.EndDate = NowADS().AddDays(30)
End If

View File

@@ -338,7 +338,13 @@
<asp:CheckBox Text=" No Validar ante SAT" ID="ChkNoValidaSAT" CssClass="md-checksd" runat="server" Checked="false" Visible="false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" />
<asp:Button ID="Button1" runat="server" Text="Valida" OnClick="Button1_Click" Visible="false" />
</td>
</tr>
</table>

View File

@@ -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