This commit is contained in:
2025-01-13 06:59:57 -07:00
17 changed files with 759 additions and 163 deletions

View File

@@ -104,48 +104,119 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion"
EmptyDataText="No se encontraron autorizaciones" ToolTip=""
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Tipo " ItemStyle-Width="3%">
<ItemTemplate>
<asp:Label ID="LblTipo" Text='<%# Eval("TipoDocumento") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo" ItemStyle-Width="3%">
<ItemTemplate>
<asp:Label ID="LblTipoAuto" Text='<%# Eval("TipoAutorizacionTexto") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="9%" />
<%-- 30--%>
<asp:BoundField DataField="Importe" ItemStyle-Width="7%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PorcentajeDescuento" ItemStyle-Width="5%" HeaderText="% Desc" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="7%" HeaderText="L.Créd" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Saldo" ItemStyle-Width="7%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="7%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="3%" HeaderText="D.Ven" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
<asp:HyperLinkField DataTextField="FacturaAplicada" ItemStyle-Width="7%" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
<%-- 45--%>
<asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" >
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UsuarioAutorizo" HeaderText="Autorizó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7%" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea autorizar el limite?" data-btn-ok-label="si" ID="LnkAutorizar" OnClick="LnkAutorizar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-check'></i>"></asp:LinkButton>
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea rechazar el limite?" data-btn-ok-label="si" ID="LnkRechazar" OnClick="LnkRechazar_Click" CssClass="btn btn-circle btn-sm red" runat="server" Text="<i class='fa fa-times'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" Visible='<%# Eval("CveEstatus").ToString = "0" OrElse Eval("CveEstatus").ToString = "1" %>' runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el limite?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<div class="portlet light xspadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 1; color: #ff6000;">Solicitudes de autorizaciones</span>
</div>
<div class="actions">
<div class="btn-group">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion"
EmptyDataText="No se encontraron autorizaciones" ToolTip=""
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Tipo " ItemStyle-Width="3%">
<ItemTemplate>
<asp:Label ID="LblTipo" Text='<%# Eval("TipoDocumento") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo" ItemStyle-Width="3%">
<ItemTemplate>
<asp:Label ID="LblTipoAuto" Text='<%# Eval("TipoAutorizacionTexto") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="9%" />
<%-- 30--%>
<asp:BoundField DataField="Importe" ItemStyle-Width="7%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PorcentajeDescuento" ItemStyle-Width="5%" HeaderText="% Desc" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="7%" HeaderText="L.Créd" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Saldo" ItemStyle-Width="7%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="7%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="3%" HeaderText="D.Ven" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
<asp:HyperLinkField DataTextField="FacturaAplicada" ItemStyle-Width="7%" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
<%-- 45--%>
<asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UsuarioAutorizo" HeaderText="Autorizó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7%" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea autorizar el limite?" data-btn-ok-label="si" ID="LnkAutorizar" OnClick="LnkAutorizar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-check'></i>"></asp:LinkButton>
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea rechazar el limite?" data-btn-ok-label="si" ID="LnkRechazar" OnClick="LnkRechazar_Click" CssClass="btn btn-circle btn-sm red" runat="server" Text="<i class='fa fa-times'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" Visible='<%# Eval("CveEstatus").ToString = "0" OrElse Eval("CveEstatus").ToString = "1" %>' runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el limite?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<br />
<div class="portlet light xspadding traspasorow bordered" id="DivAntNCIxC" runat="server" visible="false">
<div class="portlet-title">
<div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 1; color: #ff6000;">Anticipos, notas de crédito e ingresos por comprobar</span>
</div>
<div class="actions">
<div class="btn-group">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusquedaAnt" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnt','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnt','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GVAnticipos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" GridLines="None" DataKeyNames="CveIE,Folio,Tipo,CveVenta,CveCliente" Style="text-align: center; min-width: 783px; width: 100%;">
<Columns>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" DataFormatString="{0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40%" />
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%">
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Tipo" DataField="Tipo" DataFormatString="{0}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("EstatusTexto") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ToolTip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" ToolTip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModal" class="modal ADS fade" role="dialog">

View File

@@ -62,6 +62,10 @@ Partial Class Ventas_CatAutorizacionLimites
DdlEstatus.SelectedValue = "0"
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
DivAntNCIxC.Visible = True
End If
UpModal.Update()
End Sub
Private Sub CargaDatos()
@@ -82,6 +86,11 @@ Partial Class Ventas_CatAutorizacionLimites
End If
ObjGral.Dispose()
GvDatos.DataBind()
If DivAntNCIxC.Visible Then
CargaAnticipos(CveCliente, FechaI, FechaF)
End If
UpDatos.Update()
End Sub
@@ -367,4 +376,130 @@ Partial Class Ventas_CatAutorizacionLimites
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
End Sub
#End Region
Private Sub CargaAnticipos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime)
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCAutorizaciones(CveCliente, UsuarioActual.CveEmpresa, FechaI, FechaF) Then
GVAnticipos.DataSource = ObjMovtos.DtResultados
End If
ObjMovtos.Dispose()
GVAnticipos.DataBind()
End Sub
Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
End If
End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
ObjEventoBitacora.Dispose()
End If
CargaDatos()
End If
UpDatos.Update()
End Sub
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
ObjEventoBitacora.Dispose()
End If
CargaDatos()
End If
UpDatos.Update()
End Sub
Protected Sub GVAnticipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAnticipos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado"))
If AnticipoAutorizado Then
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success"
Else
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-danger"
End If
If e.Row.DataKey("CveIE").ToString().ToEntero() > 0 Then
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a>", e.Row.DataKey("CveIE"), e.Row.DataKey("Folio"))
Else
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DataKey("CveVenta"), e.Row.DataKey("Folio"))
End If
If UsuarioActual.TienePermisoProceso(379) Then
If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then
If Not AnticipoAutorizado Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
If e.Row.DBCampo("CveIE").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("IxC") Then
If Not AnticipoAutorizado Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
End If
End If
End Sub
End Class

View File

@@ -10759,17 +10759,34 @@ Partial Class Clientes
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
End If
End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
If ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then
GvEB.DataSource = ObjEventoBitacora.DtResultados
End If
ObjEventoBitacora.Dispose()
GvEB.DataBind()
UPEventoBitacora.Update()
CargaEventoBitacora()
End If
End If
CargaAnticipos()
@@ -10778,13 +10795,38 @@ Partial Class Clientes
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
If CveVenta > 0 Then
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
End Using
CargaAnticipos()
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
If ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then
GvEB.DataSource = ObjEventoBitacora.DtResultados
End If
ObjEventoBitacora.Dispose()
GvEB.DataBind()
UPEventoBitacora.Update()
CargaEventoBitacora()
End If
End If
End Sub
End Class

View File

@@ -589,11 +589,11 @@ Partial Class Ventas_PVCobranza
Dim CveVentaRemision As Integer = -1
Dim DbRowVenta As DataRow = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
Dim ObjVtaRemision As New ClsVentas
If ObjVtaRemision.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
DbRowVenta = ObjVtaRemision.DtResultados.Copy().FiltroPrimero("")
End If
ObjVentas.Dispose()
ObjVtaRemision.Dispose()
If DbRowVenta IsNot Nothing Then
Dim VentaActual As New Venta(UsuarioActual)
@@ -635,6 +635,7 @@ Partial Class Ventas_PVCobranza
Dim ObjIE As New ClsBancos(ObjVentas2.IniciaTransacSQL())
Dim ObjConta As New ClsContabilidad(ObjVentas2.IniciaTransacSQL())
Dim ObjClientes As New ClsClientes(ObjVentas2.IniciaTransacSQL())
Dim ObjOIEventos As New ClsOIEventos(ObjVentas2.IniciaTransacSQL())
Dim respFactura As Modelos.Factura.MMensajeFactura = Nothing
Dim respNC As Modelos.Factura.MMensajeFactura = Nothing
@@ -661,6 +662,14 @@ Partial Class Ventas_PVCobranza
If respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
PagoAplicado += respFactura.Factura.DtAnticiposAplicados.SUM("Importe")
SaldoPendiente = SaldoPendiente - PagoAplicado
For Each RowAnt As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
If Not ActualizaAnticipos(RowAnt("CveIE").ToString().ToEntero(), RowAnt("CveVenta").ToString().ToEntero(), RowAnt("Tipo").ToString(), RowAnt("Folio").ToString(), ObjVentas2, ObjOIEventos) Then
MsgError = "Ocurrió un error al actualizar los anticipos"
Exit For
End If
Next
End If
End If
@@ -683,6 +692,14 @@ Partial Class Ventas_PVCobranza
Else
PagoAplicado += respNC.Factura.Total
SaldoPendiente = SaldoPendiente - PagoAplicado
For Each RowAnt As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
If Not ActualizaAnticipos(RowAnt("CveIE").ToString().ToEntero(), RowAnt("CveVenta").ToString().ToEntero(), RowAnt("Tipo").ToString(), RowAnt("Folio").ToString(), ObjVentas2, ObjOIEventos) Then
MsgError = "Ocurrió un error al actualizar los anticipos"
Exit For
End If
Next
End If
Else
MsgError = "Ocurrió un error al generar la nota de crédito"
@@ -885,6 +902,31 @@ Partial Class Ventas_PVCobranza
End Sub
Private Function ActualizaAnticipos(CveIE As Integer, CveVenta As Integer, Tipo As String, Folio As String, ByRef ObjVentas As ClsVentas, ByRef ObjEventoBitacora As ClsOIEventos) As Boolean
Dim Retorno As Boolean = True
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
If Tipo.Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf Tipo.Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
If Actualizo Then
Retorno = ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{Folio}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveIE, -1, CveCliente, -1, -1, -1, -1, -1, CveVenta:=CveVenta)
End If
End If
Return Retorno
End Function
Private Sub LimpiarDatos()
PnlContado.Visible = False
TxtImporteEfectivo.Text = ""
@@ -1029,6 +1071,7 @@ Partial Class Ventas_PVCobranza
DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String))
DtAnticipos.Columns.Add("Tipo", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
@@ -1045,8 +1088,9 @@ Partial Class Ventas_PVCobranza
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio")
Dim Tipo = GvRow.DataKey("Tipo")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio)
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio, Tipo)
End If
Next
@@ -1185,6 +1229,7 @@ Partial Class Ventas_PVCobranza
DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String))
DtAnticipos.Columns.Add("Tipo", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
@@ -1201,8 +1246,10 @@ Partial Class Ventas_PVCobranza
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio")
Dim Tipo = GvRow.DataKey("Tipo")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio)
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio, Tipo)
End If
Next

View File

@@ -9006,13 +9006,16 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso Not UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
e.Row.FCLinkButton("LnkDescuentos").Visible = True
If e.Row.DBCampo("TipoDocto") = "Cot" AndAlso CveVenta > 0 AndAlso Not EsCreaApartirDe Then
If e.Row.DBCampo("TipoDocto").Contiene("Cot") AndAlso (CveVenta > 0 AndAlso Not EsCreaApartirDe) Then
e.Row.FCLinkButton("imgClone").Visible = False
End If
End If
If UsuarioActual.CveEmpresa = 189 Then
e.Row.FCLinkButton("LnkExistencias").Visible = True
If e.Row.DBCampo("TipoDocto").Contiene("Cot", "Rem") AndAlso (CveVenta > 0 AndAlso Not EsCreaApartirDe) Then
e.Row.FCLinkButton("imgClone").Visible = False
End If
End If
If CveVenta <= 0 Then
@@ -9224,12 +9227,17 @@ Partial Class Ventas
End If
End If
If RecalcularPromociones Then
ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU)
Dim RegenerarPU As Boolean = False
If ObjDescuento.EsPUModificado Then
PU = ObjDescuento.PU
'SI ES IMPORTE ASIGNADO ES MAYOR, RESPETAR EL ORIGINAL
If GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Enabled AndAlso (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal() > ObjDescuento.PU) Then
PU = GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal()
Else
PU = ObjDescuento.PU
End If
End If
End If
@@ -9244,7 +9252,7 @@ Partial Class Ventas
Exit Sub
End If
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal) Then
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal, EsEdicion:=True) Then
Exit Sub
End If
@@ -19503,7 +19511,7 @@ Partial Class Ventas
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
AgregarPS()
End Sub
Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "", Optional CantidadOriginal As Decimal = 0D) As Boolean 'NO TOCAR - IPP
Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "", Optional CantidadOriginal As Decimal = 0D, Optional EsEdicion As Boolean = False) As Boolean 'NO TOCAR - IPP
'VALIDA PARAMETROS
If CvePS <= 0 Or CveUM <= 0 Then
@@ -19590,17 +19598,34 @@ Partial Class Ventas
' Return False
'End If
Dim ValidarMonedas As Boolean = False
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If DrPS IsNot Nothing Then
If DrPS("CveMoneda").ToString.ToEntero() <> DdlMoneda.SelectedValue.ToEntero() Then
Alert("No puede agregar un producto de diferente moneda a la ya seleccionada", TipoMensaje.MsgAdvertencia)
Return False
ValidarMonedas = True
'MODALIDAD EDICION
If EsEdicion Then
ValidarMonedas = False
End If
'REFACTURACION
If NuevaFactura = 1 Then
ValidarMonedas = False
End If
If ValidarMonedas Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If DrPS IsNot Nothing Then
If DrPS("CveMoneda").ToString.ToEntero() <> DdlMoneda.SelectedValue.ToEntero() Then
Alert("No puede agregar un producto de diferente moneda a la ya seleccionada", TipoMensaje.MsgAdvertencia)
Return False
End If
End If
End If
End If
End If
' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
@@ -23989,22 +24014,33 @@ Partial Class Ventas
GvPS.Columns(21).Visible = True
thOrden.Visible = True
If GvPS.Columns(21).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
Dim HabilitarExistencias As Boolean = False
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
Next
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
HabilitarExistencias = True
GvPS.Columns(20).Visible = True
End If
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
If HabilitarExistencias Then
GvRow.FCLinkButton("LnkExistencias").Visible = True
GvRow.FCLinkButton("imgClone").Visible = False
GvRow.FCLinkButton("LnkDescuentos").Visible = False
End If
Next
OrdenarPS(True)
UpCliente.Update()
@@ -24121,7 +24157,8 @@ Partial Class Ventas
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero,
FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveCondicionEntrega:=DdlFormaEntrega.SelectedValue.ToEntero(), FolioRemision:=TxtFolioRemision.Text.Trim) Then
FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveCondicionEntrega:=DdlFormaEntrega.SelectedValue.ToEntero(), FolioRemision:=TxtFolioRemision.Text.Trim,
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
OcurrioError = True
End If
@@ -27069,7 +27106,7 @@ Partial Class Ventas
Dim CancelacionPagos = OpcionesCancelacionPagos.SinPagos
If (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1") AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then
If (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1") AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem", "Ant") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then
CancelacionPagos = OpcionesCancelacionPagos.ConPagos_CancelarIE
End If
@@ -33184,22 +33221,33 @@ Partial Class Ventas
GvPS.Columns(21).Visible = True
thOrden.Visible = True
If GvPS.Columns(21).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
Dim HabilitarExistencias As Boolean = False
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
Next
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
HabilitarExistencias = True
GvPS.Columns(20).Visible = True
End If
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
If HabilitarExistencias Then
GvRow.FCLinkButton("LnkExistencias").Visible = True
GvRow.FCLinkButton("imgClone").Visible = False
GvRow.FCLinkButton("LnkDescuentos").Visible = False
End If
Next
OrdenarPS(True)
UpPS.Update()
@@ -33324,7 +33372,8 @@ Partial Class Ventas
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim.ToUpper(), CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(),
CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal,
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(),
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
MensajeError = "Ocurrió un error al actualizar la información de la cotización"
OcurrioError = True
End If
@@ -35322,7 +35371,7 @@ Partial Class Ventas
Exit Sub
End If
If Not ObjVentas.UpdateFechaVencimientoVenta(CveVenta, TxtFechaPago.Text.ToDate) Then
If Not ObjVentas.UpdateFechaVencimientoVenta(CveVenta, TxtFechaPago.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorTrans = True
End If
@@ -36833,7 +36882,7 @@ Partial Class Ventas
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text,
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim,
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text,
Episodio:=TxtEpisodio.Text) Then
Episodio:=TxtEpisodio.Text, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
TieneError = True
End If
@@ -37750,7 +37799,7 @@ Partial Class Ventas
If CveVenta > 0 Then
Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtTotal.Text.ToDecimal(), 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ing", DiasVencidos:=25, CveVenta:=CveVenta) Then
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtTotal.Text.ToDecimal(), 0, UsuarioActual.CveUsuario, 1, TipoDocumento:=DdlTipoComprobante.SelectedValue, DiasVencidos:=25, CveVenta:=CveVenta) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
'signal
@@ -37765,33 +37814,36 @@ Partial Class Ventas
Exit Sub
End If
Else
Dim DiasVencidos As Integer = 0
Dim CveEstatus As Integer = 0
Dim TipoDocto As String = DdlSolCreditoTipoDocto.SelectedValue
Dim CveTipoAutorizacion As Integer = DdlTipoAutorizacion.SelectedValue.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(595) <> "3" AndAlso CveTipoAutorizacion <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If CveTipoAutorizacion = 2 Then
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivoAutorizacion.Text
Dim ObjPS As New ClsVentas
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
'signal
Dim mensaje = "<br/> <a target='_blank' href='https://www.w3schools.com'>La autorización se agregó correctamente.</a>"
ClsSisNotificaciones.EnviarAlerta("Autorización Crédito", mensaje, "100", Tipo:=TipoNotificacion.ToastInformacionB)
End If
ObjPS.Dispose()
End If
Dim DiasVencidos As Integer = 0
Dim CveEstatus As Integer = 0
Dim TipoDocto As String = DdlSolCreditoTipoDocto.SelectedValue
Dim CveTipoAutorizacion As Integer = DdlTipoAutorizacion.SelectedValue.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(595) <> "3" AndAlso CveTipoAutorizacion <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If CveTipoAutorizacion = 2 Then
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivoAutorizacion.Text
Dim ObjPS As New ClsVentas
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
'signal
Dim mensaje = "<br/> <a target='_blank' href='https://www.w3schools.com'>La autorización se agregó correctamente.</a>"
ClsSisNotificaciones.EnviarAlerta("Autorización Crédito", mensaje, "100", Tipo:=TipoNotificacion.ToastInformacionB)
End If
ObjPS.Dispose()
UpModalSolicitud.Update()
End Sub
Protected Sub DdlTipoAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAutorizacion.SelectedIndexChanged