nuevos filtros al reporte de solicitudes anticipo y en ventas al se puede cancenlar una factura de tipo docto pedi2

This commit is contained in:
Antonio Gonzalez
2020-12-02 21:14:48 -07:00
parent 9032c10f35
commit f69da7bd8c
4 changed files with 41 additions and 5 deletions

View File

@@ -2524,7 +2524,7 @@ Public Class ClsOC
End Function
#End Region
#Region "REP SOLICITUDES ANTICIPO"
Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer) As Boolean
Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer, Optional CveUsuario As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RepSolicitudAnticipoGet")
@@ -2534,6 +2534,8 @@ Public Class ClsOC
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
.Add("@CveEventoEstatus", SqlDbType.Int).Value = CveEventoEstatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With
Try

View File

@@ -30,7 +30,7 @@
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
<%--<a href="javascript:;" class="expand"></a>--%>
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row" style="margin-left: 10px;">
@@ -81,6 +81,19 @@
</div>
<div class="portlet-body" style="display: none;">
<div class="row" style="margin-left: 10px;">
<label class="col-md-1 " runat="server" style="margin-top: 5px; font-size:12px;">Usuario Registró:</label>
<div class="col-md-2" runat="server">
<asp:DropDownList ID="DdlUsuarios" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveUsuario" DataTextField="Nombre" ValidationGroup="GrpGuardar" CssClass="select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Label runat="server" ID="lblSubProyecto" class="col-md-1 " style="margin-top: 5px; font-size:12px;">Subproyecto:</asp:Label>
<div class="col-md-2" runat="server">
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -73,10 +73,23 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
txtFechaI.Text = DateTime.Now.AddMonths(-1).FirstDayOfMonth().ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString();
CveProveedor = -1;
CargaSubProyectos();
CargaProveedor();
CargaUsuarios();
CargaDatos();
}
private void CargaSubProyectos()
{
CargarCentrosDeCosto(null,DdlSubProyecto,null,lblSubProyecto);
}
private void CargaUsuarios()
{
DdlUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa);
DdlUsuarios.DataBind();
}
protected void CargaProveedor()
{
DdlProveedores.setEsWebService(true);
@@ -93,7 +106,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
FechaI = (txtFechaI.Text.ToString() != "" ? txtFechaI.Text.ToDateTime() : MinFecha);
FechaF = (txtFechaF.Text.ToString() != "" ? txtFechaF.Text.ToDateTime() : DateTime.Now);
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero()))
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero(),DdlUsuarios.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero()))
{
DtDatos = ObjOC.DtResultados;
GvSolicitudes.DataSource = DtDatos;

View File

@@ -3926,7 +3926,7 @@ Partial Class Ventas
LblAlertRefacInv.Visible = True
End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
If UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
@@ -20880,8 +20880,16 @@ Partial Class Ventas
RegistraScript("$('#ModalCancelarDocumento').modal();")
UpCancelarDocumento.Update()
sb.Clear()
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
Dim ObjVentas As New ClsVentas
If ObjVentas.UpdateEstatusVenta(CveVenta, 22, UsuarioActual.CveEmpresa) Then
Dim redirectString As String = String.Format("document.location.href=""/Ventas/Ventas.aspx?CveVenta={0}""", CveVenta)
Alert("Pedido cancelado.", JSBtnAceptar:=redirectString)
', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta
End If
ObjVentas.Dispose()
Else
CancelarDocumento()
CancelarDocumento()
End If
End Sub