From a4695df7af2a6f4df0079e8d72608b95becb1a5c Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 13 May 2024 08:44:00 -0700 Subject: [PATCH 01/11] =?UTF-8?q?EMD=20-=20OC=20Autorizadas,=20registrar?= =?UTF-8?q?=20prep=C3=B3liza=20154=20Cargo,=20152=20Abono?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contratos/RepPresupuestos.aspx | 14 ++- OC/OC.aspx.vb | 117 ++++++++++++++++++--- Transportes/RepContratos.aspx | 74 ++++++------- Transportes/RepContratosCalendario.aspx | 20 ++-- Transportes/RepContratosCalendario.aspx.vb | 5 +- 5 files changed, 167 insertions(+), 63 deletions(-) diff --git a/Contratos/RepPresupuestos.aspx b/Contratos/RepPresupuestos.aspx index e62242dae..d8ba3eecc 100644 --- a/Contratos/RepPresupuestos.aspx +++ b/Contratos/RepPresupuestos.aspx @@ -330,6 +330,7 @@ Agrupador Autorizado + Comprometido Ejercido Por Ejercer Pagado @@ -342,6 +343,7 @@ <%-- + @@ -377,9 +379,11 @@ Total + - + + @@ -459,15 +463,19 @@ <%-- --%> - + <%-- --%> - + + + + + diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 426f06023..71a3f72b6 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -6,6 +6,7 @@ Imports System.Data.SqlClient Imports System.IO Imports Extensiones Imports GemBox.Spreadsheet +Imports Microsoft.Owin.Security.Provider Imports Newtonsoft.Json Partial Class OC_OC @@ -2852,6 +2853,14 @@ Partial Class OC_OC End If + If Not TieneError AndAlso TipoOC = "OC" Then + + If Not GeneraPrePolizaPresupuesto(CveOrdenCompra, OC.IniciaTransacSQL) Then + TieneError = True + End If + + End If + If Not TieneError Then If Conta IsNot Nothing Then Conta.Commit() OC.Commit() @@ -3304,6 +3313,7 @@ Partial Class OC_OC 'TERMINA TODO POR SI OCURRIÓ ALGO RARO If TieneError Then + If OC IsNot Nothing Then OC.RollBack() If UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto Then If Conta IsNot Nothing Then Conta.RollBack() @@ -3505,6 +3515,16 @@ Partial Class OC_OC End If + + If Not HuboError AndAlso UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + + If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then + HuboError = True + End If + + End If + + Catch ex As Exception HuboError = True End Try @@ -9027,22 +9047,6 @@ Partial Class OC_OC If resultadosFiltrados.Count > 0 Then - Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable() - Group row By - SubProyecto = row.Field(Of String)("SubProyecto"), - CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"), - Clasificacion = row.Field(Of String)("Clasificacion"), - CveClasificacion = row.Field(Of Integer)("CveClasificacion") - Into Group - Select New With { - .SubProyecto = SubProyecto, - .CveSubProyecto = CveSubProyecto, - .Clasificacion = Clasificacion, - .CveClasificacion = CveClasificacion, - .TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total")))) - }).ToList() - - If Opcion = 1 Then @@ -9075,6 +9079,22 @@ Partial Class OC_OC End If Else + + Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable() + Group row By + SubProyecto = row.Field(Of String)("SubProyecto"), + CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"), + Clasificacion = row.Field(Of String)("Clasificacion"), + CveClasificacion = row.Field(Of Integer)("CveClasificacion") + Into Group + Select New With { + .SubProyecto = SubProyecto, + .CveSubProyecto = CveSubProyecto, + .Clasificacion = Clasificacion, + .CveClasificacion = CveClasificacion, + .TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total")))) + }).ToList() + For Each item In EnumAgrupado Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto) @@ -9105,6 +9125,7 @@ Partial Class OC_OC respuesta = True End If Next + End If Else @@ -9130,6 +9151,70 @@ Partial Class OC_OC End Function + Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPrePoliza As Integer, Optional ByRef transaccion As SqlTransaction = Nothing) As Boolean + + Dim Respuesta As Boolean = True + + If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + + Dim ObjConta As New ClsContabilidad() + + If transaccion Is Nothing Then + ObjConta = New ClsContabilidad(Nothing) + Else + ObjConta = New ClsContabilidad(transaccion) + End If + + + Dim CvePrePolizaPreSuPuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + If CvePrePolizaPreSuPuesto > 0 Then + + Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable() + Group row By + SubProyecto = row.Field(Of String)("SubProyecto"), + CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"), + Clasificacion = row.Field(Of String)("Clasificacion"), + CveClasificacion = row.Field(Of Integer)("CveClasificacion") + Into Group + Select New With { + .SubProyecto = SubProyecto, + .CveSubProyecto = CveSubProyecto, + .Clasificacion = Clasificacion, + .CveClasificacion = CveClasificacion, + .TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total"))) + If(IsDBNull(r("IVA")), 0D, Convert.ToDecimal(r("IVA"))) + If(IsDBNull(r("IEPSPSIVA")), 0D, Convert.ToDecimal(r("IEPSPSIVA"))) - If(IsDBNull(r("RetIVA")), 0D, Convert.ToDecimal(r("RetIVA"))) - If(IsDBNull(r("RetISR")), 0D, Convert.ToDecimal(r("RetISR")))) + }).ToList() + + For Each item In EnumAgrupado + + Dim SerieFolio = $"OC: {Folio}, Clasificación: {item.Clasificacion}" + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, item.TotalSum, item.TotalSum, 154, SerieFolio, SerieFolio, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPrePoliza, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then + Respuesta = False + Exit For + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, True, item.TotalSum, item.TotalSum, 152, SerieFolio, SerieFolio, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPrePoliza, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then + Respuesta = False + Exit For + End If + + Next + Else + Respuesta = False + End If + + + + End If + + Return Respuesta + + End Function + + + + #End Region diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index 86deadc43..d8dd7ac16 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -41,15 +41,16 @@ <%-- Filtro Visible - Consulta --%>
- +
-
-
+
+ + <%--
--%> + <%-- Fecha Inicial --%> -
+
@@ -69,7 +70,7 @@
<%-- Fecha Final --%> -
+
@@ -100,43 +101,44 @@
-
+ <%--
--%>
<%-- Filtro Oculto --%> -
-
-
+ + + +
+
+
+
+
@@ -485,7 +491,7 @@
- + @@ -691,14 +697,14 @@ } function updateEvent(event, element) { + $('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros); $('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato); $('#<%=TxtObservaciones.ClientID%>').val(event.title); $('#<%=TxtDescripcion.ClientID%>').val(event.title); $('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento); - <%--$('#<%=TxtFechaSalida.ClientID%>').val(event.start._i); - $('#<%=TxtFechaRegreso.ClientID%>').val(event.end._i);--%> + $('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start._i)); $('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal)); @@ -722,7 +728,8 @@ $('#HidModCveCliente').val(event.CveCliente); - $('#<%=BtnModal.ClientID%>').click(); + $('#<%=BtnModal.ClientID%>').click(); + } @@ -793,6 +800,7 @@ } function Calendario() { + var date = new Date(); var d = date.getDate(); var m = date.getMonth(); diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index bff2a01e6..e47c8d212 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -38,7 +38,7 @@ Partial Class RepContratosCalendario InicializaCalendar() CargaDatos() End If - InicializaCalendar() + 'InicializaCalendar() End Sub Private Sub CargaDatos() Dim ObjContratos As New ClsContratos @@ -193,7 +193,8 @@ Partial Class RepContratosCalendario Dim ObjContratos As New ClsContratos ObjContratos.IniciaTransacSQL() - If Contrato.ToEntero <= 0 Then Contrato = CveContrato.Value + Contrato = CveContrato.Value + If ObjContratos.UpdateContratos(Contrato.ToEntero, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero) Then ObjContratos.Commit() Alert("Actualizado Correctamente.") From 46599f20de7160580b893b1c729a5ae6d270a539 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 13 May 2024 10:54:05 -0700 Subject: [PATCH 02/11] =?UTF-8?q?EMD=20-=20OC=20Autorizadas,=20registrar?= =?UTF-8?q?=20prep=C3=B3liza=20154=20Cargo,=20152=20Abono=20dolares?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contratos/RepPresupuestos.aspx | 8 ++++---- OC/OC.aspx.vb | 29 +++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Contratos/RepPresupuestos.aspx b/Contratos/RepPresupuestos.aspx index d8ba3eecc..ebe5ac5bd 100644 --- a/Contratos/RepPresupuestos.aspx +++ b/Contratos/RepPresupuestos.aspx @@ -329,8 +329,8 @@ - - + + @@ -342,8 +342,8 @@ <%-- - - + + diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 71a3f72b6..7fe4a936e 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -926,7 +926,13 @@ Partial Class OC_OC ChkEntregaDirecta.Checked = False End If - + If CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then + If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then + Alert("PrePoliza de Presupuesto Generada Correctamente") + Else + Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia) + End If + End If End If @@ -9151,21 +9157,28 @@ Partial Class OC_OC End Function - Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPrePoliza As Integer, Optional ByRef transaccion As SqlTransaction = Nothing) As Boolean + Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing) As Boolean Dim Respuesta As Boolean = True If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero + Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal) + + If CveMonedaPresupuesto > 1 AndAlso TC = 0 Then + Alert($"No se genero la prepoliza de presupuesto, no se pudo obtener el Tipo de Cambio de la fecha {TxtFecha.Text}", TipoMensaje.MsgAdvertencia) + Return False + End If + Dim ObjConta As New ClsContabilidad() If transaccion Is Nothing Then - ObjConta = New ClsContabilidad(Nothing) + ObjConta = New ClsContabilidad() Else ObjConta = New ClsContabilidad(transaccion) End If - Dim CvePrePolizaPreSuPuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrePolizaPreSuPuesto > 0 Then @@ -9189,12 +9202,16 @@ Partial Class OC_OC Dim SerieFolio = $"OC: {Folio}, Clasificación: {item.Clasificacion}" - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, item.TotalSum, item.TotalSum, 154, SerieFolio, SerieFolio, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPrePoliza, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then + Dim Importe As Decimal = item.TotalSum + Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, item.TotalSum) + Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, 1, item.TotalSum * TC) + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then Respuesta = False Exit For End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, True, item.TotalSum, item.TotalSum, 152, SerieFolio, SerieFolio, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPrePoliza, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, True, Importe, ImporteMN, 152, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then Respuesta = False Exit For End If From ab93b922557aae3986392ed4cc3932f019695b92 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 13 May 2024 17:38:55 -0700 Subject: [PATCH 03/11] VyA - calendario pierde las fechas, la regresa al mes actual al hacer postback --- OC/OC.aspx.vb | 8 +-- Transportes/RepContratosCalendario.aspx | 61 ++++++++++++++++++++-- Transportes/RepContratosCalendario.aspx.vb | 8 +-- 3 files changed, 66 insertions(+), 11 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 7fe4a936e..55c3c1330 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -926,7 +926,7 @@ Partial Class OC_OC ChkEntregaDirecta.Checked = False End If - If CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then + If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then Alert("PrePoliza de Presupuesto Generada Correctamente") Else @@ -3522,7 +3522,7 @@ Partial Class OC_OC End If - If Not HuboError AndAlso UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(13, 73) Then If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then HuboError = True @@ -9161,7 +9161,7 @@ Partial Class OC_OC Dim Respuesta As Boolean = True - If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(13, 73) Then Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal) @@ -9204,7 +9204,7 @@ Partial Class OC_OC Dim Importe As Decimal = item.TotalSum Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, item.TotalSum) - Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, 1, item.TotalSum * TC) + Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC) If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then Respuesta = False diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index ed6b65f08..04147c7a9 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -500,6 +500,9 @@ + + + @@ -688,8 +691,14 @@ var date = null; function InitCalendar() { - $(document).ready(function () { - Calendario(); + $(document).ready(function () { + + let mes = parseInt($('#<%=HidCurrentMonth.ClientID%>').val()); + let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val()); + + + Calendario(mes,anio); + }); } @@ -799,7 +808,20 @@ updateEventOnDropResize(event); } - function Calendario() { + function Calendario(mes = -1, anio = -1) { + + + let fechaActual = new Date(); + if (mes === -1) { + mes = fechaActual.getMonth() + 1; + } + if (anio === -1) { + anio = fechaActual.getFullYear(); + } + + + let mesFormateado = ('0' + mes).slice(-2); + let fechaInicio = `${anio}-${mesFormateado}-01`; var date = new Date(); var d = date.getDate(); @@ -807,6 +829,7 @@ var y = date.getFullYear(); var h = {}; + //alert(fechaInicio); if ($('#calendar').width() <= 400) { $('#calendar').addClass("mobile"); h = { @@ -826,6 +849,7 @@ $('#calendar').fullCalendar('destroy'); $('#calendar').fullCalendar({ + defaultDate: fechaInicio, header: h, monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], @@ -857,10 +881,39 @@ } }, eventDrop: eventDropped, - eventResize: eventResized + eventResize: eventResized, + viewRender: function(view, element) { + + let pointDate = view.intervalStart; + let currentMonth = pointDate.month() + 1; + let currentYear = pointDate.year(); + + $('#<%=HidCurrentMonth.ClientID%>').val(currentMonth); + $('#<%=HidCurrentYear.ClientID%>').val(currentYear); + + } + }); } + function obtenerFechaInicio(mes = -1, anio = -1) { + let fechaActual = new Date(); + + if (mes === -1) { + mes = fechaActual.getMonth() + 1; // getMonth() es base 0, así que se suma 1 + } + if (anio === -1) { + anio = fechaActual.getFullYear(); + } + + + let mesFormateado = ('0' + mes).slice(-2); + + + let fechaInicio = `${anio}-${mesFormateado}-01`; + + return fechaInicio; + } diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index e47c8d212..dbafeca6b 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -107,7 +107,8 @@ Partial Class RepContratosCalendario UPPGantt.Update() End If End Sub - Private Sub InicializaCalendar() + Private Sub InicializaCalendar() + RegistraScript("InitCalendar();") DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True End Sub @@ -200,11 +201,12 @@ Partial Class RepContratosCalendario Alert("Actualizado Correctamente.") Else ObjContratos.RollBack() - End If - + End If + ObjContratos.Dispose() UpTitulos.Update() CargaDatos() + InicializaCalendar() End Sub Protected Sub UpdateModal(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) From 8ea3861e0e1c89d3c17947c5edf666abc8265e43 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 13 May 2024 18:38:00 -0700 Subject: [PATCH 04/11] OC.aspx, validar presupuesto con el valor del concepto 154 --- OC/OC.aspx.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 55c3c1330..40d6360bd 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -9034,7 +9034,8 @@ Partial Class OC_OC Dim respuesta As Boolean = False - If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + 'If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(13, 83) Then Dim ObjCon As New ClsContratos Dim CvePresupuesto As Integer = 0 From ec8e121a001ccbda0f3514b0eeffbd18d6fbceed Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 14 May 2024 09:58:16 -0700 Subject: [PATCH 05/11] --FIX cotizaciones por facturar --- Ventas/Ventas.aspx.vb | 114 ++++++++++++------------------------------ 1 file changed, 31 insertions(+), 83 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f7f66754d..004986c96 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -7664,7 +7664,9 @@ Partial Class Ventas 'SI ES AUTORIZACION DEBE PERMITIR GENERARLA If Bloqueo Then - BtnEmitirImprimir.Visible = False + If DdlTipoComprobante.SelectedValue <> "Cot" Then + BtnEmitirImprimir.Visible = False + End If BtnsFacturar.Visible = False LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) BtnGenerarRemision.Visible = False @@ -7952,7 +7954,9 @@ Partial Class Ventas Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) BtnsFacturar.Visible = False BtnGenerarRemision.Visible = False - BtnEmitirImprimir.Visible = False + If DdlTipoComprobante.SelectedValue <> "Cot" Then + BtnEmitirImprimir.Visible = False + End If If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then TieneBloqueoPorCreditoVencimiento = 1 @@ -9626,7 +9630,7 @@ Partial Class Ventas Me.CveAutorizacion = -1 'SI ES A CREDITO DEBE VERIFICAR SI TIENE AUTORIZACIONES - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCliente > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs") AndAlso RBLPago.SelectedValue = "1" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCliente > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing") AndAlso RBLPago.SelectedValue = "1" Then Dim TipoDocumentoAutorizacion As String = "" Dim ImporteAutorizacion As Decimal = 0 Dim TipoAutorizacion As Integer = 0 @@ -9634,13 +9638,13 @@ Partial Class Ventas Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero() Dim ObjVentas As New ClsVentas Try - If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, DdlTipoDocto.SelectedValue, CveEstatus:=1) Then + If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "Ing", CveEstatus:=1) Then Dim RowAutorizacion As DataRow = Nothing 'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO If TieneDiasVencidos Then - RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='{DdlTipoComprobante.SelectedValue}'", Orderby:="Importe DESC") + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") Else - RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='{DdlTipoComprobante.SelectedValue}'", Orderby:="Importe DESC") + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") End If If RowAutorizacion IsNot Nothing Then @@ -9660,11 +9664,11 @@ Partial Class Ventas If TipoDocumentoAutorizacion = "Ing" Then If TipoAutorizacion = 1 Then - If TieneDiasVencidos Then - CveAutorizacion = -1 - Alert($"El crédito no esta autorizado. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + 'If TieneDiasVencidos Then + ' CveAutorizacion = -1 + ' Alert($"El crédito no esta autorizado. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then Dim BloquearCredito As Boolean = True @@ -9714,79 +9718,23 @@ Partial Class Ventas End If End If - If TieneDiasVencidos AndAlso DdlTipoComprobante.SelectedValue = "Egs" AndAlso CveAutorizacion <= 0 Then - CveAutorizacion = -1 - Alert($"El crédito no esta autorizado. No tiene autorización para generar notas de crédito. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + 'If TieneDiasVencidos AndAlso DdlTipoComprobante.SelectedValue = "Egs" AndAlso CveAutorizacion <= 0 Then + ' CveAutorizacion = -1 + ' Alert($"El crédito no esta autorizado. No tiene autorización para generar notas de crédito. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If - If TipoDocumentoAutorizacion = "Egs" Then - If TipoAutorizacion = 1 Then - If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then - CveAutorizacion = -1 - Alert($"El crédito autorizado es insuficiente. Crédito Disponible:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - End If - End If + 'If TipoDocumentoAutorizacion = "Egs" Then + ' If TipoAutorizacion = 1 Then + ' If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then + ' CveAutorizacion = -1 + ' Alert($"El crédito autorizado es insuficiente. Crédito Disponible:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia) + ' Exit Sub + ' End If + ' End If + 'End If End If - 'SI TIENE LINEA ADICIONAL NO VERIFICAR LIMITE DE CREDITO - 'SI NO TIENE AUTORIZACION VERIFICAR LIMITE DE CREDITO Y CANDADOS DE VENTA - 'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada. - 'If DdlLineaAdicional.SelectedValue.ToEntero() <= 0 AndAlso Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then - ' 'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then - - ' If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then - ' Dim ObjVentas As New ClsVentas - - ' If ObjVentas.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) Then - ' If ObjVentas.DtResultados.Rows.Count > 0 Then - - ' If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then - ' If ObjVentas.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then - ' ObjVentas.Dispose() - ' Alert("Se está excediendo el límite de credito permitido de la Sucursal del Cliente.", TipoMensaje.MsgInformacion) - ' Exit Sub - ' End If - ' Else - ' If ObjVentas.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then - ' ObjVentas.Dispose() - ' Alert("Se está excediendo el límite de credito permitido del Cliente.", TipoMensaje.MsgInformacion) - ' Exit Sub - ' End If - ' End If - - ' Else - ' ObjVentas.Dispose() - ' Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError) - ' Exit Sub - ' End If - ' Else - ' ObjVentas.Dispose() - ' Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError) - ' Exit Sub - ' End If - ' ObjVentas.Dispose() - - ' 'VERIFICA SI TIENE BLOQUEO POR DIAS VENCIDOS - ' If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - ' Dim Vta As New ClsVentas - ' Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa, TipoVerificacion:=2) - ' Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

{0}", Vta.SerieVenta) - ' Vta.Dispose() - - ' If Opcion = 2 Then - ' Alert(OpcionMsg, TipoMensaje.MsgError) - ' Exit Sub - ' End If - ' End If - - ' End If - - ' 'End If - 'End If - 'VALIDAR LINEAS ADICIONALES If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then 'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL @@ -18188,8 +18136,8 @@ Partial Class Ventas 'VALIDA ESTATUS CLIENTE - SOLO SE PUEDE USAR EL CLIENTE PARA COTIZAR EN CASO DE ESTAR INACTIVO If EsCreaApartirDe OrElse ModalidadEdicion OrElse CveVenta <= 0 Then If DdlTipoComprobante.SelectedValue.Contiene("Cot", "DPe") Or TipoContrato >= 0 Then 'SI VIENE DE PEDIDO DE AF DESDE CONTRATO NO BLOQUEA CUANDO EL CLIENTE ESTA INACTIVO - BtnEmitirImprimir.Visible = TieneBloqueoPorCreditoVencimiento = 0 - TrVistaPrevia.Visible = TieneBloqueoPorCreditoVencimiento = 0 + BtnEmitirImprimir.Visible = True + TrVistaPrevia.Visible = True Else If LblCliente.Text <> "Cliente" And Not EstatusCliente Then Alert("El Cliente seleccionado no esta activo", TipoMensaje.MsgAdvertencia) From dfbbd7fc47e64f9765028d527ef9fe26b4a2f509 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 14 May 2024 17:01:46 -0700 Subject: [PATCH 06/11] =?UTF-8?q?EMD=20-=20OC=20Autorizadas,=20registrar?= =?UTF-8?q?=20prep=C3=B3liza=20154=20Cargo,=20152=20Abono?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contratos/RepPresupuestosDetalle.aspx | 6 ++++-- Contratos/RepPresupuestosDetalle.aspx.vb | 27 ++++++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Contratos/RepPresupuestosDetalle.aspx b/Contratos/RepPresupuestosDetalle.aspx index 35ed80fe3..b30af087b 100644 --- a/Contratos/RepPresupuestosDetalle.aspx +++ b/Contratos/RepPresupuestosDetalle.aspx @@ -247,7 +247,8 @@
AgrupadorAutorizadoComprometidoAutorizadoComprometido Ejercido Por Ejercer Pagado
- + + @@ -259,7 +260,8 @@ <%-- - + + diff --git a/Contratos/RepPresupuestosDetalle.aspx.vb b/Contratos/RepPresupuestosDetalle.aspx.vb index 06966b86a..5788852bb 100644 --- a/Contratos/RepPresupuestosDetalle.aspx.vb +++ b/Contratos/RepPresupuestosDetalle.aspx.vb @@ -87,14 +87,15 @@ Partial Class Contratos_RepPresupuestosDetalle Gpo = IfNull(Request("CveAgrupador"), -1).ToString.ToEntero Dim Mensual = CBool(IfNull(Request("Mensual"), False)) Dim EsProyecto = CBool(IfNull(Request("EsProyecto"), False)) - If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1 + 'If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1 DdlAgrupador.SelectedValueExist(Agrupador) - DdlClasificacion.SelectedValueExist(CveClasificacion) - If DdlAgrupador.SelectedValue.ToEntero = 2 Then + DdlClasificacion.SelectedValueExist(CveClasificacion) + + If DdlAgrupador.SelectedValue.ToEntero = 1 Then DdlClasificacion.SelectedValueExist(Gpo) DdlProyecto.SelectedValueExist(CveProyecto) DdlSubProyecto.SelectedValueExist(CveSubProyecto) - ElseIf DdlAgrupador.SelectedValue.ToEntero = 1 Then + ElseIf DdlAgrupador.SelectedValue.ToEntero = 2 Then If Not EsProyecto Then Dim Dr As DataRow = GlobalDTSubProyectos(-1, Gpo)(0) DdlProyecto.SelectedValueExist(Dr("CveProyecto")) @@ -158,20 +159,20 @@ Partial Class Contratos_RepPresupuestosDetalle e.Row.Cells(1).Text = "-" End If If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then - e.Row.Cells(2).Text = "-" - End If - If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then e.Row.Cells(3).Text = "-" End If - If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then + If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then e.Row.Cells(4).Text = "-" End If - If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then + If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then e.Row.Cells(5).Text = "-" End If - If e.Row.DBCampo("Pagado").ToDecimal = 0 Then + If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then e.Row.Cells(6).Text = "-" End If + If e.Row.DBCampo("Pagado").ToDecimal = 0 Then + e.Row.Cells(7).Text = "-" + End If If e.Row.RowIndex > 0 Then Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero Dim EsProyecto = False @@ -185,9 +186,13 @@ Partial Class Contratos_RepPresupuestosDetalle End If EsProyecto = True End If - Dim Css = "Texto" + Dim Css = "Texto" + Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}" e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" + + Dim LigaComprometido = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}&Comprometido=1" + e.Row.Cells(2).Text = "" + e.Row.Cells(2).Text + "" End If End If End Sub From 6bab26399425c0e68e9297410a5f52c83f198078 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 14 May 2024 19:10:13 -0700 Subject: [PATCH 07/11] --FIX bloquear si tiene vencimientos funcionalidad 702 valor 2 --- Ventas/Ventas.aspx.vb | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 004986c96..274ae7575 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -7529,7 +7529,7 @@ Partial Class Ventas Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595) 'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO - If (Not UsuarioActual.Empresa.Funcionalidad(702).Contiene("1", "2")) AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then + If (Not UsuarioActual.Empresa.Funcionalidad(702).Contiene("1")) AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then RBLPago.SelectedValue = "2" RBLPago.Items(0).Enabled = False RBLPago_SelectedIndexChanged(Nothing, Nothing) @@ -7981,11 +7981,40 @@ Partial Class Ventas End If End If - End If UPPCreditoDisponible.Update() + 'SOLO VERIFICA VENCIMIENTOS + If UsuarioActual.Empresa.Funcionalidad(702).Contiene("2") Then + + Dim ValidaCliente As Boolean = False + + If (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso (Me.CveVenta <= 0 OrElse EsCreaApartirDe)) OrElse ((DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso (Me.CveVenta > 0 AndAlso Not EsCreaApartirDe))) Then + ValidaCliente = True + End If + + If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (Me.CveCliente = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()) Then + ValidaCliente = False + End If + + 'SI ES FACTURA, REMISION o FACTURACION DE COTIZACIONES + If ValidaCliente Then + Dim Vta As New ClsVentas + Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa, TipoVerificacion:=2) + Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

{0}", Vta.SerieVenta) + Vta.Dispose() + + If Opcion = 2 Then + Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) + BtnEmitirImprimir.Visible = False + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False + TieneBloqueoPorCreditoVencimiento = 1 + End If + End If + End If + 'Puede hacer pedido If CveVenta <= 0 Then If Not UsuarioActual.TienePermisoProceso(177) And Not EsVentaMedica Then From dcc70326b21ce9121ce524bcd4540f97279dee49 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 14 May 2024 19:11:07 -0700 Subject: [PATCH 08/11] --FIX generar movto de almacen de cancelacion en devolucion si se tiene la funcionalidad 567 --- Ventas/RepCancelacionesPorRespuesta.aspx.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index 096e121fc..b4907ecf4 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -566,7 +566,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas } else { + //SI REGISTRA SALIDA DE ALMACÉN EN AUTOMÁTICO Y ES DEVOLUCION QUE REALIZE EL MOVMIENTO DE SALIDA DE ALMACEN + if (UsuarioActual.Empresa.Funcionalidad(567) == "1" && factura.TipoDocto == "Dev" && factura.SaldoAlmacen != 0) + { + factura.RealizarDevolucionAlmacen = true; + } retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse); + } return retorno; From 916f14a06670ec16aee7d65d8747d472ef2b617b Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 14 May 2024 23:36:54 -0700 Subject: [PATCH 09/11] Comprometido detalle desglose OC en RepPresupuestosDetalleCompras --- App_Code/ClsContratos.vb | 3 +- .../RepPresupuestosDetalleCompras.aspx.vb | 60 +++++++++++++------ 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index a5899031b..3c0f7b656 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -3246,7 +3246,7 @@ Public Class ClsContratos Return Retorno End Function - Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveAgrupador As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean + Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveAgrupador As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer, Optional Comprometido As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_PresupuestosRepDetalleCompra") @@ -3259,6 +3259,7 @@ Public Class ClsContratos .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario + .Add("@Comprometido", SqlDbType.Bit).Value = Comprometido End With Try diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx.vb b/Contratos/RepPresupuestosDetalleCompras.aspx.vb index 08d386d3f..f1dafa0e4 100644 --- a/Contratos/RepPresupuestosDetalleCompras.aspx.vb +++ b/Contratos/RepPresupuestosDetalleCompras.aspx.vb @@ -2,11 +2,14 @@ Option Strict On Imports System.Data Imports Extensiones +Imports Org.BouncyCastle.Asn1.Ocsp Partial Class Contratos_RepPresupuestosDetalleCompras - Inherits ClsPaginas - + Inherits ClsPaginas + + + #Region "P R O P I E D A D E S" - + Public Property Gpo() As Integer Get Return DirectCast(ViewState("Gpo"), Integer) @@ -14,8 +17,20 @@ Partial Class Contratos_RepPresupuestosDetalleCompras Set(ByVal value As Integer) ViewState("Gpo") = value End Set - End Property - + End Property + + Public Property Comprometido As Boolean + Get + If ViewState("Comprometido") Is Nothing Then + ViewState("Comprometido") = False + End If + Return Boolean.Parse(ViewState("Comprometido").ToString) + End Get + Set(value As Boolean) + ViewState("Comprometido") = value + End Set + End Property + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -25,8 +40,8 @@ Partial Class Contratos_RepPresupuestosDetalleCompras CargaDatos() End If - End Sub - + End Sub + #Region " INICIALIZA VALORES " Private Sub InicializaValores() @@ -71,7 +86,11 @@ Partial Class Contratos_RepPresupuestosDetalleCompras Dim CveProyecto = IfNull(Request("CveProyecto"), -1).ToString.ToEntero Dim CveSubProyecto = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero Dim CveTipoGasto = IfNull(Request("CveTipoGasto"), -1).ToString.ToEntero - Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero + Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero + + Comprometido = If(Request("Comprometido") IsNot Nothing AndAlso Request("Comprometido").ToEntero = 1, True, False) + + Gpo = IfNull(Request("CveAgrupador"), -1).ToString.ToEntero Dim EsProyecto = CBool(IfNull(Request("EsProyecto"), False)) If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1 @@ -106,7 +125,8 @@ Partial Class Contratos_RepPresupuestosDetalleCompras End Sub Private Sub CargaDatos() Dim ObjPresupuestos As New ClsContratos - If ObjPresupuestos.GetPresupuestosRepDetalleCompras(DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlTipoGasto.SelectedValue.ToEntero, TxtFiltrosFechaInicio.Text.ToDate, TxtFiltrosFechaFin.Text.ToDate, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then + If ObjPresupuestos.GetPresupuestosRepDetalleCompras(DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlTipoGasto.SelectedValue.ToEntero, TxtFiltrosFechaInicio.Text.ToDate, + TxtFiltrosFechaFin.Text.ToDate, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Comprometido:=Comprometido) Then GvDatos.DataSource = ObjPresupuestos.DtResultados End If ObjPresupuestos.Dispose() @@ -131,15 +151,21 @@ Partial Class Contratos_RepPresupuestosDetalleCompras Dim Liga = "" Dim Css = "Texto" - Dim TipoAgrupador As Integer = e.Row.DBCampo("TipoAgrupador").ToEntero() - Select Case TipoAgrupador - Case 1 - Liga = $"/Compras/Compras.aspx?&CveCompra={e.Row.DBCampo("CveCompra")}" - Case 2 - Liga = $"/Contabilidad/RegPrePoliza.aspx?&CvePrePoliza={e.Row.DBCampo("CveCompra")}" - Case Else + + If Comprometido Then + Liga = $"/OC/OC.aspx?OC={e.Row.DBCampo("CveOrdenCompra")}" + Else + Dim TipoAgrupador As Integer = e.Row.DBCampo("TipoAgrupador").ToEntero() + Select Case TipoAgrupador + Case 1 + Liga = $"/Compras/Compras.aspx?&CveCompra={e.Row.DBCampo("CveCompra")}" + Case 2 + Liga = $"/Contabilidad/RegPrePoliza.aspx?&CvePrePoliza={e.Row.DBCampo("CveCompra")}" + Case Else + + End Select + End If - End Select e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + "" End If End If From 683f05caf6918d6769b892fc0c0e903f39960095 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 15 May 2024 10:02:34 -0700 Subject: [PATCH 10/11] Reportes presupuestos acentos --- Contratos/RepPresupuestos.aspx | 10 +++++----- Contratos/RepPresupuestosDetalle.aspx | 10 +++++----- Contratos/RepPresupuestosDetalleCompras.aspx | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Contratos/RepPresupuestos.aspx b/Contratos/RepPresupuestos.aspx index ebe5ac5bd..62963dcf3 100644 --- a/Contratos/RepPresupuestos.aspx +++ b/Contratos/RepPresupuestos.aspx @@ -208,7 +208,7 @@
Agrupador:
- +
@@ -231,7 +231,7 @@ -
Clasificacion:
+
Clasificación:
@@ -341,9 +341,9 @@ <%-- - + - + @@ -383,7 +383,7 @@ - + diff --git a/Contratos/RepPresupuestosDetalle.aspx b/Contratos/RepPresupuestosDetalle.aspx index b30af087b..799be4123 100644 --- a/Contratos/RepPresupuestosDetalle.aspx +++ b/Contratos/RepPresupuestosDetalle.aspx @@ -201,7 +201,7 @@
Agrupador:
- +
@@ -224,7 +224,7 @@
-
Clasificacion:
+
Clasificación:
@@ -259,9 +259,9 @@ <%-- - + - + @@ -299,7 +299,7 @@
AgrupadorAutorizadoAutorizadoComprometido Ejercido Por Ejercer Pagado
- + diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx b/Contratos/RepPresupuestosDetalleCompras.aspx index a6f50fb94..f251ca390 100644 --- a/Contratos/RepPresupuestosDetalleCompras.aspx +++ b/Contratos/RepPresupuestosDetalleCompras.aspx @@ -219,7 +219,7 @@