diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index a2129f8a1..4e3b0b213 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4463,6 +4463,21 @@ Public Class ClsBancos Return Retorno End Function + Public Function InhabilitarCuentasBancos(CveBanco As Integer, Estatus As Boolean) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_InhabilitarCuentas") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveBanco", SqlDbType.Int).Value = CveBanco + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al inhabilitar las Cuentas Bancarias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function Public Function GetBancosSAT() As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_Sat_BancosGet") diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index a07d2a7d3..7cb6f40ef 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -431,7 +431,8 @@ Public Class ClsCRM Return Retorno End Function - Public Function AddEmpresaCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, CveEncuestaAplicada As Integer, CveVendedor As Integer, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Integer + Public Function AddEmpresaCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, CveEncuestaAplicada As Integer, CveVendedor As Integer, + Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional CveGiroClasificacion As Integer = -1) As Integer Dim CveEmpresaCRM As Integer = -1 DataAdapter("PA_CRM_EmpresaAdd") With SqlAdapter.SelectCommand.Parameters @@ -444,6 +445,7 @@ Public Class ClsCRM .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -456,7 +458,8 @@ Public Class ClsCRM Return CveEmpresaCRM End Function - Public Function UpdateEmpresCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresaCRM As Integer, CveVendedor As Integer, CveUsuarioMod As Integer, Optional CveCliente As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Boolean + Public Function UpdateEmpresCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresaCRM As Integer, CveVendedor As Integer, CveUsuarioMod As Integer, + Optional CveCliente As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional CveGiroClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_EmpresaUpdate") With SqlAdapter.SelectCommand.Parameters @@ -469,6 +472,7 @@ Public Class ClsCRM .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@CveGiroClasificaciones", SqlDbType.Int).Value = CveGiroClasificacion End With Try SqlAdapter.Fill(Data) @@ -651,7 +655,8 @@ Public Class ClsCRM Public Function GetAcercamiento(CveEmpresa As Integer, Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamiento As Integer = -1, Optional CveTipoProceso As Integer = -1, Optional CveVendedor As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1", Optional NombreAcercamiento As String = "-1", Optional CveMedioCaptacion As Integer = -1, Optional CveRechazoMotivo As Integer = -1, Optional CveProbabilidad As Integer = -1, - Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1", Optional TopSelect As Integer = 10000) As Boolean + Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1", Optional TopSelect As Integer = 10000, Optional CvePS As Integer = -1, + Optional CveGiroClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoGet") With SqlAdapter.SelectCommand.Parameters @@ -675,6 +680,9 @@ Public Class ClsCRM .Add("@FechaCierre", SqlDbType.VarChar).Value = FechaCierre .Add("@TopSelect", SqlDbType.Int).Value = TopSelect + + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion End With Try SqlAdapter.Fill(Data) @@ -688,7 +696,7 @@ Public Class ClsCRM Public Function AddAcercamiento(CveEmpresaCRM As Integer, CveContactoPrincipal As Integer, CveTipoProceso As Integer, CveEtapaProcesoActual As Integer, CveVendedor As Integer, CveMedioCaptacion As Integer, CveRechazoMotivo As Integer, CveProbabilidadAcercamiento As Integer, FechaApertura As DateTime, NombreAcercamiento As String, Descripcion As String, Importe As Double, Comision As Double, Prioridad As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, - Optional FechaCierre As Nullable(Of DateTime) = Nothing) As Integer + Optional FechaCierre As Nullable(Of DateTime) = Nothing, Optional CvePS As Integer = -1) As Integer Dim _CveAcercamiento As Integer = -1 DataAdapter("PA_CRM_AcercamientoAdd") @@ -714,6 +722,7 @@ Public Class ClsCRM .Add("@Prioridad", SqlDbType.Int).Value = Prioridad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuarioIng", SqlDbType.Int).Value = CveUsuarioIng + .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -729,7 +738,7 @@ Public Class ClsCRM Public Function UpdateAcercamiento(CveAcercamiento As Integer, CveContactoPrincipal As Integer, CveTipoProceso As Integer, CveEtapaProcesoActual As Integer, CveVendedor As Integer, CveMedioCaptacion As Integer, CveProbabilidadAcercamiento As Integer, NombreAcercamiento As String, Descripcion As String, Importe As Double, Comision As Double, Prioridad As Integer, CveUsuarioMod As Integer, Optional CveRechazoMotivo As Integer = -1, Optional CveEncuestaAplicadaProceso As Integer = -1, - Optional FechaApertura As Nullable(Of DateTime) = Nothing, Optional FechaCierre As Nullable(Of DateTime) = Nothing) As Boolean + Optional FechaApertura As Nullable(Of DateTime) = Nothing, Optional FechaCierre As Nullable(Of DateTime) = Nothing, Optional CvePS As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoUpdate") With SqlAdapter.SelectCommand.Parameters @@ -755,6 +764,7 @@ Public Class ClsCRM .Add("@CveRechazoMotivo", SqlDbType.Int).Value = CveRechazoMotivo .Add("@FechaApertura", SqlDbType.DateTime).Value = IIf(FechaApertura Is Nothing, SqlTypes.SqlDateTime.Null, FechaApertura) .Add("@FechaCierre", SqlDbType.DateTime).Value = IIf(FechaCierre Is Nothing, SqlTypes.SqlDateTime.Null, FechaCierre) + .Add("@CvePS", SqlDbType.Int).Value = CvePS End With Try SqlAdapter.Fill(Data) @@ -1051,7 +1061,7 @@ Public Class ClsCRM Return retorno End Function - Public Function RepAcercamientosDetalle(CveEmpresa As Int32, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, cveEtapaProceso As Int32, sFecha As String, sFechaIni As String, sFechaFin As String) As Boolean + Public Function RepAcercamientosDetalle(CveEmpresa As Int32, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, cveEtapaProceso As Int32, sFecha As String, sFechaIni As String, sFechaFin As String, Optional CveTipoProceso As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAcercamientosDetalle", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -1063,6 +1073,7 @@ Public Class ClsCRM .Add("@SFecha", SqlDbType.VarChar).Value = sFecha .Add("@SFechaIni", SqlDbType.VarChar).Value = sFechaIni .Add("@SFechaFin", SqlDbType.VarChar).Value = sFechaFin + .Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index b89221914..e4bdd741e 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5252,6 +5252,30 @@ Public Class ClsInventarios Return Retorno End Function + + 'Public Function GetMovimientosDetalleTransitorio(CveMovimiento As Integer, CveEmpresa As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter(" + ' select t.FechaMovto, t.CveMovimiento, d.CvePS, d.Cantidad, d.PUOriginal,d.CveUM, dm.CveMovimiento, db.CveMovimientoDetalle from ( + ' select * from Inv_Movimientos m where CveConcepto = 27 and CveEmpresa = @CveEmpresa and + ' m.FechaMovto > '2020/10/01' and m.CveMovimiento = @CveMovimiento and not exists (select * from Conta_PrePolizasDetalle dd where dd.CveMovimientoAlmacen = m.CveMovimiento) + ' ) t left join Inv_MovimientosDetalle d on d.CveMovimiento = t.CveMovimiento left join Inv_MovimientosDetalle dm on dm.CveMovimientoDetalle = d.CveMovimientoDetalleEntrada + ' left join Inv_MovimientosDetalle db on db.CveMovimientoDetalleEntrada = dm.CveMovimientoDetalle and db.CveMovimiento = dm.CveMovimiento + 1 order by db.CveMovimientoDetalle ", CommandType.Text) + + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener los movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try + + ' Return Retorno + 'End Function + #Region "Proyeccion" Public Function AddMovimientosProyectados(CvePS As Integer, Cantidad As Decimal, TipoMovto As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 53b11a3e3..e40a7740e 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -1985,7 +1985,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function GetNominaEmpleado(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, Optional RegimenContratacion As Integer = 1) As Boolean + Public Function GetNominaEmpleado(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() @@ -1998,6 +1998,7 @@ Public Class ClsNominas .Add("@Agrupador", SqlDbType.VarChar).Value = Agrupador .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@RegimenContratacion", SqlDbType.Int).Value = RegimenContratacion + .Add("@CvePersonal", SqlDbType.Decimal).Value = CvePersonal End With diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 2f7f7c87d..c9557b703 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2159,7 +2159,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte de Altas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al actualizar las bajas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index d0648d098..a4b949dfd 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2719,7 +2719,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetRepCotizacionesSinFacturar(FechaI As Date, FechaF As Date, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Public Function GetRepCotizacionesSinFacturar(FechaI As Date, FechaF As Date, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional CveEstatusFactura As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepCotizacionesSinFacturarGet") @@ -2729,6 +2729,7 @@ Public Class ClsVentas .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta End With diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index a01edf317..68dbd2bec 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -520,6 +520,11 @@ Namespace Modelos Me.DtOtrosConceptos = ObjVentas.DtResultados.Copy() End If + 'CARGA REMISIONES RELACIONADAS + If ObjVentas.GetRemisionesRelacionadas(CveVenta, TipoDocto) Then + Me.DtRemisionesDocumentosRelacionados = ObjVentas.DtResultados.Copy() + End If + ObjVentas.Dispose() If Me.RealizarDevolucionAlmacen Then @@ -5806,6 +5811,8 @@ Namespace Modelos Public Property DtDocumentacionCliente As Data.DataTable Public Property DtContratosSerieDetalle As Data.DataTable Public Property DtOtrosConceptos As Data.DataTable + + Public Property DtRemisionesDocumentosRelacionados As Data.DataTable Public Property DtInventario As Data.DataTable 'Public Property DtAnticipoAmortizacion As Data.DataTable Public Property DtRemConceptosSurtidos As Data.DataTable diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 56fce0da2..42549491e 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -2688,6 +2688,15 @@ Public Class Timbrado #Region "Timbra" If ArchivoGenerado Then + Dim opciones As String() = New String(0) {"CALCULAR_SELLO"} + Dim pade = New PADE33.PadeTimbradoServiceClient + Dim Respuesta As String = pade.timbradoPrueba("72330711-cac6-4106-8051-cbcda1aef495", "rene.molina@adssistemas.mx", "Facturacion2021#", cfdi.Xml, opciones) + ' Aumentamos el timeout de la operación + + Dim FolioFiscal As String + FolioFiscal = obtenerAtributo(Respuesta, "TimbreFiscalDigital", "UUID") 'XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText + + 'cfdi.TimbrarCfdi(UsuarioServicio, ClaveServicio, UrlServicio, TimbraProduccion) 'sw.Stop() diff --git a/App_WebReferences/PADE33/Reference.svcmap b/App_WebReferences/PADE33/Reference.svcmap new file mode 100644 index 000000000..0bfba4957 --- /dev/null +++ b/App_WebReferences/PADE33/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/Timbrado3.wsdl b/App_WebReferences/PADE33/Timbrado3.wsdl new file mode 100644 index 000000000..20ff39a6d --- /dev/null +++ b/App_WebReferences/PADE33/Timbrado3.wsdl @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/Timbrado3.xsd b/App_WebReferences/PADE33/Timbrado3.xsd new file mode 100644 index 000000000..a986a6652 --- /dev/null +++ b/App_WebReferences/PADE33/Timbrado3.xsd @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/configuration.svcinfo b/App_WebReferences/PADE33/configuration.svcinfo new file mode 100644 index 000000000..34a3fd535 --- /dev/null +++ b/App_WebReferences/PADE33/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/configuration91.svcinfo b/App_WebReferences/PADE33/configuration91.svcinfo new file mode 100644 index 000000000..fdf001f3e --- /dev/null +++ b/App_WebReferences/PADE33/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + PadeTimbradoServicePortBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://timbrado.pade.mx:80/servicio/Timbrado3.3 + + + + + + basicHttpBinding + + + PadeTimbradoServicePortBinding + + + PADE33.PadeTimbradoService + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + PadeTimbradoServicePort + + + + + + + + + + + \ No newline at end of file diff --git a/Ashx/SIGGPS.ashx b/Ashx/SIGGPS.ashx index 64678a627..5f0c66a38 100644 --- a/Ashx/SIGGPS.ashx +++ b/Ashx/SIGGPS.ashx @@ -74,7 +74,7 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState 'Dim contextc = Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager.GetHubContext(Of MyGPSHub)() 'SendNotificacionGPS(contextc, 5, 1727, "Encabezado", "Mensaje", 2, "{""timeOut"":15000, ""extendedTimeOut"":16000}", "142608__autistic-lucario__error.wav", 0, SQLToGmapsJArray("POINT (-99.211688 19.717715)", "POINT").ToString()) Using ObjGPS As New ClsSisNotificaciones - ObjGPS.ObtenerNotificaciones() + Retorno = $"[""IsOk""=""{ObjGPS.ObtenerNotificaciones()}""]" End Using context.Response.Write(Retorno) End Sub diff --git a/Bancos/CatBancos.aspx.vb b/Bancos/CatBancos.aspx.vb index 9a57ab193..0aee43f9b 100644 --- a/Bancos/CatBancos.aspx.vb +++ b/Bancos/CatBancos.aspx.vb @@ -119,6 +119,7 @@ Partial Class Bancos_CatBancos Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating Dim ObjBancos As New ClsBancos + ObjBancos.IniciaTransacSQL() Dim Banco As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtBanco"), TextBox).Text.Trim Dim Ejecutivo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEjecutivo"), TextBox).Text.Trim @@ -126,13 +127,27 @@ Partial Class Bancos_CatBancos Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero + Dim TieneError As Boolean = False If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then - GvDatos.EditIndex = -1 - ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTBancos = ObjBancos.DtResultados - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + If ObjBancos.InhabilitarCuentasBancos(CveBanco, Estatus) Then + GvDatos.EditIndex = -1 + ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTBancos = ObjBancos.DtResultados + Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + Else + TieneError = True + End If + Else + TieneError = True + End If + + If TieneError Then + ObjBancos.RollBack() + Else + ObjBancos.Commit() + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing End If ObjBancos.Dispose() diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 98ddf784d..0f859956c 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1118,8 +1118,9 @@ Partial Class Bancos_IE End If + 'DATOS DE CANCELACION - If ObjIE.CveEstatusIE = 2 Then + If ObjIE.CveEstatusIE = 2 OrElse (ObjIE.CveEstatusIE = 1 AndAlso ObjIE.CveIECancelacion > 0) Then TabCancelacion.Visible = True LbUsuarioCancelacion.Text = ObjIE.UsuarioCancelacion LbFechaCancelacion.Text = ObjIE.FechaCancelacion.ToShortDateString diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index c16a3ca10..b11dc7cc1 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1832,7 +1832,7 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria 'tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion) + Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioCompraValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * TipoCambioPago) 'Añadimos la diferencia de perdida en la venta diff --git a/CRM/Acercamiento.aspx b/CRM/Acercamiento.aspx index ef2aec956..4fac5eeab 100644 --- a/CRM/Acercamiento.aspx +++ b/CRM/Acercamiento.aspx @@ -405,12 +405,15 @@ <%-- style="padding-bottom: 17px;" --%>
- + <%----%>
- +
+ + +
diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 3890d6dc8..30c7a064f 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -234,6 +234,18 @@ public partial class CRM_Acercamiento : ClsPaginas ViewState["CveAcercamientoGasto"] = value; } } + private int CvePS + { + get + { + return ViewState["CvePS"] == null ? -1 : ViewState["CvePS"].ToString().ToEntero(); + } + + set + { + ViewState["CvePS"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -269,6 +281,7 @@ public partial class CRM_Acercamiento : ClsPaginas } } } + CargarPS(); } } @@ -322,6 +335,8 @@ public partial class CRM_Acercamiento : ClsPaginas CveEncuestaAplicadaProceso = (ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() : -1; //CveEtapaBitacoraSeleccionada = CveEtapaActual; + CvePS = ObjCRM.DtResultados.FiltroPrimeroValor("CvePS").ToEntero(); + HdfEtapaSeleccionada.Value = CveEtapaActual.ToString(); //INHABILITAMOS CAMPOS QUE NO SE PUEDEN EDITAR DdlEmpresaCRM.Enabled = false; @@ -556,6 +571,17 @@ public partial class CRM_Acercamiento : ClsPaginas if (DTEtapasProceso.FiltroPrimeroValor("CveTipoEtapa", String.Format("CveEtapaProceso = {0}", DdlEtapaProceso.SelectedValue.ToEntero())).Contiene("1", "2", "3")) GuardarCambioEtapa(); } + + private void CargarPS() + { + DdlPS.setEsWebService(true); + if(CvePS > 0) + { + string productoAsignado = get_GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS: CvePS).FiltroPrimeroValor("PSCodigo"); + DdlPS.SelectedValue = CvePS.ToString(); + DdlPS.SelectedText = productoAsignado; + } + } #endregion #region "GUARDAR" @@ -605,7 +631,7 @@ public partial class CRM_Acercamiento : ClsPaginas } if ((CveEncuestaAplicadaProceso != 0) && ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento, - NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre)) + NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS:DdlPS.SelectedValue.ToEntero())) { //String MensajeBitacora = (CveEtapaProcesoActualActualizar != CveEtapaActual) ? String.Format("Se actualizó la etapa del acercamiento a {0}.", DTEtapasProceso.FiltroPrimeroValor("EtapaProceso", "CveEtapaProceso = " + CveEtapaProcesoActualActualizar)) : String.Format("Se actualizó el Acercamiento {0} con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text); @@ -671,7 +697,7 @@ public partial class CRM_Acercamiento : ClsPaginas int CveUsuarioIng = UsuarioActual.CveUsuario; if (ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento, - NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre)) + NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS: DdlPS.SelectedValue.ToEntero())) { CveEtapaActual = CveEtapaProcesoActualActualizar; HdfEtapaSeleccionada.Value = CveEtapaProcesoActualActualizar.ToString(); diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index 9ff6a1393..24e763256 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -109,6 +109,11 @@ +
+ + +
+ <%-- DATOS DINAMICOS - TABLA ENCUESTA --%> @@ -676,6 +681,12 @@ +
+
+ + +
+
diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 85ff85b65..8c2874e1b 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -217,6 +217,19 @@ public partial class CRM_EmpresaCRM : ClsPaginas ViewState["DtProbabilidadAcercamiento"] = value; } } + + private int CveGiroClasificacion + { + get + { + return ViewState["CveGiroClasificacion"].ToString().ToEntero(); + } + + set + { + ViewState["CveGiroClasificacion"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -237,6 +250,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas CargaDatosTecnicos(); } VerificaPermisos(); + CargaClasificaciones(); + DdlPS.setEsWebService(true); } } @@ -274,7 +289,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas { string Mensaje = ""; //DATOS GENERALES - CveEmpresaCRM = ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CveEncuestaAplicada, CveVendedorActualizar, CveSubProyecto, Correo); + CveEmpresaCRM = ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CveEncuestaAplicada, CveVendedorActualizar, CveSubProyecto, Correo, DdlGiroClasificacion.SelectedValue.ToEntero()); if (CveEmpresaCRM > 0) { @@ -321,7 +336,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveEncuestaAplicada = GuardaDatosTecnicos(ObjDatosTecnicos, CveEncuestaAplicada); } - if ((CveEncuestaAplicada != 0) && ObjCRM.UpdateEmpresCRM(NombreEmpresa, RFC, CveMedioCaptacion, CveEmpresaCRM, CveVendedorActualizar, UsuarioActual.CveUsuario, CveSubProyecto: CveSubProyecto, Correo: Correo)) + if ((CveEncuestaAplicada != 0) && ObjCRM.UpdateEmpresCRM(NombreEmpresa, RFC, CveMedioCaptacion, CveEmpresaCRM, CveVendedorActualizar, UsuarioActual.CveUsuario, CveSubProyecto: CveSubProyecto, Correo: Correo,CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) { if (!ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { @@ -628,8 +643,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveVendedor = ObjCRM.DtResultados.FiltroPrimeroValor("CveVendedorAsignado").ToEntero(); CveSubProyecto = ObjCRM.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero(); CveCliente = ObjCRM.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero(); + CveGiroClasificacion = ObjCRM.DtResultados.FiltroPrimeroValor("CveGiroClasificacion") != "" ? ObjCRM.DtResultados.FiltroPrimeroValor("CveGiroClasificacion").ToEntero() : -1; - if(!(CveCliente > 0)) + if (!(CveCliente > 0)) { HplCrearCliente.Visible = true; HplCrearCliente.NavigateUrl = String.Format("/Ventas/Clientes.aspx?CveEmpresaCRM={0}", CveEmpresaCRM); @@ -652,6 +668,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas BtnEliminarEmpresa.Enabled = false; DivBitacora.Visible = false; + + CveGiroClasificacion = -1; } ObjCRM.Dispose(); @@ -665,6 +683,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas else { CreaTempDTContactos(); + CveGiroClasificacion = -1; } DdlVendedorAsignado.SelectedValueExist(CveVendedor); @@ -1429,7 +1448,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjCRM.DtResultados.Rows.Count > 0) { CveAcercamiento = ObjCRM.AddAcercamiento(CveEmpresaCRM, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActual, CveVendedor, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidadAcercamiento, - FechaApertura, NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveEmpresa, CveUsuarioIng); + FechaApertura, NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveEmpresa, CveUsuarioIng, CvePS:DdlPS.SelectedValue.ToEntero()); }else { Alert("No tiene 'Etapa Proceso' con el 'Proceso' seleccionado al agregar el Acercamiento",ModExtensiones.TipoMensaje.MsgAdvertencia); @@ -1487,7 +1506,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas BtnEliminarEmpresa.Visible = false; if (!UsuarioActual.TienePermisoProceso(251)) + { LnkAgregarAcercamiento.Visible = false; + } if ((UsuarioActual.CveVendedor != CveVendedor)) { @@ -1545,4 +1566,13 @@ public partial class CRM_EmpresaCRM : ClsPaginas CargaMetodosCaptacion(); UpDatos.Update(); } + + private void CargaClasificaciones() + { + DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); + DdlGiroClasificacion.DataSource = dtGiroClasificaciones; + DdlGiroClasificacion.DataBind(); + DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlGiroClasificacion.SelectedValueExist(CveGiroClasificacion); + } } \ No newline at end of file diff --git a/CRM/RepAcercamientos.aspx b/CRM/RepAcercamientos.aspx index 7ae9adb04..7b6db4b54 100644 --- a/CRM/RepAcercamientos.aspx +++ b/CRM/RepAcercamientos.aspx @@ -20,7 +20,7 @@
- <%----%> +
@@ -54,13 +54,24 @@
+ +
+
+ +
+
+
- <%--
diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs index b9443e390..1eef821ff 100644 --- a/CRM/RepAcercamientos.aspx.cs +++ b/CRM/RepAcercamientos.aspx.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Extensiones; +using System.Data; public partial class CRM_RepAcercamientos : ClsPaginas { @@ -41,25 +42,19 @@ public partial class CRM_RepAcercamientos : ClsPaginas protected void CargaDatos() { CveVendedor = DdlVendedor.SelectedValue.ToEntero(); - - if (CveVendedor > 0) + string FechaInicio = TxtFechaInicio.Text == "" ? "-1" : TxtFechaInicio.Text; + string FechaFin = TxtFechaFin.Text == "" ? "-1" : TxtFechaFin.Text; + int CvePS = DdlPS.SelectedValue.ToEntero() == 0 ? -1 : DdlPS.SelectedValue.ToEntero(); + ClsCRM ObjCRM = new ClsCRM(); + if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) { - string FechaInicio = TxtFechaInicio.Text == "" ? "-1" : TxtFechaInicio.Text; - string FechaFin = TxtFechaFin.Text == "" ? "-1" : TxtFechaFin.Text; - - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin)) - { - GVDatos.DataSource = ObjCRM.DtResultados; - GVDatos.DataBind(); - } - - ObjCRM.Dispose(); - UPDatos.Update(); - }else - { - Alert("El Campo Vendedor es requerido",ModExtensiones.TipoMensaje.MsgError); + GVDatos.DataSource = ObjCRM.DtResultados; + GVDatos.DataBind(); } + + ObjCRM.Dispose(); + UPDatos.Update(); + } protected void GVDatos_RowDataBound(object sender, GridViewRowEventArgs e) @@ -84,6 +79,12 @@ public partial class CRM_RepAcercamientos : ClsPaginas //CALCULAMOS EL INTERVALO DE LA SEMANA ACTUAL TxtFechaInicio.Text = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek) + 1).ToShortDateString(); //TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString(); + DdlPS.setEsWebService(true); + + DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); + DdlGiroClasificacion.DataSource = dtGiroClasificaciones; + DdlGiroClasificacion.DataBind(); + DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); } #endregion } \ No newline at end of file diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx b/CRM/RepAcercamientosProcesosDetalle.aspx index b54c7f46d..61d484036 100644 --- a/CRM/RepAcercamientosProcesosDetalle.aspx +++ b/CRM/RepAcercamientosProcesosDetalle.aspx @@ -266,7 +266,7 @@ - + @@ -286,7 +286,7 @@ - + diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx.cs b/CRM/RepAcercamientosProcesosDetalle.aspx.cs index fe8ab3eb8..b33304729 100644 --- a/CRM/RepAcercamientosProcesosDetalle.aspx.cs +++ b/CRM/RepAcercamientosProcesosDetalle.aspx.cs @@ -85,9 +85,9 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas RcveMedioCaptacion = Request["cveMedioCaptacion"] == null ? -1 : Request["cveMedioCaptacion"].ToString().ToEntero(); RcveProbabilidadAcercamiento = Request["cveProbabilidadAcercamiento"] == null ? -1 : Request["cveProbabilidadAcercamiento"].ToString().ToEntero(); RcveEtapaProceso = Request["cveEtapaProceso"] == null ? -1 : Request["cveEtapaProceso"].ToString().ToEntero(); - RsFecha = Request["Fecha"] == null ? "" : Request["Fecha"].ToString(); - RsFechaIni = Request["FechaInicio"] == null ? "" : Request["FechaInicio"].ToString(); - RsFechaFin = Request["FechaFin"] == null ? "" : Request["FechaFin"].ToString(); + RsFecha = Request["Fecha"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["Fecha"].ToString(); + RsFechaIni = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString(); + RsFechaFin = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString(); try { RsFechaIni = RsFechaIni.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaInicio.Text = RsFechaIni.ToDateTime().ToString("dd/MM/yyyy"); } catch (Exception) { RsFechaIni = ""; } try { RsFechaFin = RsFechaFin.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaFin.Text = RsFechaFin.ToDateTime().ToString("dd/MM/yyyy"); } @@ -192,7 +192,7 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas protected void cargarDatos() { ClsCRM ObjRepA = new ClsCRM(); - ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni, RsFechaFin); + ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni, RsFechaFin,CveTipoProceso:DdlTipoProceso.SelectedValue.ToEntero()); GVRepAcercamientosDetalle.DataSource = ObjRepA.DtResultados; ObjRepA.Dispose(); GVRepAcercamientosDetalle.DataBind(); @@ -218,8 +218,8 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas // RsFecha = Request["CveGrupo1"] == null ? "" : Request["CveGrupo1"].ToString(); // break; //} - RsFechaIni = TxtFechaInicio.Text.Length > 0 ? TxtFechaInicio.Text.ToDateTime().ToString("yyyy/MM/dd") : ""; - RsFechaFin = TxtFechaFin.Text.Length > 0 ? TxtFechaFin.Text.ToDateTime().ToString("yyyy/MM/dd") : ""; + RsFechaIni = TxtFechaInicio.Text.Length > 0 ? TxtFechaInicio.Text.ToDateTime().ToString("yyyy/MM/dd") : Extensiones.ModExtensiones.MinFecha.ToString(); + RsFechaFin = TxtFechaFin.Text.Length > 0 ? TxtFechaFin.Text.ToDateTime().ToString("yyyy/MM/dd") : Extensiones.ModExtensiones.MaxFecha.ToString(); RcveVendedor = DdlVendedor.SelectedValue.ToEntero(); RcveMedioCaptacion = DdlMedioCaptacion.SelectedValue.ToEntero(); RcveProbabilidadAcercamiento = DdlProbabilidad.SelectedValue.ToEntero(); diff --git a/CRM/RepAcercamientosRechazos.aspx.cs b/CRM/RepAcercamientosRechazos.aspx.cs index 9a1efc92f..1a5d105c8 100644 --- a/CRM/RepAcercamientosRechazos.aspx.cs +++ b/CRM/RepAcercamientosRechazos.aspx.cs @@ -131,9 +131,17 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas HyperLinkField hypt = new HyperLinkField(); hypt.DataTextField = $"Total"; hypt.HeaderText = $"Total"; - hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" }; - string strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); - hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + string strfilstros = ""; + if (DdlGrupo1.SelectedValue == "1") { + hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1", "CveVendedor" }; + strfilstros = string.Format("&cveMedioCaptacion={0}&cveProbabilidadAcercamiento={1}", cveMedioCaptacion, cveProbabilidadAcercamiento); + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&cveVendedor={{3}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + } + else { + hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" }; + strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&c&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + } switch (idgrupo1) { case 1: diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 7150832a1..66bddceac 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -1,5206 +1,5335 @@ -<%@ Page Title="Compras - Registro de Facturas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" ValidateRequest="false" CodeFile="Compras.aspx.vb" Inherits="Compras_Compras" EnableEventValidation="false" %> - - - - - - - -
  • - -
  • -
    -
    - - -
  • - -
  • -
  • - Agregar Concepto -
  • -
  • - Imprimir XML -
  • -
  • - Imprimir PDF -
  • -
  • - Ver Almacen -
  • -
  • - Imprimir Desglose -
  • -
  • - Agregar PS -
  • -
  • - Agregar Otros Gastos -
  • -
  • - Costo Indirecto/Importaciones -
  • - - -
  • - -
  • -
    -
    - - -
  • - -
  • -
    -
    - - - -
  • - Descontabilizar -
  • -
    - - - -
    -
  • - Contabilizar -
  • -
  • - Pagar -
  • - - -
  • - <%----%> - Solicitar Devolución -
  • -
    -
    - - +<%@ Page Title="Compras - Registro de Facturas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" ValidateRequest="false" CodeFile="Compras.aspx.vb" Inherits="Compras_Compras" EnableEventValidation="false" %> + + + + + + + +
  • + +
  • +
    +
    + + +
  • + +
  • +
  • + Agregar Concepto +
  • +
  • + Imprimir XML +
  • +
  • + Imprimir PDF +
  • +
  • + Ver Almacen +
  • +
  • + Imprimir Desglose +
  • +
  • + Agregar PS +
  • +
  • + Agregar Otros Gastos +
  • +
  • + Costo Indirecto/Importaciones +
  • + + +
  • + +
  • +
    +
    + + +
  • + +
  • +
    +
    + + + +
  • + Descontabilizar +
  • +
    + + + +
    +
  • + Contabilizar +
  • +
  • + Pagar +
  • + + +
  • + <%----%> + Solicitar Devolución +
  • +
    +
    + + -
  • - Contratos +
  • + Contratos
  • -
    - -
    - - - -
    - -
  • - Fletes -
  • -
  • - - - Complementos Pago - - - - -
  • -
  • - Actualizar Tipo Cambio -
  • - - <%-- 25/05/2018 - Link a Paqueterias Guias --%> - - -
  • - Agregar Guía -
  • -
    -
    - -
    - - - - - - - Registro de Compras - - - - - <%-- - --%> - - -
    -
    - - -
    -
    -
    - - Datos de factura de Compra -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - <%-- - - - - --%> - Proveedor: - <%--Proveedor:--%> - <%-- Proveedor:--%> -
    - - - - - -
    -
    -
    - Tipo: -
    - - - - - - -
    -
    -
    -
    - # O.C.: -
    - -
    - - -
    -
    -
    -
    -
    -
    - -
    - - - -
    - -
    - - - - - -
    -
    -
    -
    -
    - -
    - - - -
    -
    -
    -
    -
    -
    - Fecha Factura: -
    -
    - - - - - - - - - - - - - -
    -
    -
    -
    - Descripción: -
    - - - -
    -
    -
    - Refacturación: -
    - - -
    -
    -
    - ¿Es No Deducible? -
    - -
    -
    - - - - <%--
    - Tipo Gasto: -
    - - - -
    -
    --%> -
    -
    -
    -
    -
    -
    - -
    - - -
    -
    -
    - - Estatus -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - Sucursal: -
    - - -
    -
    -
    - -
    - Estatus: -
    -
    - - - - - -
    -
    -
    - Importe: -
    - - - -
    -
    -
    - Saldo: -
    - - - -
    -
    -
    - Contabilizada: -
    - - <%----%> - <%----%> -
    -
    -
    - Tipo Factura: -
    - -
    -
    -
    - Validada SAT: -
    - - No - Si - -
    -
    -
    - Capturó: -
    - -
    -
    -
    - F. Captura -
    - -
    -
    -
    - Tipo Compra: -
    - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    - - -
    - - - - -
    -
    -
    -
    - - La factura no se puede registrar: - -
    -
    -
    -
    - - - - - - - - - - - -
    -
    -
    - - Presupuesto Egresos General -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    - - - -
    -
    -
    -
    - - - - -
    -
    -
    -
    - - - - -
    -
    -
    -
    - - - -
    -
    -
    -
    - <%--$--%> - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - -
    - - - <%--width="100%"--%> - - - - - - - - - - - -
    -
    - - - - - - - - - - - -
    #CantUnidadClasificación - - - -     - - - - -
    - -
    -
    - Producto o Servicio
    Observación - -   - - - -
    - -
    - -
    Tipo de Gasto - - - - -
    -
    -
    P.U. % IVA Total ¿No Deducible? Comandos
    - - - - - - -
    -
    - - - -
    - <%----%> -
    -
    -
    - - - -
    -
    - -
    -
    -
    - - - - - - - -
    -
    - - - - - <%-- 0 --%> - - - - - - <%-- 1 --%> - - <%-- 2 --%> - - - - - - - <%-- 3 --%> - - -
    - - - - -
    - -
    -
    -
    - <%-- 4 --%> - - <%-- 5 --%> - - - - - - - - - <%-- 6 --%> - - <%-- 7 --%> - - <%-- 8 --%> - - - - - - <%-- 9 --%> - - - <%-- 10 --%> - - - - - - - <%-- 11 --%> - - - - - - <%-- 12 --%> - - - - - - <%-- 13 --%> - - - - - - <%-- 14 --%> - - - - - - <%-- 15 --%> - - - - - - <%-- 16 --%> - - - - - - <%-- 17 --%> - - - - - -
    -
    - - -
    - -
    -
    - - - - - - -       - - - - - - Factura - - - - - - Fecha - - - - - - Total - - - - - - - Anticipo/NC - -   - - - - - - Mon - -   - - - - - - - - - - - - Aux - - - - - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Original
    - - - - - -
    - - - - - - -
    - - -
    -
    -
    SubTotal:
    -
    - - - -  
    Descuentos: - - -  
    Amort. Ant.: - - -   -   -   -   - - - - -
    SubTotal 2: - - - - -  
    IVA: - - - - - - - Deglose 6% - <%----%> - - - 8% - 16% - 0% - -
    Ret. IVA: - - - - - - - -
    Ret ISR: - - - - - % - - -
    IEPS: - - -
    O.Imp: - - -
    Redondeo: - - -
    Total: - - - - - -
    - - - - - - - -
    - TC: - - - - -
    -
    -
    -
    -
    -
    - -
    - - -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    -
    -
    -
      -
    • Aplica consignación: - - - - -
    • -
      -
    • - - - - -
    • -
    • Consignación: - - - - -
    • - <%--
    • Folio Consignación: - - - - -
    • --%> -
    -
    -
    - - <%----%> -
    -
    -
    -
    -
    - - - - - - - - - - -
    - - Archivo -
    - -
    -
    -
    - - - - - - - - Aplica
    - Inventario
    - -
    - - - -
    - - - -
    - - -
    - -
    - - - - - - - - - Almacén
    - -
    -
    - - - - - - - - - <%-- - - - - --%> - - - Almacén Consignación
    - -
    - - - -
    - - - - - - - - - - - - - <%-- - - - - --%> -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - Producto - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - -
    -
    - - Factura de la nota de Credito -
    -
    -
    -
    -
    - -
    - - - - - - -
    Compra: - - - -
    -
    -
    -
    -
    -
    - - - - - -
    Almacen: - -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - - -
    -
    - -
    - -
    -
    -
    -
    -
      -
    • Tipo Cambio: - - - - - - - -
    • -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    - - Advertencia: - -
    -
    -
    - -
    - -
    -
    -
    -
    - - Advertencia: - -
    -
    -
    -
    - -
    -
    -
    -
    - - Nota: - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - Promoción: -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - Ordenes de Compra con Almacén: -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    - - - -            - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - - - - - - - - - - <%-- --%> - - - - - - - - - <%-- --%> - - - - - - - - - - <%-- --%> - - - - - - - - - - <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - - - - - - <%-- --%> - - - - - - - - - - <%-- --%> - - - - - - - - - <%-- --%> - -
    Importes VinculadosCalculados
    Tipo De Cambio - - - - - -
    Subtotal - - - - - -
    Descuento - - - - -
    Subtotal 2 - - - - - - -
    IEPS - - - - -
    IVA - - - - -
    Ret IVA - - - - -
    Ret ISR - - - - -
    Total - - - - -
    -
    - -
    -
    -
    -
    - - Datos de la Compra - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - -
    - - - - - - - - - - -
    - -
    - - Clasificación - - - -
    - Producto/Servicio - - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Subtotal - - -
    Descuento - - -
    Subtotal 2 - - -
    IEPS - - -
    IVA - - -
    Ret IVA - - -
    Ret ISR - - -
    Anticipos: - - -
    Total - - -
    -
    - -
    - - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - - -
    -
    - - <%-- - - - - - - - - - - -
    #Est - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    --%> - - - Activos Fijos - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    #CantidadUnidadProductoObservaciónVinculación AFHorómetro / OdómetroMantenimientoDividir
    -
    -
    - - - - - - - -
    -
    - - - - - - - - - - - - - - -
    #CantidadUnidadProductoObservaciónVinculacion AF
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - <%-- - - -
    --%> - -
    -
    -
    - - - - <%----%> - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - -
    #CantidadUnidadProductoObservaciónReferencia - - Personal - - - -
    - - - -
    Desglosar
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - <%-- - - -
    --%> - -
    -
    -
    - - - - - - - - - - -
    - - -
    -
    - - - - - - - <%----%> - <%-- - - - - - - - --%> - - <%-- --%> - - - - - - - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - Condiciones de la compra -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    Método Pago: -
    Fecha Pago: -
    - - - - - - - - - - - - - - -
    -
    - -
    - -
    - - - - - - Personal/Empleado - Caja Chica - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    Reembolso: - - - Personal/Empleado - Caja Chica -
    #
    -
    -
    - - - - - - - <%-- --%> - -
    - - - Crédito - Contado - Reembolsos - Crédito Financiero - -
    Numero de Reembolso: - - - -
    - - - -
    -
    - -
    - -
    - -
    -
    - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - <%--<%--Reembolsos--%> -
    - <%-- - - - -
    - - - - - - - -
    --%> - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Observaciones -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - - - - - - -
    Observaciones Generales: 
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Acciones -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - - - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - Facturas Aplicadas -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - -
    -
    -
    -
    - - - - - - <%--********* INICIAN MODALES ***********--%> - - - - - - - - - <%----%> - - - - - - - -
    -
    -
    - -
    -
    - <%----%> - Bitácora -
    -
    -
    - <%--
    - - Agregar -
    --%> -
    -
    - - - -
    -
    -
    - -
    - - - - - - - Fecha - - - - - - Fecha Agenda - - - - - - Usuario - - - - - - Descripción - - - - - - Archivo - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - <%-- MODAL SERIE-LOTE ALMACEN --%> - - - - - -
    -
    -
    -
    -
    - - Historial de Modificación -
    -
    -
    -
    -
    -
    -
    - - - - Fecha - - - - - - - - - - -
    -
    -
    -
    -
    -
    - - - - - - <%--MODAL PREGUNTA IEPS y Otros Impuestos--%> - - - - <%--MODAL IR A OC--%> - - - <%--FLETES--%> - - - - - - - - - - - <%--MODAL AGREGAR/EDITAR PS--%> - - - <%-- PS NO REGISTRADO - AGREGAR ALIAS A PRODUCTO--%> - - - <%-- UM NO REGISTRADA - AGREGAR ALIAS/EQUIVALENCIA --%> - - - <%-- COMPLEMENTOS PAGO --%> - - - - - - - <%-- ACTUALIZAR TIPO CAMBIO PREPOLIZA --%> - - - - - - <%-- MODAL FLETES E IMPORTACIONES --%> - - - -<%-- --%> - - - - - - - diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2c17d3d82..2210878a2 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1079,6 +1079,13 @@ Partial Class ContabilidadC_RegPrePolizaS Else DdlPersonalE.Visible = False End If + + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(51) Then + CargaClasificacionesE() + DdlClasificacionesE.Visible = True + Else + DdlClasificacionesE.Visible = False + End If If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then CargaClientesE() DdlClientesE.Visible = True @@ -1136,6 +1143,12 @@ Partial Class ContabilidadC_RegPrePolizaS DdlPersonalE.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonalE.DataBind() DdlPersonalE.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + Private Sub CargaClasificacionesE() + DdlClasificacionesE.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacionesE.DataBind() + DdlClasificacionesE.Items.Insert(0, New ListItem(" - ", "-1")) End Sub Private Sub DdlProveedoresE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedoresE.SelectedIndexChanged CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero) diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index fb51b55b5..1653e71d9 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -1048,7 +1048,7 @@ Partial Class Contratos_Default TxtPorAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero TxtPorAmortizacionAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero TxtPorGarantia.Text = ObjContratos.PorGarantia.FormatoNumero - DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString + 'DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero) DdlSubProyectoContrato.SelectedValue = ObjContratos.CveSubProyecto.ToString TxtPorIVA.Text = ObjContratos.PorIVA.ToString diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index b4a6d3302..93b79843a 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -294,6 +294,11 @@ Partial Class Inventarios_EntradasSalidas Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then + If UsuarioActual.CveUsuario = 100 AndAlso IfNull(Request("Regenera"), "").ToString = "1" Then + RegeneraRM(Request("CveMovimiento").ToString.ToEntero, 119) + Exit Sub + End If + CveMovimiento = -1 CveMovimientoRelacionado = -1 TieneRelacionado = -1 @@ -3594,45 +3599,52 @@ Partial Class Inventarios_EntradasSalidas End If Next Else - If ObjInventario.Modulo = "ASA/G1" Then + If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then Contabilizable = False - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 289, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then ErrorMovInv = True End If Else - If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then - 'genero las prepolizas manuales - Dim tCveConcepto As Integer = 95 - Dim CveCuenta As Integer - If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519 - IdCtaContable = 1 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then + If ObjInventario.Modulo = "ASA/G1" Then + Contabilizable = False + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then ErrorMovInv = True - End If - Else - - Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero - Dim tCveConcepto As Integer = 69 - If DdlConcepto.SelectedValue = "30" Then - tCveConcepto = 181 - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero - End If - - For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL - If tCveConcepto = 69 Then - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then + 'genero las prepolizas manuales + Dim tCveConcepto As Integer = 95 + Dim CveCuenta As Integer + If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519 + IdCtaContable = 1 + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then ErrorMovInv = True - Exit For + End If - Next + Else + Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero + Dim tCveConcepto As Integer = 69 + If DdlConcepto.SelectedValue = "30" Then + tCveConcepto = 181 + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero + End If + + For Each RowInv As DataRow In tmpCostos.Rows + ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + If tCveConcepto = 69 Then + IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + ErrorMovInv = True + Exit For + End If + + Next + + End If End If End If End If @@ -4840,6 +4852,76 @@ Partial Class Inventarios_EntradasSalidas End Sub + Private Sub RegeneraRM(CveMovD As Integer, CveMov2 As Integer) + 'Dim Retorno As Integer = -1 + 'Dim ErrorMovInv As Boolean = False + 'Dim ObjConta As New ClsContabilidad + 'ObjConta.IniciaTransacSQL() + 'Dim ObjInventario As New ClsInventarios(ObjConta.IniciaTransacSQL) + 'Dim CveMovimientoInsertado As Integer = 0 + 'Dim Fecha As Date + 'Dim Importe As Decimal + + 'If ObjInventario.GetMovimientosDetalleTransitorio(CveMovD, UsuarioActual.CveEmpresa) Then + + + ' Fecha = ObjInventario.DtResultados.Rows(0)("FechaMovto").ToString.ToDate + + ' Dim dtvirtual As DataTable = ObjInventario.DtResultados + + ' If dtvirtual.Rows.Count > 0 Then + ' CveMovimientoInsertado = ObjInventario.AddMovimiento(352, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/VM") + + ' For Each RowVirtual As DataRow In dtvirtual.Rows + ' Dim CvePS = RowVirtual("CvePS").ToString().ToEntero() + ' Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble() + ' Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal() + ' Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero() + ' Dim CveMovimientoDetalle As Integer = RowVirtual("CveMovimientoDetalle").ToString().ToEntero() + + ' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInsertado, CantidadUsado, CveUM, CvePS, PU, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ' ErrorMovInv = True + ' Exit For + ' End If + ' Next + + ' If ObjInventario.GetMovimientosDetalle(CveMovimientoInsertado, UsuarioActual.CveEmpresa) Then + + ' Dim resultado As DataTable = ObjInventario.DtResultados + ' Importe = resultado.SUMD("Total").RoundSQL + + ' Dim Contabilizable As Boolean = False + ' Dim Concepto As String = "Traspaso" + ' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Manualx", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoInsertado, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ' ErrorMovInv = True + ' End If + + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovD, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ' ErrorMovInv = True + ' End If + + ' If Not ErrorMovInv Then Retorno = CvePrePoliza + + ' End If + ' End If + 'Else + ' ErrorMovInv = True + 'End If + + 'If ErrorMovInv Then + ' ObjConta.RollBack() + ' Alert("No se aplico", TipoMensaje.MsgError) + 'Else + ' ObjConta.Commit() + ' Alert("Se aplico", TipoMensaje.MsgInformacion) + 'End If + + 'ObjConta.Dispose() + 'ObjInventario.Dispose() + + End Sub + End Class diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 097e61ba0..e45b5635f 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2307,6 +2307,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim ObjOC As New ClsOC(ObjInventario.IniciaTransacSQL()) Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL()) + Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL()) Dim ObjContaAC As ClsContPAQi = Nothing Dim ObjContaContPAQ As ClsContPAQi = Nothing @@ -2629,6 +2630,36 @@ Partial Class Inventarios_RecepcionAlmacen If Not ErrorMovInv Then MovtosEntradaExA.Add(MovEntradaExA.CveMovimiento) FoliosEntradaExA.Add(MovEntradaExA.Folio) + + 'SI LA REMISION FUE FACTURADA GENERA EL MOVIMIENTO DE SALIDA DIRECTA + If ObjFactura.DtRemisionesDocumentosRelacionados.Rows.Count > 0 Then + If ObjVentas.VerificarRemisionFacturada(ObjFactura.CveVenta) Then + + Dim dttsalida As DataTable = dttexa.Copy + 'se limpia la seccion, para que lo tome automaticamente + For Each drr As DataRow In dttsalida.Rows + Dim RowFactura As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVentaDetalleRemision={drr("CveVentaDetalle")}") + drr("CveVentaDetalle") = RowFactura("CveVentaDetalleFacturada") + drr("CveVenta") = RowFactura("CveVenta") + Next + + For Each DrFactura As DataRow In Dt.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows + Dim dtSalidaFactura As DataTable = dttsalida.FiltraParametros($"CveVenta={DrFactura("CveVenta")}") + Dim MovSalidaDirectaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 40, DrFactura("CveVenta").ToString().ToEntero(), MovEntradaExA.CveMovimiento, dtSalidaFactura, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R3") + + ErrorMovInv = MovSalidaDirectaExA.CveMovimiento <= 0 + + If ErrorMovInv Then + Exit For + Else + MovtosSalidaDirecta.Add(MovSalidaDirectaExA.CveMovimiento) + FoliosSalidaDirecta.Add(MovSalidaDirectaExA.Folio) + End If + + Next + + End If + End If End If End If @@ -3459,6 +3490,8 @@ Partial Class Inventarios_RecepcionAlmacen link = String.Format("{1}", MovtosSalidaDirecta(index), FoliosSalidaDirecta(index)) Msg.AppendFormat("
    Movimiento de Salida Folio: {0}", link) Next + + End If 'APARTADO diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 320899cee..95743d634 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -802,6 +802,7 @@ Partial Class Inventarios_ResguardoMaterial Private Sub Guardar(Concepto As Integer) Dim ObjInventario As New ClsInventarios Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL()) 'Inicia la transacción + Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim TieneError = False Dim MensajeError As String = "" Dim ImporteConcepto = 0.0 @@ -854,6 +855,7 @@ Partial Class Inventarios_ResguardoMaterial If Not TieneError Then CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 2, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservaciones.Text, CvePersonal:=CvePersonal, CveMovimientoRelacionado:=CveMovimientoSalida, CveCliente:=CveCliente, CveProveedor:=CveProveedor, Modulo:="ResgMat2") FolioEntrada = ObjInventario.Folio + Dim Importe As Decimal = 0 If CveMovimientoEntrada <= 0 Then MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar." @@ -862,6 +864,7 @@ Partial Class Inventarios_ResguardoMaterial If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim CveSeccionAlmacen As Integer = 0 + Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL For Each Dr As DataRow In ObjInventario.DtResultados.Rows If CBool(Dr("AplicaSeccion")) Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero @@ -880,6 +883,10 @@ Partial Class Inventarios_ResguardoMaterial Next End If End If + + 'registra la prepoliza + + ContabilizaMovimientoAlmacen(ObjConta, Fecha, "Resguardo", "ResgMat", CveMovimientoSalida, CveMovimientoEntrada, Importe, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) End If Case 24 'LIBERACION @@ -914,6 +921,7 @@ Partial Class Inventarios_ResguardoMaterial If Not TieneError Then CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero, 23, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservacionesLiberacion.Text, CvePersonal:=CvePersonalLiberacion, CveMovimientoRelacionado:=CveMovimientoSalida, CveProveedor:=CveProveedorLiberacion, CveCliente:=CveClienteLiberacion, MovimientoFijo:=True, Modulo:="ResgMat4") FolioEntrada = ObjInventario.Folio + Dim Importe As Decimal = 0 If CveMovimientoEntrada <= 0 Then MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar." @@ -921,6 +929,7 @@ Partial Class Inventarios_ResguardoMaterial Else If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Cont = 0 + Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL For Each Dr As DataRow In ObjInventario.DtResultados.Rows Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero 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, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then @@ -932,6 +941,9 @@ Partial Class Inventarios_ResguardoMaterial Cont += 1 Next End If + + ContabilizaMovimientoAlmacen(ObjConta, Fecha, "Resguardo", "ResgMat", CveMovimientoSalida, CveMovimientoEntrada, Importe, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) + End If End If @@ -981,6 +993,25 @@ Partial Class Inventarios_ResguardoMaterial ObjInventario.Dispose() ObjEventos.Dispose() End Sub + + Public Function ContabilizaMovimientoAlmacen(ByRef ObjConta As ClsContabilidad, Fecha As Date, Concepto As String, Modulo As String, CveMovimientoSalida As Integer, CveMovimientoEntrada As Integer, Importe As Decimal, CveUsuario As Integer, CveEmpresa As Integer, Contabilizable As Boolean) As Integer + Dim Retorno As Integer = -1 + Dim ErrorMovInv As Boolean = False + + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas(Modulo, 53, 0, 0, 1, Fecha, Concepto, CveUsuario, CveEmpresa) + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ErrorMovInv Then Retorno = CvePrePoliza + + Return Retorno + End Function + Private Function AgregarAgenda(ByRef ObjEventos As ClsOIEventos, FolioEntrada As Integer, FolioSalida As Integer) As Boolean Dim TieneError As Boolean = False Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1", CveAgendaTipo = 4, Prioridad = 3, CveTipoEvento = 2, Importe = -1 diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 06766458f..eaf48f3d2 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -650,7 +650,7 @@
    - + <%-- diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 5146a4a86..4639c8aea 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -971,7 +971,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUMD("Total").RoundSQL + Dim importe As Decimal = resultado.SUMD("Total").RoundAD 'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero 'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero Dim Contabilizable As Boolean = True @@ -1012,7 +1012,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUMD("Total").RoundSQL + Dim importe As Decimal = resultado.SUMD("Total").RoundAD Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then @@ -1532,7 +1532,7 @@ Partial Class Inventarios_TraspasoAlmacen If Dtt IsNot Nothing Then If TxtFolioRecepcion.Text.Trim <> "" Then - CveMovimientoSalida = ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimiento", "").ToEntero + CveMovimientoSalida = Dtt.FiltroPrimeroValor("CveMovimiento", "").ToEntero End If CveAlmacenDestino = DdlAlmacenRecepcion.SelectedValue.ToEntero @@ -1736,7 +1736,7 @@ Partial Class Inventarios_TraspasoAlmacen End If If Not ErrorMovInv Then - Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL + Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundAD Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, @@ -1810,6 +1810,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim ObjInventario As New ClsInventarios Dim Dtt As DataTable = Nothing Dim CveMovimientoEntrada As Integer = 0 + Dim CveMovimientoSalidaTransitorio As Integer = 0 Dim Folio = 0 Dim ErrorMovInv As Boolean = False Dim TextoError = "" @@ -1845,15 +1846,15 @@ Partial Class Inventarios_TraspasoAlmacen 'AGREGAMOS LA SALIDA - 'CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, - ' Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11") + CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, + Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11") 'AGREGAMOS LA ENTRADA CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1") Folio = ObjInventario.Folio - If CveMovimientoSalida <= 0 Then + If CveMovimientoSalidaTransitorio <= 0 Then TextoError = "No se pudo generar el movimiento de salida correctamente" ErrorMovInv = True Else @@ -1887,12 +1888,16 @@ Partial Class Inventarios_TraspasoAlmacen TextoError = "Ocurrió un error al guardar los movimientos de salida" Exit For End If - ''MOV, Alm, Transito - 'If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then - ' ErrorMovInv = True - ' TextoError = "Ocurrió un error al guardar los movimientos de salida" - ' Exit For - 'End If + 'MOV, Alm, Transito + If gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero > 0 Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then + ErrorMovInv = True + TextoError = "Ocurrió un error al guardar los movimientos de salida" + Exit For + End If + Else + CveMovimientoSalidaTransitorio = 0 + End If ElseIf cantidadDisponibleValidacion < 0 Then TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString) @@ -1903,22 +1908,26 @@ Partial Class Inventarios_TraspasoAlmacen If Not ErrorMovInv Then Dim Concepto As String = TxtObservacionesRecepcion.Text If Concepto = "" Then Concepto = "Recepción Traspaso" - 'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - 'If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then - ' Dim resultado As DataTable = ObjInventario.DtResultados - ' Dim importe As Decimal = resultado.SUMD("Total").RoundSQL - ' Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero + Dim resultado As DataTable = ObjInventario.DtResultados + Dim importe As Decimal = resultado.SUMD("Total").RoundAD + Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero + Dim tCveConcepto As Integer = 68 - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then - ' ErrorMovInv = True - ' End If + If CveMovimientoSalidaTransitorio = 0 Then + tCveConcepto = 289 + End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, tCveConcepto, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=importe, Contabilizable:=False) Then + ErrorMovInv = True + End If - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then - ' ErrorMovInv = True - ' End If - 'End If - End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then + ErrorMovInv = True + End If + End If + End If End If diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs index e1507fd52..b89c02fb9 100644 --- a/Nomina/Aguinaldo.aspx.cs +++ b/Nomina/Aguinaldo.aspx.cs @@ -537,16 +537,8 @@ Aguinaldoapagar if (Listaparametros!= null) { foreach (parametroQuery pr in Listaparametros) - { - if (pr.SqlDataType != null) - { - if (pr.ParameterDirection != null) - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; - else - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value; - } - else - SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue); + { + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; } } @@ -586,15 +578,7 @@ Aguinaldoapagar { foreach (parametroQuery pr in Listaparametros) { - if ( pr.SqlDataType != null) - { - if ( pr.ParameterDirection != null) - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; - else - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value; - } - else - SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue); + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; } } @@ -714,18 +698,18 @@ Aguinaldoapagar } } -public class parametroQuery -{ - public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection)) - { - this.ParameterName = parameterName; - this.SqlDataType = sqlDataType; - this.ParameterDirection = parameterDirection; - this.SqlValue = sqlValue; - } +//public class parametroQuery +//{ +// public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection)) +// { +// this.ParameterName = parameterName; +// this.SqlDataType = sqlDataType; +// this.ParameterDirection = parameterDirection; +// this.SqlValue = sqlValue; +// } - public string ParameterName { get; set; } - public SqlDbType SqlDataType { get; set; } - public ParameterDirection ParameterDirection { get; set; } - public object SqlValue { get; set; } -} +// public string ParameterName { get; set; } +// public SqlDbType SqlDataType { get; set; } +// public ParameterDirection ParameterDirection { get; set; } +// public object SqlValue { get; set; } +//} diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx index c77da1039..c2112291a 100644 --- a/Nomina/Finiquito.aspx +++ b/Nomina/Finiquito.aspx @@ -4,6 +4,37 @@ - Finiquito -
  • - Cambiar Empleado
  • + done_allAutorizar +
  • - ReCalcular
  • + Timbrar +
  • - done_allAutorizar
  • -
  • - Timbrar
  • -
  • - Formato Renuncia
  • + Formato Finiquito +
    @@ -83,79 +82,177 @@ - - -
    -
    - -
    -
    -
    - - Datos del Empleado -
    -
    - - -
    -
    -
    -
    -
    Empleado:
    -
    - -
    -
    -
    -
    Estatus
    -
    - -
    -
    -
    -
    Motivo Baja
    -
    - -
    -
    -
    -
    Fecha Baja
    -
    - -
    -
    -
    -
    Perido Finiquito
    -
    - -
    -
    -
    -
    -
    - -
    - - - - - -
    -