From 81c2c36a14798432a9ff5308a5990ac47997d2ba Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Nov 2024 10:46:38 -0700 Subject: [PATCH 01/18] -- mensaje para evitar que se cambie a enviado, si no tiene el movimiento de salida. --- Acumuladores/CatFoliosGarantia.aspx | 1 + Acumuladores/CatFoliosGarantia.aspx.vb | 51 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index b0d679f5a..13f18fd12 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -265,6 +265,7 @@ +
diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb index e2b64d68d..ad11b7002 100644 --- a/Acumuladores/CatFoliosGarantia.aspx.vb +++ b/Acumuladores/CatFoliosGarantia.aspx.vb @@ -98,19 +98,20 @@ Partial Class Acumuladores_CatFoliosGarantia End Sub - Protected Sub BtnAgregarFolioGarantiaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantiaModal.Click - - Dim ObjAcum As New ClsAcumuladores - - 'Dim Cargo, Bonificacion, Compra, Puntos As Decimal - - 'Cargo = If(TxtCargo.Text.ToDecimal > 0, TxtCargo.Text.ToDecimal, -1) - 'Bonificacion = If(TxtBonificacion.Text.ToDecimal > 0, TxtBonificacion.Text.ToDecimal, -1) - 'Compra = If(TxtCompra.Text.ToDecimal > 0, TxtCompra.Text.ToDecimal, -1) - 'Puntos = If(TxtPuntos.Text.ToDecimal > 0, TxtPuntos.Text.ToDecimal, -1) - - - If Not Actualizar Then + Protected Sub BtnAgregarFolioGarantiaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantiaModal.Click + + + + 'Dim Cargo, Bonificacion, Compra, Puntos As Decimal + + 'Cargo = If(TxtCargo.Text.ToDecimal > 0, TxtCargo.Text.ToDecimal, -1) + 'Bonificacion = If(TxtBonificacion.Text.ToDecimal > 0, TxtBonificacion.Text.ToDecimal, -1) + 'Compra = If(TxtCompra.Text.ToDecimal > 0, TxtCompra.Text.ToDecimal, -1) + 'Puntos = If(TxtPuntos.Text.ToDecimal > 0, TxtPuntos.Text.ToDecimal, -1) + + + If Not Actualizar Then + Dim ObjAcum As New ClsAcumuladores If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then TxtFolioGarantia.Text = "" @@ -128,8 +129,16 @@ Partial Class Acumuladores_CatFoliosGarantia Alert("Folio de Garantía Agregado Correctamente", TipoMensaje.MsgInformacion) Else Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError) - End If - Else + End If + ObjAcum.Dispose() + Else + 'si se marca como enviado, debe de revisar que tenga el movto de traslado + If HdnCveMovimientoSalida.Value = "" AndAlso DdlEstatusEditar.SelectedValue = "2" Then + Alert("No se ha realizado la salida del almacen de garantía, al de 'devolución al proveedor'.
Favor de aplicar la salida y luego cambiar el estatus a enviado. ", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim ObjAcum As New ClsAcumuladores If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then @@ -149,14 +158,15 @@ Partial Class Acumuladores_CatFoliosGarantia Alert("Folio de Garantía Actualizado Correctamente", TipoMensaje.MsgInformacion) Else Alert("Ocurrió un error al Actualizar el Folio de Garantía", TipoMensaje.MsgError) - End If + End If + ObjAcum.Dispose() End If CveFolioGarantia = -1 - Actualizar = False - - ObjAcum.Dispose() - + Actualizar = False + + + End Sub Public Sub Remove_ClickFolioGarantia(sender As Object, e As EventArgs) @@ -188,6 +198,7 @@ Partial Class Acumuladores_CatFoliosGarantia TxtLimite.Text = GvRow.DataKey("Limite") DdlTipoFolioModal.SelectedValue = GvRow.DataKey("tipoFolio") DdlArea.SelectedValue = GvRow.DataKey("Area") + HdnCveMovimientoSalida.Value = GvRow.DataKey("CveMovimiento") 'TxtCargo.Text = GvRow.DataKey("Cargo").ToDecimal.ToString("###,###,###.00") 'TxtBonificacion.Text = GvRow.DataKey("Bonificacion").ToDecimal.ToString("###,###,###.00") 'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00") From 8070a634786f4f1e2470384a9a6f772ee209c7e5 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Nov 2024 10:46:59 -0700 Subject: [PATCH 02/18] mejora en tipos de periodos --- App_Code/ClsPaginas.vb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b85352d4c..d6093e399 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -2248,15 +2248,25 @@ Public Class ClsPaginas 'Fin Bancos 'Fin EstadoCIvil 'TipoPerioso - Property GlobalDTTipoPeriodo() As DataTable + Property GlobalDTTipoPeriodo(Optional Estatus As Integer = 1) As DataTable Get Dim AppNombre As String = "GlobalDTTipoPeriodo" If HttpContext.Current.Application(AppNombre) Is Nothing Then Using ObjNom As New ClsNominas() - If ObjNom.GetTiposPeriodos() Then Application(AppNombre) = ObjNom.DtResultados + If ObjNom.GetTiposPeriodos(-1) Then Application(AppNombre) = ObjNom.DtResultados End Using End If - GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + Dim filtros As New List(Of String) + If Estatus <> -1 Then filtros.Add($"CveEstatus = {Estatus}") + + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTTipoPeriodo = Dv.ToTable + Dv.Dispose() + Else + GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End If + End Get Set(value As DataTable) From 6fbd22649797062e7c1a953dabdd87c874658796 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Nov 2024 10:47:23 -0700 Subject: [PATCH 03/18] -- cambio en globaldttipoperiodo --- Nomina/CatPeriodos.aspx.vb | 11 ++++------- Nomina/ChecadorAsistencia.aspx.cs | 2 +- Nomina/MovimientosSUA.aspx.cs | 2 +- Nomina/ReportedeAcumulados.aspx.cs | 3 +-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Nomina/CatPeriodos.aspx.vb b/Nomina/CatPeriodos.aspx.vb index 6a5f39df1..320e9fcb9 100644 --- a/Nomina/CatPeriodos.aspx.vb +++ b/Nomina/CatPeriodos.aspx.vb @@ -40,8 +40,7 @@ Partial Class Nomina_CatPeriodos Public Sub CargaDatos() Dim ObjNom_Periodos As New ClsNominas If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero(), -1, -1, DdlEstatus.SelectedValue.ToEntero()) Then - ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - + ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados Else Me.GvDatos.DataSource = Nothing End If @@ -58,15 +57,13 @@ Partial Class Nomina_CatPeriodos #Region " C O M B O S" Private Sub CargaTipoPeriodo() - DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo - DdlTipoPeriodoAdd.DataSource = GlobalDTTipoPeriodo - DdlTipoPeriodoCM.DataSource = GlobalDTTipoPeriodo + DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo(-1) + DdlTipoPeriodoAdd.DataSource = GlobalDTTipoPeriodo(-1) + DdlTipoPeriodoCM.DataSource = GlobalDTTipoPeriodo(-1) DdlTipoPeriodo.DataBind() DdlTipoPeriodoAdd.DataBind() DdlTipoPeriodoCM.DataBind() - - End Sub Private Sub cargaEjercicios() diff --git a/Nomina/ChecadorAsistencia.aspx.cs b/Nomina/ChecadorAsistencia.aspx.cs index 44b5ab34a..bb6838006 100644 --- a/Nomina/ChecadorAsistencia.aspx.cs +++ b/Nomina/ChecadorAsistencia.aspx.cs @@ -60,7 +60,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas } private void CargaTiposPeriodo() { - DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'"); + DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodo(); DdlTipoPeriodo.DataBind(); DdlTipoPeriodo.Items.Insert(0, new ListItem("Todos", "-1")); if (DdlTipoPeriodo.Items.Count > 0) diff --git a/Nomina/MovimientosSUA.aspx.cs b/Nomina/MovimientosSUA.aspx.cs index dca56c321..0baa2250b 100644 --- a/Nomina/MovimientosSUA.aspx.cs +++ b/Nomina/MovimientosSUA.aspx.cs @@ -56,7 +56,7 @@ public partial class Nomina_MovimientosSUA : ClsPaginas private void CargaTiposPeriodo() { - DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'"); + DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodo(); DdlTipoPeriodo.DataBind(); DdlTipoPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1")); if (DdlTipoPeriodo.Items.Count > 0) diff --git a/Nomina/ReportedeAcumulados.aspx.cs b/Nomina/ReportedeAcumulados.aspx.cs index 44eeb98ea..46c7eaf91 100644 --- a/Nomina/ReportedeAcumulados.aspx.cs +++ b/Nomina/ReportedeAcumulados.aspx.cs @@ -157,7 +157,7 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas } private void CargaTiposPeriodo() { - DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'"); + DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodo(); DdlTipoPeriodo.DataBind(); DdlTipoPeriodo.Items.Insert(0, new ListItem("Todos", "-1")); if (DdlTipoPeriodo.Items.Count > 0) @@ -167,7 +167,6 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas } - public void cargaDatos() { int CveEmpresa = UsuarioActual.CveEmpresa; From 867607adc50d98d2645ea1667296cb16c8ade4ce Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Nov 2024 13:29:36 -0700 Subject: [PATCH 04/18] --verifica si existe columna --- General/SaldosIniciales.aspx.vb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 073f60a19..b04588b00 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -3061,15 +3061,14 @@ Partial Class General_SaldosIniciales If AgrupadoresSAT.Rows.Count > 0 Then - For Each Row As DataRow In dt.Rows Dim Cuenta As String = Row("Cuenta").ToString().Trim.Replace("-", "") If Cuenta <> "" Then NombreCuenta = Row("NombreCuenta").ToString().Trim CuentaPadre = Row("CuentaPadre").ToString().Trim.Replace("-", "") - CodigoVinculacion = Row("CodigoVinculacion").ToString().Trim + CodigoVinculacion = If(dt.Columns.Contains("CodigoVinculacion"), Row("CodigoVinculacion").ToString().Trim, "") - Dim TipoCuenta As String = Row("TipoCuenta").ToString().Trim + Dim TipoCuenta As String = Row("TipoCuenta").ToString().Trim.ToUpper Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString().Trim Dim CveCuentaPadre As Integer = -1 Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero()) From 3826935f0094a881fb36e2605cd2fcdd3e7b2a44 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Nov 2024 13:30:01 -0700 Subject: [PATCH 05/18] -- actualiza directamente remision especial --- App_Code/ClsVentas.vb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 767ffd089..58e6691f6 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -783,6 +783,24 @@ Public Class ClsVentas Return Retorno End Function + Public Function UpdateVentaRemisionEspecial(CveVenta As Integer, Num2 As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasRemisionEspecialUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@Num2", SqlDbType.Int).Value = Num2 + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la venta como remision especial.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function UpdateVentaAnticipoAutorizado(CveVenta As Integer, Autorizado As Boolean) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentaAnticipoAutorizadoUpdate") From 1f6655b91aa1716e9c810a88fd60cfca284e3a1f Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Nov 2024 13:30:12 -0700 Subject: [PATCH 06/18] =?UTF-8?q?--actualiza=20remisi=C3=B3n=20especial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx | 2 +- Ventas/Ventas.aspx.vb | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index dca78cecb..631fab0ae 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -870,7 +870,7 @@ - + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1fda30a4f..a0cb51500 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5245,24 +5245,17 @@ Partial Class Ventas EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString()) If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then - If DbRowVenta("Num2").ToString().ToEntero() = 2000 Then + If DbRowVenta("Num2").ToString = "2000" Then ChkRemEspecial.Checked = True ChkRemEspecial.Enabled = False TxtFech2.Text = DbRowVenta("Fech2").ToString() - TrRemEspecial.Visible = UsuarioActual.TienePermisoProceso(390) + End If + If UsuarioActual.TienePermisoProceso(390) Then + TrRemEspecial.Visible = True + ChkRemEspecial.Enabled = True End If End If - 'If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then - ' Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) - ' If TienePermiso <> "" Then ' si tiene acceso en el subproyecto - ' 'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175) - ' If UsuarioActual.TienePermisoProceso(264) Then - ' InicializaAplicaRNCDevolucion(TmpDT) - ' End If - ' End If - 'End If - Case "RNC" Trsaldo.Visible = True HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) @@ -39788,5 +39781,13 @@ Partial Class Ventas ' End Sub 'End Class + + Protected Sub ChkRemEspecial_CheckedChanged(sender As Object, e As EventArgs) + Dim objV As New ClsVentas + If objV.UpdateVentaRemisionEspecial(CveVenta, If(ChkRemEspecial.Checked, 2000, 0), Now.AddDays(7), UsuarioActual.CveEmpresa) Then + Alert("Se aplicó el cambio", TipoMensaje.ToastInformacion) + End If + objV.Dispose() + End Sub End Class From 63b251fe4d11c8f72c5187e83867b46f82d95f7b Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Nov 2024 09:32:50 -0700 Subject: [PATCH 07/18] =?UTF-8?q?--=20correcci=C3=B3n=20de=20concepto=20en?= =?UTF-8?q?=20la=20aplicaci=C3=B3n=20de=20NC=20de=20compra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d6093e399..2cfcde5e5 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9282,7 +9282,7 @@ Public Class ClsPaginas Select Case CveMoneda Case 1 'pesos Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 17, 308) - If TipoAplicacionPago.Contiene("NC", "DEV", "RNC") Then Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 22, 363) 'pago nota de crédito + If TipoAplicacionPago.Contiene("NC", "DEV", "RNC") Then Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 272, 363) 'pago nota de crédito Case 2 'dólares Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 312, 309) If TipoAplicacionPago.Contiene("NC", "DEV", "RNC") Then Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 304, 364) 'pago nota de crédito ME From f92083edcd9cbb64bf35b128f9900aa419628958 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 5 Nov 2024 08:25:18 -0700 Subject: [PATCH 08/18] Transportes Mejoras --- App_Code/ClsInventarios.vb | 23 ++ App_Code/ClsOIEventos.vb | 5 +- Compras/Compras.aspx.vb | 52 +++++ Compras/PopUpVerFactura.aspx.vb | 26 +++ Compras/eFacturas.aspx.vb | 21 +- OI/PopUpAgenda.aspx.vb | 8 +- RH/Personal.aspx.vb | 12 +- Sistemas/EmpresasModulos.aspx | 5 +- Sistemas/EmpresasModulos.aspx.vb | 27 ++- Transportes/RepContratoDetalle.aspx | 279 ++++++++++++++++++++---- Transportes/RepContratoDetalle.aspx.vb | 286 ++++++++++++++++++++++--- Transportes/RepContratos.aspx | 3 +- Transportes/RepContratos.aspx.vb | 20 ++ 13 files changed, 678 insertions(+), 89 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 966e36d81..59a28d0d3 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -6320,6 +6320,27 @@ Public Class ClsInventarios #End Region + + Public Function GetValidaFechaAlmacen(CveEmpresa As Integer, CveAlmacen As Integer, CvePS As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ValidaFechaAlmacenGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los productos por fechas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) @@ -6352,6 +6373,8 @@ Public Class ClsInventarios + + #End Region End Class diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 43dadaa3d..3f57aef6b 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2493,13 +2493,14 @@ Public Class ClsOIEventos Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1, Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1, Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1, - Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1) As Boolean + Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1, + Optional CveContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioPara, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe, CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto, CveCompra:=CveCompra, - CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento) + CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, CveContrato:=CveContrato) Return Retorno diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 5132a9e44..9a6939f25 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4481,6 +4481,10 @@ Partial Class Compras_Compras End If End If End If + + If Not ValidaFechaDeAlamacen() Then + Exit Sub + End If End If If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then @@ -7803,6 +7807,54 @@ Partial Class Compras_Compras End If End Sub + Private Function ValidaFechaDeAlamacen() As Boolean + Dim respuesta As Boolean = False + + + + Dim objInventario As New ClsInventarios + Dim MovimientosError As Boolean = False + + 'Dim SB As New StringBuilder + 'Dim FechaCompra As DateTime = TxtFecha.Text.ToDate + 'FechaCompra + Dim FechaMinima As DateTime = TxtFecha.Text.ToDate + + If DtInv IsNot Nothing Then + For Each Dr As DataRow In TmpDT.Rows + + Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero + + If CveTipoPS = 2 Then + If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=ddlAlmacenAdd.SelectedValue.ToEntero, CvePS:=Dr("CvePS").ToString.ToEntero) Then + + If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then + Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate + If FechamoMovimiento > FechaMinima Then + FechaMinima = FechamoMovimiento + End If + + End If + + End If + End If + + Next + End If + + objInventario.Dispose() + + If FechaMinima > TxtFecha.Text.ToDate Then + Alert($"Los productos tienen movientos, la fecha minima que se puede aplicar es {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia) + respuesta = False + Else + respuesta = True + End If + + Return respuesta + + End Function + Private Function GeneraStrinDoctosRelacionados() As String Dim DoctosRelacionados As String = "-1" diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 279619e3a..75a18080d 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -107,6 +107,32 @@ Partial Class PopUpVerFactura ImprimeFormatoCartaPorteTimbrado(Request("CVETIMBRE").ToString.ToEntero) End If + If Request("ArchivoContrato") IsNot Nothing AndAlso Request("ArchivoContrato") IsNot Nothing Then + + Dim ArchivoContrato As String = Decripta(Request("ArchivoContrato")) + Dim File As New FileInfo(ArchivoContrato) + + If File.Exists Then 'set appropriate headers + + Response.Clear() + Response.ClearHeaders() + Response.ClearContent() + Response.AddHeader("Content-Disposition", "inline; filename=" & $"{File.Name}") + Response.AddHeader("Content-Length", File.Length.ToString()) + 'Response.ContentType = "text/plain" + Response.ContentType = "application/octet-stream" + Response.Flush() + ' Response.TransmitFile(File.FullName) + Response.WriteFile(File.FullName) + Response.End() + + Else + + Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()") + + End If + End If + If Request("RFC") IsNot Nothing AndAlso Request("File") IsNot Nothing Then Dim Path As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), Request("File")) Dim Archivo As New System.IO.FileInfo(Path) diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 94837b32c..031d3d505 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -9036,16 +9036,23 @@ Namespace ADS.eFacturas Try Dim listaDS As New List(Of ReportDataSource) Dim rdsTotales As New ReportDataSource() - Dim ltotales As New List(Of utilValores)() + 'Dim ltotales As New List(Of utilValores)() Dim DTTotales As New DataTable DTTotales.TableName = "DTTotales" DTTotales.Columns.Add("Nombre") DTTotales.Columns.Add("Valor") - ltotales.Add(New utilValores("Subtotal", objxml.comprobante.SubTotal.ToString("N2"))) + Dim nRowSubtotales As DataRow = DTTotales.NewRow + nRowSubtotales("Nombre") = "Subtotal" + nRowSubtotales("Valor") = objxml.comprobante.SubTotal.ToString("N2") + DTTotales.Rows.Add(nRowSubtotales) + If objxml.comprobante.Descuento > 0 Then - ltotales.Add(New utilValores("Descuento", objxml.comprobante.Descuento.ToString("N2"))) + Dim nRowDescuento As DataRow = DTTotales.NewRow + nRowDescuento("Nombre") = "Descuento" + nRowDescuento("Valor") = objxml.comprobante.Descuento.ToString("N2") + DTTotales.Rows.Add(nRowDescuento) End If For Each item As CFDIImpuesto In objxml.Impuestos @@ -9053,8 +9060,6 @@ Namespace ADS.eFacturas If item.Importe > 0 Then Dim TasaOCuota As Decimal = 0 Decimal.TryParse(item.TasaOCuota, TasaOCuota) - ltotales.Add(New utilValores($"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}", item.Importe.ToString("N2"))) - nRow("Nombre") = $"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}" nRow("Valor") = item.Importe.ToString("N2") DTTotales.Rows.Add(nRow) @@ -9062,7 +9067,11 @@ Namespace ADS.eFacturas End If Next - ltotales.Add(New utilValores("Total", objxml.comprobante.Total.ToString("N2"))) + Dim nRowTotal As DataRow = DTTotales.NewRow + nRowTotal("Nombre") = "Subtotal" + nRowTotal("Valor") = objxml.comprobante.Total.ToString("N2") + DTTotales.Rows.Add(nRowTotal) + rdsTotales.Name = "dsTotales" rdsTotales.Value = DTTotales 'ltotales.ToDataTable listaDS.Add(rdsTotales) diff --git a/OI/PopUpAgenda.aspx.vb b/OI/PopUpAgenda.aspx.vb index 07487ed21..1d516cda5 100644 --- a/OI/PopUpAgenda.aspx.vb +++ b/OI/PopUpAgenda.aspx.vb @@ -716,6 +716,12 @@ Partial Class OI_PopUpAgenda CveMovimiento = Request("CveMovimiento").ToEntero End If + Dim CveContrato As Integer = -1 + If Request("CveContrato") IsNot Nothing AndAlso IsNumeric(Request("CveContrato")) AndAlso Request("CveContrato").ToEntero > 0 Then + CveContrato = Request("CveContrato").ToEntero + End If + + '------------------------------------------ 'Recorrro Grid para obtener el usuario PARA For Each RowPara As GridViewRow In GVUsuarios.Rows @@ -741,7 +747,7 @@ Partial Class OI_PopUpAgenda Alert("La Nueva Tarea se guardó correctamente.", TipoMensaje.MsgInformacion) End If ElseIf CveTipoEvento = 2 Then - If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveCompra:=CveCompra, CveVenta:=CveVenta, CveMovimiento:=CveMovimiento) Then + If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveCompra:=CveCompra, CveVenta:=CveVenta, CveMovimiento:=CveMovimiento, CveContrato:=CveContrato) Then Alert("La Nueva Agenda se guardó correctamente.", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") End If ElseIf CveTipoEvento = 3 Then diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index bba66e78a..6fa45cfb1 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1539,8 +1539,18 @@ Partial Class RH_Personal Private Sub CargaOutSourcing() + Dim DtModulosEmpresa As New DataTable + Dim ObjEmpresas As New ClsSisEmpresas + If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then + DtModulosEmpresa = ObjEmpresas.DtResultados + Else + DtModulosEmpresa = Nothing + End If + ObjEmpresas.Dispose() + + If UsuarioActual.CveEmpresa = 7 Then - DdlEmpresaAsignada.DataSource = GlobalDTEmpresas.FiltraParametros("CveEmpresa in (7,11,12,122,145,113)") + DdlEmpresaAsignada.DataSource = DtModulosEmpresa.FiltraParametros("CveEmpresa in (7,11,12,122,145,113)") DdlEmpresaAsignada.DataBind() DvOutsourcing.Visible = True End If diff --git a/Sistemas/EmpresasModulos.aspx b/Sistemas/EmpresasModulos.aspx index 3d1e9ed6e..d0933aa2b 100644 --- a/Sistemas/EmpresasModulos.aspx +++ b/Sistemas/EmpresasModulos.aspx @@ -20,7 +20,10 @@