diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 98e94a859..829a5b2f1 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -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 diff --git a/OC/RepSolicitudesAnticipo.aspx b/OC/RepSolicitudesAnticipo.aspx index 4c03a5549..14e80d0fe 100644 --- a/OC/RepSolicitudesAnticipo.aspx +++ b/OC/RepSolicitudesAnticipo.aspx @@ -30,7 +30,7 @@
- <%----%> +
@@ -81,6 +81,19 @@
diff --git a/OC/RepSolicitudesAnticipo.aspx.cs b/OC/RepSolicitudesAnticipo.aspx.cs index ae72827e5..67228491a 100644 --- a/OC/RepSolicitudesAnticipo.aspx.cs +++ b/OC/RepSolicitudesAnticipo.aspx.cs @@ -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; diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 2a8583eed..bc64ed41d 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -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