-- Cambio de autorizaciones de anticipo por tabla.
--PA_Vta_ClienteAnticiposNCIxC --PA_Vta_VentaAnticipoAutorizadoUpdate --PA_Vta_IxCAnticipoAutorizadoUpdate
This commit is contained in:
@@ -123,7 +123,7 @@
|
|||||||
<div class="portlet-body rowpadding">
|
<div class="portlet-body rowpadding">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion"
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion,TipoDocumento"
|
||||||
EmptyDataText="No se encontraron autorizaciones" ToolTip=""
|
EmptyDataText="No se encontraron autorizaciones" ToolTip=""
|
||||||
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
|
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
@@ -169,54 +169,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<div id="DModal" class="modal ADS fade" role="dialog">
|
<div id="DModal" class="modal ADS fade" role="dialog">
|
||||||
|
|||||||
@@ -62,10 +62,6 @@ Partial Class Ventas_CatAutorizacionLimites
|
|||||||
|
|
||||||
DdlEstatus.SelectedValue = "0"
|
DdlEstatus.SelectedValue = "0"
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
|
||||||
DivAntNCIxC.Visible = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
UpModal.Update()
|
UpModal.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
@@ -87,10 +83,6 @@ Partial Class Ventas_CatAutorizacionLimites
|
|||||||
ObjGral.Dispose()
|
ObjGral.Dispose()
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
|
|
||||||
If DivAntNCIxC.Visible Then
|
|
||||||
CargaAnticipos(CveCliente, FechaI, FechaF)
|
|
||||||
End If
|
|
||||||
|
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -225,6 +217,10 @@ Partial Class Ventas_CatAutorizacionLimites
|
|||||||
'cuando es la modalidad 3, es autorización directa sobre la venta ya asociada a la solicitud.
|
'cuando es la modalidad 3, es autorización directa sobre la venta ya asociada a la solicitud.
|
||||||
If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then CveEstatusAutorizacion = 2
|
If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then CveEstatusAutorizacion = 2
|
||||||
|
|
||||||
|
If gvRow.DataKey("TipoDocumento") = "Anticipo" Then
|
||||||
|
CveEstatusAutorizacion = 1
|
||||||
|
End If
|
||||||
|
|
||||||
Dim Importe As Decimal = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
|
Dim Importe As Decimal = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
|
||||||
'AUTORIZACION DE IMPORTE,
|
'AUTORIZACION DE IMPORTE,
|
||||||
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
|
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
|
||||||
@@ -376,130 +372,4 @@ Partial Class Ventas_CatAutorizacionLimites
|
|||||||
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
|
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#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
|
End Class
|
||||||
|
|||||||
@@ -2342,12 +2342,12 @@
|
|||||||
<asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" />
|
<asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false">
|
<%-- <asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||||
<ItemTemplate>
|
<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="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" />
|
<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>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>--%>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1946,9 +1946,9 @@ Partial Class Clientes
|
|||||||
End If
|
End If
|
||||||
ObjMovtos.Dispose()
|
ObjMovtos.Dispose()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
|
'If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
|
||||||
GVAnticipos.Columns(7).Visible = True
|
' GVAnticipos.Columns(7).Visible = True
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
GVAnticipos.DataBind()
|
GVAnticipos.DataBind()
|
||||||
GVAnticiposHistorial.DataBind()
|
GVAnticiposHistorial.DataBind()
|
||||||
@@ -10753,82 +10753,82 @@ Partial Class Clientes
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
|
'Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
|
||||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
' Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
|
' Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
|
||||||
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
|
' Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
|
||||||
|
|
||||||
If CveVenta > 0 OrElse CveIE > 0 Then
|
' If CveVenta > 0 OrElse CveIE > 0 Then
|
||||||
Dim Actualizo As Boolean = False
|
' Dim Actualizo As Boolean = False
|
||||||
|
|
||||||
Using ObjVentas As New ClsVentas
|
' Using ObjVentas As New ClsVentas
|
||||||
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
|
' If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
|
||||||
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
|
' If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
|
||||||
Alert("El anticipo se autorizó correctamente")
|
' Alert("El anticipo se autorizó correctamente")
|
||||||
Actualizo = True
|
' Actualizo = True
|
||||||
End If
|
' End If
|
||||||
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
|
' ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
|
||||||
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
|
' If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
|
||||||
Alert("El anticipo se autorizó correctamente")
|
' Alert("El anticipo se autorizó correctamente")
|
||||||
Actualizo = True
|
' Actualizo = True
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
End Using
|
' End Using
|
||||||
|
|
||||||
If Actualizo Then
|
' If Actualizo Then
|
||||||
Dim ObjEventoBitacora As New ClsOIEventos
|
' 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
|
' 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
|
' GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||||
End If
|
' End If
|
||||||
ObjEventoBitacora.Dispose()
|
' ObjEventoBitacora.Dispose()
|
||||||
GvEB.DataBind()
|
' GvEB.DataBind()
|
||||||
|
|
||||||
UPEventoBitacora.Update()
|
' UPEventoBitacora.Update()
|
||||||
CargaEventoBitacora()
|
' CargaEventoBitacora()
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
CargaAnticipos()
|
' CargaAnticipos()
|
||||||
End Sub
|
'End Sub
|
||||||
|
|
||||||
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
|
'Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
|
||||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
' Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
|
' Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
|
||||||
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
|
' Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
|
||||||
|
|
||||||
If CveVenta > 0 OrElse CveIE > 0 Then
|
' If CveVenta > 0 OrElse CveIE > 0 Then
|
||||||
Dim Actualizo As Boolean = False
|
' Dim Actualizo As Boolean = False
|
||||||
Using ObjVentas As New ClsVentas
|
' Using ObjVentas As New ClsVentas
|
||||||
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
|
' If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
|
||||||
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
|
' If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
|
||||||
Alert("El anticipo se desautorizó correctamente")
|
' Alert("El anticipo se desautorizó correctamente")
|
||||||
Actualizo = True
|
' Actualizo = True
|
||||||
End If
|
' End If
|
||||||
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
|
' ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
|
||||||
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
|
' If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
|
||||||
Alert("El anticipo se desautorizó correctamente")
|
' Alert("El anticipo se desautorizó correctamente")
|
||||||
Actualizo = True
|
' Actualizo = True
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
End Using
|
' End Using
|
||||||
CargaAnticipos()
|
' CargaAnticipos()
|
||||||
|
|
||||||
If Actualizo Then
|
' If Actualizo Then
|
||||||
Dim ObjEventoBitacora As New ClsOIEventos
|
' 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
|
' 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
|
' GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||||
End If
|
' End If
|
||||||
ObjEventoBitacora.Dispose()
|
' ObjEventoBitacora.Dispose()
|
||||||
GvEB.DataBind()
|
' GvEB.DataBind()
|
||||||
|
|
||||||
UPEventoBitacora.Update()
|
' UPEventoBitacora.Update()
|
||||||
CargaEventoBitacora()
|
' CargaEventoBitacora()
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
End Sub
|
'End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,18 @@ Partial Class Ventas_PVCobranza
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property CveVendedor As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveVendedor") Is Nothing Then
|
||||||
|
ViewState("CveVendedor") = -1
|
||||||
|
End If
|
||||||
|
Return ViewState("CveVendedor").ToString.ToEntero
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveVendedor") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Private Property CveVentaCancelacion As Integer
|
Private Property CveVentaCancelacion As Integer
|
||||||
Get
|
Get
|
||||||
If ViewState("CveVentaCancelacion") Is Nothing Then
|
If ViewState("CveVentaCancelacion") Is Nothing Then
|
||||||
@@ -970,6 +982,8 @@ Partial Class Ventas_PVCobranza
|
|||||||
LtlTipoAnticipo.Text = ""
|
LtlTipoAnticipo.Text = ""
|
||||||
HdnTipoAmortizacion.Value = ""
|
HdnTipoAmortizacion.Value = ""
|
||||||
CveCliente = -1
|
CveCliente = -1
|
||||||
|
CveVendedor = -1
|
||||||
|
|
||||||
|
|
||||||
If TmpDTAnticiposNCIxCCliente IsNot Nothing Then
|
If TmpDTAnticiposNCIxCCliente IsNot Nothing Then
|
||||||
TmpDTAnticiposNCIxCCliente.Clear()
|
TmpDTAnticiposNCIxCCliente.Clear()
|
||||||
@@ -1959,17 +1973,16 @@ Partial Class Ventas_PVCobranza
|
|||||||
DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
|
DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveCliente <= 0 Then
|
Dim DbRowVenta As DataRow = Nothing
|
||||||
Dim DbRowVenta As DataRow = Nothing
|
Dim ObjVentas As New ClsVentas
|
||||||
Dim ObjVentas As New ClsVentas
|
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
|
||||||
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
|
End If
|
||||||
End If
|
ObjVentas.Dispose()
|
||||||
ObjVentas.Dispose()
|
|
||||||
|
|
||||||
If DbRowVenta IsNot Nothing Then
|
If DbRowVenta IsNot Nothing Then
|
||||||
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
|
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
|
||||||
End If
|
CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveCliente > 0 Then
|
If CveCliente > 0 Then
|
||||||
@@ -2125,6 +2138,19 @@ Partial Class Ventas_PVCobranza
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim CveVenta As Integer = gvr.DataKey("CveVenta").ToEntero()
|
||||||
|
Dim CveIE As Integer = gvr.DataKey("CveIE").ToEntero()
|
||||||
|
|
||||||
|
Dim ObjVta As New ClsVentas
|
||||||
|
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, gvr.DataKey("CveCliente").ToEntero(), CveVendedor, Importe, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
|
||||||
|
Dim msgAlert = "La autorización se agregó correctamente."
|
||||||
|
If EnvioMsg Then
|
||||||
|
msgAlert = $"{msgAlert} Se envió una notificación de autorización a los usuarios"
|
||||||
|
End If
|
||||||
|
Alert(msgAlert, TipoMensaje.MsgInformacion)
|
||||||
|
End If
|
||||||
|
ObjVta.Dispose()
|
||||||
|
|
||||||
|
|
||||||
UpAnticipos.Update()
|
UpAnticipos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2291,20 +2317,19 @@ Partial Class Ventas_PVCobranza
|
|||||||
DivConceptoNC.Visible = False
|
DivConceptoNC.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveCliente <= 0 Then
|
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
|
||||||
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
|
Dim DbRowVenta As DataRow = Nothing
|
||||||
Dim DbRowVenta As DataRow = Nothing
|
Dim ObjVentas As New ClsVentas
|
||||||
Dim ObjVentas As New ClsVentas
|
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
|
||||||
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
|
|
||||||
End If
|
|
||||||
ObjVentas.Dispose()
|
|
||||||
|
|
||||||
If DbRowVenta IsNot Nothing Then
|
|
||||||
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
If DbRowVenta IsNot Nothing Then
|
||||||
|
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
|
||||||
|
CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If CveCliente > 0 Then
|
If CveCliente > 0 Then
|
||||||
CargaAnticipos(CveCliente)
|
CargaAnticipos(CveCliente)
|
||||||
|
|||||||
Reference in New Issue
Block a user