From 17348ffe57bb112e5d1268029eb6f53a3300656e Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 11 Dec 2020 12:46:26 -0700 Subject: [PATCH 1/8] Contratos --- App_Code/ClsContratos.vb | 16 +- App_Code/ClsPaginas.vb | 37 ++++ App_Code/ClsRH.vb | 45 ++-- Contratos/ContratoObra.aspx.vb | 315 ++++++++++++++++++++-------- Inventarios/TraspasoAlmacen.aspx.vb | 4 +- 5 files changed, 309 insertions(+), 108 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 2f6dc4b60..81bfc0d90 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -1007,14 +1007,15 @@ Public Class ClsContratos End Try Return Retorno - End Function - - - + End Function + + + #End Region - + #Region "CONTRATOS DETALLE" - Public Function AddContratosDetalle(CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, CveTipoPresupuesto As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, Optional Observacion As String = "") As Boolean + Public Function AddContratosDetalle(CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, CveTipoPresupuesto As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, + Optional Observacion As String = "", Optional CveRubro As Integer = -1, Optional CveActividad As Integer = -1, Optional CveSubTipoActivoFijo As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Con_ContratosDetalleAdd") @@ -1029,6 +1030,9 @@ Public Class ClsContratos .Add("@OCInterna", SqlDbType.VarChar).Value = OCInterna .Add("@LimitarCantidad", SqlDbType.Bit).Value = If(LimitarCantidad, 1, 0) .Add("@Observacion", SqlDbType.VarChar).Value = Observacion + .Add("@CveRubro", SqlDbType.Int).Value = CveRubro + .Add("@CveActividad", SqlDbType.Int).Value = CveActividad + .Add("@CveSubTipoActivoFijo", SqlDbType.Int).Value = CveSubTipoActivoFijo 'NoIdentificacion End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 850cbb1c6..be81c310e 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -634,6 +634,8 @@ Public Class ClsPaginas Application("GlobalDTEmpresas") = value End Set End Property + + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) @@ -664,6 +666,41 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property + + + + + Property GlobalDTRHActividades(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTRHActividades-{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + + Dim ObjRH As New ClsRH + If ObjRH.GetActividades(CveEmpresa) Then Application(AppNombre) = ObjRH.DtResultados + ObjRH.Dispose() + + End If + + If CveEmpresa <> -1 Then + Dim Str As New StringBuilder + Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + GlobalDTRHActividades = Dv.ToTable + Dv.Dispose() + Else + GlobalDTRHActividades = DirectCast(Application(AppNombre), DataTable) + End If + + + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTRHActividades-{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property + Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones2-{0}", CveEmpresa) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index de7538cf9..66e53ec8a 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -6865,21 +6865,40 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al eliminar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function + End Function #End Region - - - 'Public msgsError As New StringBuilder() - 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") - ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - ' msgsError.AppendLine(Mensaje) - ' msgsError.Append("
") - ' 'Alert(Obj, Mensaje, TipoMensaje.MsgError) - ' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - 'End Sub - + +#Region " A C T I V I D A D E S" + + + Public Function GetActividades(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ActividadesGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el listado de checadores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region + + + 'Public msgsError As New StringBuilder() + 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") + ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + ' msgsError.AppendLine(Mensaje) + ' msgsError.Append("
") + ' 'Alert(Obj, Mensaje, TipoMensaje.MsgError) + ' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + 'End Sub + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) 'If msgsError.ToString().Length > 0 Then ' Alert(msgsError.ToString(), TipoMensaje.MsgError) diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index e04960ae0..15bce85a9 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -596,6 +596,16 @@ Partial Class Contratos_ContratoObra TmpDT.Columns.Add("LimitarCantidad", GetType(Integer)) TmpDT.Columns.Add("OCInterna", GetType(String)) TmpDT.Columns.Add("Observacion", GetType(String)) + + TmpDT.Columns.Add("CveRubro", GetType(Integer)) + TmpDT.Columns.Add("CveActividad", GetType(Integer)) + TmpDT.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) + + TmpDT.Columns.Add("Rubro", GetType(String)) + TmpDT.Columns.Add("Actividad", GetType(String)) + TmpDT.Columns.Add("SubTipoActivoFijo", GetType(String)) + + End Sub Protected Sub Limpiar() TxtNumeroContrato.Text = "" @@ -4126,27 +4136,58 @@ Partial Class Contratos_ContratoObra Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs) Dim DTCargaPresupuesto As New DataTable - DTCargaPresupuesto = CargaPreSupuestoExcel() + Dim DTCargaPresupuestoInsumos As New DataTable + Dim DTCargaPresupuestoManoObra As New DataTable + Dim DTCargaPresupuestoFlotillas As New DataTable + + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto") + + + If DTCargaPresupuesto.Rows.Count > 0 Then + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing) + Else + Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) + End If + - If DTCargaPresupuesto.Rows.Count > 0 Then - ProcesaDatosCargaPresupuesto(DTCargaPresupuesto) Else - Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) + + DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos") + DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra") + DTCargaPresupuestoFlotillas = CargaPreSupuestoExcel("Flotillas") + + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas) + End If + TxtModalCargaPresupuesto.Text = "" + End Sub Protected Sub BtnDecargaFormato_Click(sender As Object, e As EventArgs) - Dim FI As New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") + Else + FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObraInterno.xlsx") + End If + If FI.Exists Then Response.ContentType = "application/octet-stream" - Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx") + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx") + Else + Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObraInterno.xlsx") + End If + Response.TransmitFile(FI.FullName) Response.End() @@ -4156,7 +4197,7 @@ Partial Class Contratos_ContratoObra End Sub - Private Function CargaPreSupuestoExcel() As DataTable + Private Function CargaPreSupuestoExcel(Hoja As String) As DataTable Dim FileExtension As String = "-1" Dim Filesgral As List(Of Archivo) = TxtModalCargaPresupuesto.getfiles().Archivos @@ -4178,7 +4219,7 @@ Partial Class Contratos_ContratoObra tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) SpreadsheetInfo.SetLicense(Extensiones.SerialGemBoxSpreadsheet) Dim workbook = ExcelFile.Load(fileItem.FileUrl) - Dim worksheet = workbook.Worksheets(0) + Dim worksheet = workbook.Worksheets(Hoja) DTPS = worksheet.CreateDataTable(New CreateDataTableOptions() With { .ColumnHeaders = True, @@ -4190,7 +4231,7 @@ Partial Class Contratos_ContratoObra Next - TxtModalCargaPresupuesto.Text = "" + RegistraScript("$('#ModalUploadPresupuesto').modal('hide')") @@ -4201,7 +4242,25 @@ Partial Class Contratos_ContratoObra End Function - Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable) + Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable, DTCargaPresupuestoManoObra As DataTable, DTCargaPresupuestoFlotillas As DataTable) + + + If Not DTPresupuesto Is Nothing Then + DTPresupuesto.CaseSensitive = False + End If + + If Not DTCargaPresupuestoManoObra Is Nothing Then + DTCargaPresupuestoManoObra.CaseSensitive = False + End If + + If Not DTCargaPresupuestoFlotillas Is Nothing Then + DTCargaPresupuestoFlotillas.CaseSensitive = False + End If + + + + + Dim DTPS = New DataTable DTPS.Columns.Add("CveContratoDetalle", GetType(Integer)) @@ -4228,65 +4287,141 @@ Partial Class Contratos_ContratoObra DTPS.Columns.Add("OCInterna", GetType(String)) DTPS.Columns.Add("Observacion", GetType(String)) + DTPS.Columns.Add("CveRubro", GetType(Integer)) + DTPS.Columns.Add("CveActividad", GetType(Integer)) + DTPS.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) + + DTPS.Columns.Add("Rubro", GetType(String)) + DTPS.Columns.Add("Actividad", GetType(String)) + DTPS.Columns.Add("SubTipoActivoFijo", GetType(String)) + Dim RowNoEncontrados As String = "" - For Each DrowPS As DataRow In DTPresupuesto.Rows + If Not DTPresupuesto Is Nothing Then + For Each DrowPS As DataRow In DTPresupuesto.Rows - Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c) - Dim CvePS As Integer - Dim CveUM As Integer + Dim StrArray() As String = GetPS("PS", DrowPS("Producto").ToString).Split("|"c) + Dim CvePS As Integer + Dim CveUM As Integer - If StrArray.Length > 0 Then - If CBool(StrArray(0)) = True Then - CvePS = StrArray(1).ToEntero - Else - RowNoEncontrados &= StrArray(1) & "<\BR>" + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + Else + RowNoEncontrados &= StrArray(1) & "<\BR>" + End If End If - End If - - If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then - - CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero - - Dim Row As DataRow = DTPS.NewRow() - Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble - Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble - Row("CveUM") = CveUM - Row("UM") = "" - Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero - Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString - Row("CvePS") = CvePS - Row("PS") = DrowPS("PS").ToString - Row("CodigoPS") = DrowPS("PS").ToString - Row("PU") = DrowPS("PU").ToString.ToDouble - Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble - - - Select Case TipoCargaPresupuesto - Case EnumTipoCargaPresupuesto.Ventas - Row("CveTipoPresupuesto") = 2 - Exit Select - Case EnumTipoCargaPresupuesto.Control - Row("CveTipoPresupuesto") = 1 - Exit Select - Case Else - Row("CveTipoPresupuesto") = 1 - End Select - - - Row("NoIdentificacion") = "" - Row("OCInterna") = "" - Row("LimitarCantidad") = 0 - Row("Observacion") = "" - - DTPS.Rows.Add(Row) - - End If - Next + If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then + + + + CveUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $" UnidadMedida = '{ DrowPS("UnidadMedida").ToString.Trim }' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString.Trim }'").ToEntero + + If CveUM <= 0 Then + CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero + End If + + + Dim Row As DataRow = DTPS.NewRow() + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = CveUM + Row("UM") = "" + Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero + Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString + Row("CvePS") = CvePS + Row("PS") = DrowPS("Producto").ToString + Row("CodigoPS") = DrowPS("Producto").ToString + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + + + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Ventas + + Row("CveTipoPresupuesto") = 2 + Row("CveRubro") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + + Exit Select + Case EnumTipoCargaPresupuesto.Control + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 2 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Exit Select + Case Else + Row("CveTipoPresupuesto") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + End Select + + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + + End If + Next + + End If + + + + If Not DTCargaPresupuestoManoObra Is Nothing Then + + + For Each DrowPS As DataRow In DTCargaPresupuestoManoObra.Rows + + Dim CveActividad As Integer = 0 + + CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero + + If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then + + Dim Row As DataRow = DTPS.NewRow() + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = -1 + Row("UM") = "" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = DrowPS("Actividad").ToString + Row("CodigoPS") = DrowPS("Actividad").ToString + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Row("CveTipoPresupuesto") = 2 + Row("CveRubro") = 3 + Row("CveActividad") = CveActividad + Row("CveSubTipoActivoFijo") = -1 + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + + End If + Next + + End If + + If Not DTCargaPresupuestoFlotillas Is Nothing Then + + End If Dim ErrorProceso = False Dim ObjContratos As New ClsContratos @@ -4295,10 +4430,12 @@ Partial Class Contratos_ContratoObra For Each Row As DataRow In DTPS.Rows - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, + Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero, + CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero) Then If Autorizado Then - Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) + Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro")) guardarBitacora(msj) End If @@ -4322,6 +4459,14 @@ Partial Class Contratos_ContratoObra NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") NrowTmpDT("Observacion") = Row("Observacion") + NrowTmpDT("CveRubro") = Row("CveRubro") + NrowTmpDT("CveActividad") = Row("CveActividad") + NrowTmpDT("CveSubTipoActivoFijo") = Row("CveSubTipoActivoFijo") + + NrowTmpDT("Rubro") = Row("Rubro") + NrowTmpDT("Actividad") = Row("Actividad") + NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo") + NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") @@ -4606,42 +4751,38 @@ Partial Class Contratos_ContratoObra Con.Dispose() - If DTDatos.Rows.Count > 0 Then + Try + If DTDatos.Rows.Count > 0 Then - Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal - Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal - Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0) + Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal + Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal + Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0) - Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal - Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal - Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0) + Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal + Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal + Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0) - LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }" - LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %" - LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%" - SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%") + LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }" + LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %" + LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%" + SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%") - LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}" - LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %" - LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%" - SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%") + LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}" + LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %" + LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%" + SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%") - End If + End If + + Catch ex As Exception + + End Try - 'Dim TotalContratos As Decimal = DTDatos.SUM("Importe") - 'Dim TotalAvance As Decimal = DTDatos.SUM("AvanceImporte") - 'Dim TotalFaltante As Decimal = TotalContratos - TotalAvance - 'Dim TotalAvancePorcentaje As Decimal = ((TotalAvance * 100) / TotalContratos).RoundAD(2) - 'Dim TotalFaltantePorcentaje As Decimal = (100 - TotalAvancePorcentaje).RoundAD(2) - - - ' LtlGrafNumeroContratos.Text = NumeroContratos.ToString - 'LtlGrafTotal.Text = TotalContratos.ToString("###,###,###.00") DVGraficas.Visible = True diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 434eaf4fb..4af10e301 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1525,7 +1525,7 @@ Partial Class Inventarios_TraspasoAlmacen FolioBusqueda = If(TxtFolioRecepcion.Text = "", -1, TxtFolioRecepcion.Text.ToEntero) Dim ObjInventarios As New ClsInventarios - If ObjInventarios.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then + If ObjInventarios.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then Dtt = ObjInventarios.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4")) Else Alert("Ocurrió un error al consultar los movimientos transitorios. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) @@ -1820,7 +1820,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) '' verifica que no se halla recibido previamente, si ya se recibió da salida - If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then Dtt = ObjInventario.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4"), "", {"CveMovimientoDetalle", "Codigo", "Cantidad"}) If Dtt IsNot Nothing AndAlso Dtt.FiltraParametros("Cantidad < 0").Rows.Count > 0 Then From 9c6039c77d28778225f6d952f10667292fe9e5db Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 11 Dec 2020 13:56:32 -0700 Subject: [PATCH 2/8] Rep Compras Detalle cambio de fecha --- App_Code/ClsContratos.vb | 3 ++- Compras/RepComprasDetalle.aspx.vb | 7 +++++-- Contratos/ContratoObra.aspx.vb | 21 ++++++++++++--------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 81bfc0d90..09656d558 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -1015,7 +1015,7 @@ Public Class ClsContratos #Region "CONTRATOS DETALLE" Public Function AddContratosDetalle(CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, CveTipoPresupuesto As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, - Optional Observacion As String = "", Optional CveRubro As Integer = -1, Optional CveActividad As Integer = -1, Optional CveSubTipoActivoFijo As Integer = -1) As Boolean + Optional Observacion As String = "", Optional CveRubro As Integer = -1, Optional CveActividad As Integer = -1, Optional CveSubTipoActivoFijo As Integer = -1, Optional Dias As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Con_ContratosDetalleAdd") @@ -1033,6 +1033,7 @@ Public Class ClsContratos .Add("@CveRubro", SqlDbType.Int).Value = CveRubro .Add("@CveActividad", SqlDbType.Int).Value = CveActividad .Add("@CveSubTipoActivoFijo", SqlDbType.Int).Value = CveSubTipoActivoFijo + .Add("@Dias", SqlDbType.Int).Value = Dias 'NoIdentificacion End With diff --git a/Compras/RepComprasDetalle.aspx.vb b/Compras/RepComprasDetalle.aspx.vb index e7a5e5439..9e2776116 100644 --- a/Compras/RepComprasDetalle.aspx.vb +++ b/Compras/RepComprasDetalle.aspx.vb @@ -291,7 +291,10 @@ Partial Class Compras_RepComprasDetalle FechaICaptura = If(IsDate(TxtFechaICaptura.Text.Trim()), TxtFechaICaptura.Text.Trim(), "-1") FechaFCaptura = If(IsDate(TxtFechaFCaptura.Text.Trim()), TxtFechaFCaptura.Text.Trim(), "-1") - + Dim AnioMes As String = If(FechaF <> "-1", "-1", IfNull(Request("AnioMes"), "-1").ToString()) + + + If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then TCEspecifico = TxtEspecifico.Text.ToDouble Else @@ -301,7 +304,7 @@ Partial Class Compras_RepComprasDetalle Dim SubProyectos As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim TipoGasto As String = IIf(DdlTipoGasto.GetSelectedValuesM = "", "-1", DdlTipoGasto.GetSelectedValuesM).ToString - If ObjCompras.GetRepComprasDetalle(DdlGrupo.SelectedValue.ToEntero, IfNull(Request("Anio"), Now.Year).ToString.ToEntero, IfNull(Request("Mes"), "-1").ToString.ToEntero, IfNull(Request("AnioMes"), "-1").ToString(), IfNull(Request("Fecha"), "-1").ToString(), + If ObjCompras.GetRepComprasDetalle(DdlGrupo.SelectedValue.ToEntero, IfNull(Request("Anio"), Now.Year).ToString.ToEntero, IfNull(Request("Mes"), "-1").ToString.ToEntero, AnioMes, IfNull(Request("Fecha"), "-1").ToString(), DdlProveedores.SelectedValue.ToEntero, CveMoneda, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, DDlUsuarioCaptura.SelectedValue.ToEntero, IfNull(Request("NumeroRemesa"), "-1").ToString.ToEntero, IfNull(Request("CveUsuarioRemesa"), "-1").ToString.ToEntero, FechaICaptura, FechaFCaptura, IfNull(Request("FechaCaptura"), "-1").ToString, SubProyectos, DdlTipoDocto.SelectedValue, UsuarioActual.CveEmpresa, diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 15bce85a9..a6c87309f 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -595,8 +595,9 @@ Partial Class Contratos_ContratoObra TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("LimitarCantidad", GetType(Integer)) TmpDT.Columns.Add("OCInterna", GetType(String)) - TmpDT.Columns.Add("Observacion", GetType(String)) - + TmpDT.Columns.Add("Observacion", GetType(String)) + + TmpDT.Columns.Add("CveRubro", GetType(Integer)) TmpDT.Columns.Add("CveActividad", GetType(Integer)) TmpDT.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) @@ -605,6 +606,8 @@ Partial Class Contratos_ContratoObra TmpDT.Columns.Add("Actividad", GetType(String)) TmpDT.Columns.Add("SubTipoActivoFijo", GetType(String)) + TmpDT.Columns.Add("Dias", GetType(Integer)) + End Sub Protected Sub Limpiar() @@ -2204,9 +2207,6 @@ Partial Class Contratos_ContratoObra End If - - - If ObjContratos.GetReporteContratosAvancesDetalleControl(CveContrato, UsuarioActual.CveEmpresa) Then GvDatosAvanceControl.DataSource = ObjContratos.DtResultados @@ -4294,6 +4294,7 @@ Partial Class Contratos_ContratoObra DTPS.Columns.Add("Rubro", GetType(String)) DTPS.Columns.Add("Actividad", GetType(String)) DTPS.Columns.Add("SubTipoActivoFijo", GetType(String)) + DTPS.Columns.Add("Dias", GetType(Integer)) Dim RowNoEncontrados As String = "" @@ -4327,6 +4328,7 @@ Partial Class Contratos_ContratoObra Dim Row As DataRow = DTPS.NewRow() + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble Row("CveUM") = CveUM @@ -4339,9 +4341,6 @@ Partial Class Contratos_ContratoObra Row("PU") = DrowPS("PU").ToString.ToDouble Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble - - - Select Case TipoCargaPresupuesto Case EnumTipoCargaPresupuesto.Ventas @@ -4349,6 +4348,7 @@ Partial Class Contratos_ContratoObra Row("CveRubro") = 1 Row("CveActividad") = -1 Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 Exit Select Case EnumTipoCargaPresupuesto.Control @@ -4356,11 +4356,13 @@ Partial Class Contratos_ContratoObra Row("CveRubro") = 2 Row("CveActividad") = -1 Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 Exit Select Case Else Row("CveTipoPresupuesto") = 1 Row("CveActividad") = -1 Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 End Select @@ -4406,6 +4408,7 @@ Partial Class Contratos_ContratoObra Row("CveRubro") = 3 Row("CveActividad") = CveActividad Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = DrowPS("Dias").ToString.ToEntero Row("NoIdentificacion") = "" Row("OCInterna") = "" @@ -4432,7 +4435,7 @@ Partial Class Contratos_ContratoObra If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero, - CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero) Then + CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then If Autorizado Then Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro")) From 7a0ce67ee5c3a282af68782f33e9d071d7590844 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 11 Dec 2020 20:43:57 -0700 Subject: [PATCH 3/8] Contratos --- App_Code/ClsContratos.vb | 10 +- App_Code/ClsRH.vb | 29 ++- Contratos/ContratoObra.aspx | 60 +++-- Contratos/ContratoObra.aspx.vb | 442 ++++++++++++++++++++++----------- 4 files changed, 376 insertions(+), 165 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 09656d558..e7b9a2971 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -1014,6 +1014,7 @@ Public Class ClsContratos #End Region #Region "CONTRATOS DETALLE" + Public Function AddContratosDetalle(CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, CveTipoPresupuesto As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, Optional Observacion As String = "", Optional CveRubro As Integer = -1, Optional CveActividad As Integer = -1, Optional CveSubTipoActivoFijo As Integer = -1, Optional Dias As Integer = -1) As Boolean Dim Retorno = False @@ -1049,7 +1050,8 @@ Public Class ClsContratos End Function - Public Function UpdateContratosDetalle(CveContratoDetalle As Integer, CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, Optional Observacion As String = "") As Boolean + Public Function UpdateContratosDetalle(CveContratoDetalle As Integer, CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, + Optional Observacion As String = "", Optional CveRubro As Integer = -1, Optional CveActividad As Integer = -1, Optional CveSubTipoActivoFijo As Integer = -1, Optional Dias As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Con_ContratosDetalleUpdate") @@ -1063,7 +1065,11 @@ Public Class ClsContratos .Add("@NoIdentificacion", SqlDbType.VarChar).Value = NoIdentificacion .Add("@OCInterna", SqlDbType.VarChar).Value = OCInterna .Add("@LimitarCantidad", SqlDbType.Bit).Value = If(LimitarCantidad, 1, 0) - .Add("@Observacion", SqlDbType.VarChar).Value = Observacion + .Add("@Observacion", SqlDbType.VarChar).Value = Observacion + .Add("@CveRubro", SqlDbType.Int).Value = CveRubro + .Add("@CveActividad", SqlDbType.Int).Value = CveActividad + .Add("@CveSubTipoActivoFijo", SqlDbType.Int).Value = CveSubTipoActivoFijo + .Add("@Dias", SqlDbType.Int).Value = Dias End With diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 66e53ec8a..9d5bfabce 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1359,6 +1359,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Public Property CveUniforme As Integer + Public Property CveActividad As Integer + Public ReadOnly Property DtResultados() As DataTable Get @@ -6881,10 +6883,35 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener el listado de checadores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al obtener el listado de actividades ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno End Function + + + Public Function AddActividades(Actividad As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + + CveActividad = -1 + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ActividadesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Actividad", SqlDbType.VarChar).Value = Actividad + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveActividad", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + + CveActividad = SqlAdapter.SelectCommand.Parameters("@CveActividad").Value.ToString.ToEntero + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el listado de ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + #End Region diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index 56c505e65..ef3d982e3 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -942,7 +942,7 @@
@@ -997,6 +997,13 @@ + + + + + + + @@ -2696,7 +2703,15 @@
- <%--
- - -
--%> - - <%--
- - -
--%> - - -
+
-
+
- - +
-
+
@@ -2744,10 +2746,28 @@
+ + + +
+ + + + + +
+ +
+ + + + +
-
+
+
diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index a6c87309f..f627ea687 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -1490,10 +1490,14 @@ Partial Class Contratos_ContratoObra Row("LimitarCantidad") = False 'If(ChkLimitarVenta.Checked, 1, 0) Row("Observacion") = "" 'TxtObservacionesDetalles.Text + Row("CveRubro") = 1 + + + Dim ObjContratos As New ClsContratos - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", Observacion:=Row("Observacion").ToString) Then + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", Observacion:=Row("Observacion").ToString, CveRubro:=1) Then If Autorizado Then Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) @@ -1548,7 +1552,7 @@ Partial Class Contratos_ContratoObra Dim ObjContratos As New ClsContratos - If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, False, "", Observaciones) Then + If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, False, "", Observaciones, CveRubro:=1) Then If Autorizado Then Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", @@ -1809,25 +1813,59 @@ Partial Class Contratos_ContratoObra Dim Row As DataRow = TmpDT.NewRow() Row("Cantidad") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero Row("CantidadContratada") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero - Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero - Row("UM") = DdlUMInsumos.SelectedItem - Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue - Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem - Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero - Row("PS") = DdlProductowsInsumos.SelectedText - Row("CodigoPS") = DdlProductowsInsumos.SelectedText + Row("PU") = TxtPUInsumos.Text.ToDouble.FormatoNumero Row("Total") = (TxtCantidadInsumos.Text.ToDouble * TxtPUInsumos.Text.ToDouble).FormatoNumero Row("CveTipoPresupuesto") = 1 Row("NoIdentificacion") = "" 'TxtNoIdentificacionvInsumos.Text.Trim Row("LimitarCantidad") = False + Row("CveRubro") = DdlRubro.SelectedValue.ToEntero + Row("Rubro") = DdlRubro.SelectedItem.Text + + If DdlRubro.SelectedValue.ToEntero = 3 Then + Row("CveActividad") = DdlActividades.SelectedValue.ToEntero + Row("Actividad") = DdlActividades.SelectedItem.Text + Row("Dias") = TxtDias.Text.ToEntero + Row("CveSubTipoActivoFijo") = -1 + + + Row("CveUM") = -1 + Row("UM") = "" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = DdlActividades.SelectedItem.Text + Row("CodigoPS") = DdlActividades.SelectedItem.Text + + Else + Row("CveActividad") = -1 + Row("Actividad") = "" + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + + + Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero + Row("UM") = DdlUMInsumos.SelectedItem + Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue + Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem + Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero + Row("PS") = DdlProductowsInsumos.SelectedText + Row("CodigoPS") = DdlProductowsInsumos.SelectedText + + + + End If + + Dim ObjContratos As New ClsContratos - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "") Then - If Autorizado Then - Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) - guardarBitacora(msj) - End If + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", + CveRubro:=Row("CveRubro").ToString.ToEntero, CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then + 'If Autorizado Then + ' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) + ' guardarBitacora(msj) + 'End If + Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") TmpDT.Rows.Add(Row) Dim TotalRow = Row("Total").ToString.ToDouble @@ -1856,22 +1894,34 @@ Partial Class Contratos_ContratoObra Dim Cantidad, PU As Double Dim CvePS, CveUM As Integer - 'Dim NoIdentificacion As String = "" - 'Dim LimitarCantidad As Boolean + + Dim CveRubro As Integer = DdlRubro.SelectedValue.ToEntero + + Dim CveActividad As Integer = -1 + Dim CveSubTipoActivoFijo As Integer = -1 + Dim Dias As Integer = 0 + + If CveRubro = 3 Then + + CveActividad = DdlActividades.SelectedValue.ToEntero + Dias = TxtDias.Text.ToEntero + + CvePS = -1 + CveUM = -1 + Else + CvePS = DdlProductowsInsumos.SelectedValue.ToEntero + CveUM = DdlUMInsumos.SelectedValue.ToEntero + End If + Cantidad = TxtCantidadInsumos.Text.ToDouble PU = TxtPUInsumos.Text.ToDouble - CvePS = DdlProductowsInsumos.SelectedValue.ToEntero - CveUM = DdlUMInsumos.SelectedValue.ToEntero - 'NoIdentificacion = TxtNoIdentificacionvInsumos.Text.Trim - 'LimitarCantidad = If(ChkLimitarInsumos.Checked, True, False) + Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0) - - Dim ObjContratos As New ClsContratos - If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "") Then + If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "", CveRubro:=CveRubro, CveActividad:=CveActividad, CveSubTipoActivoFijo:=CveSubTipoActivoFijo, Dias:=Dias) Then If Autorizado Then Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", @@ -4018,17 +4068,10 @@ Partial Class Contratos_ContratoObra Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) LimpiarModalVentas() - 'CveContratoDetalle,CveUM,CvePS,Cantidad,PU,CveTipoPresupuesto,CveClasificacion,CodigoPS,LimitarCantidad - CveContratoDetalleEditar = GvRow.DataKey("CveContratoDetalle").ToEntero - - 'TxtOCInterna.Text = GvRow.DataKey("OCInterna") TxtCantidad.Text = GvRow.DataKey("CantidadContratada").ToDouble.ToString - 'ChkLimitarVenta.Checked = Boolean.Parse(GvRow.DataKey("LimitarCantidad")) - - 'TxtNoIdentificacionv.Text = GvRow.DataKey("NoIdentificacion").ToDouble.ToString DdlClasificacionAdd.SelectedValueExist(GvRow.DataKey("CveClasificacion").ToEntero) DdlProductows.txtText.Value = GvRow.DataKey("PS").ToString @@ -4050,14 +4093,17 @@ Partial Class Contratos_ContratoObra RegistraScript("$('#ModalVentasAddPS').modal('show')") End Sub Protected Sub LnkEditarPresupuestoControlDetalle_Click(sender As Object, e As EventArgs) + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + + Dim CveRubro As Integer = gvRow.DataKey("CveRubro").ToEntero + LimpiarModalControl() CveContratoDetalleEditar = gvRow.DataKey("CveContratoDetalle").ToEntero TxtCantidadInsumos.Text = gvRow.DataKey("CantidadContratada").ToDouble.ToString - 'ChkLimitarInsumos.Checked = Boolean.Parse(gvRow.DataKey("LimitarCantidad")) - ' TxtNoIdentificacionvInsumos.Text = gvRow.DataKey("NoIdentificacion") + DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero) @@ -4069,16 +4115,42 @@ Partial Class Contratos_ContratoObra DdlUMInsumos.DataBind() DdlUMInsumos.SelectedValueExist(gvRow.DataKey("CveUM").ToDouble.ToString) - - TxtPUInsumos.Text = gvRow.DataKey("PU").ToDouble.ToString + DdlRubro.SelectedValueExist(gvRow.DataKey("CveRubro").ToString) + + If CveRubro = 3 Then + + DVDias.Visible = True + DVActividadesRH.Visible = True + + DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + + DdlActividades.SelectedValueExist(gvRow.DataKey("CveActividad")) + TxtDias.Text = gvRow.DataKey("Dias") + Else + DVDias.Visible = False + DVActividadesRH.Visible = False + + DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + DdlActividades.SelectedValueExist(-1) + TxtDias.Text = "0" + + End If + ModalControlPSAdd = False ChkContinualAgregandoControl.Visible = False ChkContinualAgregandoControl.Checked = False + UpModalControlAddPS.Update() + RegistraScript("$('#ModalControlAddPS').modal('show')") End Sub @@ -4108,7 +4180,12 @@ Partial Class Contratos_ContratoObra End Sub Private Sub LimpiarModalControl() + DdlActividades.Items.Clear() + DdlActividades.DataSource = GlobalDTRHActividades(UsuarioActual.CveEmpresa) + DdlActividades.DataBind() + + DdlActividades.Items.Insert(0, New ListItem("Seleccione una", "-1")) TxtCantidadInsumos.Text = "" 'ChkLimitarInsumos.Checked = False @@ -4120,6 +4197,21 @@ Partial Class Contratos_ContratoObra DdlUMInsumos.SelectedValueExist(-1) TxtPUInsumos.Text = "" + DdlRubro.SelectedValue = "2" + ' DdlRubro_SelectedIndexChanged(Nothing, Nothing) + + + DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + DVDias.Visible = False + DVActividadesRH.Visible = False + + TxtDias.Text = "" + DdlActividades.SelectedValueExist(-1) + + If ModalControlPSAdd = True Then LtlModalControlPSTitulo.Text = "Agregar Producto Presupuesto Control" @@ -4142,8 +4234,8 @@ Partial Class Contratos_ContratoObra If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then - DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto") + DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto") If DTCargaPresupuesto.Rows.Count > 0 Then ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing) @@ -4151,7 +4243,6 @@ Partial Class Contratos_ContratoObra Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) End If - Else DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos") @@ -4257,6 +4348,7 @@ Partial Class Contratos_ContratoObra DTCargaPresupuestoFlotillas.CaseSensitive = False End If + Dim ErrorProceso = False @@ -4372,7 +4464,8 @@ Partial Class Contratos_ContratoObra Row("Observacion") = "" DTPS.Rows.Add(Row) - + Else + ErrorProceso = True End If Next @@ -4380,44 +4473,77 @@ Partial Class Contratos_ContratoObra - If Not DTCargaPresupuestoManoObra Is Nothing Then + If Not DTCargaPresupuestoManoObra Is Nothing And Not ErrorProceso Then For Each DrowPS As DataRow In DTCargaPresupuestoManoObra.Rows Dim CveActividad As Integer = 0 + Dim Actividad As String - CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero - If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then + If DrowPS("Actividad").ToString.Trim.Length > 0 Then + GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing + CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero - Dim Row As DataRow = DTPS.NewRow() - Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble - Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble - Row("CveUM") = -1 - Row("UM") = "" - Row("CveClasificacion") = -1 - Row("Clasificacion") = "" - Row("CvePS") = -1 - Row("PS") = DrowPS("Actividad").ToString - Row("CodigoPS") = DrowPS("Actividad").ToString - Row("PU") = DrowPS("PU").ToString.ToDouble - Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + If CveActividad <= 0 Then - Row("CveTipoPresupuesto") = 2 - Row("CveRubro") = 3 - Row("CveActividad") = CveActividad - Row("CveSubTipoActivoFijo") = -1 - Row("Dias") = DrowPS("Dias").ToString.ToEntero - Row("NoIdentificacion") = "" - Row("OCInterna") = "" - Row("LimitarCantidad") = 0 - Row("Observacion") = "" + Dim ObjRH As New ClsRH() - DTPS.Rows.Add(Row) + If ObjRH.AddActividades(DrowPS("Actividad").ToString.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + CveActividad = ObjRH.CveActividad + + If CveActividad <= 0 Then + ErrorProceso = True + End If + + GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing + + Else + ErrorProceso = True + End If + + ObjRH.Dispose() + + End If + + + If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 And Not ErrorProceso Then + + Actividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Actividad", $" CveActividad = {CveActividad}") + + Dim Row As DataRow = DTPS.NewRow() + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = -1 + Row("UM") = "Actividad RH" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = Actividad + Row("CodigoPS") = Actividad + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 3 + Row("CveActividad") = CveActividad + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = DrowPS("Dias").ToString.ToEntero + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + + End If End If + + Next End If @@ -4426,101 +4552,114 @@ Partial Class Contratos_ContratoObra End If - Dim ErrorProceso = False - Dim ObjContratos As New ClsContratos - Dim TotalRow As Double = 0 - ObjContratos.IniciaTransacSQL() - - For Each Row As DataRow In DTPS.Rows - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, - Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero, - CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then + If Not ErrorProceso Then - If Autorizado Then - Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro")) - guardarBitacora(msj) + Dim ObjContratos As New ClsContratos + Dim TotalRow As Double = 0 + ObjContratos.IniciaTransacSQL() + + For Each Row As DataRow In DTPS.Rows + + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, + Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero, + CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then + + If Autorizado Then + Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro")) + guardarBitacora(msj) + End If + + Dim NrowTmpDT As DataRow = TmpDT.NewRow + + + NrowTmpDT("Cantidad") = Row("Cantidad") + NrowTmpDT("CantidadContratada") = Row("CantidadContratada") + NrowTmpDT("CveUM") = Row("CveUM") + NrowTmpDT("UM") = Row("UM") + NrowTmpDT("CveClasificacion") = Row("CveClasificacion") + NrowTmpDT("Clasificacion") = Row("Clasificacion") + NrowTmpDT("CvePS") = Row("CvePS") + + + NrowTmpDT("PS") = Row("PS") + NrowTmpDT("CodigoPS") = Row("CodigoPS") + + + + + NrowTmpDT("PU") = Row("PU") + NrowTmpDT("Total") = Row("Total") + NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") + NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion") + NrowTmpDT("OCInterna") = Row("OCInterna") + NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") + NrowTmpDT("Observacion") = Row("Observacion") + + NrowTmpDT("CveRubro") = Row("CveRubro") + NrowTmpDT("CveActividad") = Row("CveActividad") + NrowTmpDT("CveSubTipoActivoFijo") = Row("CveSubTipoActivoFijo") + + NrowTmpDT("Rubro") = Row("Rubro") + NrowTmpDT("Actividad") = Row("Actividad") + NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo") + + + NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") + + TmpDT.Rows.Add(NrowTmpDT) + TmpDT.AcceptChanges() + + TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble + Else + ErrorProceso = True + Exit For End If - - Dim NrowTmpDT As DataRow = TmpDT.NewRow + Next - NrowTmpDT("Cantidad") = Row("Cantidad") - NrowTmpDT("CantidadContratada") = Row("CantidadContratada") - NrowTmpDT("CveUM") = Row("CveUM") - NrowTmpDT("UM") = Row("UM") - NrowTmpDT("CveClasificacion") = Row("CveClasificacion") - NrowTmpDT("Clasificacion") = Row("Clasificacion") - NrowTmpDT("CvePS") = Row("CvePS") - NrowTmpDT("PS") = Row("PS") - NrowTmpDT("CodigoPS") = Row("CodigoPS") - NrowTmpDT("PU") = Row("PU") - NrowTmpDT("Total") = Row("Total") - NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") - NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion") - NrowTmpDT("OCInterna") = Row("OCInterna") - NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") - NrowTmpDT("Observacion") = Row("Observacion") - - NrowTmpDT("CveRubro") = Row("CveRubro") - NrowTmpDT("CveActividad") = Row("CveActividad") - NrowTmpDT("CveSubTipoActivoFijo") = Row("CveSubTipoActivoFijo") - - NrowTmpDT("Rubro") = Row("Rubro") - NrowTmpDT("Actividad") = Row("Actividad") - NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo") - - - NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") - - TmpDT.Rows.Add(NrowTmpDT) - TmpDT.AcceptChanges() - - TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble + If ErrorProceso Then + ObjContratos.RollBack() + Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError) Else - ErrorProceso = True - Exit For + + ObjContratos.Commit() + Alert("Presupuesto Cargado correctamente") + + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Ventas + CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) + UpGV.Update() + Exit Select + Case EnumTipoCargaPresupuesto.Control + CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) + UpGVInsumos.Update() + Exit Select + Case Else + + End Select + + LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero + LblImporte.Text = LbTotalGeneral.Text + UpGral.Update() + End If - Next + ObjContratos.Dispose() - If ErrorProceso Then - ObjContratos.RollBack() - Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError) - Else - - ObjContratos.Commit() - Alert("Presupuesto Cargado correctamente") - - - Select Case TipoCargaPresupuesto - Case EnumTipoCargaPresupuesto.Ventas - CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - UpGV.Update() - Exit Select - Case EnumTipoCargaPresupuesto.Control - CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) - UpGVInsumos.Update() - Exit Select - Case Else - - End Select - - LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero - LblImporte.Text = LbTotalGeneral.Text - UpGral.Update() End If - ObjContratos.Dispose() - If RowNoEncontrados.Length > 0 Then Alert($"Productos no encontrados
{RowNoEncontrados} ") End If + + End Sub @@ -4784,10 +4923,6 @@ Partial Class Contratos_ContratoObra End Try - - - - DVGraficas.Visible = True UpGrafica.Update() @@ -4797,6 +4932,29 @@ Partial Class Contratos_ContratoObra + Protected Sub DdlRubro_SelectedIndexChanged(sender As Object, e As EventArgs) + + + If DdlRubro.SelectedValue.ToEntero = 3 Then + DVDias.Visible = True + DVActividadesRH.Visible = True + + DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + Else + DVDias.Visible = False + DVActividadesRH.Visible = False + + DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + End If + + UpModalControlAddPS.Update() + + End Sub End Class From a380977f663203949c30e9513e4f8e3f47dbe912 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Sat, 12 Dec 2020 12:15:27 -0700 Subject: [PATCH 4/8] Compras viaticos solo mostrar personal activo --- Compras/Compras.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index fb272a042..af6b2a37b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1314,7 +1314,7 @@ Partial Class Compras_Compras Dim ObjPersonal As New ClsRH ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) DdlPersonal.DataSource = ObjPersonal.DtResultados - DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados + DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1") ObjPersonal.Dispose() DdlPersonal.DataBind() DdlPersonalReembolso.DataBind() From 388b7fbb27b03d21b7b04d120b7ef23f4311e94e Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sat, 12 Dec 2020 17:45:05 -0700 Subject: [PATCH 5/8] retirando cambios en el inventario fisico --- Inventarios/InventarioFisicoDetalle.aspx.vb | 60 ++++++++++----------- Inventarios/RepAnomalias.aspx.vb | 3 +- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index a5abf5a98..a3a248298 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -328,37 +328,37 @@ Partial Class Inventarios_InventarioFisicoDetalle End If FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString) End If - If AplicaSeccion Then - Dim ObjInv As New ClsInventarios - Dim SeccionesAlmacenDelProducto As New DataTable - If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then - SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes)) - End If - 'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes)) - 'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString) - If SeccionesAlmacenDelProducto.Rows.Count = 1 Then - CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen") - Else - divSeccion.Visible = AplicaSeccion - If DdlSeccionAlmacen.Items.Count = 0 Then - DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto - DdlSeccionAlmacen.DataBind() - DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If + 'If AplicaSeccion Then + ' Dim ObjInv As New ClsInventarios + ' Dim SeccionesAlmacenDelProducto As New DataTable + ' If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then + ' SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes)) + ' End If + ' 'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes)) + ' 'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString) + ' If SeccionesAlmacenDelProducto.Rows.Count = 1 Then + ' CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen") + ' Else + ' divSeccion.Visible = AplicaSeccion + ' If DdlSeccionAlmacen.Items.Count = 0 Then + ' DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto + ' DdlSeccionAlmacen.DataBind() + ' DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) + ' End If - If DdlSeccionAlmacen.SelectedValue = "-1" Then - RfvSeccionAlmacen.Enabled = True - RfvSeccionAlmacen.Visible = True - RfvSeccionAlmacen.SetFocusOnError = True - RfvSeccionAlmacen.Validate() - RfvSeccionAlmacen.ValidationGroup = " " - Exit Sub - End If - CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero - End If - ObjInv.Dispose() - SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen)) - End If + ' If DdlSeccionAlmacen.SelectedValue = "-1" Then + ' RfvSeccionAlmacen.Enabled = True + ' RfvSeccionAlmacen.Visible = True + ' RfvSeccionAlmacen.SetFocusOnError = True + ' RfvSeccionAlmacen.Validate() + ' RfvSeccionAlmacen.ValidationGroup = " " + ' Exit Sub + ' End If + ' CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero + ' End If + ' ObjInv.Dispose() + ' SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen)) + 'End If RFVSerie.ValidationGroup = "GrpIngresar" RFVSerie.Enabled = False diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index 12433a1ec..57f6afc1a 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -194,9 +194,10 @@ Partial Class Inventarios_RepAnomalias e.Row.Cells(8).Text = "0" End If - If e.Row.Cells(7).Text = MinFecha Then + If e.Row.Cells(7).Text = MinFecha.ToString Then e.Row.Cells(7).Text = "" End If + e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1 End If From 66d671bc0f4cca250589f939f8b8ce6805572144 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 14 Dec 2020 12:00:45 -0700 Subject: [PATCH 6/8] Ventas contratos Egresos --- Compras/ReembolsosComprobaciones.aspx.vb | 49 ++++++++++++++---------- Ventas/Ventas.aspx | 4 +- Ventas/Ventas.aspx.vb | 14 +++++-- vwd.webinfo | 4 ++ 4 files changed, 45 insertions(+), 26 deletions(-) diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index f5d83d58c..4b00fbc2c 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -93,33 +93,40 @@ Partial Class Compras_ReembolsosComprobaciones Dim ObjPersonal As New ClsRH ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) - DdlPersonal.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1") - ObjPersonal.Dispose() - DdlPersonal.DataBind() - CargaTipoTransaccion() - - If UsuarioActual.Empresa.Funcionalidad(506) = "1" Then - CbPermitirExcedente.Visible = True + If UsuarioActual.CveEmpresa.Contiene(119, 158) Then + DdlPersonal.DataSource = ObjPersonal.DtResultados Else - CbPermitirExcedente.Visible = False + DdlPersonal.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1") End If - If UsuarioActual.CveEmpresa.Contiene(1, 4, 7, 11, 12, 72, 80, 119) Then - rowComisiones.Visible = True + + ObjPersonal.Dispose() + DdlPersonal.DataBind() + + CargaTipoTransaccion() + + If UsuarioActual.Empresa.Funcionalidad(506) = "1" Then + CbPermitirExcedente.Visible = True + Else + CbPermitirExcedente.Visible = False + End If + + If UsuarioActual.CveEmpresa.Contiene(1, 4, 7, 11, 12, 72, 80, 119) Then + rowComisiones.Visible = True + End If + + If UsuarioActual.CveEmpresa = 119 Then + ChkReembolsarSinBancos.Visible = True + End If + + TxtFechaPrePoliza.Text = Date.Now.ToShortDateString + + 'CargaCuentasDiferencia() + + 'TableDiferencia.Visible = False End If - If UsuarioActual.CveEmpresa = 119 Then - ChkReembolsarSinBancos.Visible = True - End If - - TxtFechaPrePoliza.Text = Date.Now.ToShortDateString - - 'CargaCuentasDiferencia() - - 'TableDiferencia.Visible = False - End If - End Sub #Region " FILTROS " diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 08553cbad..4dc1dfa02 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -2822,9 +2822,9 @@
- - <%----%> + +
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 215665354..063add67b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9115,7 +9115,7 @@ Partial Class Ventas ObjFactura.NumeroPersonas = 0 - If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Then + If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Egs" And DdlContratosModal.SelectedValue.ToEntero > 0 Then CveContrato = DdlContratosModal.SelectedValue.ToEntero End If @@ -16384,6 +16384,10 @@ Partial Class Ventas Dim TotalCalculableImpuestosIVA As Decimal = 0 PU = PU.RoundAD(6) ' el precio unitario puede llevar hasta 6 decimales permitidos + If Not TmpDT.Columns.Contains("RetIVA") Then + TmpDT.Columns.Add("RetIVA", GetType(Decimal)) + End If + Row = TmpDT.NewRow() Row("CveProyecto") = CveProyecto Row("Proyecto") = Proyecto @@ -16510,7 +16514,11 @@ Partial Class Ventas Row("IVA") = Row("PorcentajeIVA") Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales) Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales) + + + Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales) + Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales) Row("PorcentajeRetIVA") = ClienteRetIVA Row("PorcentajeRetISR") = ClienteRetISR @@ -28702,11 +28710,11 @@ Partial Class Ventas Alert("Se selecciono un contrato de obra, para continuar seleccione una estimación.", TipoMensaje.MsgAdvertencia) End If - ElseIf DdlTipoComprobante.SelectedValue = "Ant" Then + ElseIf DdlTipoComprobante.SelectedValue = "Ant" Or DdlTipoComprobante.SelectedValue = "Egs" Then Respuesta = True Else Alert("Tipo de documento no valido para contratos de obra.", TipoMensaje.MsgAdvertencia) - Respuesta = True + Respuesta = False End If Else diff --git a/vwd.webinfo b/vwd.webinfo index ce767c892..02418376d 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -140,6 +140,10 @@ + + + + From 164d37d7df3ab87cee9194563b483db51a362fda Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 14 Dec 2020 19:40:27 -0700 Subject: [PATCH 7/8] Contatos Compras --- App_Code/ClsCompras.vb | 12 ++++---- Compras/Compras.aspx | 61 +++++++++++++++++++++++++++++++++++++++++ Compras/Compras.aspx.vb | 52 ++++++++++++++++++++++++++++++++++- 3 files changed, 119 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 0fe3e20d1..277667dc0 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -195,7 +195,8 @@ Public Class ClsCompras AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional IdPoliza As Integer = -1, Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1, Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, - Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1) As Boolean + Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1, + Optional CveContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -246,6 +247,7 @@ Public Class ClsCompras .Add("@TotalOriginal", SqlDbType.Money).Value = TotalOriginal .Add("@CveTipoConcepto", SqlDbType.Int).Value = CveTipoConcepto .Add("@CveFactura", SqlDbType.Int).Value = CveFactura + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato End With Try @@ -267,10 +269,9 @@ Public Class ClsCompras Return Retorno End Function Public Function UpdateCompra(Descripcion As String, FolioSecundario As String, FechaVencimiento As Date, AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, - Descuento As Double, SubTotal As Double, IVA As Double, Total As Double, CveUsuario As Integer, - CveCompra As Integer, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, - Optional CveProveedorSucursal As Integer = -1, Optional PorcentajeIVA As Double = 0, - Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveFactura As Integer = -1) As Boolean + Descuento As Double, SubTotal As Double, IVA As Double, Total As Double, CveUsuario As Integer, CveCompra As Integer, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, + Optional CveProveedorSucursal As Integer = -1, Optional PorcentajeIVA As Double = 0, Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False, + Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -297,6 +298,7 @@ Public Class ClsCompras .Add("@CveTipoCompra", SqlDbType.Int).Value = CveTipoCompra .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible .Add("@CveFactura", SqlDbType.Int).Value = CveFactura + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato End With Try diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index d0118d925..b5bfea7dd 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -80,6 +80,17 @@ + + + + +
  • + Contratos +
  • + +
    +
    + @@ -5134,10 +5145,60 @@
    + + + + + + + + + + + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index af6b2a37b..596aa860d 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1165,6 +1165,26 @@ Partial Class Compras_Compras End Set End Property + + Private Property CveContratoObra As Integer + Get + If ViewState("CveContratoObra") Is Nothing Then + Return -1 + Else + Return ViewState("CveContratoObra").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveContratoObra") = value + End Set + End Property + + + + + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then 'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip") @@ -1186,6 +1206,7 @@ Partial Class Compras_Compras CveConceptoContableAlmacen = 0 EsNoDeducible = False CveTipoConcepto = 1 + CargaContratos() '******** Prorrateo ******************************************** If UsuarioActual.Empresa.Funcionalidad(117) <> "" Then btnProrateo.Visible = True @@ -1442,6 +1463,8 @@ Partial Class Compras_Compras DivEsNoDeducible.Visible = True DivActualizarVincular.Visible = True + 'LiAccionesContratos.Visible = False + Else ViewState("CveProveedor") = -1 @@ -4636,7 +4659,7 @@ Partial Class Compras_Compras TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen, - CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto) Then + CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, CveContrato:=CveContratoObra) Then ViewState("CveCompra") = ObjCompras.CveCompra If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString @@ -16597,12 +16620,19 @@ Partial Class Compras_Compras Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs) + LiAccionesContratos.Visible = False If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then If DdlTipoComprobante.SelectedValue = "NC" Then DivReembolso.Visible = False RBLPago.Items(2).Enabled = False + + + If Not CveCompra > 0 Then + LiAccionesContratos.Visible = True + End If + Else DivReembolso.Visible = True RBLPago.Items(2).Enabled = True @@ -16626,6 +16656,8 @@ Partial Class Compras_Compras End If + + UpAccionesContratos.Update() UPCondicionesPago.Update() End Sub @@ -20441,6 +20473,24 @@ Partial Class Compras_Compras End If Return True End Function + + + Private Sub CargaContratos() + DdlContrato.DataSource = GlobalDTContratos.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveContratoTipo IN(30,31) ") + DdlContrato.DataBind() + DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1")) + End Sub + + Protected Sub BtnModalContratos_Click(sender As Object, e As EventArgs) + + RegistraScript("$('#DvModalContratos').modal('hide');") + CveContratoObra = DdlContrato.SelectedValue.ToEntero + + + End Sub + Protected Sub LnkContratos_Click(sender As Object, e As EventArgs) + RegistraScript("$('#DvModalContratos').modal('show');") + End Sub End Class Public Class MMensajeDevolucion From b332d9b83d6e278db778dd3d0ed18c80d48fb214 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Tue, 15 Dec 2020 15:18:02 -0700 Subject: [PATCH 8/8] ClientesAbonar --- Ventas/ClientesAbonar.aspx | 12 ++++++++++-- Ventas/ClientesAbonar.aspx.vb | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx index b3a9d6d14..6887e39d7 100644 --- a/Ventas/ClientesAbonar.aspx +++ b/Ventas/ClientesAbonar.aspx @@ -261,7 +261,7 @@ @@ -358,7 +358,15 @@ CveVenta - + + + + + + + Complemento Pago + + diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 98735344f..8b4334e83 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -636,6 +636,17 @@ Partial Class Ventas_ClientesAbonar e.Row.FCCheckBox("Chk").Visible = False End If + + If e.Row.DBCampo("CveVenta").ToEntero > 0 Then + If e.Row.DataKey("ClaveMetodoPagoSAT") = "PUE" Then + e.Row.FCLinkButton("LnkComplemento").Text = "" + e.Row.FCLinkButton("LnkComplemento").CssClass = "text-danger" + End If + Else + e.Row.FCLinkButton("LnkComplemento").Visible = False + End If + + End If End Sub @@ -2505,6 +2516,18 @@ Partial Class Ventas_ClientesAbonar 'For i = 0 To CveVentas.Count - 1 Dim ObjBancos As New ClsBancos + + + If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, If(CveIESustitucion > 0, 2, 1), UsuarioActual.CveEmpresa, -1) Then + If Not ObjBancos.DtResultados.Rows.Count > 0 Then + ObjBancos.Dispose() + Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia) + Return "" + End If + End If + + + ObjBancos.IniciaTransacSQL() If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=If(CveIESustitucion > 0, True, False)) Then