Validacion de autorizaciones, limitar remisiones de nota de credito

This commit is contained in:
2020-10-21 13:07:29 -07:00
parent dd282564d7
commit 897b04e407
3 changed files with 41 additions and 33 deletions

View File

@@ -2021,7 +2021,7 @@ Public Class ClsClientes
Return Retorno
End Function
Public Function UpdateEstatusPedido(CveVenta As Integer, CveEstatusFactura As Integer, Dias As Integer, CveUsuario As Integer) As Boolean
Public Function UpdateEstatusPedido(CveVenta As Integer, CveEstatusFactura As Integer, Dias As Integer, CveUsuario As Integer, Optional CveRemision As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteVentasPedidoEstatusUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -2029,6 +2029,7 @@ Public Class ClsClientes
.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura
.Add("@Dias", SqlDbType.Int).Value = Dias
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveRemision", SqlDbType.Int).Value = CveRemision
End With
Try
SqlAdapter.Fill(Data)
@@ -2037,28 +2038,28 @@ Public Class ClsClientes
OnError("Ocurrió un error al actualizar el pedido del cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
'Public Function UpdateFechaPedido(CveVenta As Integer, DiasCredito As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_Vta_ClienteVentasPedidoFechaUpdate")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
' .Add("@DiasCredito", SqlDbType.Int).Value = DiasCredito
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al actualizar la fecha del pedido del cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
' End Try
' Return Retorno
'End Function
End Function
'Public Function UpdateFechaPedido(CveVenta As Integer, DiasCredito As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_Vta_ClienteVentasPedidoFechaUpdate")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
' .Add("@DiasCredito", SqlDbType.Int).Value = DiasCredito
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al actualizar la fecha del pedido del cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
' End Try
' Return Retorno
'End Function
#End Region
#Region "A P L I C A C I O N"
Public Function AddClienteApp(Cliente As MCliente) As Boolean
Dim Retorno As Boolean = False

View File

@@ -6235,8 +6235,8 @@
</div>
<div class="col-md-10">
<asp:DropDownList ID="DdlVentaUsado" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="100%" CssClass="select2me" OnSelectedIndexChanged="DdlVentaUsado_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>
<%-- <asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
@@ -6293,14 +6293,14 @@
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" />
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="row" id="DivSMU" runat="server" visible="false">
<div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
<tr align="right">

View File

@@ -2160,6 +2160,7 @@ Partial Class Ventas
'Carga Venta
If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero() > 0 Then
ViewState("CveVenta") = Request("CveVenta")
If CargaVenta() Then
'DdlSucursal.Enabled = False
@@ -2694,7 +2695,7 @@ Partial Class Ventas
TrPedido.Visible = False
' TrKilometrajeTxt.Visible = True
End If
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveVenta)
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""></i> Tarea</a>", CveVenta)
End If
@@ -5415,7 +5416,7 @@ Partial Class Ventas
DdlVentaUsado.DataBind()
DdlVentaUsado.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlVentaUsado.Items.Insert(0, New ListItem("No Aplica", "-1"))
UpModalRemisionesNC.Update()
End If
@@ -10190,7 +10191,7 @@ Partial Class Ventas
'PedidoA'
If ObjVentas.CveVenta > 0 And CvePedidoA > 0 And DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario) Then
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario, CveRemision:=factura.CveVenta) Then
ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA")
End If
End If
@@ -23116,13 +23117,19 @@ Partial Class Ventas
GvRemisionesNCBon.DataBind()
If CveVentaUsado > 0 Then
DivSMU.Visible = True
Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa)
LtlSMU.Text = String.Format("{0:N2}", FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal())
Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
LtlSMU.Text = String.Format("{0:N2}", 0)
DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
UpModalRemisionesNC.Update()
UpDescNC.Update()
End Sub
Private Sub CargaDescRNC()
Dim DtNC As DataTable = Nothing
@@ -23318,8 +23325,8 @@ Partial Class Ventas
End Sub
Protected Sub GvRemisionesNC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaTotalRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaCantidadRNCMasivo({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
End If
End Sub