diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index e74ffebca..62b5e8d2e 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1149,12 +1149,6 @@ Public Class ClsInventarios End With Try SqlAdapter.Fill(Data) - - If Data IsNot Nothing AndAlso Data.Rows.Count >= 1 Then - Dim dr As DataRow = Data.Rows(0) - CveSeccion = dr("CveSeccionAlmacen").ToString.ToEntero - End If - Retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener los movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) @@ -2952,7 +2946,7 @@ Public Class ClsInventarios DataAdapter("Vta_UpdateDevolucionVentaDetalle") With SqlAdapter.SelectCommand.Parameters - .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta + .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle .Add("@Valor", SqlDbType.Int).Value = Valor End With diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 586bd8874..54ee9c7b4 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -522,10 +522,28 @@ Public Class ClsNominas Return Retorno End Function + Public Function AutorizaNom_Nominas(CvePersonal As Integer, CvePeriodo As Integer, Optional Autorizado As Boolean = True) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Nom_Nominas_Autoriza") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al autorizar la nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function AddNom_Nominas(FolioNom As Integer, CveNominaTipo As Integer, CvePersonal As Integer, CvePeriodo As Integer, SubTotal As Double, Descuento As Double, RetISR As Double, Total As Double, CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, Fecha As Date, MotivoDescuento As String, Observaciones As String, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double, - Fech1 As Date, Fech2 As Date, Fech3 As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Fech1 As Date, Fech2 As Date, Fech3 As Date, CveUsuario As Integer, CveEmpresa As Integer, Optional Autorizado As Boolean = True) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_NominasAdd") @@ -555,6 +573,7 @@ Public Class ClsNominas .Add("@Fech3", SqlDbType.VarChar).Value = IIf(Fech3.ToString = "01/01/0001 12:00:00 a.m.", "-1", Fech3.ToString) .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With 'SqlTypes.SqlDateTime.Null diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6c1eaf2e6..fd1b013bf 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -851,14 +851,7 @@ Public Class ClsPaginas Application("GlobalDTLeyendasFiscales") = value End Set End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTFolios") = value - End Set - End Property + Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(Application("GlobalDTEstatusFactura"), DataTable) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 358cc7495..f0223a50f 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2298,10 +2298,36 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function + End Function + + Public Function AddAsistenciaMasiva2(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + Data = New DataTable + SqlDataAdapter("PA_RH_PersonalAsistenciasMasivaAddUpd2") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya se registró la Asistencia para el empleado.", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar la Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function #End Region - + #Region "Asistencias Detalles" Public Function GetAsistenciasDetalle() As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 4fae8a392..07f8fecbf 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6684,14 +6684,6 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value End Set End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(HttpContext.Current.Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFolios") = value - End Set - End Property Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable) diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index fa0c9409b..c1e46ead0 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -1,5 +1,5 @@ -<%@ WebHandler Language="VB" Class="SIGFacturacion" %> - +<%@ WebHandler Language="VB" Class="SIGFacturacion" %> + Imports System Imports System.Web Imports System.Net.Http @@ -212,8 +212,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState json.Add(New JProperty("Almacen", ObsInv.ToString())) Return json - End Function - + End Function + #Region "V A L I D A - D A T O S" Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario Dim UsuarioActual As Usuario = Nothing @@ -247,8 +247,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState UsuarioActual.Empresa = ObjEmpresa.Empresa End If ObjEmpresa.Dispose() - End Sub - + End Sub + #End Region #Region "D E F I N I R - O B J E T O S" Private Function CreaFactura(Resp As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DTRemisionesPS As DataTable, CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer, DatosRemisiones As JObject, FechaI As DateTime, FechaF As DateTime) As Modelos.Factura @@ -750,7 +750,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState 'RECARGAR GV Return Row - End Function + End Function #End Region #Region "E N V I O - C O R R E O" Private Sub EnviarCorreo(Objfactura As Modelos.Factura, UsuarioActual As Usuario) @@ -894,9 +894,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState End If End Try End If - End Sub + End Sub #End Region - + Public Sub GuardaLogFacturacion(Str As String) Dim ArchivoW As StreamWriter Dim strLineaTMP As String @@ -919,8 +919,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ArchivoW.Close() ArchivoW.Dispose() - End Sub - + End Sub + #Region "G L O B A L - D T" Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double Get @@ -1105,10 +1105,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTPSATPS") = value End Set - End Property - + End Property + #Region "GLOBALES DE SAT COMERCIO EXTERIOR" - + Property GlobalDTClavePedimento() As DataTable Get GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application("GlobalDTClavePedimento"), DataTable) @@ -1218,10 +1218,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTColonia") = value End Set - End Property - + End Property + #End Region - + Property GlobalDTPSATUM() As DataTable Get GlobalDTPSATUM = DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), DataTable) @@ -1605,15 +1605,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value End Set - End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(HttpContext.Current.Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFolios") = value - End Set - End Property + End Property + Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable) @@ -2354,9 +2347,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus") = value End Set - End Property - - + End Property + + #Region "***********************************************************************DT EVENTOS****************************************************************************************" Property GlobalDTTiposEventos() As DataTable Get @@ -2392,9 +2385,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOIEstatusEventos") = value End Set - End Property + End Property #End Region - + #Region " **********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable Get @@ -2435,9 +2428,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************" Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable Get @@ -2530,10 +2523,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoActivoFijo") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT GENERALES**************************************************************************************" Property GlobalDTGralPaises() As DataTable Get @@ -2621,10 +2614,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTGralColectivas") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable Get @@ -2833,8 +2826,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosTipos") = value End Set - End Property - + End Property + #Region " DT PROSPECTOS SOLICITUDES" Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable Get @@ -2901,15 +2894,15 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos") = value End Set - End Property - + End Property + #End Region #End Region - + #Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" - + #Region "***********************************************************************DT AMORTIZACIÓN CONTABLE*********************************************************************************************" - + Property GlobalDTAC_RubrosIngreso() As DataTable Get GlobalDTAC_RubrosIngreso = DirectCast(HttpContext.Current.Application("GlobalDTAC_RubrosIngreso"), DataTable) @@ -3165,11 +3158,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_MatrizEgresos") = value End Set - End Property - - + End Property + + #End Region - + Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3248,9 +3241,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_PD_Metas") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************" Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable Get @@ -3287,11 +3280,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value End Set - End Property - - + End Property + + #End Region - + #Region "F I N A N Z A S " Property GlobalDTFinan_RazonesFinancieras() As DataTable Get @@ -3300,10 +3293,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras") = value End Set - End Property + End Property #End Region - - + + #Region "***********************************************************************GLOBAL DT CONTABILIDAD****************************************************************************" Property GlobalDTContaPlantillasPolizas(CveEmpresa As Integer, Optional TipoPlantilla As Integer = -1) As DataTable Get @@ -3357,9 +3350,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTContaConceptosContables") = value End Set - End Property + End Property #End Region - + #Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************" Property GlobalDTAsistenciaDetalle() As DataTable Get @@ -3511,13 +3504,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoBuzon") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - C O M B U S T I B L E S ***********" - - - + + + Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3556,11 +3549,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(ByVal value As DataTable) HttpContext.Current.Application("GlobalDTCombustiblesTipos") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - M A N T E N I M I E N T O S ***********" - + Property GlobalDTMantenimientosTipos() As DataTable Get GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable) @@ -3599,13 +3592,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value End Set - End Property - + End Property + #End Region - - + + #Region "*********** D T - T A L L E R E S ***********" - + Property GlobalDTTalleresTipos() As DataTable Get GlobalDTTalleresTipos = DirectCast(HttpContext.Current.Application("GlobalDTTalleresTipos"), DataTable) @@ -3622,12 +3615,12 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTalleres") = value End Set - End Property - + End Property + #End Region - + #Region "*********** D T - D I S T R I B U I D O R E S ***********" - + Property GlobalDTDistribuidoresTipos() As DataTable Get GlobalDTDistribuidoresTipos = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidoresTipos"), DataTable) @@ -3644,11 +3637,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTDistribuidores") = value End Set - End Property - + End Property + #End Region - - + + Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3739,8 +3732,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTPaqueterias") = value End Set - End Property - + End Property + #End Region - + End Class \ No newline at end of file diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 552b2f736..69e205ef3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6591,7 +6591,7 @@ Partial Class Compras_Compras Next 'calcula la diferencia entre lo recibido por la OC, considerando costos indirectos y lo que se ingresaria en la compra - SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * 1).RoundSQL 'sumatoria de la factura + SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * TCO).RoundSQL 'sumatoria de la factura If SumatoriaOCINV.RoundSQL <> 0 Then ' se abona el costo, cambiamos su naturaleza 'SumatoriaOCINV = -SumatoriaOCINV diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index 7155797ae..b005a874d 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -19,6 +19,15 @@ Partial Class Contratos_FacturacionMasiva ViewState("DTCicloComercial") = value End Set End Property + Private Property FolioVigentes As Boolean + Get + Return CType(ViewState("FolioVigentes"), Boolean) + End Get + Set(value As Boolean) + ViewState("FolioVigentes") = value + End Set + End Property + Private Property Mensaje As String Get Return CType(ViewState("Mensaje"), String) @@ -100,6 +109,7 @@ Partial Class Contratos_FacturacionMasiva Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + FolioVigentes = False CargaCombos() txtFechaI.Text = DateTime.Today.ToString("d") txtFechaF.Text = DateTime.Today.ToString("d") @@ -118,6 +128,8 @@ Partial Class Contratos_FacturacionMasiva DdlSucursal.DataBind() End Sub Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer) + ValidaFolio() + Dim ObjContratos As New ClsContratos If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0") @@ -127,9 +139,21 @@ Partial Class Contratos_FacturacionMasiva GvCiclosComerciales.DataBind() UpGv.Update() End Sub + + Private Sub ValidaFolio() + Dim ObjFolios As New ClsGralFolios + If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then + If ObjFolios.DtResultados.Rows.Count > 0 Then + FolioVigentes = True + End If + End If + + ObjFolios.Dispose() + End Sub Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then + '' Pendiente de aplicar validacion + If Not FolioVigentes Then e.Row.FCCheckBox("chkDis").Enabled = False e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios" End If diff --git a/Contratos/RepContratosCostos.aspx b/Contratos/RepContratosCostos.aspx index 0711f2a7b..bf7c217b9 100644 --- a/Contratos/RepContratosCostos.aspx +++ b/Contratos/RepContratosCostos.aspx @@ -134,7 +134,7 @@ - + diff --git a/GPS/FacturacionMasiva.aspx.vb b/GPS/FacturacionMasiva.aspx.vb index 5db90c87c..79ee47c03 100644 --- a/GPS/FacturacionMasiva.aspx.vb +++ b/GPS/FacturacionMasiva.aspx.vb @@ -27,6 +27,14 @@ Partial Class Contratos_FacturacionMasiva ViewState("Mensaje") = value End Set End Property + Private Property FolioVigentes As Boolean + Get + Return CType(ViewState("FolioVigentes"), Boolean) + End Get + Set(value As Boolean) + ViewState("FolioVigentes") = value + End Set + End Property Private Property ErrorList As List(Of String) Get Return CType(ViewState("ErrorList"), List(Of String)) @@ -79,6 +87,7 @@ Partial Class Contratos_FacturacionMasiva Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + FolioVigentes = False CargaCombos() txtFechaI.Text = DateTime.Today.ToString("d") txtFechaF.Text = DateTime.Today.ToString("d") @@ -97,6 +106,7 @@ Partial Class Contratos_FacturacionMasiva DdlSucursal.DataBind() End Sub Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer) + ValidaFolio() Dim ObjContratos As New ClsContratos If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0") @@ -106,9 +116,20 @@ Partial Class Contratos_FacturacionMasiva GvCiclosComerciales.DataBind() UpGv.Update() End Sub + + Private Sub ValidaFolio() + Dim ObjFolios As New ClsGralFolios + If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then + If ObjFolios.DtResultados.Rows.Count > 0 Then + FolioVigentes = True + End If + End If + + ObjFolios.Dispose() + End Sub Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then + If Not FolioVigentes Then e.Row.FCCheckBox("chkDis").Enabled = False e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios" End If diff --git a/Global.asax b/Global.asax index 11fea0e3e..d2a87c94f 100644 --- a/Global.asax +++ b/Global.asax @@ -356,18 +356,13 @@ Dim ObjLeyendasFiscales As New ClsLeyendasFiscales() If ObjLeyendasFiscales.GetLeyendasFiscales() Then Application("GlobalDTLeyendasFiscales") = ObjLeyendasFiscales.DtResultados Else Application("GlobalDTLeyendasFiscales") = Nothing - ObjLeyendasFiscales.Dispose() - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C A R G A - F O L I O S - - Dim ObjFolios As New ClsGralFolios() - If ObjFolios.GetFolios() Then Application("GlobalDTFolios") = ObjFolios.DtResultados Else Application("GlobalDTFolios") = Nothing - ObjFolios.Dispose() - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'F A C T U R A S - + ObjLeyendasFiscales.Dispose() + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'F A C T U R A S + Dim ObjEstatusFactura As New ClsEstatusFactura() If ObjEstatusFactura.GetEstatusFactura() Then Application("GlobalDTEstatusFactura") = ObjEstatusFactura.DtResultados Else Application("GlobalDTEstatusFactura") = Nothing ObjEstatusFactura.Dispose() diff --git a/Inventarios/Apartados.aspx b/Inventarios/Apartados.aspx index 57bf1f423..36a17a7c0 100644 --- a/Inventarios/Apartados.aspx +++ b/Inventarios/Apartados.aspx @@ -86,7 +86,7 @@
- +
@@ -203,7 +203,7 @@
- +
@@ -310,7 +310,7 @@
Cliente
- + <%-- diff --git a/Inventarios/Apartados.aspx.vb b/Inventarios/Apartados.aspx.vb index db73531dd..f10ca6247 100644 --- a/Inventarios/Apartados.aspx.vb +++ b/Inventarios/Apartados.aspx.vb @@ -466,7 +466,8 @@ Partial Class Inventarios_Apartados Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, "-1")) If Valido Then - AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Text <> "", TxtnSerie.Text, ""), Limpia:=FuncionalidadSinSerie) + Dim StrSeccion As String = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedItem.Text, "") + AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=StrSeccion, Serie:=If(TxtnSerie.Text <> "", TxtnSerie.Text, ""), Limpia:=FuncionalidadSinSerie) End If End If diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 7cd2b7882..393d66ab9 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -255,9 +255,9 @@
- +
- +
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index b7acf9b87..2146c8de4 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -463,10 +463,6 @@ Partial Class Inventarios_EntradasSalidas End If DdlClasificacion.DataBind() - DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlSeccion.DataBind() - DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) DdlSeccionAlmacen.DataBind() @@ -825,7 +821,7 @@ Partial Class Inventarios_EntradasSalidas 'cargar también los movimentos detalle If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DdlSeccion.SelectedValueExist(Mov.CveSeccion.ToString) + DtMovimientos = Mov.DtResultados.FiltraParametros("", "CveMovimientoDetalle") DtMovimientos.Columns("No").AutoIncrement = True @@ -929,7 +925,6 @@ Partial Class Inventarios_EntradasSalidas TxtObservaciones.Enabled = True DdlMoneda.Enabled = True TxtGuia.Enabled = True - DdlSeccion.Enabled = True If CveMovimiento > 0 Then DdlAlmacen.Enabled = False @@ -940,7 +935,7 @@ Partial Class Inventarios_EntradasSalidas TxtObservaciones.Enabled = False DdlMoneda.Enabled = False TxtGuia.Enabled = False - DdlSeccion.Enabled = False + End If UppGrid.Update() End Sub @@ -2233,10 +2228,10 @@ Partial Class Inventarios_EntradasSalidas End If If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then - GvM.Columns(9).Visible = DtTemp.MAX("Serie").ToString <> "" - GvM.Columns(10).Visible = DtTemp.MAX("Lote").ToString <> "" - GvM.Columns(11).Visible = DtTemp.MAX("FechaCaducidad").ToString <> "" - GvM.Columns(12).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString <> "" + GvM.Columns(9).Visible = DtTemp.MAX("Serie") <> "" + GvM.Columns(10).Visible = DtTemp.MAX("Lote") <> "" + GvM.Columns(11).Visible = DtTemp.MAX("FechaCaducidad").ToDate > MinFecha + GvM.Columns(12).Visible = DtTemp.MAX("CveSeccionAlmacen") <> "" End If @@ -4042,7 +4037,6 @@ Partial Class Inventarios_EntradasSalidas If TxtRemision.Visible Then TxtRemision.Enabled = True If DdlMoneda.Visible Then DdlMoneda.Enabled = True If TxtGuia.Visible Then TxtGuia.Enabled = True - If DdlSeccion.Visible Then DdlSeccion.Enabled = True If BtnEliminar.Visible Then BtnEliminar.Visible = False diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 6d6001392..6fd5a6a6f 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -660,8 +660,9 @@ Partial Class Inventarios_EntregaAlmacen Alert("Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar.", TipoMensaje.MsgError) End If End If - - CargaDocumentos(CveVenta) + If UsuarioActual.Empresa.FacturaProduccion Then + CargaDocumentos(CveVenta) + End If Else Alert("No se encontraron productos pendientes por surtir. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) End If diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 893e3be4c..f0f919c1a 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -479,7 +479,8 @@ Partial Class Inventarios_RecepcionAlmacen Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacen.SelectedIndexChanged If DdlAlmacen.SelectedValue <> "-1" Then - CargaCompra(CveCompraSurtir, CveProveedor) + + CargaGVInv() 'For Each Gvr As GridViewRow In GvInv.Rows ' If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then ' Dim Dr As DataRow = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("") @@ -1263,7 +1264,7 @@ Partial Class Inventarios_RecepcionAlmacen If CBool(e.Row.DBCampo("AplicaSeccion")) Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True If DdlAlmacen.SelectedValue.ToEntero > 0 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) End If @@ -2192,7 +2193,7 @@ Partial Class Inventarios_RecepcionAlmacen 'ENTRADA ALMACÉN CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, If(TipoMovimiento > 1, 13, 2), 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), - MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G") + MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1") If CveMovimiento > 0 Then InvFolio = ObjInventario.Folio.ToString Dim DtDetalle As New DataTable @@ -2311,7 +2312,7 @@ Partial Class Inventarios_RecepcionAlmacen CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), - MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G") + MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G2") FolioSalidaDirecta = ObjInventario.Folio If Not CveMovtoSalidaDirecta > 0 Then @@ -2365,7 +2366,7 @@ Partial Class Inventarios_RecepcionAlmacen If CveVendedorActual = -1 Or (Dr("CveVendedor").ToString.ToEntero <> CveVendedorActual Or Dr("CveCliente").ToString.ToEntero <> CveClienteActual) Then CveMovtoSalidaActual = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), CveAlmacenDestino:=CveAlmacenDestino, MovimientoFijo:=True, CveVendedor:=Dr("CveVendedor").ToString.ToEntero, - CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text, Modulo:="RA/G") + CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text, Modulo:="RA/G3") MovtosSalida.Add(CveMovtoSalidaActual) FoliosSalida.Add(ObjInventario.Folio) @@ -2447,7 +2448,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacenFiltro).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4") FolioVirtual = ObjInventario.Folio For Each RowUsado As DataRow In DtPSVirtual.Rows @@ -2590,7 +2591,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G5") FolioVirtual = ObjInventario.Folio For Each RowUsado As DataRow In DtPSVirtual.Rows @@ -3048,7 +3049,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjContaAC As ClsContPAQi = Nothing 'ENTRADA ALMACÉN - CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 2, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveImportacionCompra, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=-1, Remision:=TxtRemision.Text, Modulo:="RA/G") + CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 2, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveImportacionCompra, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=-1, Remision:=TxtRemision.Text, Modulo:="RA/G6") If CveMovimiento > 0 Then InvFolio = ObjInventario.Folio.ToString Dim DtDetalle As New DataTable diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index aad0f3987..9aabeb893 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -608,7 +608,7 @@ Partial Class Inventarios_ResguardoMaterial Private Sub CargaGvMLiberacion() GvM.Columns(5).Visible = False For Each Dr As DataRow In DtMovimientosLiberacion.Rows - If Dr("SerieLote").ToString <> "" Then + If Dr("Serie").ToString <> "" Then GvM.Columns(5).Visible = True Exit For End If @@ -777,7 +777,7 @@ Partial Class Inventarios_ResguardoMaterial Dim Cont As Integer = 0 For Each Dr As DataRow In DtMovimientos.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For @@ -796,7 +796,7 @@ Partial Class Inventarios_ResguardoMaterial Else If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" Exit For diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 55ee7d78a..752c30d04 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -855,7 +855,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim Cont As Integer = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacenDestino").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de entrada" Exit For diff --git a/Nomina/Nomina.aspx.vb b/Nomina/Nomina.aspx.vb index 86a6aea16..5fca491c5 100644 --- a/Nomina/Nomina.aspx.vb +++ b/Nomina/Nomina.aspx.vb @@ -229,7 +229,7 @@ Partial Class Nomina_Nomina Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then - If UsuarioActual.CveEmpresa = 80 OrElse UsuarioActual.CveEmpresa = 72 Then + If UsuarioActual.CveEmpresa = 80 OrElse UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 119 Then Response.Redirect("/Nomina/Nomina2.aspx") End If CargaTiposPeriodo() diff --git a/Nomina/Nomina2.aspx b/Nomina/Nomina2.aspx index 56dc52083..7ce1b7f3d 100644 --- a/Nomina/Nomina2.aspx +++ b/Nomina/Nomina2.aspx @@ -4,9 +4,10 @@