8 -COMO CANCELAR DE MUCHAS PROMOCIONES _siguiente semana (Acciones inactivar), Proveedores abonar RNC remision generada ya existe
This commit is contained in:
@@ -2611,6 +2611,27 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_PromocionEstatusUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemovePromociones(CvePromocion As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_PromocionesRemove")
|
||||
|
||||
@@ -858,6 +858,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
Pago.CveMonedaPago = CveMoneda
|
||||
|
||||
'inserto las compras que voy a pagar
|
||||
Dim nRow As Integer = 1
|
||||
For Each gvr As GridViewRow In GvCxP.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
|
||||
@@ -963,7 +964,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
If serieFolioArray.Length = 2 Then
|
||||
SerieRNC = serieFolioArray(0)
|
||||
FolioRNC = serieFolioArray(1)
|
||||
SerieFolioRNC = $"{FolioRNC}-D-{SerieRNC = serieFolioArray(0)}"
|
||||
SerieFolioRNC = $"D-{SerieRNC}-{ FolioRNC}"
|
||||
|
||||
Else
|
||||
FolioRNC = serieFolioArray(0)
|
||||
@@ -992,9 +993,19 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
End If
|
||||
|
||||
Dim ExisteRNC As Boolean = False
|
||||
If ObjComp.GetCompras(-1, $"D-{SerieRNC}", FolioRNC, CveProveedor, -1, UsuarioActual.CveEmpresa) Then
|
||||
Dim dtRNC As DataTable = ObjComp.DtResultados.FiltraParametros(" TipoDocto ='RNC' ")
|
||||
If dtRNC.Rows.Count > 0 Then
|
||||
ExisteRNC = True
|
||||
SerieFolioRNC = $"D{nRow}-{SerieRNC}-{ FolioRNC}"
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim CveCompraRNC As Integer = GeneraRNC(Descuento, ObjComp.IniciaTransacSQL, gvr.DataKey("CveCompra").ToEntero, CompraActual, ObjMov, CvePrePoliza, CveProveedor, HplProveedor.Text, TxtFechaDocumento.Text.ToDate,
|
||||
$"Remisión Nota de Crédito pago {gvr.DataKey("SerieFolio").ToString}", gvr.DataKey("CveMoneda").ToEntero, TxtTC.Text.ToDecimal, SerieRNC, FolioRNC, PorcentajeIVA:=PorcentajeIVA,
|
||||
CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero)
|
||||
CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, nRow:=nRow, ExisteRNC:=ExisteRNC)
|
||||
|
||||
If CveCompraRNC > 0 Then
|
||||
|
||||
@@ -1012,6 +1023,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
|
||||
End If
|
||||
nRow = nRow + 1
|
||||
Next
|
||||
|
||||
Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83)
|
||||
@@ -1956,7 +1968,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
|
||||
Public Function GeneraRNC(ImporteRNC As Decimal, ByRef sqltransaccion As SqlTransaction, CveCompraAmortizada As Integer, ByRef CompraActual As Compra, ByRef ObjConta As ClsContabilidad, CvePrePoliza As Integer,
|
||||
CveProveedor As Integer, NombreProveedor As String, Fecha As Date, Descripcion As String, CveMoneda As Integer, TipoCambio As Decimal, Serie As String, Folio As String, Optional EsDRMN As Boolean = False,
|
||||
Optional TmpListadoPS As DataTable = Nothing, Optional PorcentajeIVA As Decimal = 0, Optional CveSubProyecto As Integer = -1) As Integer
|
||||
Optional TmpListadoPS As DataTable = Nothing, Optional PorcentajeIVA As Decimal = 0, Optional CveSubProyecto As Integer = -1, Optional nRow As Integer = -1, Optional ExisteRNC As Boolean = False) As Integer
|
||||
Dim CveCompraRNC As Integer = -1
|
||||
Dim respuesta As Boolean = True
|
||||
'Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||
@@ -1990,7 +2002,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
.Fecha = Fecha,
|
||||
.CveMoneda = CveMoneda,
|
||||
.TipoCambio = If(CveMoneda = 1, 1, TipoCambio),
|
||||
.Serie = $"D-{Serie}",
|
||||
.Serie = If(ExisteRNC, $"D{nRow}-{Serie}", $"D-{Serie}"),
|
||||
.Folio = Folio,
|
||||
.CveCompraAmortizacion = CveCompraAmortizada,
|
||||
.CveCompraRelacionada = CveCompraAmortizada
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgAddPromocion" PostBackUrl="/Ventas/Promociones.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i>Nueva Promoción</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAccInactivar" runat="server" OnClick="LnkAccInactivar_Click" Visible="false"><i class="fa fa-times" aria-hidden="true"></i>Inactivar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
@@ -90,16 +93,47 @@
|
||||
|
||||
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<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 class="col-md-8">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpInactivar" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="LnkInactivar" CssClass="btn btn-primary" OnClick="LnkInactivar_Click" Visible="false"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Inactivar selección?" data-btn-ok-label="si" ><i class="fa fa-times" aria-hidden="true"></i> Inactivar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" runat="server" AutoGenerateColumns="False" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" runat="server" AutoGenerateColumns="False" GridLines="None"
|
||||
DataKeyNames="CvePromocion"
|
||||
>
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Left" Visible="false" >
|
||||
<HeaderTemplate>
|
||||
<input type="checkbox" id="chkSelectAll" onclick="checkAll()" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chk" CssClass="selChk" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Promoción" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink runat="server" ID="HLPromocion" Text='<%# Eval("Promocion").ToString %>' NavigateUrl ='<%# Eval("CvePromocion", "/Ventas/Promociones.aspx?CvePromocion={0}") %>' CssClass="Texto"></asp:HyperLink>
|
||||
@@ -128,5 +162,18 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script>
|
||||
|
||||
function checkAll() {
|
||||
|
||||
var isChecked = $('#chkSelectAll').prop('checked');
|
||||
|
||||
$('#<%= GvDatos.ClientID %> input[type="checkbox"][id*=chk]').each(function () {
|
||||
$(this).prop('checked', isChecked);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -22,18 +22,25 @@ Partial Class Ventas_CatPromociones
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(386) Then
|
||||
LnkAccInactivar.Visible = True
|
||||
End If
|
||||
|
||||
InicializaControles()
|
||||
OcultarMostrarInactivar(True)
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub InicializaControles()
|
||||
|
||||
|
||||
|
||||
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto)
|
||||
|
||||
GvDatos.Columns(6).HeaderText = LblSubProyecto.Text
|
||||
GvDatos.Columns(7).HeaderText = LblSubProyecto.Text
|
||||
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
@@ -95,4 +102,50 @@ Partial Class Ventas_CatPromociones
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkAccInactivar_Click(sender As Object, e As EventArgs)
|
||||
OcultarMostrarInactivar(True)
|
||||
End Sub
|
||||
|
||||
Private Sub OcultarMostrarInactivar(Mostrar As Boolean)
|
||||
|
||||
GvDatos.Columns(0).Visible = Mostrar
|
||||
LnkInactivar.Visible = Mostrar
|
||||
UpInactivar.Update()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub LnkInactivar_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
Dim ErrorProceo As Boolean = False
|
||||
|
||||
Dim ContInactivadas As Integer = 0
|
||||
For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
Dim Chk As CheckBox = GvRow.FCCheckBox("chk")
|
||||
Dim CvePromocion As Integer = GvRow.DataKey("CvePromocion").ToEntero
|
||||
|
||||
If Chk.Checked Then
|
||||
If ObjVentas.UpdatePromocionEstatus(CvePromocion, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ContInactivadas = ContInactivadas + 1
|
||||
Else
|
||||
ErrorProceo = True
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If ErrorProceo Then
|
||||
ObjVentas.RollBack()
|
||||
Else
|
||||
ObjVentas.Commit()
|
||||
Alert($"Se inactivaron {ContInactivadas} promociones.")
|
||||
OcultarMostrarInactivar(False)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user