Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -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
|
||||
@@ -216,13 +216,13 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ninguna remisión pendiente por facturar" DataKeyNames="CveVenta"
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ninguna remisión pendiente por facturar" DataKeyNames="CveVenta,Fecha"
|
||||
ToolTip="Remisiones sin Facturar"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField ="Folio" DataNavigateUrlFormatString="/Ventas/RepRemisionesDetalle.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" Target="_blank" />
|
||||
<asp:HyperLinkField HeaderText="Fecha" ItemStyle-Width="100px" DataTextField ="Fecha" DataTextFormatString="{0:d}" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
|
||||
<asp:HyperLinkField HeaderText="Fecha" ItemStyle-Width="150px" DataTextField ="Fecha" DataTextFormatString="{0:d}" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
|
||||
<asp:BoundField HeaderText="Vencimiento" DataField="FechaVencimiento" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Cliente" />
|
||||
<asp:BoundField HeaderText="Contrato" DataField="TieneContrato" Visible="false" />
|
||||
@@ -230,6 +230,7 @@
|
||||
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
|
||||
<asp:BoundField HeaderText="Folio Rem" DataField="Alfa1" Visible="false" />
|
||||
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PrimerCodigoPS" Visible="false" />
|
||||
<asp:BoundField DataField="PorcentajeAvance" HeaderText="Facturado" DataFormatString="{0:F}%" HtmlEncode="false" />
|
||||
<asp:BoundField DataField="SubTotal" HeaderText="SubTotal" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Descuento" HeaderText="Descuento" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
|
||||
|
||||
@@ -67,7 +67,12 @@ Partial Class RepRemisiones
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(189) Then
|
||||
GvDatos.Columns(9).Visible = True
|
||||
End If
|
||||
|
||||
CargaSucursales()
|
||||
CargaCliente()
|
||||
CargaContrato()
|
||||
@@ -89,18 +94,19 @@ Partial Class RepRemisiones
|
||||
|
||||
Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString
|
||||
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
|
||||
Dim PrimerProducto As Boolean = If(UsuarioActual.CveEmpresa.Contiene(189), True, False)
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=chkInv.Checked) Then
|
||||
If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=chkInv.Checked, PrimerProducto:=PrimerProducto) Then
|
||||
DtVentas = ObjVentas.DtResultados.Copy()
|
||||
GvDatos.DataSource = DtVentas
|
||||
End If
|
||||
|
||||
If DtVentas IsNot Nothing Then
|
||||
GvDatos.Columns(11).Visible = DtVentas.SUMD("Descuento") > 0
|
||||
GvDatos.Columns(12).Visible = DtVentas.SUMD("Descuento") > 0
|
||||
End If
|
||||
|
||||
GvDatos.Columns(14).Visible = chkInv.Checked 'solo se visualiza si está selccionada
|
||||
GvDatos.Columns(15).Visible = chkInv.Checked 'solo se visualiza si está selccionada
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
@@ -124,7 +130,10 @@ Partial Class RepRemisiones
|
||||
e.Row.Cells(2).ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
e.Row.Cells(1).Text = $"<a href='./Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}' targen='_blank'>{e.Row.DataKey("Fecha").ToDate().ToString("dd/MM/yyyy HH:mm:ss")}</a>"
|
||||
|
||||
End If
|
||||
|
||||
e.Row.FCLiteral("LtlTotal").Text = "<a class=""Texto"" target=""_blank"" href=""/Ventas/RepRemisionesDetalle.aspx?CveVenta=" & e.Row.DBCampo("CveVenta") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&FechaV=" & FechaV & "&CveCliente=" & If(e.Row.DBCampo("CveCliente").ToString().ToEntero() > 0, e.Row.DBCampo("CveCliente").ToString(), DdlClientes.SelectedValue) & "&CveContrato=" & CveContrato & "&CveSubProyecto=" & Sucursales & "&CveMoneda=" & e.Row.DBCampo("CveMoneda") & """>" & e.Row.FCLiteral("LtlTotal").Text & "</a>"
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user