diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 72ba56b54..4ddd2d56a 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1445,7 +1445,7 @@ Public Class ClsBancos .Add("@FechaDocumento", SqlDbType.Date).Value = FechaDocumento .Add("@Folio", SqlDbType.VarChar).Value = Folio .Add("@PagueseA", SqlDbType.VarChar).Value = PagueseA - .Add("@Importe", SqlDbType.Money).Value = Importe + .Add("@Importe", SqlDbType.Money).Value = Importe.RoundSQL .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@TipoCambio", SqlDbType.Float).Value = TipoCambio .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 23ef846b9..9845e2643 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -1463,7 +1463,7 @@ Public Class ClsClientes #Region "D I R E C C I O N D E E N V I O " Public Function DireccionEnvioAdd(CveCliente As Integer, EnvioDireccion As String, EnvioNoExt As String, EnvioNoInt As String, EnvioColonia As String, EnvioCiudad As String, EnvioEstado As String, EnvioCP As Integer, EnvioContacto As String, CveUsuario As Integer, Estatus As Integer, Optional CveClienteSucursal As Integer = -1, Optional EnvioDepartamento As String = "-1", Optional EnvioTel As String = "-1", - Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1) As Integer + Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1, Optional CveEmpresa As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Vta_ClientesDireccionesEnvioAdd") @@ -1488,6 +1488,7 @@ Public Class ClsClientes .Add("@CveMunicipio", SqlDbType.Int).Value = CveMunicipio .Add("@CveLocalidad", SqlDbType.Int).Value = CveLocalidad .Add("@CveColonia", SqlDbType.Int).Value = CveColonia + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveDireccionEnvio", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index 08b2a0361..a7c6401b3 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -246,14 +246,14 @@ Public Class ClsEdocumentacion End Try Return Retorno - End Function + End Function #End Region - - + + #Region "D O C U M E N T A C I O N - E L E C T R O N I C A" - - - Public Function DocumentacionElectronicaGet(CvePersonal As Integer, CveCliente As Integer, CveProveedor As Integer, CveEmpresa As Integer, CveDocumentacionTipo As Integer, Optional CveVenta As Integer = -1, Optional Modulo As Integer = 1) As Boolean + + + Public Function DocumentacionElectronicaGet(CvePersonal As Integer, CveCliente As Integer, CveProveedor As Integer, CveEmpresa As Integer, CveDocumentacionTipo As Integer, Optional CveVenta As Integer = -1, Optional Modulo As Integer = 1, Optional Periodo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionElectronicaGet") @@ -265,6 +265,7 @@ Public Class ClsEdocumentacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@Periodo", SqlDbType.Int).Value = Periodo .Add("@Modulo", SqlDbType.Int).Value = Modulo End With @@ -279,7 +280,7 @@ Public Class ClsEdocumentacion End Function Public Function DocumentacionElectronicaAdd(CveDocumentacion As Integer, CvePersonal As Integer, CveCliente As Integer, CveProveedor As Integer, Estatus As Integer, Observacion As String, Adjunto As String, - CveUsuario As Integer, FechaLimite As Date, Optional FechaVigencia As Date = Nothing, Optional CveVenta As Integer = -1, Optional Observacion2 As String = "-1") As Integer + CveUsuario As Integer, FechaLimite As Date, Optional FechaVigencia As Date = Nothing, Optional CveVenta As Integer = -1, Optional Observacion2 As String = "-1", Optional Periodo As Integer = 190001) As Integer Dim Retorno As Integer = 0 @@ -298,6 +299,7 @@ Public Class ClsEdocumentacion .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@FechaLimite", SqlDbType.Date).Value = FechaLimite .Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia + .Add("@Periodo", SqlDbType.Int).Value = Periodo .Add("@CveDocumentacionElectronica", SqlDbType.Int).Direction = ParameterDirection.Output 'FechaVigencia End With @@ -534,6 +536,9 @@ Public Class ClsEdocumentacion Dim retorno As Boolean = False Try SqlAdapter.Fill(DSet) + If DSet.Tables.Count > 0 Then + Data = DSet.Tables(0) + End If retorno = True Catch ex As Exception retorno = False @@ -543,8 +548,64 @@ Public Class ClsEdocumentacion End Function +#Region "CRUD_Edoc_MaterialidadEnvios" + Public Function Edoc_MaterialidadEnviosGet(cveMaterialidadEnvios As Int32, cveCliente As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadEnviosGet", CommandType.StoredProcedure) + addParameters("@CveMaterialidadEnvios", SqlDbType.Int, cveMaterialidadEnvios) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + retorno = RunQuery("Ocurrió un error al obtener el Edoc_MaterialidadEnvios.") + Return retorno + End Function + Public Function Edoc_MaterialidadEnviosAdd(cveCliente As Int32, periodo As Int32, noarchivos As Int32, observacion As String, Correos As String, cveUsuario As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadEnviosAdd", CommandType.StoredProcedure) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + addParameters("@Periodo", SqlDbType.Int, periodo) + addParameters("@Noarchivos", SqlDbType.Int, noarchivos) + addParameters("@Observacion", SqlDbType.VarChar, observacion) + addParameters("@Correos", SqlDbType.VarChar, Correos) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + retorno = RunQuery("Ocurrió un error al agregar el Edoc_MaterialidadEnvios.") + Return retorno + End Function + Public Function Edoc_MaterialidadEnviosUp(cveMaterialidadEnvios As Int32, cveCliente As Int32, periodo As Int32, noarchivos As Int32, observacion As String, cveUsuario As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadEnviosUp", CommandType.StoredProcedure) + addParameters("@CveMaterialidadEnvios", SqlDbType.Int, cveMaterialidadEnvios) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + addParameters("@Periodo", SqlDbType.Int, periodo) + addParameters("@Noarchivos", SqlDbType.Int, noarchivos) + addParameters("@Observacion", SqlDbType.VarChar, observacion) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + retorno = RunQuery("Ocurrió un error al actualizar el Edoc_MaterialidadEnvios.") + Return retorno + End Function + Public Function Edoc_MaterialidadEnviosRemove(cveMaterialidadEnvios As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadEnviosRemove", CommandType.StoredProcedure) + addParameters("@CveMaterialidadEnvios", SqlDbType.Int, cveMaterialidadEnvios) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + retorno = RunQuery("Ocurrió un error al eliminar el Edoc_MaterialidadEnvios.") + Return retorno + End Function +#End Region #Region "CRUD_Edoc_Materialidad" - + Public Function materialidadDoctos(strxml As String, cveUsuario As Integer, cveEmpresa As Integer, periodo As Integer, Optional guardar As Boolean = False) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_MaterialidadAddXmlDoctos", CommandType.StoredProcedure) + addParameters("@strxml", SqlDbType.Xml, If(String.IsNullOrEmpty(strxml.Trim()), DBNull.Value, DirectCast(strxml, Object))) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@Periodo", SqlDbType.Int, periodo) + addParameters("@Guardar", SqlDbType.Bit, guardar) + retorno = RunQueryds("Ocurrió un error al analizar archivos.") + Return retorno + End Function Public Function TableroMaterialidadGET(cveEmpresa As Integer, anio As Integer, mes As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Edoc_TableroMaterialidad", CommandType.StoredProcedure) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 7bf8d911c..d517fbe4e 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3650,8 +3650,7 @@ Public Class ClsGenerales Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0, - Optional CveEntregaAlmacen As Integer = -1, - Optional AplicaCP As Boolean = False) As Integer + Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Gral_TimbreAdd") @@ -3696,7 +3695,7 @@ Public Class ClsGenerales With SqlAdapter.SelectCommand.Parameters .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -3818,13 +3817,17 @@ Public Class ClsGenerales .Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada + .Add("@Tipo", SqlDbType.VarChar).Value = Tipo + .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia .Add("@Referencia", SqlDbType.VarChar).Value = Referencia - .Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite - .Add("@Orden", SqlDbType.Int).Value = Orden - .Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Estatus", SqlDbType.VarChar).Value = Estatus .Add("@Distancia", SqlDbType.Int).Value = Distancia + + .Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite + + + .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 92cd449be..b3cf9ba5b 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -174,6 +174,46 @@ Public Class ClsNominas End Sub #End Region + Public Function AutorizaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, PersonalXml As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_AutorizaCalculoAnual", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@PersonalXml", SqlDbType.Xml).Value = If(String.IsNullOrEmpty(PersonalXml), DBNull.Value, DirectCast(PersonalXml, Object)) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al aplicar calculo anual.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener los agro departamentos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function PersonalAplicaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, CvePersonal As Integer, Aplica As Integer, motivo As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_PersonalAplicaCalculoAnual", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Aplica", SqlDbType.Int).Value = Aplica + .Add("@Motivo", SqlDbType.VarChar).Value = motivo + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al aplicar calculo anual.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener los agro departamentos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function #Region "ClsNominas_Nominas" Public Function NominaUpMetododepago(cveEmpresa As Integer, CvePersonal As Integer, CvePeriodo As Integer, MetodoPagoFijo As Boolean, @@ -2356,6 +2396,14 @@ Public Class ClsNominas Return retorno End Function + Public Function CalculoISRAnual(ejercicio As Integer, cveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_CalculoISRAnual", CommandType.StoredProcedure) + addParameters("@Ejercicio", SqlDbType.Int, ejercicio) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + retorno = RunQuery("Ocurrió un error al obtener el PA_Nom_CalculoISRAnual.") + Return retorno + End Function Public Function GetNominaAcumulado(Ejercicio As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodoI As Integer, CvePeriodoF As Integer, CveEmpresa As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean Dim retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 1f84f03f7..156c363ff 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4179,6 +4179,9 @@ Public Class ClsPaginas PaginaDict.Add("/Nomina/NomTimbrados.aspx".ToUpper(), 920) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/RepInversiondeNomina.aspx".ToUpper(), 906) + PaginaDict.Add("/Nomina/CalculoISRAnual.aspx".ToUpper(), 983) + PaginaDict.Add("/Documentacion/TableroMaterialidad.aspx".ToUpper(), 965) + PaginaDict.Add("/Documentacion/TableroMaterialidadDetalle.aspx".ToUpper(), 965) PaginaDict.Add("/RH/DiasFestivos.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/FiniquitoB.aspx".ToUpper(), -1) ''CONFIGURACIONES GENERALES @@ -5014,6 +5017,7 @@ Public Class ClsPaginas PaginaDict.Add("/Inventarios/CatUnidades.aspx".ToUpper(), 2056) PaginaDict.Add("/Inventarios/EntregaAlmacenRuta.aspx".ToUpper(), 1320) PaginaDict.Add("/Inventarios/RepEntregaAlmacenRuta.aspx".ToUpper(), 1319) + PaginaDict.Add("/Inventarios/CartaPorteManual.aspx".ToUpper(), 1321) @@ -5251,8 +5255,6 @@ Public Class ClsPaginas PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422) PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427) PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428) - PaginaDict.Add("/Documentacion/TableroMaterialidad.aspx".ToUpper(), -1) - PaginaDict.Add("/Documentacion/TableroMaterialidadDetalle.aspx".ToUpper(), -1) PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 5c1b1d796..d333a9036 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1535,6 +1535,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@FechaIIngreso", SqlDbType.VarChar).Value = FechaIIngreso .Add("@FechaFIngreso", SqlDbType.VarChar).Value = FechaFIngreso .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@ISSIG", SqlDbType.Int).Value = 1 End With diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index e8db041ba..ea8833527 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1636,7 +1636,7 @@ Namespace Modelos 'PedidoA' If ObjVentas.CveVenta > 0 And factura.CvePedidoA > 0 And factura.TipoDocto.Contiene("Rem") Then - If Not ObjCliente.UpdateEstatusPedido(factura.CvePedidoA, 18, -1, UsuarioActual.CveUsuario) Then + If Not ObjCliente.UpdateEstatusPedido(factura.CvePedidoA, 18, -1, UsuarioActual.CveUsuario, CveRemision:=ObjVentas.CveVenta) Then ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA") End If End If @@ -5806,7 +5806,7 @@ Namespace Modelos Exit For End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, CveAF:=DrRem("CveActivoFijo").ToString.ToEntero, Serie:=DrRem("Serie").ToString, Lote:=DrRem("Lote").ToString, CveVentaDetalle:=CveVentaDetalleRem, CveMovimientoDetalleEntrada:=DrRem("CveMovimientoDetalle").ToString().ToEntero(), CveSeccionAlmacen:=-3) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, CveAF:=DrRem("CveActivoFijo").ToString.ToEntero, Serie:=DrRem("Serie").ToString, Lote:=DrRem("Lote").ToString, FechaCaducidad:=DrRem("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=CveVentaDetalleRem, CveMovimientoDetalleEntrada:=DrRem("CveMovimientoDetalle").ToString().ToEntero(), CveSeccionAlmacen:=-3) Then ErrorCancelar = True Exit For End If @@ -5829,7 +5829,7 @@ Namespace Modelos If Not ErrorCancelar Then If DtEntradaDetalle IsNot Nothing Then For Each Dr As DataRow In DtEntradaDetalle.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=-3) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveSeccionAlmacen:=-3) Then ErrorCancelar = True Exit For End If diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index a8263dfde..8dfb746a1 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -119,7 +119,8 @@ Public Class Timbres Dim Distancia As Integer = 1 Dim ObjGrales As New ClsGenerales - If ObjGrales.GetGralTimbre(CveTimbre, "-1", FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then + + If ObjGrales.GetGralTimbre(CveTimbre, Obj.TipoDocto, FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then If ObjGrales.DtResultados.Rows.Count = 1 Then Dim DtMovimientos As DataTable = Nothing @@ -144,20 +145,20 @@ Public Class Timbres End If If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then - DtMovimientos = ObjGrales.DtResultados - Else - TieneError = True - _MsgError.AppendLine("Error al obtener Movimientos") - End If + DtMovimientos = ObjGrales.DtResultados + Else + TieneError = True + _MsgError.AppendLine("Error al obtener Movimientos") + End If - ObjFactura.DtDetalle = DtMovimientos + ObjFactura.DtDetalle = DtMovimientos - AplicaCP = Boolean.Parse(drT("AplicaCP").ToString) + AplicaCP = Boolean.Parse(drT("AplicaCP").ToString) - ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero + ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero - ObjFactura.SetSubProyecto() - ObjFactura.SetSubProyectoMatriz() + ObjFactura.SetSubProyecto() + ObjFactura.SetSubProyectoMatriz() If AplicaCP Then @@ -264,7 +265,7 @@ Public Class Timbres .Unidad = drr("UM").ToString, .Dimensiones = "", .PesoenKg = drr("PesoKg").ToString.ToDecimal, - .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", "No"), + .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""), .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, .Embalaje = drr("ClaveEmbalaje").ToString, .DescripEmbalaje = drr("Embalaje").ToString, @@ -274,7 +275,7 @@ Public Class Timbres .UUIDComercioExt = "" } - Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal} + Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal} conceptoCarta.DetalleMercancia = DetalleMercancia Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"} @@ -331,15 +332,17 @@ Public Class Timbres _MsgError.AppendLine("timbrado son detalle de productos") End If - End If + End If - Else - TieneError = True + Else + TieneError = True _MsgError.AppendLine("Consultar datos de timbrado") End If ObjGrales.Dispose() - + Else + Timbre = Nothing + _MsgError.AppendLine("Consultar datos de timbrado") End If Return Timbre End Function diff --git a/App_WebReferences4/App_WebReferences.rar b/App_WebReferences4/App_WebReferences.rar new file mode 100644 index 000000000..a2a97c94b Binary files /dev/null and b/App_WebReferences4/App_WebReferences.rar differ diff --git a/App_WebReferences4/Cancelacion/Cancelacion.disco b/App_WebReferences4/Cancelacion/Cancelacion.disco new file mode 100644 index 000000000..6a7ff22e0 --- /dev/null +++ b/App_WebReferences4/Cancelacion/Cancelacion.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/Cancelacion/Cancelacion1.wsdl b/App_WebReferences4/Cancelacion/Cancelacion1.wsdl new file mode 100644 index 000000000..05d511610 --- /dev/null +++ b/App_WebReferences4/Cancelacion/Cancelacion1.wsdl @@ -0,0 +1,496 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cancela un Cfdi en pruebas + + + + + Obtiene el estatus de un Cfdi en producción + + + + + Obtiene el estatus de un Cfdi en pruebas + + + + + Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Producción) + + + + + Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Pruebas) + + + + + Acepta/Rechaza una solicitud pendiente de cancelación (Producción) + + + + + Acepta/Rechaza una solicitud pendiente de cancelación (Pruebas) + + + + + Obtiene el/los Cfdi(s) relacionado(s) de un UUID de un RFC (Pruebas) + + + + + Obtiene el/los Cfdi(s) relacionado(s) de un UUID de un RFC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/Cancelacion/Reference.svcmap b/App_WebReferences4/Cancelacion/Reference.svcmap new file mode 100644 index 000000000..89dc843bf --- /dev/null +++ b/App_WebReferences4/Cancelacion/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_WebReferences4/Cancelacion/configuration.svcinfo b/App_WebReferences4/Cancelacion/configuration.svcinfo new file mode 100644 index 000000000..feac99a9f --- /dev/null +++ b/App_WebReferences4/Cancelacion/configuration.svcinfo @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/Cancelacion/configuration91.svcinfo b/App_WebReferences4/Cancelacion/configuration91.svcinfo new file mode 100644 index 000000000..4c19ea711 --- /dev/null +++ b/App_WebReferences4/Cancelacion/configuration91.svcinfo @@ -0,0 +1,310 @@ + + + + + + + CancelacionSoap1 + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + Transport + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + CancelacionSoap2 + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + https://cancel.gofac.com.mx/Cancelacion.asmx + + + + + + basicHttpBinding + + + CancelacionSoap1 + + + Cancelacion.CancelacionSoap + + + 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 + + + CancelacionSoap1 + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/RCService.disco b/App_WebReferences4/RCGPSService/RCService.disco new file mode 100644 index 000000000..4bb710ab7 --- /dev/null +++ b/App_WebReferences4/RCGPSService/RCService.disco @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/RCService.wsdl b/App_WebReferences4/RCGPSService/RCService.wsdl new file mode 100644 index 000000000..551a9ff02 --- /dev/null +++ b/App_WebReferences4/RCGPSService/RCService.wsdl @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/RCService.xsd b/App_WebReferences4/RCGPSService/RCService.xsd new file mode 100644 index 000000000..637160031 --- /dev/null +++ b/App_WebReferences4/RCGPSService/RCService.xsd @@ -0,0 +1,21 @@ + + + + + + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/RCService1.xsd b/App_WebReferences4/RCGPSService/RCService1.xsd new file mode 100644 index 000000000..9f6160718 --- /dev/null +++ b/App_WebReferences4/RCGPSService/RCService1.xsd @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/RCService2.xsd b/App_WebReferences4/RCGPSService/RCService2.xsd new file mode 100644 index 000000000..f49ca0c3e --- /dev/null +++ b/App_WebReferences4/RCGPSService/RCService2.xsd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/RCService3.xsd b/App_WebReferences4/RCGPSService/RCService3.xsd new file mode 100644 index 000000000..d58e7f39c --- /dev/null +++ b/App_WebReferences4/RCGPSService/RCService3.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/Reference.svcmap b/App_WebReferences4/RCGPSService/Reference.svcmap new file mode 100644 index 000000000..eab2aa3f3 --- /dev/null +++ b/App_WebReferences4/RCGPSService/Reference.svcmap @@ -0,0 +1,35 @@ + + + + false + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/configuration.svcinfo b/App_WebReferences4/RCGPSService/configuration.svcinfo new file mode 100644 index 000000000..a7d7a06f2 --- /dev/null +++ b/App_WebReferences4/RCGPSService/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/RCGPSService/configuration91.svcinfo b/App_WebReferences4/RCGPSService/configuration91.svcinfo new file mode 100644 index 000000000..a9f709562 --- /dev/null +++ b/App_WebReferences4/RCGPSService/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + BasicHttpBinding_IRCService + + + + + + + + + + + + + + + + + + + + + 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://gps.rcontrol.com.mx/Tracking/wcf/RCService.svc + + + + + + basicHttpBinding + + + BasicHttpBinding_IRCService + + + RCGPSService.IRCService + + + 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 + + + BasicHttpBinding_IRCService + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSBancoMexico/DgieWS.wsdl b/App_WebReferences4/WSBancoMexico/DgieWS.wsdl new file mode 100644 index 000000000..e86ca9fcc --- /dev/null +++ b/App_WebReferences4/WSBancoMexico/DgieWS.wsdl @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSBancoMexico/Reference.svcmap b/App_WebReferences4/WSBancoMexico/Reference.svcmap new file mode 100644 index 000000000..1cbb044a0 --- /dev/null +++ b/App_WebReferences4/WSBancoMexico/Reference.svcmap @@ -0,0 +1,30 @@ + + + + false + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSBancoMexico/configuration.svcinfo b/App_WebReferences4/WSBancoMexico/configuration.svcinfo new file mode 100644 index 000000000..0b17e8c67 --- /dev/null +++ b/App_WebReferences4/WSBancoMexico/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSBancoMexico/configuration91.svcinfo b/App_WebReferences4/WSBancoMexico/configuration91.svcinfo new file mode 100644 index 000000000..42048e194 --- /dev/null +++ b/App_WebReferences4/WSBancoMexico/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + DgieWSPortSoapBinding + + + + + + + + + + + + + + + + + + + + + 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://www.banxico.org.mx/DgieWSWeb/DgieWS + + + + + + basicHttpBinding + + + DgieWSPortSoapBinding + + + WSBancoMexico.DgieWSPort + + + 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 + + + DgieWSPort + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSGF/Reference.svcmap b/App_WebReferences4/WSGF/Reference.svcmap new file mode 100644 index 000000000..23755607e --- /dev/null +++ b/App_WebReferences4/WSGF/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_WebReferences4/WSGF/Timbrado.disco b/App_WebReferences4/WSGF/Timbrado.disco new file mode 100644 index 000000000..55ea70cd3 --- /dev/null +++ b/App_WebReferences4/WSGF/Timbrado.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSGF/Timbrado.wsdl b/App_WebReferences4/WSGF/Timbrado.wsdl new file mode 100644 index 000000000..b2f5b2a46 --- /dev/null +++ b/App_WebReferences4/WSGF/Timbrado.wsdl @@ -0,0 +1,409 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Obtiene el timbre, regresa el timbre y el cfdi + + + + + Cancela el timbre + + + + + Obtiene el timbre, regresa el timbre y el cfdi + + + + + Obtiene un Cfdi a través del Uuid + + + + + Obtiene el saldo de timbres de un emisor + + + + + Obtiene los Cfdi emitidos en un rango de tiempo + + + + + Obtiene un Cfdi a través del Uuid + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSGF/configuration.svcinfo b/App_WebReferences4/WSGF/configuration.svcinfo new file mode 100644 index 000000000..77f380f5a --- /dev/null +++ b/App_WebReferences4/WSGF/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSGF/configuration91.svcinfo b/App_WebReferences4/WSGF/configuration91.svcinfo new file mode 100644 index 000000000..344349008 --- /dev/null +++ b/App_WebReferences4/WSGF/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + Service1Soap1 + + + + + + + + + + + + + + + + + + + + + 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://192.168.0.2:8080/ADSistemas/Timbrado.asmx + + + + + + basicHttpBinding + + + Service1Soap1 + + + WSGF.Service1Soap + + + 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 + + + Service1Soap1 + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSKimberlyClark/Reference.svcmap b/App_WebReferences4/WSKimberlyClark/Reference.svcmap new file mode 100644 index 000000000..6c50306af --- /dev/null +++ b/App_WebReferences4/WSKimberlyClark/Reference.svcmap @@ -0,0 +1,31 @@ + + + + false + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSKimberlyClark/Service.disco b/App_WebReferences4/WSKimberlyClark/Service.disco new file mode 100644 index 000000000..b81207155 --- /dev/null +++ b/App_WebReferences4/WSKimberlyClark/Service.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSKimberlyClark/Service.wsdl b/App_WebReferences4/WSKimberlyClark/Service.wsdl new file mode 100644 index 000000000..43b002e2e --- /dev/null +++ b/App_WebReferences4/WSKimberlyClark/Service.wsdl @@ -0,0 +1,1435 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Autenticacion necesaria para la operacion por parte de los prestadores + + + + + Cierre de sesion explicito por parte del prestador + + + + + Inserta un evento, reconoce el prestador por medio del login previo + + + + + Loguea e inserta multiples eventos en modo batch + + + + + Loguea e inserta un evento + + + + + Loguea e inserta un evento indicando ademas de incorporar los sensores + + + + + + + + + Retorna el primer comando de la lista + + + + + Indica que el comando ya fue procesado + + + + + Metodo para informar el estado del comando, retorna verdadero su fue insertado correctamente + + + + + Metodo para el cambio de clave, retorna verdadero si la clave es realmente cambiada. + + + + + Loguea cambia la clave, retorna verdadero si la clave es realmente cambiada. + + + + + Realiza el login y retorna el primer comando de la lista + + + + + Realiza el login y finaliza un comando + + + + + Realiza el login y actualiza el estado de un comando en proceso + + + + + Realiza el login y retorna el primer comando de la lista + + + + + + + Autenticacion necesaria para la operacion por parte de los prestadores + + + + + Cierre de sesion explicito por parte del prestador + + + + + Inserta un evento, reconoce el prestador por medio del login previo + + + + + Loguea e inserta un evento + + + + + + + + + Retorna el primer comando de la lista + + + + + Indica que el comando ya fue procesado + + + + + Metodo para informar el estado del comando, retorna verdadero su fue insertado correctamente + + + + + Metodo para el cambio de clave, retorna verdadero si la clave es realmente cambiada. + + + + + Loguea cambia la clave, retorna verdadero si la clave es realmente cambiada. + + + + + Realiza el login y retorna el primer comando de la lista + + + + + Realiza el login y finaliza un comando + + + + + Realiza el login y actualiza el estado de un comando en proceso + + + + + Realiza el login y retorna el primer comando de la lista + + + + + + + Autenticacion necesaria para la operacion por parte de los prestadores + + + + + Cierre de sesion explicito por parte del prestador + + + + + Inserta un evento, reconoce el prestador por medio del login previo + + + + + Loguea e inserta un evento + + + + + + + + + Retorna el primer comando de la lista + + + + + Indica que el comando ya fue procesado + + + + + Metodo para informar el estado del comando, retorna verdadero su fue insertado correctamente + + + + + Metodo para el cambio de clave, retorna verdadero si la clave es realmente cambiada. + + + + + Loguea cambia la clave, retorna verdadero si la clave es realmente cambiada. + + + + + Realiza el login y retorna el primer comando de la lista + + + + + Realiza el login y finaliza un comando + + + + + Realiza el login y actualiza el estado de un comando en proceso + + + + + Realiza el login y retorna el primer comando de la lista + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSKimberlyClark/configuration.svcinfo b/App_WebReferences4/WSKimberlyClark/configuration.svcinfo new file mode 100644 index 000000000..73ba6a313 --- /dev/null +++ b/App_WebReferences4/WSKimberlyClark/configuration.svcinfo @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSKimberlyClark/configuration91.svcinfo b/App_WebReferences4/WSKimberlyClark/configuration91.svcinfo new file mode 100644 index 000000000..95dc999a4 --- /dev/null +++ b/App_WebReferences4/WSKimberlyClark/configuration91.svcinfo @@ -0,0 +1,549 @@ + + + + + + + ServiceSoap + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + Transport + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + ServiceSoap1 + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + ServiceSoap12 + + + + + + + + + + + + + + + System.ServiceModel.Configuration.TextMessageEncodingElement + + + 64 + + + 16 + + + Soap12 + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + System.ServiceModel.Configuration.HttpsTransportElement + + + False + + + 524288 + + + 65536 + + + False + + + 00:00:00 + + + Anonymous + + + False + + + True + + + StrongWildcard + + + True + + + 65536 + + + 0 + + + System.ServiceModel.Configuration.HttpMessageHandlerFactoryElement + + + (Collection) + + + + + + + + + Anonymous + + + + + + Buffered + + + False + + + True + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + System.ServiceModel.Configuration.WebSocketTransportSettingsElement + + + Never + + + False + + + 00:00:00 + + + + + + False + + + 0 + + + False + + + + + + + + + https://unigis2.unisolutions.com.ar/HUB/UNIGIS/MAPI/SOAP/GPS/Service.asmx + + + + + + basicHttpBinding + + + ServiceSoap + + + WSKimberlyClark.ServiceSoap + + + 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 + + + ServiceSoap + + + + + + + + + + + + + https://unigis2.unisolutions.com.ar/HUB/UNIGIS/MAPI/SOAP/GPS/Service.asmx + + + + + + customBinding + + + ServiceSoap12 + + + WSKimberlyClark.ServiceSoap + + + 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 + + + ServiceSoap12 + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSMandaMail/MandaCorreo.disco b/App_WebReferences4/WSMandaMail/MandaCorreo.disco new file mode 100644 index 000000000..25e16a3f9 --- /dev/null +++ b/App_WebReferences4/WSMandaMail/MandaCorreo.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSMandaMail/MandaCorreo.discomap b/App_WebReferences4/WSMandaMail/MandaCorreo.discomap new file mode 100644 index 000000000..e18af6118 --- /dev/null +++ b/App_WebReferences4/WSMandaMail/MandaCorreo.discomap @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSMandaMail/MandaCorreo.wsdl b/App_WebReferences4/WSMandaMail/MandaCorreo.wsdl new file mode 100644 index 000000000..1505add1e --- /dev/null +++ b/App_WebReferences4/WSMandaMail/MandaCorreo.wsdl @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSPenske/ReceiveGPSInfo.disco b/App_WebReferences4/WSPenske/ReceiveGPSInfo.disco new file mode 100644 index 000000000..3af92a3ea --- /dev/null +++ b/App_WebReferences4/WSPenske/ReceiveGPSInfo.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSPenske/ReceiveGPSInfo.discomap b/App_WebReferences4/WSPenske/ReceiveGPSInfo.discomap new file mode 100644 index 000000000..f1679af7c --- /dev/null +++ b/App_WebReferences4/WSPenske/ReceiveGPSInfo.discomap @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSPenske/ReceiveGPSInfo.wsdl b/App_WebReferences4/WSPenske/ReceiveGPSInfo.wsdl new file mode 100644 index 000000000..caf0bbb86 --- /dev/null +++ b/App_WebReferences4/WSPenske/ReceiveGPSInfo.wsdl @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRDLC/Reference.svcmap b/App_WebReferences4/WSRDLC/Reference.svcmap new file mode 100644 index 000000000..7d1170ffa --- /dev/null +++ b/App_WebReferences4/WSRDLC/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_WebReferences4/WSRDLC/WebService.disco b/App_WebReferences4/WSRDLC/WebService.disco new file mode 100644 index 000000000..f77fceb97 --- /dev/null +++ b/App_WebReferences4/WSRDLC/WebService.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRDLC/WebService.wsdl b/App_WebReferences4/WSRDLC/WebService.wsdl new file mode 100644 index 000000000..d0999869b --- /dev/null +++ b/App_WebReferences4/WSRDLC/WebService.wsdl @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRDLC/configuration.svcinfo b/App_WebReferences4/WSRDLC/configuration.svcinfo new file mode 100644 index 000000000..a293d9338 --- /dev/null +++ b/App_WebReferences4/WSRDLC/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRDLC/configuration91.svcinfo b/App_WebReferences4/WSRDLC/configuration91.svcinfo new file mode 100644 index 000000000..11320f6a5 --- /dev/null +++ b/App_WebReferences4/WSRDLC/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + WebServiceSoap + + + + + + + + + + + + + + + + + + + + + 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://localhost:7999/WebService.asmx + + + + + + basicHttpBinding + + + WebServiceSoap + + + WSRDLC.WebServiceSoap + + + 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 + + + WebServiceSoap + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRVConsultas/Reference.svcmap b/App_WebReferences4/WSRVConsultas/Reference.svcmap new file mode 100644 index 000000000..ac15cf16f --- /dev/null +++ b/App_WebReferences4/WSRVConsultas/Reference.svcmap @@ -0,0 +1,31 @@ + + + + false + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRVConsultas/configuration.svcinfo b/App_WebReferences4/WSRVConsultas/configuration.svcinfo new file mode 100644 index 000000000..e21a129e8 --- /dev/null +++ b/App_WebReferences4/WSRVConsultas/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRVConsultas/configuration91.svcinfo b/App_WebReferences4/WSRVConsultas/configuration91.svcinfo new file mode 100644 index 000000000..ca61c35f2 --- /dev/null +++ b/App_WebReferences4/WSRVConsultas/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + Service1Soap + + + + + + + + + + + + + + + + + + + + + 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://generacfdi.com.mx/wsconsultas/service1.asmx + + + + + + basicHttpBinding + + + Service1Soap + + + WSRVConsultas.Service1Soap + + + 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 + + + Service1Soap + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRVConsultas/service1.disco b/App_WebReferences4/WSRVConsultas/service1.disco new file mode 100644 index 000000000..46e8f452f --- /dev/null +++ b/App_WebReferences4/WSRVConsultas/service1.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSRVConsultas/service1.wsdl b/App_WebReferences4/WSRVConsultas/service1.wsdl new file mode 100644 index 000000000..163b1bab0 --- /dev/null +++ b/App_WebReferences4/WSRVConsultas/service1.wsdl @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Consultar un CFDI directamente por UUID y Fecha + + + + + Consultar un acuse de Cancelacion por UUID de un RFC + + + + + Consultar un acuse de Timbrado por UUID de un RFC + + + + + Consultar saldo de los timbres actuales de un RFC + + + + + Consultar un CFDI por: Serie, Folio, Fecha, RFC Emisor + + + + + Consultar un CFDI directamente por UUID y Fecha + + + + + Obtener un XML de cancelación + + + + + Consultar un CFDI directamente por UUID y Fecha + + + + + Consultar los CFDIs emitidos por rango de fecha + + + + + Consultar los CFDIs emitidos por rango de fecha + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSTecnoMovil/SendSmsWS.discomap b/App_WebReferences4/WSTecnoMovil/SendSmsWS.discomap new file mode 100644 index 000000000..e54e69c2b --- /dev/null +++ b/App_WebReferences4/WSTecnoMovil/SendSmsWS.discomap @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSTecnoMovil/SendSmsWS.wsdl b/App_WebReferences4/WSTecnoMovil/SendSmsWS.wsdl new file mode 100644 index 000000000..4b961ff7e --- /dev/null +++ b/App_WebReferences4/WSTecnoMovil/SendSmsWS.wsdl @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/WSTecnoMovil/SendSmsWS.xsd b/App_WebReferences4/WSTecnoMovil/SendSmsWS.xsd new file mode 100644 index 000000000..378e84c55 --- /dev/null +++ b/App_WebReferences4/WSTecnoMovil/SendSmsWS.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService.wsdl b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService.wsdl new file mode 100644 index 000000000..4bcccd879 --- /dev/null +++ b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService.wsdl @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService.xsd b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService.xsd new file mode 100644 index 000000000..2b26d844c --- /dev/null +++ b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService1.xsd b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService1.xsd new file mode 100644 index 000000000..b76f53cbb --- /dev/null +++ b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService1.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService2.xsd b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService2.xsd new file mode 100644 index 000000000..d58e7f39c --- /dev/null +++ b/App_WebReferences4/wsValidaCFDi2/ConsultaCFDIService2.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsValidaCFDi2/Reference.svcmap b/App_WebReferences4/wsValidaCFDi2/Reference.svcmap new file mode 100644 index 000000000..d41213e94 --- /dev/null +++ b/App_WebReferences4/wsValidaCFDi2/Reference.svcmap @@ -0,0 +1,33 @@ + + + + false + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsValidaCFDi2/configuration.svcinfo b/App_WebReferences4/wsValidaCFDi2/configuration.svcinfo new file mode 100644 index 000000000..00bc866e9 --- /dev/null +++ b/App_WebReferences4/wsValidaCFDi2/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsValidaCFDi2/configuration91.svcinfo b/App_WebReferences4/wsValidaCFDi2/configuration91.svcinfo new file mode 100644 index 000000000..5af6136a3 --- /dev/null +++ b/App_WebReferences4/wsValidaCFDi2/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + BasicHttpBinding_IConsultaCFDIService + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + Transport + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc + + + + + + basicHttpBinding + + + BasicHttpBinding_IConsultaCFDIService + + + wsValidaCFDi2.IConsultaCFDIService + + + 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 + + + BasicHttpBinding_IConsultaCFDIService + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsmailto/mandacorreo.disco b/App_WebReferences4/wsmailto/mandacorreo.disco new file mode 100644 index 000000000..936387b22 --- /dev/null +++ b/App_WebReferences4/wsmailto/mandacorreo.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsmailto/mandacorreo.discomap b/App_WebReferences4/wsmailto/mandacorreo.discomap new file mode 100644 index 000000000..56571cedc --- /dev/null +++ b/App_WebReferences4/wsmailto/mandacorreo.discomap @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/App_WebReferences4/wsmailto/mandacorreo.wsdl b/App_WebReferences4/wsmailto/mandacorreo.wsdl new file mode 100644 index 000000000..f8ddc73dd --- /dev/null +++ b/App_WebReferences4/wsmailto/mandacorreo.wsdl @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index a0b88fb36..248704414 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -118,12 +118,14 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState context.Response.Write(sendMailLPM(context)) Case "getSATColomias" getSatColonias(context) - Case "GetFilesDirectory" + Case "GetFilesDirectory" GetFilesDirectory(context) Case "Getetiquetas" Getetiquetas(context) - Case "cancelarRemision" + Case "cancelarRemision" cancelarRemision(context) + Case "RemoveMovimiento" + RemoveMovimiento(context) End Select Catch ex As Exception ex.GuardaLog(ex.Message) @@ -1644,4 +1646,66 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Return retorno End Function #End Region + Private Function RemoveMovimiento(ByVal context As HttpContext) As String + Dim retorno As String = "" + + Dim Borrar As Boolean = False + Dim Inv As New ClsInventarios + Dim Conta As New ClsContabilidad(Inv.IniciaTransacSQL()) + Dim ObjGral As New ClsGenerales(Inv.IniciaTransacSQL()) + + Dim CveMovimiento As Integer = IfNull(context.Request("CveMovimiento"), "-1").ToString().ToEntero() + Dim CveEmpresa As Integer = IfNull(context.Request("CveEmpresa"), "-1").ToString().ToEntero() + + Dim TieneError = False + + CveMovimiento.ToString.GuardaLog + + 'Dim ObjConta As ClsContPAQi = Nothing + 'If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then + ' ObjConta = New ClsContPAQi(UsuarioActual.Empresa) + ' ObjConta.IniciaTransacSQL() + 'End If + + 'If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, String.Format("{0}, Informacion = {1}", TxtDescripcion.Text, DescripcionDetalladaEliminar), "Inventarios", TxtFolio.Text + " / " + DdlConcepto.SelectedItem.Text) Then + ' TieneError = True + 'End If + + If Not Inv.MovimientoRemove(CveMovimiento, CveEmpresa) Then + + TieneError = True + End If + + 'If Not TieneError Then + ' If Not Conta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + ' TieneError = True + ' End If + 'End If + + If Not TieneError Then + 'If ObjConta IsNot Nothing Then ObjConta.Commit() + Inv.Commit() + + + Else + Inv.RollBack() + + Alert("Ocurrió un error al eliminar el movimiento. Por favor vuelva a intentar.", TipoMensaje.MsgError) + End If + CveMovimiento = 0 + + Inv.Dispose() + ObjGral.Dispose() + Conta.Dispose() + If Not String.IsNullOrEmpty(retorno) Then + context.Response.Write(retorno) + Else + context.Response.Write("[]") + End If + + Return retorno + End Function + + + End Class \ No newline at end of file diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index f24961ea0..0a09a646e 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -5832,7 +5832,14 @@ Partial Class Bancos_IE Else If CveIE > 0 Then If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then - GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}) + + + ' GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}) + + GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "Folio", "SerieFolio", "FechaComplemento", "Importe", "RFCReceptor", "StrEstatus", "FechaCancelacion", "Tipo", "Estatus", "CveIE", "CvePAC"}) + + '"CveComplementoPago","FolioFiscal","Folio","SerieFolio","FechaComplemento","Importe","RFCReceptor","StrEstatus","FechaCancelacion","Tipo,Estatus","CveIE","CvePAC" + End If End If diff --git a/Bancos/RepIE.aspx b/Bancos/RepIE.aspx index ae5d9e704..d44810e5d 100644 --- a/Bancos/RepIE.aspx +++ b/Bancos/RepIE.aspx @@ -329,8 +329,8 @@
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
diff --git a/CRM/Acercamiento.aspx b/CRM/Acercamiento.aspx index 2a0b2c928..bb3e9389d 100644 --- a/CRM/Acercamiento.aspx +++ b/CRM/Acercamiento.aspx @@ -996,7 +996,7 @@
diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index bd33d2fb3..b58db10e3 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -9,6 +9,13 @@ using System.Data; using Extensiones; using System.Web.UI.HtmlControls; +using ADSNetLibrary.SIGAPI.Services.CRM; +using ADSNetLibrary.SIGAPI.Models.CRM.Request; +using ADSNetLibrary.SIGAPI.Models.CRM.Response; +using ADSNetLibrary.SIGAPI.Models.Ventas.Request; +using ADSNetLibrary.SIGAPI.Models.Ventas.Response; +using MoreLinq; +using ADSNetLibrary.SIGAPI.Services; public partial class CRM_Acercamiento : ClsPaginas { @@ -246,6 +253,19 @@ public partial class CRM_Acercamiento : ClsPaginas ViewState["CvePS"] = value; } } + + private Boolean TieneCotizacion + { + get + { + return (Boolean)ViewState["TieneCotizacion"]; + } + + set + { + ViewState["TieneCotizacion"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -290,65 +310,61 @@ public partial class CRM_Acercamiento : ClsPaginas { if (CveAcercamiento > 0) { - ClsCRM ObjCRM = new ClsCRM(); - - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveAcercamiento: CveAcercamiento) && ObjCRM.DtResultados.Rows.Count > 0) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestAcercamiento AcercamientoModel = new RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamiento); + var objAcercamiento = cRMService.GetAceracamientoCRM(AcercamientoModel); + if (objAcercamiento.Result.Count > 0) { - LblEncabezadoAcercamiento.Text = String.Format("{0}: {1}", ObjCRM.DtResultados.FiltroPrimeroValor("TipoProceso").ToUpper(), ObjCRM.DtResultados.FiltroPrimeroValor("NombreAcercamiento").ToUpper()); - CveTipoProceso = ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso").ToEntero(); + LblEncabezadoAcercamiento.Text = String.Format("{0}: {1}", objAcercamiento.Result[0].TipoProceso.ToUpper(), objAcercamiento.Result[0].NombreAcercamiento.ToUpper()); + CveTipoProceso = objAcercamiento.Result[0].CveTipoProceso.ToEntero(); //SECCION DATOS DEL ACERCAMIENTO - TxtNombreAcercamiento.Text = ObjCRM.DtResultados.FiltroPrimeroValor("NombreAcercamiento"); - TxtDescripcion.Text = ObjCRM.DtResultados.FiltroPrimeroValor("Descripcion"); - TxtFechaApertura.Text = ObjCRM.DtResultados.FiltroPrimeroValor("FechaApertura").ToDateTime().ToShortDateString(); - TxtFechaCierre.Text = (ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre") == "") ? "" : ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre").ToDateTime().ToShortDateString(); - TxtImporte.Text = String.Format("{0:C2}", ObjCRM.DtResultados.FiltroPrimeroValor("Importe").ToString().ToDecimal()); - TxtComision.Text = String.Format("{0:C2}", ObjCRM.DtResultados.FiltroPrimeroValor("Comision").ToString().ToDecimal()); - - DdlProbabilidadAcercamiento.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveProbabilidadAcercamiento")); - DdlPrioridad.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("Prioridad")); + TxtNombreAcercamiento.Text = objAcercamiento.Result[0].NombreAcercamiento; + TxtDescripcion.Text = objAcercamiento.Result[0].Descripcion; + TxtFechaApertura.Text = objAcercamiento.Result[0].FechaApertura.ToDateTime().ToShortDateString(); + TxtFechaCierre.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") ? "" : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString(); + TxtImporte.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Importe.ToEntero()); + TxtComision.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Comision.ToEntero()); + DdlProbabilidadAcercamiento.SelectedValueExist(objAcercamiento.Result[0].CveProbabilidadAcercamiento); + DdlPrioridad.SelectedValueExist(objAcercamiento.Result[0].Prioridad); CargaDdl(); //SECCION DATOS DE LA EMPRESA - DdlEmpresaCRM.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveEmpresaCRM")); - //DdlContactoPrincipal.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveContactoPrincipal")); + DdlEmpresaCRM.SelectedValueExist(objAcercamiento.Result[0].CveEmpresaCRM); + //SECCION DATOS DEL PROCESO - //DdlTipoProceso.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso")); - DdlEtapaProceso.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveEtapaProcesoActual")); - DdlVendedor.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveVendedor")); - DdlMedioCaptacion.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveMedioCaptacion")); + DdlEtapaProceso.SelectedValueExist(objAcercamiento.Result[0].CveEtapaProcesoActual); + DdlVendedor.SelectedValueExist(objAcercamiento.Result[0].CveVendedor); + DdlMedioCaptacion.SelectedValueExist(objAcercamiento.Result[0].CveMedioCaptacion); //CARGA MODAL CIERRE-CANCELACION - TxtFechaCierreRechazo.Text = (ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre") == "") ? DateTime.Now.ToShortDateString() : ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre").ToDateTime().ToShortDateString(); - DdlRechazoMotivo.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveRechazoMotivo")); - TxtObservacionRechazo.Text = ObjCRM.DtResultados.FiltroPrimeroValor("ObservacionRechazo"); + TxtFechaCierreRechazo.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") ? DateTime.Now.ToShortDateString() : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString(); + DdlRechazoMotivo.SelectedValueExist(objAcercamiento.Result[0].CveRechazoMotivo); + TxtObservacionRechazo.Text = objAcercamiento.Result[0].ObservacionRechazo; //CARGAMOS PARAMETROS - NombreAcercamiento = ObjCRM.DtResultados.FiltroPrimeroValor("NombreAcercamiento").ToUpper(); - CveEmpresaCRM = ObjCRM.DtResultados.FiltroPrimeroValor("CveEmpresaCRM").ToEntero(); - CveVendedorAsignado = ObjCRM.DtResultados.FiltroPrimeroValor("CveVendedor").ToEntero(); - CveContactoPrincipal = (ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveContactoPrincipal").ToEntero() : -1; + NombreAcercamiento = objAcercamiento.Result[0].NombreAcercamiento.ToUpper(); + CveEmpresaCRM = objAcercamiento.Result[0].CveEmpresaCRM.ToEntero(); + CveVendedorAsignado = objAcercamiento.Result[0].CveVendedor.ToEntero(); + CveContactoPrincipal = (objAcercamiento.Result[0].CveTipoProceso.ToEntero() > 0) ? objAcercamiento.Result[0].CveContactoPrincipal.ToEntero() : -1; - CveEtapaActual = ObjCRM.DtResultados.FiltroPrimeroValor("CveEtapaProcesoActual").ToEntero(); - + CveEtapaActual = objAcercamiento.Result[0].CveEtapaProcesoActual.ToEntero(); - CveEncuestaProcesoCRM = (ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaProcesoCRM").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaProcesoCRM").ToEntero() : -1; - CveEncuestaAplicadaProceso = (ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() : -1; - //CveEtapaBitacoraSeleccionada = CveEtapaActual; - CvePS = ObjCRM.DtResultados.FiltroPrimeroValor("CvePS").ToEntero(); + CveEncuestaProcesoCRM = (objAcercamiento.Result[0].CveEncuestaProcesoCRM.ToEntero() > 0) ? objAcercamiento.Result[0].CveEncuestaProcesoCRM.ToEntero() : -1; + CveEncuestaAplicadaProceso = (objAcercamiento.Result[0].CveEncuestaAplicadaProceso.ToEntero() > 0) ? objAcercamiento.Result[0].CveEncuestaAplicadaProceso.ToEntero() : -1; + + CvePS = objAcercamiento.Result[0].CvePS.ToEntero(); HdfEtapaSeleccionada.Value = CveEtapaActual.ToString(); //INHABILITAMOS CAMPOS QUE NO SE PUEDEN EDITAR DdlEmpresaCRM.Enabled = false; - //DdlTipoProceso.Enabled = false; //MOSTRAMOS BOTONES BtnGuardarAcercamiento.Text = "Actualizar"; BtnGuardarAcercamiento.Visible = true; BtnEliminarAcercamiento.Visible = true; - //DivVerBitacoraCompleta.Visible = true; - } + else { Alert("La Empresa solicitada no existe, por favor revise su búsqueda.", ModExtensiones.TipoMensaje.MsgAdvertencia); @@ -361,7 +377,6 @@ public partial class CRM_Acercamiento : ClsPaginas CveEncuestaProcesoCRM = -1; CveEncuestaAplicadaProceso = -1; } - ObjCRM.Dispose(); if (CveAcercamiento > 0) { @@ -429,47 +444,53 @@ public partial class CRM_Acercamiento : ClsPaginas protected void CargaDdl() { - ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestProbalidadAcercamiento ProbalidadAcercamiento = new RequestProbalidadAcercamiento(UsuarioActual.CveEmpresa, 1); + var ObjProbalidadAcercamiento = cRMService.GetProbabilidadAceracamientoCRM(ProbalidadAcercamiento); + RequestEmpresasCRM EmpresaCRM = new RequestEmpresasCRM(UsuarioActual.CveEmpresa, -1); + var objEmpresaCRM = cRMService.GetEmpresasCRM(EmpresaCRM); + RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa); + var ObjMedioCaptacion = cRMService.GetMedioCaptacionCRM(MedioCaptacion); - if (ObjCRM.GetProbabilidadAcercamiento(UsuarioActual.CveEmpresa, 1)) + if (ObjProbalidadAcercamiento.Result.Count > 0) { - DdlProbabilidadAcercamiento.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}", CveTipoProceso)); + DataTable DtProbabilidadAcercamiento = ObjProbalidadAcercamiento.Result.ToDataTable(); + DdlProbabilidadAcercamiento.DataSource = DtProbabilidadAcercamiento.FiltraParametros(String.Format("CveTipoProceso = {0}", CveTipoProceso)); } - if (ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa)) + + + if (objEmpresaCRM.Result.Count > 0) { - DdlEmpresaCRM.DataSource = ObjCRM.DtResultados; + DdlEmpresaCRM.DataSource = objEmpresaCRM.Result; DdlEmpresaCRM.Items.Insert(0, new ListItem("Seleccione ", "-1")); } - //if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa, 1)) - //{ - // DdlTipoProceso.DataSource = ObjCRM.DtResultados; - // DdlTipoProceso.Items.Insert(0, new ListItem("Seleccione ", "-1")); - //} - if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa, 1)) + + + if (ObjMedioCaptacion.Result.Count > 0) { - DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}",CveTipoProceso)); + DataTable DTMedioCaptacion = ObjMedioCaptacion.Result.ToDataTable(); + DdlMedioCaptacion.DataSource = DTMedioCaptacion.FiltraParametros(String.Format("CveTipoProceso = {0}", CveTipoProceso)); DdlMedioCaptacion.Items.Insert(0, new ListItem("Seleccione ", "-1")); } + DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa); - ObjCRM.Dispose(); - DdlProbabilidadAcercamiento.DataBind(); DdlEmpresaCRM.DataBind(); - //DdlTipoProceso.DataBind(); DdlVendedor.DataBind(); DdlMedioCaptacion.DataBind(); } protected void CargaRechazosMotivos() { - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetRechazoMotivo(UsuarioActual.CveEmpresa, 1, CveTipoProceso)) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestRechazoMotivo RequestRechazoMotivo = new RequestRechazoMotivo(UsuarioActual.CveEmpresa, 1, CveTipoProceso); + var objRequestRechazoMotivo = cRMService.GetRechazoMotivoCRM(RequestRechazoMotivo); + if (objRequestRechazoMotivo.Result.Count > 0) { - DdlRechazoMotivo.DataSource = ObjCRM.DtResultados; + DdlRechazoMotivo.DataSource = objRequestRechazoMotivo.Result; DdlRechazoMotivo.Items.Insert(0, new ListItem("Seleccione ", "-1")); } - ObjCRM.Dispose(); DdlRechazoMotivo.DataBind(); } @@ -500,17 +521,19 @@ public partial class CRM_Acercamiento : ClsPaginas protected void CargaContactos(int CveEmpresaCRM) { DdlContactoPrincipal.Items.Clear(); - ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestContactoEmpresaCRM contactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM, UsuarioActual.CveEmpresa); + var objcontactoEmpresa = cRMService.GetContactosEmpresasCRM(contactoEmpresaCRM); - if (ObjCRM.GetContactoEmpresa(CveEmpresaCRM)) + if (objcontactoEmpresa.Result.Count > 0) { - DdlContactoPrincipal.DataSource = ObjCRM.DtResultados; - DdlContactoAgenda.DataSource = ObjCRM.DtResultados; + DdlContactoPrincipal.DataSource = objcontactoEmpresa.Result; + DdlContactoAgenda.DataSource = objcontactoEmpresa.Result; } DdlContactoPrincipal.Items.Insert(0, new ListItem("Seleccione ", "-1")); DdlContactoAgenda.Items.Insert(0, new ListItem("Seleccione ", "-1")); - ObjCRM.Dispose(); + //ObjCRM.Dispose(); DdlContactoPrincipal.DataBind(); DdlContactoAgenda.DataBind(); @@ -532,11 +555,13 @@ public partial class CRM_Acercamiento : ClsPaginas { //DDLs DdlEtapaProceso.Items.Clear(); - ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, CveTipoProceso); + var ObjEtapaProceso = cRMService.GetEtapaProcesoCRM(EtapaProceso); - if (ObjCRM.GetEtapaProceso(UsuarioActual.CveEmpresa, CveTipoProceso, CveEstatus: 1)) + if (ObjEtapaProceso.Result.Count > 0) { - DTEtapasProceso = ObjCRM.DtResultados; + DTEtapasProceso = ObjEtapaProceso.Result.ToDataTable(); OrdenEtapaActual = DTEtapasProceso.FiltroPrimeroValor("Orden", String.Format("CveEtapaProceso = {0}", CveEtapaActual)).ToEntero(); //SI LA ETAPA ES CANCELACION HABILITA MOSTRAR LAS DOS ETAPAS ANTERIORES @@ -549,7 +574,6 @@ public partial class CRM_Acercamiento : ClsPaginas DdlEtapaProceso.DataSource = DTEtapasProceso.FiltraParametros(String.Format("(( Orden >= {0} ) AND ( Orden <= {1} )) OR (CveTipoEtapa = 4)", (OrdenEtapaActual - 1), (OrdenEtapaActual + 1))); } } - ObjCRM.Dispose(); DdlEtapaProceso.DataBind(); } protected void DdlEtapaProceso_SelectedIndexChanged(object sender, EventArgs e) @@ -590,16 +614,16 @@ public partial class CRM_Acercamiento : ClsPaginas if (CveAcercamiento > 0) { ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + AcercaminetoModel AcercaminetoModel = new AcercaminetoModel(); + ClsEncuestas ObjDatosTecnicos = new ClsEncuestas(ObjCRM.IniciaTransacSQL()); //ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL()); Boolean HuboError = true; - String NombreAcercamiento = TxtNombreAcercamiento.Text; String Descripcion = TxtDescripcion.Text == "" ? "-1" : TxtDescripcion.Text; - int CveEtapaProcesoActualActualizar = DdlEtapaProceso.SelectedValue.ToEntero(); - int CveContactoPrincipal = DdlContactoPrincipal.SelectedValue.ToEntero(); int CveVendedor = DdlVendedor.SelectedValue.ToEntero(); int CveMedioCaptacion = DdlMedioCaptacion.SelectedValue.ToEntero(); @@ -629,9 +653,25 @@ public partial class CRM_Acercamiento : ClsPaginas { CveEncuestaAplicadaProceso = GuardaDatosTecnicos(ObjDatosTecnicos, CveEncuestaAplicadaProceso); } - - 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, CvePS:DdlPS.SelectedValue.ToEntero())) + AcercaminetoModel.CveAcercamiento = CveAcercamiento; + AcercaminetoModel.CveContactoPrincipal = CveContactoPrincipal; + AcercaminetoModel.CveTipoProceso = CveTipoProceso; + AcercaminetoModel.CveEtapaProcesoActual = CveEtapaProcesoActualActualizar; + AcercaminetoModel.CveVendedor = CveVendedor; + AcercaminetoModel.CveMedioCaptacion = CveMedioCaptacion; + AcercaminetoModel.CveProbabilidadAcercamiento = CveProbabilidadAcercamiento; + AcercaminetoModel.NombreAcercamiento = NombreAcercamiento; + AcercaminetoModel.Descripcion = Descripcion; + AcercaminetoModel.Importe = Importe; + AcercaminetoModel.Comision = Comision; + AcercaminetoModel.Prioridad = Prioridad; + AcercaminetoModel.CveUsuarioIng = UsuarioActual.CveUsuario; + AcercaminetoModel.CveEncuestaAplicadaProceso = CveEncuestaAplicadaProceso; + AcercaminetoModel.FechaApertura = FechaApertura; + AcercaminetoModel.FechaCierre = (DateTime)FechaCierre; + AcercaminetoModel.CvePS = DdlPS.SelectedValue.ToEntero(); + + if (cRMService.AcercamientoUpdate(AcercaminetoModel)) { //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); @@ -644,9 +684,6 @@ public partial class CRM_Acercamiento : ClsPaginas //} } - if (!HuboError) { ObjCRM.Commit(); } else { ObjCRM.RollBack(); } - - ObjCRM.Dispose(); ObjDatosTecnicos.Dispose(); //CARGA BITACORA @@ -669,8 +706,8 @@ public partial class CRM_Acercamiento : ClsPaginas protected void GuardarCambioEtapa() { - ClsCRM ObjCRM = new ClsCRM(); - + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + AcercaminetoModel AcercaminetoModel = new AcercaminetoModel(); String NombreAcercamiento = TxtNombreAcercamiento.Text; String Descripcion = TxtDescripcion.Text == "" ? "-1" : TxtDescripcion.Text; @@ -696,15 +733,30 @@ 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, CvePS: DdlPS.SelectedValue.ToEntero())) + AcercaminetoModel.CveAcercamiento = CveAcercamiento; + AcercaminetoModel.CveContactoPrincipal = CveContactoPrincipal; + AcercaminetoModel.CveTipoProceso = CveTipoProceso; + AcercaminetoModel.CveEtapaProcesoActual = CveEtapaProcesoActualActualizar; + AcercaminetoModel.CveVendedor = CveVendedor; + AcercaminetoModel.CveMedioCaptacion = CveMedioCaptacion; + AcercaminetoModel.CveProbabilidadAcercamiento = CveProbabilidadAcercamiento; + AcercaminetoModel.NombreAcercamiento = NombreAcercamiento; + AcercaminetoModel.Descripcion = Descripcion; + AcercaminetoModel.Importe = Importe; + AcercaminetoModel.Comision = Comision; + AcercaminetoModel.Prioridad = Prioridad; + AcercaminetoModel.CveUsuarioIng = UsuarioActual.CveUsuario; + AcercaminetoModel.CveEncuestaAplicadaProceso = CveEncuestaAplicadaProceso; + AcercaminetoModel.FechaApertura = FechaApertura; + AcercaminetoModel.FechaCierre = (DateTime)FechaCierre; + AcercaminetoModel.CvePS = DdlPS.SelectedValue.ToEntero(); + + if (cRMService.AcercamientoUpdate(AcercaminetoModel)) { CveEtapaActual = CveEtapaProcesoActualActualizar; HdfEtapaSeleccionada.Value = CveEtapaProcesoActualActualizar.ToString(); - } - ObjCRM.Dispose(); //CARGA BITACORA CargaEtapasProceso(CveTipoProceso); @@ -731,25 +783,28 @@ public partial class CRM_Acercamiento : ClsPaginas ClsCRM ObjCRM = new ClsCRM(); ClsOIEventos objBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL()); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestAcercamiento acercamiento = new RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamiento); - if (ObjCRM.RemoveAcercamiento(CveAcercamiento, UsuarioActual.CveEmpresa)) + if (TieneCotizacion) { - if (objBitacora.AddEventoBitacora(String.Format("Se eliminó el Acercamiento {0} de tipo {1}", NombreAcercamiento, TipoProceso), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + if (cRMService.AcercamientoDelete(acercamiento)) { - HuboError = false; + if (objBitacora.AddEventoBitacora(String.Format("Se eliminó el Acercamiento {0} de tipo {1}", NombreAcercamiento, TipoProceso), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { + HuboError = false; + } + } + if (!HuboError) + { + Alert("El Acercamiento ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion, String.Format("document.location.href=\"/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}\"", CveEmpresaCRM)); } - } - if (!HuboError) - { - ObjCRM.Commit(); - Alert("El Acercamiento ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion, String.Format("document.location.href=\"/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}\"", CveEmpresaCRM)); } else { - ObjCRM.RollBack(); + Alert("No se puede eliminar el acercamiento porque el prospecto cuenta con cotizaciones/facturaciones previas.", ModExtensiones.TipoMensaje.MsgError); } - ObjCRM.Dispose(); objBitacora.Dispose(); } #endregion @@ -811,7 +866,8 @@ public partial class CRM_Acercamiento : ClsPaginas protected void BtnRegistrarCierreCancelacion_Click(object sender, EventArgs e) { - ClsCRM ObjCRM = new ClsCRM(); + //ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); //ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL()); //Boolean HuboError = true; @@ -822,7 +878,16 @@ public partial class CRM_Acercamiento : ClsPaginas String TituloCierre = DTEtapasProceso.FiltroPrimeroValor("EtapaProceso", "CveTipoEtapa = 4"); - if (ObjCRM.UpdateAcercamientoCierre(CveAcercamiento, CveEtapaCierre, CveRechazoMotivo, UsuarioActual.CveUsuario, FechaCierre, Observacion)) + + AcercaminetoModel acercamiento = new AcercaminetoModel(); + acercamiento.CveAcercamiento = CveAcercamiento; + acercamiento.CveEtapaProcesoActual = CveEtapaCierre; + acercamiento.CveRechazoMotivo = CveRechazoMotivo; + acercamiento.CveUsuarioIng = UsuarioActual.CveUsuario; + acercamiento.FechaCierre = FechaCierre; + acercamiento.ObservacionRechazo = Observacion; + + if (cRMService.AcercamientoCierreUpdate(acercamiento)) { String MensajeBitacora = ""; if (CveEtapaActual == CveEtapaCierre) @@ -839,7 +904,7 @@ public partial class CRM_Acercamiento : ClsPaginas //if (!HuboError) { ObjCRM.Commit(); } else { ObjCRM.RollBack(); } - ObjCRM.Dispose(); + //ObjCRM.Dispose(); //ObjBitacora.Dispose(); CveEtapaActual = CveEtapaCierre; @@ -855,23 +920,27 @@ public partial class CRM_Acercamiento : ClsPaginas protected void CargaEtapasBitacora() { //CARGA STEP DE PASOS - ClsCRM ObjCRM = new ClsCRM(); + //ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, CveTipoProceso); + var ObjEtapaProceso = cRMService.GetEtapaProcesoCRM(EtapaProceso); - if (ObjCRM.GetEtapaProceso(UsuarioActual.CveEmpresa, CveTipoProceso, CveEstatus: 1)) + if (ObjEtapaProceso.Result.Count > 0) { - TipoProceso = ObjCRM.DtResultados.FiltroPrimeroValor("TipoProceso").ToUpper(); + DataTable DTTemp = ObjEtapaProceso.Result.ToDataTable(); + TipoProceso = DTTemp.FiltroPrimeroValor("TipoProceso").ToUpper(); int CveEtapaCierreCancelacion = DTEtapasProceso.FiltroPrimeroValor("CveEtapaProceso", "CveTipoEtapa = 4").ToEntero(); - NumeroEtapasProceso = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,3)").Rows.Count; + NumeroEtapasProceso = DTTemp.FiltraParametros("CveTipoEtapa IN(1,2,3)").Rows.Count; //RptTabsEtapasProcesos.DataSource = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,3)"); if (CveEtapaCierreCancelacion == CveEtapaActual) - RptStepsEtapasProceso.DataSource = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,4)"); + RptStepsEtapasProceso.DataSource = DTTemp.FiltraParametros("CveTipoEtapa IN(1,2,4)"); else - RptStepsEtapasProceso.DataSource = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,3)"); + RptStepsEtapasProceso.DataSource = DTTemp.FiltraParametros("CveTipoEtapa IN(1,2,3)"); } - ObjCRM.Dispose(); + //ObjCRM.Dispose(); //RptTabsEtapasProcesos.DataBind(); RptStepsEtapasProceso.DataBind(); //SpanProceso.InnerText = TipoProceso + ":"; @@ -1027,19 +1096,6 @@ public partial class CRM_Acercamiento : ClsPaginas Archivo = null; } - protected void EliminarFile(object sender, EventArgs e) - { - string cveEvento = string.Format("{0}",((LinkButton)sender).CommandArgument); - ClsOIEventos ObjEventoBitacora = new ClsOIEventos(); - ObjEventoBitacora.RemoveAgendaBitacora( cveEvento.ToEntero(), UsuarioActual.CveEmpresa); - ObjEventoBitacora.Dispose(); - UPAddEventoBitacora.Update(); - - //RECARGAMOS GRID BITACORA - CargaEventoBitacora(HdfEtapaSeleccionada.Value.ToEntero()); - UPBitacora.Update(); - } - protected void BtnGuardarEventoBitacora_Click(object sender, EventArgs e) { ClsOIEventos ObjEventoBitacora = new ClsOIEventos(); @@ -1059,7 +1115,7 @@ public partial class CRM_Acercamiento : ClsPaginas if (ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim(), string.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveEtapaProcesoCRM: CveEtapa)) { if (filemove != "") - filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:false); + filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"Empresas\{0}\OI", UsuarioActual.CveEmpresa)); TxtEventoDescripcion.Text = ""; @@ -1122,9 +1178,6 @@ public partial class CRM_Acercamiento : ClsPaginas ScriptManager.GetCurrent(this).RegisterPostBackControl(e.Item.FindControl("LinkArchivo")); // Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione ((Label)e.Item.FindControl("LblTipoArchivo")).Text = row["Archivo"].ToString().Split('.')[1].ToUpper(); - - ((LinkButton)e.Item.FindControl("LinkDelete")).CommandArgument = row["CveEvento"].ToString(); - } } @@ -1401,7 +1454,7 @@ public partial class CRM_Acercamiento : ClsPaginas return _CveEncuestaAplicada; } #endregion - + #region "MUESTRA UBICACION GEOGRAFICA" protected void LnkVerUbicacion_Click(object sender, EventArgs e) { @@ -1416,9 +1469,13 @@ public partial class CRM_Acercamiento : ClsPaginas protected void CargaImagenes() { var ObjCRM = new ClsCRM(); - if (ObjCRM.GetImagenesAcercamiento(CveAcercamiento)) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestImagenesAcercamiento ImagenesAcercamiento = new RequestImagenesAcercamiento(CveAcercamiento); + + var objImagenesAcercamiento = cRMService.ImagenesAcercamientoGet(ImagenesAcercamiento); + if (objImagenesAcercamiento.Result.Count > 0) { - RptFotos.DataSource = ObjCRM.DtResultados; + RptFotos.DataSource = objImagenesAcercamiento.Result; } ObjCRM.Dispose(); RptFotos.DataBind(); @@ -1429,6 +1486,9 @@ public partial class CRM_Acercamiento : ClsPaginas bool TieneError = false; var ObjCRM = new ClsCRM(); ObjCRM.IniciaTransacSQL(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestImagenesAcercamiento ImagenesAcercamiento = new RequestImagenesAcercamiento(CveAcercamiento, UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, "", TxtTituloImagen.Text, TxtDescripcionImagen.Text, "-1", UsuarioActual.CveUsuario); + try { foreach (var item in TxtUpFotos.getfiles().Archivos) @@ -1444,11 +1504,11 @@ public partial class CRM_Acercamiento : ClsPaginas break; } - int CveArchivo = ObjCRM.AddImagenAcercamiento("", TxtTituloImagen.Text, TxtDescripcionImagen.Text, UsuarioActual.CveUsuario, CveEmpresaCRM, CveAcercamiento, UsuarioActual.CveEmpresa); + int CveArchivo = cRMService.ImagenesAcercamientoAdd(ImagenesAcercamiento).ToEntero(); if ((CveArchivo > 0)) { string NombreNuevo = string.Format("{0}{1}", CveArchivo, FileExtension); - string DirectorioNuevo = string.Format("{0}Acercamientos\\{1}\\Imagenes\\", UsuarioActual.Empresa.Ruta, CveAcercamiento); + string DirectorioNuevo = string.Format("{0}\\Empresas\\{1}\\Acercamientos\\{2}\\Imagenes\\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CveAcercamiento); if (!Directory.Exists(DirectorioNuevo)) { Directory.CreateDirectory(DirectorioNuevo); @@ -1456,7 +1516,9 @@ public partial class CRM_Acercamiento : ClsPaginas DirectorioNuevo = DirectorioNuevo + NombreNuevo; var DirectorioViejo = string.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, item.filename); - if (ObjCRM.UpdateImagenAcercamiento(CveArchivo, NombreNuevo, TxtTituloImagen.Text, TxtDescripcionImagen.Text)) + RequestImagenesAcercamiento ImagenesAcercamientoUpdate = new RequestImagenesAcercamiento(CveAcercamiento, UsuarioActual.CveEmpresa, CveEmpresaCRM, CveArchivo, NombreNuevo, TxtTituloImagen.Text, TxtDescripcionImagen.Text); + + if (cRMService.ImagenesAcercamientoUpdate(ImagenesAcercamientoUpdate)) { File.Move(DirectorioViejo, DirectorioNuevo); } @@ -1504,7 +1566,10 @@ public partial class CRM_Acercamiento : ClsPaginas if (CveArchivo > 0) { var ObjCRM = new ClsCRM(); - bool Elimino = ObjCRM.RemoveImagenesAcercamiento(CveArchivo); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestImagenesAcercamiento ImagenesAcercamiento = new RequestImagenesAcercamiento(-1, CveArchivo: CveArchivo); + + bool Elimino = cRMService.ImagenesAcercamientoDelete(ImagenesAcercamiento); ObjCRM.Dispose(); if (Elimino) @@ -1522,9 +1587,14 @@ public partial class CRM_Acercamiento : ClsPaginas protected void CargaCotizaciones() { ClsVentas ObjVentas = new ClsVentas(); - if (ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "Cot", "-1", -1, "-1", -1, -1, -1, -1, "-1", "-1", "-1", CveEmpresaCRM: CveEmpresaCRM, CveAcercamientoCRM: CveAcercamiento, CveUsuarioConsulta: UsuarioActual.CveUsuario)) + IVentaService ventaService = new VentaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestVentas requestVentas = new RequestVentas(UsuarioActual.CveEmpresa, TipoDocto: "Cot", CveEmpresaCRM: CveEmpresaCRM, CveUsuarioConsulta: UsuarioActual.CveUsuario, CveAcercamientoCRM: CveAcercamiento); + var objVentas = ventaService.GetVentas(requestVentas); + + if (objVentas.IsSuccess) { - GvCotizacion.DataSource = ObjVentas.DtResultados; + GvCotizacion.DataSource = objVentas.Result; + TieneCotizacion = objVentas.Result.Count > 0; } ObjVentas.Dispose(); GvCotizacion.DataBind(); @@ -1549,9 +1619,14 @@ public partial class CRM_Acercamiento : ClsPaginas protected void CargaGastos() { ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamientosGastos(CveAcercamiento)) + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestAcermientoGastos AcermientoGastos = new RequestAcermientoGastos(CveAcercamiento); + + var objAcermientoGastos = cRMService.AcercamientosGastosGet(AcermientoGastos); + if (objAcermientoGastos.Result.Count > 0) { - GvGastos.DataSource = ObjCRM.DtResultados; + GvGastos.DataSource = objAcermientoGastos.Result; } ObjCRM.Dispose(); GvGastos.DataBind(); @@ -1576,10 +1651,11 @@ public partial class CRM_Acercamiento : ClsPaginas protected void BtnAgregarGastoModal_Click(object sender, EventArgs e) { ClsCRM ObjCRM = new ClsCRM(); - - if(!Actualizar) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestAcermientoGastos AcermientoGastos = new RequestAcermientoGastos(CveAcercamiento, -1, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal(), UsuarioActual.CveUsuario); + if (!Actualizar) { - if (ObjCRM.AddAcercamientosGastos(CveAcercamiento, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal(), UsuarioActual.CveUsuario)) + if (cRMService.AcercamientosGastosAdd(AcermientoGastos)) { CargaGastos(); @@ -1593,7 +1669,7 @@ public partial class CRM_Acercamiento : ClsPaginas } else { - if (ObjCRM.UpdateAcercamientosGastos(CveAcercamientoGasto, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal())) + if (cRMService.AcercamientosGastosUpdate(AcermientoGastos)) { CargaGastos(); @@ -1647,10 +1723,11 @@ public partial class CRM_Acercamiento : ClsPaginas { ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer; CveAcercamientoGasto = GvRow.DataKey("CveAcercamientoGasto").ToEntero(); - - if (ObjCRM.RemoveAcercamientosGastos(CveAcercamientoGasto)) + RequestAcermientoGastos AcermientoGastos = new RequestAcermientoGastos(CveAcercamiento, CveAcercamientoGasto: CveAcercamientoGasto); + if (cRMService.AcercamientosGastosDelete(AcermientoGastos)) { CargaGastos(); Alert("Gasto eliminado Correctamente", ModExtensiones.TipoMensaje.MsgInformacion); diff --git a/CRM/CatEmpresasCRM.aspx.cs b/CRM/CatEmpresasCRM.aspx.cs index 89eff8ed4..d7b7b4a1f 100644 --- a/CRM/CatEmpresasCRM.aspx.cs +++ b/CRM/CatEmpresasCRM.aspx.cs @@ -8,6 +8,11 @@ using System.Web.UI.WebControls; using System.Data; using GemBox.Spreadsheet; using Extensiones; +using ADSNetLibrary.SIGAPI.Services.CRM; +using ADSNetLibrary.SIGAPI.Models.CRM.Request; +using ADSNetLibrary.SIGAPI.Models.CRM.Response; +using Microsoft.Extensions.Configuration; +using MoreLinq; public partial class CRM_CatEmpresasCRM : ClsPaginas { @@ -44,40 +49,60 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas protected void CargaDatos() { - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveMedioCaptacion: DdlMedioCaptacion.SelectedValue.ToEntero()) && ObjCRM.DtResultados.Rows.Count > 0) + //ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestEmpresasCRM parametros = new RequestEmpresasCRM(UsuarioActual.CveEmpresa, -1, CveMedioCaptacion: DdlMedioCaptacion.SelectedValue.ToEntero()); + var objServicio = cRMService.GetEmpresasCRM(parametros); + if (objServicio.Result.Count > 0) { - TmpDT = ObjCRM.DtResultados; - GVDatos.DataSource = TmpDT; + GVDatos.DataSource = objServicio.Result; + TmpDT = objServicio.Result.ToDataTable(); } - ObjCRM.Dispose(); + //if (ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveMedioCaptacion: DdlMedioCaptacion.SelectedValue.ToEntero()) && ObjCRM.DtResultados.Rows.Count > 0) + //{ + // TmpDT = ObjCRM.DtResultados; + // GVDatos.DataSource = TmpDT; + //} + //ObjCRM.Dispose(); GVDatos.DataBind(); UPDatos.Update(); } protected void CargaMediosCaptacion() { - ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa, 1); + var ObjMedioCaptacion = cRMService.GetMedioCaptacionCRM(MedioCaptacion); - if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa, 1)) + if (ObjMedioCaptacion.Result.Count > 0) { - DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}",DdlTipoProceso.SelectedValue)); + DataTable DTMedioCaptacion = ObjMedioCaptacion.Result.ToDataTable(); + DdlMedioCaptacion.DataSource = DTMedioCaptacion.FiltraParametros(String.Format("CveTipoProceso = {0}", DdlTipoProceso.SelectedValue)); DdlMedioCaptacion.DataBind(); - DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos", "-1")); + DdlMedioCaptacion.Items.Insert(0, new ListItem("Seleccione ", "-1")); } - ObjCRM.Dispose(); + + //if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa, 1)) + //{ + // DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}",DdlTipoProceso.SelectedValue)); + // DdlMedioCaptacion.DataBind(); + // DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos", "-1")); + //} + //ObjCRM.Dispose(); } protected void CargaTipoProcesos() { - ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestTipoProceso tipoProceso = new RequestTipoProceso(UsuarioActual.CveEmpresa); + var ObjTipoProceso = cRMService.GetTipoProcesoCRM(tipoProceso); - if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa)) + if (ObjTipoProceso.Result.Count > 0) { - DdlTipoProceso.DataSource = ObjCRM.DtResultados; + DdlTipoProceso.DataSource = ObjTipoProceso.Result; + DdlTipoProceso.DataBind(); } - DdlTipoProceso.DataBind(); } #endregion @@ -85,24 +110,30 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas protected void GVDatos_RowDeleting(object sender, GridViewDeleteEventArgs e) { int CveEmpresaCRM = GVDatos.Rows[e.RowIndex].DataKey("CveEmpresaCRM").ToEntero(); - Boolean HuboError = true; + //Boolean HuboError = true; - ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestContactoEmpresaCRM ContactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM); + RequestEmpresasCRM EmpresasCRM = new RequestEmpresasCRM(-1, CveEmpresaCRM); + RequestAcercamiento aceramientoGet = new RequestAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM); + var objAcercamiento = cRMService.GetAceracamientoCRM(aceramientoGet); - ObjCRM.IniciaTransacSQL(); - if (ObjCRM.RemoveContactoEmpresa(-1, CveEmpresaCRM)) + if (objAcercamiento.Result.Count == 0) { - if (ObjCRM.RemoveEmpresaCRM(CveEmpresaCRM)) + if (cRMService.EmpresasCRMContactoDelete(ContactoEmpresaCRM)) { - HuboError = false; - Alert("La Empresa ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion); + if (cRMService.EmpresasCRMDelete(EmpresasCRM)) + { + //HuboError = false; + Alert("La Empresa ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion); + } } } - - if (!HuboError) { ObjCRM.Commit(); } else { ObjCRM.RollBack(); } - - ObjCRM.Dispose(); + else + { + Alert("No se puede eliminar la empresa porque el prospecto cuenta con cotizaciones/facturaciones previa", ModExtensiones.TipoMensaje.MsgAdvertencia); + } CargaDatos(); } @@ -156,8 +187,11 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas DataTable dt = ReadExcelFile(Directorio + file.filename, true); DataRowCollection Rows = dt.Rows; - ClsCRM ObjCRM = new ClsCRM(); - ObjCRM.IniciaTransacSQL(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestMedioCaptacion RequestMedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa); + var ObjMedioCaptacion = cRMService.GetMedioCaptacionCRM(RequestMedioCaptacion); + EmpresasCRMModel cRMModel = new EmpresasCRMModel(); + bool TieneError = false; foreach (DataRow row in Rows) @@ -178,9 +212,10 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas int CveMedioCaptacion = -1; if (MedioCaptacion != "" || Agente != "") { - if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa)) + if (ObjMedioCaptacion.Result.Count > 0) { - DataRow MediosCaptacion = ObjCRM.DtResultados.FiltroPrimero(String.Format("MedioCaptacion = '{0}'",MedioCaptacion)); + DataTable tempMedio = ObjMedioCaptacion.Result.ToDataTable(); + DataRow MediosCaptacion = tempMedio.FiltroPrimero(String.Format("MedioCaptacion = '{0}'",MedioCaptacion)); if(MediosCaptacion != null) { CveMedioCaptacion = MediosCaptacion["CveMedioCaptacion"].ToString().ToEntero(); @@ -228,24 +263,30 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas TieneError = true; break; } - - TieneError = (!(ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, -1, CveVendedor, CveSubProyecto, Mail, CveGiro) > 0)); - + cRMModel.Empresa = NombreEmpresa; + cRMModel.RFC = RFC; + cRMModel.CveMedioCaptacion = CveMedioCaptacion; + cRMModel.CveEmpresa = UsuarioActual.CveEmpresa; + cRMModel.CveUsuarioIng = UsuarioActual.CveUsuario; + cRMModel.CveEncuestaAplicada = -1; + cRMModel.CveVendedorAsignado = CveVendedor; + cRMModel.CveSubProyecto = CveSubProyecto; + cRMModel.Correo = Mail; + cRMModel.CveGiroClasificacion = CveGiro; + long CveEmpresaCRM = cRMService.EmpresasCRMAdd(cRMModel).ToEntero(); + TieneError = CveEmpresaCRM < 0; } } if (TieneError) { - ObjCRM.RollBack(); }else { - ObjCRM.Commit(); Alert("Prospectos agregados correctamente"); TxtExcel.Text = ""; RegistraScript(String.Format("$('#{0}').modal('hide');", "DivCargasMasivas")); } - ObjCRM.Dispose(); } } diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index d411c482a..af7c29205 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -6,8 +6,16 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.IO; using System.Data; - +using ADSNetLibrary.SIGAPI.Services.CRM; +using ADSNetLibrary.SIGAPI.Models.CRM.Request; +using ADSNetLibrary.SIGAPI.Models.CRM.Response; +using ADSNetLibrary.SIGAPI.Models.Ventas.Request; +using ADSNetLibrary.SIGAPI.Models.Ventas.Response; using Extensiones; +using MoreLinq; +using ADSNetLibrary.SIGAPI.Services; +using ADSNetLibrary.SIGAPI.Services.Encuestas; +using ADSNetLibrary.SIGAPI.Models.Encuestas.Request; public partial class CRM_EmpresaCRM : ClsPaginas { @@ -236,7 +244,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas { if (!IsPostBack) { - CreoCliente = false; + CreoCliente = false; RecuperaCve(); CargaTipoProceso(); CargaMetodosCaptacion(); @@ -265,8 +273,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL()); ClsEncuestas ObjDatosTecnicos = new ClsEncuestas(ObjCRM.IniciaTransacSQL()); - Boolean HuboError = false; + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + EmpresasCRMModel cRMModel = new EmpresasCRMModel(); + ResponseContactoEmpresaCRM contacto = new ResponseContactoEmpresaCRM(); + Boolean HuboError = false; String NombreEmpresa = TxtNombreEmpresa.Text; String RFC = TxtRFC.Text; String Correo = TxtCorreoEmpresaCRM.Text.Trim(); @@ -277,6 +288,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas int CveMedioCaptacion = DdlMedioCaptacion.SelectedValue.ToEntero(); int CveVendedorActualizar = DdlVendedorAsignado.SelectedValue.ToEntero(); int CveSubProyecto = DdlSucursales.SelectedValue.ToEntero(); + int CveTipoProceso = DdlTipoProceso2.SelectedValue.ToEntero(); if (!EsEditar) { @@ -291,7 +303,30 @@ public partial class CRM_EmpresaCRM : ClsPaginas { string Mensaje = ""; //DATOS GENERALES - CveEmpresaCRM = ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CveEncuestaAplicada, CveVendedorActualizar, CveSubProyecto, Correo, DdlGiroClasificacion.SelectedValue.ToEntero()); + cRMModel = new EmpresasCRMModel() + { + Empresa = NombreEmpresa, + RFC = RFC, + CveMedioCaptacion = CveMedioCaptacion, + CveEmpresa = UsuarioActual.CveEmpresa, + CveUsuarioIng = UsuarioActual.CveUsuario, + CveEncuestaAplicada = CveEncuestaAplicada, + CveVendedorAsignado = CveVendedorActualizar, + CveSubProyecto = CveSubProyecto, + Correo = Correo, + CveGiroClasificacion = DdlGiroClasificacion.SelectedValue.ToEntero(), + CveCliente = -1, + CveEncuestaCRM = CveEncuestaCRM < 1 ? -1 : CveEncuestaCRM, + CveTipoProceso = CveTipoProceso + }; + + CveEmpresaCRM = cRMService.EmpresasCRMAdd(cRMModel).ToEntero(); + if (CveEmpresaCRM <= 0) + { + HuboError = true; + } + + //CveEmpresaCRM = ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CveEncuestaAplicada, CveVendedorActualizar, CveSubProyecto, Correo, DdlGiroClasificacion.SelectedValue.ToEntero()); if (CveEmpresaCRM > 0) { @@ -310,19 +345,36 @@ public partial class CRM_EmpresaCRM : ClsPaginas foreach (DataRow row in TempDTContactos.Rows) { - if (!ObjCRM.AddContactoEmpresa(row["Nombre"].ToString(), row["TelefonoOficina"].ToString(), row["Celular"].ToString(), row["Correo"].ToString(), CveEmpresaCRM, UsuarioActual.CveUsuario)) - HuboError = true; - else + contacto.Nombre = row["Nombre"].ToString(); + contacto.TelefonoOficina = row["TelefonoOficina"].ToString(); + contacto.Celular = row["Celular"].ToString(); + contacto.Correo = row["Correo"].ToString(); + contacto.CveEmpresaCRM = CveEmpresaCRM; + contacto.CveUsuarioIng = UsuarioActual.CveUsuario; + bool Contactoagregado = cRMService.EmpresasCRMContactoAdd(contacto); + if (Contactoagregado) + { Mensaje += row["Nombre"].ToString() + ((i == numContactos) ? "" : ", "); + i++; + + } + else + { + HuboError = true; + + } + + //if (!ObjCRM.AddContactoEmpresa(row["Nombre"].ToString(), row["TelefonoOficina"].ToString(), row["Celular"].ToString(), row["Correo"].ToString(), CveEmpresaCRM, UsuarioActual.CveUsuario)) + - i++; } } if (!ObjBitacora.AddEventoBitacora(Mensaje, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { HuboError = true; - }else + } + else { string asunto = String.Format("Se registró la empresa {0} con datos RFC: {1}, Vendedor: {2}", NombreEmpresa, RFC, Vendedor); mandarCorreo(asunto, Mensaje); @@ -338,16 +390,35 @@ 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,CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) + if (CveEncuestaAplicada != 0) { - if (!ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + cRMModel.Empresa = NombreEmpresa; + cRMModel.RFC = RFC; + cRMModel.CveMedioCaptacion = CveMedioCaptacion; + cRMModel.CveEmpresaCRM = CveEmpresaCRM; + cRMModel.CveUsuarioIng = UsuarioActual.CveUsuario; + cRMModel.CveEncuestaAplicada = CveEncuestaAplicada; + cRMModel.CveVendedorAsignado = CveVendedorActualizar; + cRMModel.CveSubProyecto = CveSubProyecto; + cRMModel.Correo = Correo; + cRMModel.CveGiroClasificacion = DdlGiroClasificacion.SelectedValue.ToEntero(); + cRMModel.CveCliente = -1; + if (cRMService.EmpresasCRMUpdate(cRMModel)) + { + if (!ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { + HuboError = true; + } + else + { + string asunto = String.Format("Se actualizó la empresa {0}", NombreEmpresa); + string mensaje = String.Format("Se actualizó la empresa {0} con RFC {1} por el usuario {2}", NombreEmpresa, RFC, UsuarioActual.Nombre); + mandarCorreo(asunto, mensaje); + } + } + else { HuboError = true; - }else - { - string asunto = String.Format("Se actualizó la empresa {0}",NombreEmpresa); - string mensaje = String.Format("Se actualizó la empresa {0} con RFC {1} por el usuario {2}", NombreEmpresa, RFC,UsuarioActual.Nombre); - mandarCorreo(asunto, mensaje); } } } @@ -360,7 +431,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas else Alert(String.Format("La Empresa {0} fue actualizada correctamente.", NombreEmpresa), ModExtensiones.TipoMensaje.MsgInformacion); } - else { ObjCRM.RollBack(); } + else + { + Alert("Ocurrio un error la guardar la informacion de la empresa", ModExtensiones.TipoMensaje.MsgError); + ObjCRM.RollBack(); + } ObjCRM.Dispose(); ObjBitacora.Dispose(); @@ -378,15 +453,17 @@ public partial class CRM_EmpresaCRM : ClsPaginas protected int GuardaDatosTecnicos(ClsEncuestas ObjDatosTecnicos, int CveEncuestaAplicada = -1) { + var encuestaService = new EncuestaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); int _CveEncuestaAplicada = CveEncuestaAplicada; //NUEVA CAPTURA DE DATOS TECNICOS if (!EsEditar) { - if (ObjDatosTecnicos.AddEncuestaAplicada(CveEncuestaCRM, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + var responseModelAddEncuestaAplicada = encuestaService.AddEncuestaAplicada(new RequestEncuestaAplicadaAdd() { CveEncuesta = CveEncuestaCRM, CveCliente = -1, CvePersonal = -1, CveUsuario = UsuarioActual.CveUsuario, CveEmpresa = UsuarioActual.CveEmpresa }); + if (responseModelAddEncuestaAplicada.Result > 0) { DataTable dt; - _CveEncuestaAplicada = ObjDatosTecnicos.DtResultados.Rows[0][0].ToEntero(); + _CveEncuestaAplicada = responseModelAddEncuestaAplicada.Result.ToEntero(); foreach (GridViewRow drow in GvDatosTecnicos.Rows) { @@ -447,7 +524,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas } //CREAMOS REGISTRO DE LOS DATOS TECNICOS - if (!(ObjDatosTecnicos.AddEncuestaAplicadaDetalle(_CveEncuestaAplicada, CvePregunta, CveRespuesta, Respuesta))) + var responnseModelAddEncuestaAplicadaDetalle = encuestaService.AddEncuestaAplicadaDetalle(new RequestEncuestaAplicadaDetalleAdd() { CveEncuestaAplicada = _CveEncuestaAplicada, CvePregunta = CvePregunta, CveRespuesta = CveRespuesta, Valor = Respuesta }); + if (!responnseModelAddEncuestaAplicadaDetalle.IsSuccess) { //SI HAY ERROR REGRESA 0 _CveEncuestaAplicada = 0; @@ -527,13 +605,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas } } + var responnseModelUpdateDatosTecnicosCRM = encuestaService.UpdateDatosTecnicosCRM(new RequestDatosTecnicosCRMUpdate() { CveEncuestaAplicadaDetalle = CveEncuestaAplicadaDetalle, CveEncuestaAplicada = CveEncuestaAplicada, CvePregunta = CvePregunta, CveRespuesta = CveRespuesta, Respuesta = Respuesta }); + var responnseModelAddEncuestaAplicadaDetalle = encuestaService.AddEncuestaAplicadaDetalle(new RequestEncuestaAplicadaDetalleAdd() { CveEncuestaAplicada = _CveEncuestaAplicada, CvePregunta = CvePregunta, CveRespuesta = CveRespuesta, Valor = Respuesta }); //ACTUALIZAMOS LOS DATOS TECNICOS - if (ExisteRegistro && !(ObjDatosTecnicos.UpdateDatosTecnicosCRM(CveEncuestaAplicadaDetalle, CveEncuestaAplicada, CvePregunta, CveRespuesta, Respuesta))) + if (ExisteRegistro && !responnseModelUpdateDatosTecnicosCRM.IsSuccess) { //SI HAY ERROR REGRESA 0 _CveEncuestaAplicada = 0; } - else if (!ExisteRegistro && !(ObjDatosTecnicos.AddEncuestaAplicadaDetalle(_CveEncuestaAplicada, CvePregunta, CveRespuesta, Respuesta))) + else if (!ExisteRegistro && !responnseModelAddEncuestaAplicadaDetalle.IsSuccess) { //SI HAY ERROR REGRESA 0 _CveEncuestaAplicada = 0; @@ -568,29 +648,39 @@ public partial class CRM_EmpresaCRM : ClsPaginas protected void CargaTipoProceso() { - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa)) + //ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestTipoProceso tipoProceso = new RequestTipoProceso(UsuarioActual.CveEmpresa); + var ObjTipoProceso = cRMService.GetTipoProcesoCRM(tipoProceso); + + if (ObjTipoProceso.Result.Count > 0) { - DdlTipoProceso2.DataSource = ObjCRM.DtResultados; - DdlTipoProceso2.Items.Insert(0, new ListItem("Seleccione","-1")); + DdlTipoProceso2.DataSource = ObjTipoProceso.Result; + DdlTipoProceso2.Items.Insert(0, new ListItem("Seleccione", "-1")); } DdlTipoProceso2.DataBind(); - ObjCRM.Dispose(); + //ObjCRM.Dispose(); } protected void CargaMetodosCaptacion() { - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa, -1)) + //ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa); + var ObjMedioCaptacion = cRMService.GetMedioCaptacionCRM(MedioCaptacion); + + if (ObjMedioCaptacion.Result.Count > 0) { - DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}", DdlTipoProceso2.SelectedValue)); + DataTable tempMedio; + tempMedio = ObjMedioCaptacion.Result.ToDataTable(); + DdlMedioCaptacion.DataSource = tempMedio.FiltraParametros(String.Format("CveTipoProceso = {0}", DdlTipoProceso2.SelectedValue)); DdlMedioCaptacion.Items.Insert(0, new ListItem("Seleccione ", "-1")); DdlMedioCaptacionAcercamiento.Items.Clear(); - DdlMedioCaptacionAcercamiento.DataSource = ObjCRM.DtResultados; - DtMedioCaptacion = ObjCRM.DtResultados; + DdlMedioCaptacionAcercamiento.DataSource = tempMedio; + DtMedioCaptacion = tempMedio; DdlMedioCaptacionAcercamiento.Items.Insert(0, new ListItem("Seleccione ", "-1")); } - ObjCRM.Dispose(); + //ObjCRM.Dispose(); DdlMedioCaptacion.DataBind(); DdlMedioCaptacionAcercamiento.DataBind(); } @@ -628,26 +718,25 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (CveEmpresaCRM > 0) { - ClsCRM ObjCRM = new ClsCRM(); - - if (ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) && ObjCRM.DtResultados.Rows.Count > 0) + //ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestEmpresasCRM parametros = new RequestEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM); + var objServicio = cRMService.GetEmpresasCRM(parametros); + if (objServicio.Result.Count > 0) { EsEditar = true; - - LblEncabezadoEmpresa.Text = String.Format("Consulta de la Empresa: {0}", ObjCRM.DtResultados.FiltroPrimeroValor("Empresa").ToUpper()); - - TxtNombreEmpresa.Text = ObjCRM.DtResultados.FiltroPrimeroValor("Empresa"); - TxtRFC.Text = ObjCRM.DtResultados.FiltroPrimeroValor("RFC"); - DdlTipoProceso2.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso")); + LblEncabezadoEmpresa.Text = String.Format("Consulta de la Empresa: {0}", objServicio.Result[0].Empresa); + TxtNombreEmpresa.Text = objServicio.Result[0].Empresa; + TxtRFC.Text = objServicio.Result[0].RFC; + DdlTipoProceso2.SelectedValueExist(objServicio.Result[0].CveTipoProceso); CargaMetodosCaptacion(); - TxtCorreoEmpresaCRM.Text = ObjCRM.DtResultados.FiltroPrimeroValor("Correo"); - DdlMedioCaptacion.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveMedioCaptacion")); - - CveEncuestaAplicada = ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicada") != "" ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicada").ToEntero() : -1; - 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; + TxtCorreoEmpresaCRM.Text = objServicio.Result[0].Correo; + DdlMedioCaptacion.SelectedValueExist(objServicio.Result[0].CveMedioCaptacion); + CveEncuestaAplicada = objServicio.Result[0].CveEncuestaAplicada > 0 ? objServicio.Result[0].CveEncuestaAplicada.ToEntero() : -1; + CveVendedor = objServicio.Result[0].CveVendedorAsignado.ToEntero(); + CveSubProyecto = objServicio.Result[0].CveSubProyecto.ToEntero(); + CveCliente = objServicio.Result[0].CveCliente.ToEntero(); + CveGiroClasificacion = objServicio.Result[0].CveGiroClasificacion > 0 ? objServicio.Result[0].CveGiroClasificacion.ToEntero() : -1; if (!(CveCliente > 0)) { @@ -655,11 +744,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas HplCrearCliente.NavigateUrl = String.Format("/Ventas/Clientes.aspx?CveEmpresaCRM={0}", CveEmpresaCRM); } - CargaContactos(ObjCRM); + CargaContactos(); ActivaSeccionAcercamientos(); - CargaAcercamientos(ObjCRM); + CargaAcercamientos(); - InicializaAcercamientos(ObjCRM); + InicializaAcercamientos(); CargaCotizaciones(); @@ -676,7 +765,6 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveGiroClasificacion = -1; } - ObjCRM.Dispose(); UpDatos.Update(); BtnGuardarEmpresa.Text = "Actualizar"; @@ -707,14 +795,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas protected void DdlTipoProceso_Change(object sender, EventArgs e) { DdlMedioCaptacionAcercamiento.Items.Clear(); - DdlMedioCaptacionAcercamiento.DataSource = DtMedioCaptacion.FiltraParametros(String.Format("CveTipoProceso = {0}",DdlTipoProceso.SelectedValue.ToEntero())); + DdlMedioCaptacionAcercamiento.DataSource = DtMedioCaptacion.FiltraParametros(String.Format("CveTipoProceso = {0}", DdlTipoProceso.SelectedValue.ToEntero())); DdlMedioCaptacionAcercamiento.DataBind(); if (DdlTipoProceso.SelectedValue != "-1") { DdlMedioCaptacionAcercamiento.Enabled = true; - }else + } + else { - DdlMedioCaptacionAcercamiento.Items.Insert(0,new ListItem("Seleccione","-1")); + DdlMedioCaptacionAcercamiento.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlMedioCaptacionAcercamiento.Enabled = false; } @@ -738,20 +827,43 @@ public partial class CRM_EmpresaCRM : ClsPaginas Boolean HuboError = true; ClsCRM ObjCRM = new ClsCRM(); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestContactoEmpresaCRM ContactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM); + RequestEmpresasCRM EmpresasCRM = new RequestEmpresasCRM(-1, CveEmpresaCRM); + RequestAcercamiento aceramientoGet = new RequestAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM); + var objAcercamiento = cRMService.GetAceracamientoCRM(aceramientoGet); ClsEncuestas objDatosTecnicos = new ClsEncuestas(ObjCRM.IniciaTransacSQL()); + var encuestaService = new EncuestaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); - if (ObjCRM.RemoveContactoEmpresa(-1, CveEmpresaCRM)) + if (objAcercamiento.Result.Count == 0) { - if (ObjCRM.RemoveEmpresaCRM(CveEmpresaCRM)) - { - HuboError = false; - if (CveEncuestaAplicada > 0 && !objDatosTecnicos.RemoveEncuestaAplicada(CveEncuestaAplicada, UsuarioActual.CveEmpresa)) + if (cRMService.EmpresasCRMContactoDelete(ContactoEmpresaCRM)) + { + if (cRMService.EmpresasCRMDelete(EmpresasCRM)) + { + HuboError = false; + var responseModelRemoveEncuestaAplicada = encuestaService.RemoveEncuestaAplicada(new RequestEncuestaAplicadaRemove() { CveEmpresa = UsuarioActual.CveEmpresa, CveEncuestaAplicada = CveEncuestaAplicada }); + if (CveEncuestaAplicada > 0 && !responseModelRemoveEncuestaAplicada.IsSuccess) + { + HuboError = true; + } + } + else { HuboError = true; } + } + else + { + HuboError = true; + } + } + else + { + Alert("No se puede eliminar la empresa porque el prospecto cuenta con cotizaciones/facturaciones previa", ModExtensiones.TipoMensaje.MsgAdvertencia); } if (!HuboError) @@ -759,7 +871,12 @@ public partial class CRM_EmpresaCRM : ClsPaginas ObjCRM.Commit(); Alert("La Empresa ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion, "document.location.href=\"/CRM/CatEmpresasCRM.aspx\""); } - else { ObjCRM.RollBack(); } + else + { + ObjCRM.RollBack(); + Alert("Ocurrio un error al intentar eliminar la empresa.", ModExtensiones.TipoMensaje.MsgError); + + } ObjCRM.Dispose(); objDatosTecnicos.Dispose(); @@ -776,8 +893,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas } else { - BtnAgregarContacto.Visible = true; - DivBuscadorContactos.Visible = true; + BtnAgregarContacto.Visible = false; + DivBuscadorContactos.Visible = false; } } @@ -810,13 +927,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas UpContactos.Update(); } - protected void CargaContactos(ClsCRM objCRM) + protected void CargaContactos() { TempDTContactos = null; - - if (objCRM.GetContactoEmpresa(CveEmpresaCRM)) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestContactoEmpresaCRM contactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM, UsuarioActual.CveEmpresa, -1); + var objCRM = cRMService.GetContactosEmpresasCRM(contactoEmpresaCRM); + if (objCRM.Result.Count > 0) { - DTContactos = objCRM.DtResultados; + DTContactos = objCRM.Result.ToDataTable(); GVContactos.DataSource = DTContactos; GVContactos.DataBind(); @@ -897,13 +1016,23 @@ public partial class CRM_EmpresaCRM : ClsPaginas ClsCRM ObjCRM = new ClsCRM(); ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL()); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + ResponseContactoEmpresaCRM contacto = new ResponseContactoEmpresaCRM(); + Boolean HuboError = true; int CveUsuarioIng = UsuarioActual.CveUsuario; if (!EsEditarContacto) { - if (ObjCRM.AddContactoEmpresa(NombreContacto, TelefonoOficina, Celular, Correo, CveEmpresaCRM, CveUsuarioIng)) + contacto.Nombre = NombreContacto; + contacto.TelefonoOficina = TelefonoOficina; + contacto.Celular = Celular; + contacto.Correo = Correo; + contacto.CveEmpresaCRM = CveEmpresaCRM; + contacto.CveUsuarioIng = CveUsuarioIng; + + if (cRMService.EmpresasCRMContactoAdd(contacto)) { TelefonoOficina = (TelefonoOficina != "-1" ? String.Format(", Teléfono de Oficina: {0:(###) ###-####}", Convert.ToInt64(TelefonoOficina)) : ""); Celular = (Celular != "-1" ? String.Format(", Celular: {0:(###) ###-####}", Convert.ToInt64(Celular)) : ""); @@ -912,16 +1041,29 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjBitacora.AddEventoBitacora(String.Format("Se registró un Contacto con Nombre: {0}{1}{2}{3}", NombreContacto, TelefonoOficina, Celular, Correo), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { string asunto = "Se registró un Contacto"; - string mensaje = String.Format("Se registró un Contacto con Nombre: {0}{1}{2}{3}. Realzado por el usuario {4}", NombreContacto, TelefonoOficina, Celular, Correo,UsuarioActual.Nombre); + string mensaje = String.Format("Se registró un Contacto con Nombre: {0}{1}{2}{3}. Realzado por el usuario {4}", NombreContacto, TelefonoOficina, Celular, Correo, UsuarioActual.Nombre); mandarCorreo(asunto, mensaje); HuboError = false; Alert("El Contacto fue creado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion); } } + else + { + HuboError = true; + Alert(String.Format("Ocurrio un error al crear contacto: {0}. ", NombreContacto), ModExtensiones.TipoMensaje.MsgError); + + } } else { - if (ObjCRM.UpdateContactoEmpresa(NombreContacto, TelefonoOficina, Celular, Correo, CveContactoEditado, UsuarioActual.CveUsuario)) + contacto.Nombre = NombreContacto; + contacto.TelefonoOficina = TelefonoOficina; + contacto.Celular = Celular; + contacto.Correo = Correo; + contacto.CveContacto = CveContactoEditado; + contacto.CveUsuarioIng = CveUsuarioIng; + + if (cRMService.EmpresasCRMContactoUpdate(contacto)) { //if (ObjBitacora.AddEventoBitacora(String.Format("Se actualizó el contacto {0}", NombreContacto), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) //{ @@ -929,9 +1071,14 @@ public partial class CRM_EmpresaCRM : ClsPaginas Alert(String.Format("Se actualizó el contacto {0}.", NombreContacto), ModExtensiones.TipoMensaje.MsgInformacion); //} } + else + { + Alert(String.Format("Ocurrio un error al actualizar contacto: {0}.", NombreContacto), ModExtensiones.TipoMensaje.MsgError); + HuboError = true; + } } - CargaContactos(ObjCRM); + CargaContactos(); if (!HuboError) { ObjCRM.Commit(); } else { ObjCRM.RollBack(); } @@ -984,22 +1131,25 @@ public partial class CRM_EmpresaCRM : ClsPaginas ClsCRM ObjCRM = new ClsCRM(); ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL()); - if (ObjCRM.RemoveContactoEmpresa(CveContactoEditado)) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestContactoEmpresaCRM contacto = new RequestContactoEmpresaCRM(-1, -1, CveContactoEditado); + if (cRMService.EmpresasCRMContactoDelete(contacto)) { HuboError = false; - CargaContactos(ObjCRM); + CargaContactos(); Alert("El Contacto ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion); if (ObjBitacora.AddEventoBitacora(String.Format("Se eliminó el contacto {0}", NombreContacto), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { string asunto = "Se eliminó el contacto"; - string mensaje = String.Format("Se eliminó el contacto {0} por el usuario {1}", NombreContacto,UsuarioActual.Nombre); + string mensaje = String.Format("Se eliminó el contacto {0} por el usuario {1}", NombreContacto, UsuarioActual.Nombre); mandarCorreo(asunto, mensaje); ObjCRM.Commit(); } } else { + Alert(String.Format("Ocurrio un error al eliminar el contacto: {0}.", NombreContacto), ModExtensiones.TipoMensaje.MsgInformacion); ObjCRM.RollBack(); } @@ -1068,7 +1218,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim(), string.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { if (filemove != "") - filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:false); + filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"Empresas\{0}\OI", UsuarioActual.CveEmpresa)); TxtEventoDescripcion.Text = ""; @@ -1332,33 +1482,34 @@ public partial class CRM_EmpresaCRM : ClsPaginas RVFechaApertura.MaximumValue = DateTime.Now.ToShortDateString(); } - protected void InicializaAcercamientos(ClsCRM ObjCRM) + protected void InicializaAcercamientos() { DdlTipoProceso.Items.Clear(); DdlProbabilidadAcercamiento.Items.Clear(); DdlVendedor.Items.Clear(); - if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa, 1)) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestProbalidadAcercamiento ProbalidadAcercamiento = new RequestProbalidadAcercamiento(UsuarioActual.CveEmpresa, 1); + var ObjProbalidadAcercamiento = cRMService.GetProbabilidadAceracamientoCRM(ProbalidadAcercamiento); + + RequestTipoProceso tipoProceso = new RequestTipoProceso(UsuarioActual.CveEmpresa, 1); + var ObjTipoProceso = cRMService.GetTipoProcesoCRM(tipoProceso); + + if (ObjTipoProceso.Result.Count > 0) { - DdlTipoProceso.DataSource = ObjCRM.DtResultados; - - if (ObjCRM.DtResultados.Rows.Count > 0) - { - DdlTipoProceso.Items.Insert(0, new ListItem("Seleccione ", "-1")); - - DdlMedioCaptacionAcercamiento.Enabled = false; - } + DdlTipoProceso.DataSource = ObjTipoProceso.Result; + DdlTipoProceso.Items.Insert(0, new ListItem("Seleccione ", "-1")); + DdlMedioCaptacionAcercamiento.Enabled = false; DdlTipoProceso.DataBind(); } - if (ObjCRM.GetProbabilidadAcercamiento(UsuarioActual.CveEmpresa, 1)) + if (ObjProbalidadAcercamiento.Result.Count > 0) { //DdlProbabilidadAcercamiento.DataSource = ObjCRM.DtResultados; //DdlProbabilidadAcercamiento.DataBind(); DdlProbabilidadAcercamiento.Items.Insert(0, new ListItem("Seleccione ", "-1")); - - DtProbabilidadAcercamiento = ObjCRM.DtResultados; + DtProbabilidadAcercamiento = ObjProbalidadAcercamiento.Result.ToDataTable(); } DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa); @@ -1388,27 +1539,28 @@ public partial class CRM_EmpresaCRM : ClsPaginas } - protected void CargaAcercamientos(ClsCRM objCRM) + protected void CargaAcercamientos() { - if (objCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM)) + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestAcercamiento aceramientoGet = new RequestAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM); + var objAcercamiento = cRMService.GetAceracamientoCRM(aceramientoGet); + if (objAcercamiento.IsSuccess) { - GVAcercamientos.DataSource = objCRM.DtResultados; + GVAcercamientos.DataSource = objAcercamiento.Result; GVAcercamientos.DataBind(); } } protected void LnkAgregarAcercamiento_Click(object sender, EventArgs e) { - if(DTContactos.Rows.Count == 0) + if (DTContactos.Rows.Count == 0) { Alert("Para crear un nuevo acercamiento es necesario agregar al menos un Contacto.", ModExtensiones.TipoMensaje.MsgAdvertencia); } else { - ClsCRM ObjCRM = new ClsCRM(); CargaMetodosCaptacion(); - InicializaAcercamientos(ObjCRM); - ObjCRM.Dispose(); + InicializaAcercamientos(); limpiarCamposModalAcercamiento(); this.RegistraScript("$('#DivModalAltaAcercamiento').modal();"); UpAltaAcercamiento.Update(); @@ -1421,17 +1573,23 @@ public partial class CRM_EmpresaCRM : ClsPaginas { ClsCRM ObjCRM = new ClsCRM(); ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL()); + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + + Boolean HuboError = true; - String NombreAcercamiento = TxtAcercamiento.Text; String Descripcion = TxtDescripcionAcercamiento.Text == "" ? "-1" : TxtDescripcionAcercamiento.Text; - int CveTipoProceso = DdlTipoProceso.SelectedValue.ToEntero(); + RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, CveTipoProceso: CveTipoProceso); + var ObjEtapaProceso = cRMService.GetEtapaProcesoCRM(EtapaProceso); + DataTable tempDT = null; - ObjCRM.GetEtapaProceso(UsuarioActual.CveEmpresa, CveTipoProceso); - int CveEtapaProcesoActual = ObjCRM.DtResultados.FiltroPrimeroValor("CveEtapaProceso").ToEntero(); - + if (ObjEtapaProceso.Result.Count > 0) + { + tempDT = ObjEtapaProceso.Result.ToDataTable(); + } + int CveEtapaProcesoActual = tempDT.FiltroPrimeroValor("CveEtapaProceso").ToEntero(); int CveContactoPrincipal = DdlContactoPrincipal.SelectedValue.ToEntero(); int CveVendedor = DdlVendedor.SelectedValue.ToEntero(); int CveMedioCaptacion = DdlMedioCaptacionAcercamiento.SelectedValue.ToEntero(); @@ -1450,28 +1608,57 @@ public partial class CRM_EmpresaCRM : ClsPaginas int CveAcercamiento = -1; - if (ObjCRM.DtResultados.Rows.Count > 0) + if (tempDT.Rows.Count > 0) { - CveAcercamiento = ObjCRM.AddAcercamiento(CveEmpresaCRM, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActual, CveVendedor, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidadAcercamiento, - FechaApertura, NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveEmpresa, CveUsuarioIng, CvePS:DdlPS.SelectedValue.ToEntero()); - }else + var AcercamientoModel = new AcercaminetoModel() + { + CveEmpresaCRM = CveEmpresaCRM, + CveContactoPrincipal = CveContactoPrincipal, + CveTipoProceso = CveTipoProceso, + CveEtapaProcesoActual = CveEtapaProcesoActual, + CveVendedor = CveVendedor, + CveMedioCaptacion = CveMedioCaptacion, + CveRechazoMotivo = CveRechazoMotivo, + CveProbabilidadAcercamiento = CveProbabilidadAcercamiento, + FechaApertura = FechaApertura, + FechaCierre = (DateTime)System.Data.SqlTypes.SqlDateTime.Null, + NombreAcercamiento = NombreAcercamiento, + Descripcion = Descripcion, + Importe = Importe, + Comision = Comision, + Prioridad = Prioridad, + CveEmpresa = UsuarioActual.CveEmpresa, + CveUsuarioIng = CveUsuarioIng, + CvePS = DdlPS.SelectedValue.ToEntero() + }; + + + + CveAcercamiento = cRMService.AcercamientoAdd(AcercamientoModel).ToEntero(); + } + else { - Alert("No tiene 'Etapa Proceso' con el 'Proceso' seleccionado al agregar el Acercamiento",ModExtensiones.TipoMensaje.MsgAdvertencia); + Alert("No tiene 'Etapa Proceso' con el 'Proceso' seleccionado al agregar el Acercamiento", ModExtensiones.TipoMensaje.MsgAdvertencia); } if (CveAcercamiento > 0) { if (ObjBitacora.AddEventoBitacora(String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoPrincipal, CveEtapaProcesoCRM: CveEtapaProcesoActual)) { - string asunto = String.Format("Se registró el Acercamiento {0}",NombreAcercamiento); + string asunto = String.Format("Se registró el Acercamiento {0}", NombreAcercamiento); string mensaje = String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text); mandarCorreo(asunto, mensaje); HuboError = false; } } + else + { + Alert("Ocurrio un error al agregar el Acercamiento", ModExtensiones.TipoMensaje.MsgError); + HuboError = false; + } - CargaAcercamientos(ObjCRM); + CargaAcercamientos(); if (!HuboError) { ObjCRM.Commit(); } else { ObjCRM.RollBack(); } @@ -1504,7 +1691,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas #region "PERMISOS" protected void VerificaPermisos() { - + if (CveEmpresaCRM > 0) { if (!UsuarioActual.TienePermisoProceso(250)) @@ -1515,10 +1702,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas LnkAgregarAcercamiento.Visible = false; } - - if (!UsuarioActual.TienePermisoProceso(330)) + if ((UsuarioActual.CveVendedor != CveVendedor)) { - if ((UsuarioActual.CveVendedor != CveVendedor)) + if (UsuarioActual.CveUsuario != 100) { BtnGuardarEmpresa.Visible = false; BtnEliminarEmpresa.Visible = false; @@ -1529,12 +1715,6 @@ public partial class CRM_EmpresaCRM : ClsPaginas } } - - - - - - } } #endregion @@ -1543,10 +1723,18 @@ public partial class CRM_EmpresaCRM : ClsPaginas protected void CargaCotizaciones() { ClsVentas ObjVentas = new ClsVentas(); - if (ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "Cot", "-1", -1, "-1", -1, -1, -1, -1, "-1", "-1", "-1", CveEmpresaCRM: CveEmpresaCRM, CveUsuarioConsulta: UsuarioActual.CveUsuario)) + IVentaService ventaService = new VentaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestVentas requestVentas = new RequestVentas(UsuarioActual.CveEmpresa, TipoDocto: "Cot", CveEmpresaCRM: CveEmpresaCRM, CveUsuarioConsulta: UsuarioActual.CveUsuario); + var objVentas = ventaService.GetVentas(requestVentas); + if (objVentas.IsSuccess) { - GvCotizacion.DataSource = ObjVentas.DtResultados; + GvCotizacion.DataSource = objVentas.Result; } + + //if (ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "Cot", "-1", -1, "-1", -1, -1, -1, -1, "-1", "-1", "-1", CveEmpresaCRM: CveEmpresaCRM, CveUsuarioConsulta: UsuarioActual.CveUsuario)) + //{ + // GvCotizacion.DataSource = ObjVentas.DtResultados; + //} ObjVentas.Dispose(); GvCotizacion.DataBind(); UpCotizacion.Update(); @@ -1565,15 +1753,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas #endregion private void mandarCorreo(string Asunto, string body) { - DataTable Usuarios = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa); - int CveUsuario = Usuarios.FiltroPrimeroValor("CveUsuario",String.Format("CveVendedor = {0}",DdlVendedorAsignado.SelectedValue)).ToEntero(); + DataTable Usuarios = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); + int CveUsuario = Usuarios.FiltroPrimeroValor("CveUsuario", String.Format("CveVendedor = {0}", DdlVendedorAsignado.SelectedValue)).ToEntero(); if (CveUsuario != UsuarioActual.CveUsuario) { string correoVendedor = Usuarios.FiltroPrimeroValor("Correo", String.Format("CveUsuario = {0}", CveUsuario)); ClsSisMail Mail = new ClsSisMail(); List LSRutasMail = new List(); //ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail(); - Mail.SendMail(ClsPaginas.EmpresaNotificaciones, correoVendedor, Asunto,body); + Mail.SendMail(ClsPaginas.EmpresaNotificaciones, correoVendedor, Asunto, body); } } diff --git a/CRM/RegPrePolizaS.aspx.vb b/CRM/RegPrePolizaS.aspx.vb new file mode 100644 index 000000000..bcb621de3 --- /dev/null +++ b/CRM/RegPrePolizaS.aspx.vb @@ -0,0 +1,2083 @@ + + +Imports System.Data +Imports Extensiones +Imports System.Linq +Imports System.Web.Services +Imports GemBox.Spreadsheet +Imports Microsoft.Reporting.WebForms +Imports System.IO +Imports iTextSharp.text.pdf + +Partial Class ContabilidadC_RegPrePolizaS + Inherits ClsPaginas + + +#Region "Propiedades" + Public Property ArregloMovs As ArrayList + Get + Return CType(ViewState("ArregloMovs"), ArrayList) + End Get + Set(value As ArrayList) + ViewState("ArregloMovs") = value + End Set + End Property + Public Property DtMovimientos As DataTable + Get + Return CType(ViewState("DtMovimientos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtMovimientos") = value + End Set + End Property + Public Property DtCuentasContables As DataTable + Get + Return CType(ViewState("DtCuentasContables"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtCuentasContables") = value + End Set + End Property + Public Property TipoPlantilla As Integer + Get + Return CType(ViewState("TipoPlantilla"), Integer) + End Get + Set(value As Integer) + ViewState("TipoPlantilla") = value + End Set + End Property + Public Property CveMoneda As Integer + Get + Return CType(ViewState("CveMoneda"), Integer) + End Get + Set(value As Integer) + ViewState("CveMoneda") = value + End Set + End Property + Private ReadOnly Property CvePrePoliza As Integer + Get + Return ViewState("CvePrePoliza").ToString.ToEntero + End Get + End Property + + 'PARA CREAR IE + Private Property CveConcepto As Integer + Get + Return ViewState("CveConcepto").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveConcepto") = value + End Set + End Property + Private Property CveTipoTransaccion As Integer + Get + Return ViewState("CveTipoTransaccion").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveTipoTransaccion") = value + End Set + End Property + Private Property CveCuenta As Integer + Get + Return ViewState("CveCuenta").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveCuenta") = value + End Set + End Property + Private Property Folio As String + Get + Return ViewState("Folio").ToString + End Get + Set(value As String) + ViewState("Folio") = value + End Set + End Property + Private Property ImporteDocumento As Decimal + Get + Return ViewState("ImporteDocumento").ToString.ToDecimal + End Get + Set(value As Decimal) + ViewState("ImporteDocumento") = value + End Set + End Property + Private Property Observaciones As String + Get + Return ViewState("Observaciones").ToString + End Get + Set(value As String) + ViewState("Observaciones") = value + End Set + End Property + Private Property Beneficiario As String + Get + Return ViewState("Beneficiario").ToString + End Get + Set(value As String) + ViewState("Beneficiario") = value + End Set + End Property + Private Property RowIndex As Integer + Get + Return ViewState("RowIndex").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("RowIndex") = value + End Set + End Property + Private Property Actualizar As Boolean + Get + Return CBool(ViewState("Actualizar").ToString) + End Get + Set(value As Boolean) + ViewState("Actualizar") = value + End Set + End Property + + Private ReadOnly Property CvePeriodo As Integer + Get + Return CType(ViewState("CvePeriodo"), Integer) + End Get + End Property + Private ReadOnly Property CveProyecto As Integer + Get + Return CType(ViewState("CveProyecto"), Integer) + End Get + End Property + Private ReadOnly Property CveSubProyecto As Integer + Get + Return CType(ViewState("CveSubProyecto"), Integer) + End Get + End Property + Private ReadOnly Property CveTurno As Integer + Get + Return CType(ViewState("CveTurno"), Integer) + End Get + End Property + Public Property IndiceGrid As Integer + Get + Return CType(ViewState("IndiceGrid"), Integer) + End Get + Set(value As Integer) + ViewState("IndiceGrid") = value + End Set + End Property + Public Property IdPoliza As Integer + Get + Return CType(ViewState("IdPoliza"), Integer) + End Get + Set(value As Integer) + ViewState("IdPoliza") = value + End Set + End Property + Public Property Tick As String + Get + Return CType(ViewState("Tick"), String) + End Get + Set(value As String) + ViewState("Tick") = value + End Set + End Property + + Public Property CveIE As Integer + Get + Return CType(ViewState("CveIE"), Integer) + End Get + Set(value As Integer) + ViewState("CveIE") = value + End Set + End Property + + Public Property TipoPoliza As String + Get + Return CType(ViewState("TipoPoliza"), String) + End Get + Set(value As String) + ViewState("TipoPoliza") = value + End Set + End Property +#End Region + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + Tick = DateTime.Now.Ticks.ToString + + CveMoneda = 1 + ViewState("CvePrePoliza") = 0 + ViewState("CvePeriodo") = "0" + CveConcepto = -1 + CveTipoTransaccion = -1 + CveCuenta = -1 + Folio = "-1" + ImporteDocumento = -1 + Observaciones = "-1" + Beneficiario = "-1" + Actualizar = False + IdPoliza = -1 + + + If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then + DivTipoGasto.Visible = True + ThTipoGasto.Visible = True + CargaTiposGasto() + End If + + If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then + ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero + CreaDT() + CargaPrePoliza() + If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + GvPrePoliza.Columns(5).Visible = False + DivTG.Visible = False + GvMov.Columns(5).Visible = False + End If + + Exit Sub + Else + CreaDT() + BtnEliminar.Visible = False + LnkExcel.Visible = True + LnkImprimirPDF.Visible = False + End If + + + TipoPlantilla = -1 + If IfNull(Request("Tipo"), "").ToString = "Ing" Then + TipoPlantilla = 1 + LblEncabezado.Text = "Otros Ingresos" + End If + + CargaPlantillas(TipoPlantilla) + + If UsuarioActual.CveRol = 1 Then trNotificar.Visible = True + + CargaConceptos() + CargaSubProyectos() + CargaCuentasContables() + + 'crea tabla temporal + ArregloMovs = New ArrayList + + CargaCuentas() + + 'If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then + ' ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero + ' ViewState("CveProyecto") = Request("CveProyecto").ToEntero + ' ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero + ' ViewState("CveTurno") = Request("CveTurno").ToEntero + + ' DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) + ' DdlPlantilla.SelectedValue = "61" + ' DdlPlantilla.Enabled = False + ' DivAgregarConceptos.Visible = False + + ' CargaNomina() + + ' RegistraScript("$(document).ready(function () { calculateCargo(); Sys.Application.add_load(function (s, e) { calculateCargo(); }); } );", 1) + ' RegistraScript("$(document).ready(function () { calculateAbono(); Sys.Application.add_load(function (s, e) { calculateAbono(); }); } );", 2) + ' RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3) + 'End If + + If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + GvPrePoliza.Columns(4).Visible = False + GvMov.Columns(4).Visible = False + End If + + + + End If + + End Sub + + Private Sub CreaDT() + DtMovimientos = New DataTable("Movimientos") + Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True + With DtMovimientos.Columns + .Add("CodigoCuenta", Type.GetType("System.String")) + .Add("Cuenta", Type.GetType("System.String")) + .Add("Referencia", Type.GetType("System.String")) + .Add("Concepto", Type.GetType("System.String")) + .Add("Cargo", Type.GetType("System.Double")) + .Add("Abono", Type.GetType("System.Double")) + .Add("TipoMovto", Type.GetType("System.Int32")) + .Add("EsComodin", Type.GetType("System.Int32")) + .Add("CveConcepto", Type.GetType("System.Int32")) + .Add("CveSubProyecto", Type.GetType("System.Int32")) + .Add("Descripcion", Type.GetType("System.String")) + .Add("CveProveedor", Type.GetType("System.Int32")) + .Add("CvePersonal", Type.GetType("System.Int32")) + .Add("CveCompra", Type.GetType("System.Int32")) + .Add("CveCliente", Type.GetType("System.Int32")) + .Add("CveVenta", Type.GetType("System.Int32")) + .Add("CveClasificacion", Type.GetType("System.Int32")) + .Add("MultipleSubProyecto", Type.GetType("System.Boolean")) + .Add("CveTipoGasto", Type.GetType("System.Int32")) + .Add("CvePrePolizaDetalle", Type.GetType("System.Int32")) + .Add("CveConceptoContable", Type.GetType("System.Int32")) + .Add("IdCtaContable", Type.GetType("System.Int32")) + .Add("ConceptoContable", Type.GetType("System.String")) + .Add("CveCuenta", Type.GetType("System.Int32")) + End With + End Sub + + 'Private Sub CargaNomina() + ' Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + ' Dim ObjNomina As New ClsNominas + ' Dim ObjConta As New ClsContabilidad + + ' Dim Dt As DataTable = Nothing + ' Dim Cuenta As String = "" + ' Dim Concepto As String = "" + ' Dim IdCuenta As Integer = 0 + ' Dim TipoMovto As Integer + ' Dim CveConcepto As Integer + ' Dim CodigoCuenta As String = "" + ' Dim NombreCuenta As String = "" + ' Dim Referencia As String = "" + ' Dim EsComodin As Integer = 0 + ' DtMovimientos.Clear() + + ' If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then + ' Dt = ObjNomina.DtResultados + + ' For Each drt As DataRow In Dt.Rows + ' Dim dr As DataRow = DtMovimientos.NewRow + + ' If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then + ' CveConcepto = 98 + ' Cuenta = "Nominas por Pagar" + ' IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero + ' Concepto = "Pago Nomina" + ' Referencia = "Pago Nomina" + ' Else + ' Concepto = drt("NombreCompleto") + ' Referencia = "" + ' CveConcepto = drt("CveConceptoContable").ToString.ToEntero + ' Cuenta = drt("ConceptoContable").ToString + ' IdCuenta = drt("IdCtaContable").ToString.ToEntero + ' End If + + ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}") + ' CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "") + ' NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "") + + ' TipoMovto = drt("TipoMovto") + + ' If TipoMovto = 0 Then + ' dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal) + ' dr("Abono") = 0 + ' Else + ' dr("Cargo") = 0 + ' dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal) + ' End If + + ' dr("IdCuenta") = IdCuenta + ' dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta + ' dr("Cuenta") = Cuenta + ' dr("Concepto") = Concepto + ' dr("Descripcion") = Concepto + ' dr("Referencia") = Referencia + ' dr("TipoMovto") = TipoMovto + ' dr("EsComodin") = EsComodin + ' dr("CveConcepto") = CveConcepto + ' dr("CveProveedor") = "-1" + ' dr("CveSubProyecto") = drt("CveSubProyecto") + ' dr("CvePersonal") = drt("CvePersonal") + ' dr("CveClasificacion") = drt("CveClasificacion") + ' dr("CveTipoGasto") = drt("CveTipoGasto") + + ' DtMovimientos.Rows.Add(dr) + ' Next + + ' GvMov.DataSource = DtMovimientos + ' GvMov.DataBind() + ' UPMovs.Update() + ' End If + + 'End Sub + + Private Sub CargaPrePoliza() + BtnEliminar.Visible = True + LblEncabezado.Text = "Edición de Póliza" + + Dim ObjContabilidad As New ClsContabilidad + If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then + Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("") + If dr IsNot Nothing Then + DivAgregarConceptos.Visible = False + DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza") + TxtFechaDocumento.Text = dr("Fecha") + TxtConcepto.Text = dr("Concepto") + DivDatosPoliza.Visible = True + TipoPoliza = DdlTipoPoliza.SelectedItem.Text + Folio = dr("FolioPoliza").ToString + + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then + 'DivAgregarConceptos.Visible = True + LnkAddConcepto.Visible = True + CargaConceptos() + CargaSubProyectos() + CargaCuentasContables() + End If + + ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza) + + DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + + If UsuarioActual.CveRol = 1 AndAlso DtMovimientos.COUNT("TC", "TC > 1") > 0 Then + GvPrePoliza.Columns(7).Visible = True + End If + + If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then + LnkComplementoPago.Visible = True + End If + + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + If dr("FolioPoliza").ToString.ToEntero > 0 Then + divContabilizada.Visible = True + LblFolio.Text = dr("FolioPoliza").ToString + Folio = dr("FolioPoliza").ToString + + End If + Else + If dr("IdPoliza").ToString.ToEntero > 0 Then + HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) + divContabilizada.Visible = True + IdPoliza = dr("IdPoliza").ToString.ToEntero + ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then + 'sino está contabilizada, se activa el botón + BtnContabilizar.Visible = True + End If + End If + + divDatosPrincipales.Visible = False + divObservaciones.Visible = False + UPMovs.Visible = False + UPMovs.Update() + UPPDocumento.Update() + UpPrePoliza.Update() + + RegistraScript("comparar();") + + If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then + 'For Each row As GridViewRow In GvPrePoliza.Rows + ' row.FCTextBox("TxtCargo").Enabled = False + ' row.FCTextBox("TxtAbono").Enabled = False + 'Next + End If + LnkExcel.Visible = False + LnkImprimirPDF.Visible = True + Else + Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) + BtnEliminar.Visible = False + End If + + End If + + ObjContabilidad.Dispose() + UpPoliza.Update() + End Sub + + Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + ''Asignamos los Subproyectos + 'e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + 'e.Row.FCDropDownList("DdlSubProyecto").DataBind() + 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) + 'e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto")) + + 'Asignamos los Tipos de Gasto + 'e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + 'e.Row.FCDropDownList("DdlTipoGasto").DataBind() + 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) + 'e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto")) + + 'ASignamos las CuentasContables + 'e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas") + 'e.Row.FCDropDownList("DdlCtaContable").DataBind() + 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) + 'e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable")) + + If e.Row.DataKey("IdCtaContable") > 0 Then + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", e.Row.DataKey("IdCtaContable"))) + If drr IsNot Nothing Then + e.Row.FCLiteral("DdlCtaContable").Text = drr("CuentaFormato").ToString() + " - " + drr("Nombre").ToString() + End If + End If + + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCLiteral("TxtCargo").Text.ToDouble).ToString.FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCLiteral("TxtAbono").Text.ToDouble).ToString.FormatoNumero + + Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero + + If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) + If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) + If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) + If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) + + 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable + + End If + + If e.Row.RowType = DataControlRowType.Header Then + 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind() + 'e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1")) + End If + + End Sub + + Private Sub CargaPlantillas(TipoPlantilla As Integer) + + 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + 'GvPlantillas.DataBind() + + If UsuarioActual.CveEmpresa.Contiene(120) Then + DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) + DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) + + Else + DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + + End If + + + DdlPlantilla.DataBind() + DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) + + DdlPlantilla2.DataBind() + DdlPlantilla2.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) + End Sub + + Private Sub CargaConceptos() + DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1) + DdlConceptosContables.DataBind() + End Sub + + Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then + CargaProveedores() + DdlProveedores.Visible = True + DdlCompras.Visible = True + Else + DdlProveedores.Visible = False + DdlCompras.Visible = False + End If + + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then + CargaPersonal() + DdlPersonal.Visible = True + Else + DdlPersonal.Visible = False + End If + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then + CargaClientes() + DdlClientes.Visible = True + DdlVentas.Visible = True + Else + DdlClientes.Visible = False + DdlVentas.Visible = False + End If + End Sub + + Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged + CargaCompras(DdlProveedores.SelectedValue.ToEntero) + End Sub + + Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange + CargaVentas(DdlClientes.SelectedValue.ToEntero) + End Sub + + Private Sub CargaSubProyectos() + DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem(" - ", "-1")) + DdlSubProyectoFiltroMov.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + DdlSubProyectoFiltroMov.DataBind() + DdlSubProyectoFiltroMov.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Private Sub CargaCuentasContables() + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then + DdlCtaContable.DataSource = ObjConta.DtResultados + DtCuentasContables = ObjConta.DtResultados + End If + ObjConta.Dispose() + DdlCtaContable.DataBind() + DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + + Private Sub CargaTiposGasto() + DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + DdlTipoGasto.DataBind() + DdlTipoGasto.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + + Private Sub CargaProveedores() + DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedores.DataBind() + DdlProveedores.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + Private Sub CargaCompras(CveProveedor As Integer) + If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then + Dim ObjCompras As New ClsCompras + + DdlCompras.ClearSelection() + If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then + DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") + DdlCompras.DataBind() + DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlCompras.DataSource = Nothing + DdlCompras.DataBind() + DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjCompras.Dispose() + End If + End Sub + + Private Sub CargaClientes() + DdlClientes.setEsWebService(True) + DdlClientes.Attributes.Add("data-metodo", "getcliente") + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + DdlClientes.DataBind() + ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + Private Sub CargaVentas(CveCliente As Integer) + Dim ObjVentas As New ClsVentas + + DdlVentas.ClearSelection() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlVentas.DataSource = Nothing + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjVentas.Dispose() + End Sub + + Private Sub CargaPersonal() + DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + + Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged + + TxtTotalAbonos.Text = "" + TxtTotalCargos.Text = "" + + If DdlPlantilla.SelectedValue.ToEntero <= 0 Then + Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia) + DdlPlantilla.SelectedValue = "-1" + Exit Sub + End If + + If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + DivAgregarConceptos.Visible = True + Else + DivAgregarConceptos.Visible = False + End If + + + + Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + + Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") + Dim Cuenta As String = "" + Dim IdCuenta As Integer = 0 + Dim CodigoCuenta As String = "" + Dim NombreCuenta As String = "" + Dim EsComodin As Integer = 0 + DtMovimientos.Clear() + + For Each drt As DataRow In Dt.Rows + + Cuenta = drt("ConceptoContable").ToString + IdCuenta = 0 + CodigoCuenta = "" + NombreCuenta = "" + If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) + If drr IsNot Nothing Then + IdCuenta = drt("IdCtaContable").ToString.ToEntero + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + 'Cuenta = drr("Nombre").ToString() + End If + EsComodin = 0 + End If + + Dim dr As DataRow = DtMovimientos.NewRow + + dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta + dr("Cuenta") = Cuenta 'TxtCuentaContable.Text + dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) + dr("Concepto") = TxtObservaciones.Text + dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) + dr("EsComodin") = EsComodin + dr("CveConcepto") = drt("CveConcepto") + dr("CveSubProyecto") = drt("CveSubProyectoNegativo") + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("CveProveedor") = drt("CveProveedor") + dr("CvePersonal") = drt("CvePersonal") + dr("CveClasificacion") = -1 + dr("MultipleSubProyecto") = drt("MultipleSubProyecto") + dr("CveCuenta") = drt("CveCuenta") + 'dr("FolioPoliza") = 0 'drt("FolioPoliza") + + DtMovimientos.Rows.Add(dr) + Next + + + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() + + End Sub + + Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left + e.Row.Height = Unit.Pixel(1) + e.Row.Cells(0).ToolTip = e.Row.DBCampo("CveCuenta") + + If e.Row.DBCampo("TipoMovto") = "1" Then + e.Row.FCTextBox("TxtAbono").Visible = True + Else + e.Row.FCTextBox("TxtCargo").Visible = True + End If + + e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono")) + e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo")) + e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion") + + If CvePeriodo > 0 Then + e.Row.FCTextBox("TxtCargo").Enabled = False + e.Row.FCTextBox("TxtAbono").Enabled = False + End If + + e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlSubProyecto").DataBind() + e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) + e.Row.FCDropDownList("DdlSubProyecto").SelectedValue = e.Row.DBCampo("CveSubProyecto") + + 'Asignamos los Tipos de Gasto + e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlTipoGasto").DataBind() + e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) + e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto") + + If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + e.Row.FCDropDownList("DdlSubProyecto").Enabled = True + e.Row.FCLinkButton("imgD").Visible = True + Else + e.Row.FCDropDownList("DdlSubProyecto").Enabled = False + End If + + If e.Row.DBCampo("MultipleSubProyecto") = "True" Then + e.Row.FCDropDownList("DdlSubProyecto").Enabled = True + End If + + 'Agregamos la opcion para vincular los movimientos bancarios + If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then + Dim ObjMovimientos As New ClsMovimientos + Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos") + + Select Case e.Row.DataKey("CveConcepto").ToEntero + + 'Acreedores + Case 41 + If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then + DdlSaldos.Visible = True + DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}") + DdlSaldos.DataBind() + DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + End Select + + ObjMovimientos.Dispose() + End If + + If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then + e.Row.FCLinkButton("ImgBancos").Visible = True + + + If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then + e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" + End If + End If + End If + End Sub + + Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click + Dim TotalCargos, TotalAbonos As Decimal + + If CvePrePoliza > 0 Then + TotalCargos = TxtTotalCargos.Text.ToDecimal + TotalAbonos = TxtTotalAbonos.Text.ToDecimal + Else + For Each Gvr As GridViewRow In GvMov.Rows + TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal + TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal + Next + End If + + If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then + Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If CvePrePoliza > 0 Then + 'Nuevo Modulo Charlie + ActualizarPrePoliza() + Else + Dim MensajeAlert = New StringBuilder + Dim ObjIE As New ClsBancos() + Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) + ' Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL) + Dim Conta As ClsContPAQi = Nothing + Dim IDPoliza As Integer = 0 + Dim MsgError As String = "" + Dim CveIE As Integer + Dim FolioIE As String = "" + + Try + Dim CvePrePoliza As Integer + Dim ConceptoPoliza As String = TxtObservaciones.Text + CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + + If CvePrePoliza > 0 Then + Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" + Dim idCuentaContabilizacion As Long = 1 + Dim Importe As Double = 0 + Dim TipoMovto As Boolean = False + Dim IdCtaContable As Integer = 0 + + 'Registra movimieno bancario + If CveConcepto = 30 Then + CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" + If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then + FolioIE = ObjIE.Folio + End If + End If + + + + 'inserto las compras que voy a pagarDdlSaldos + For Each gvr As GridViewRow In GvMov.Rows + 'If gvr.DataKey("IDCuenta").ToEntero > 0 Then + ' IdCtaContable = gvr.DataKey("IDCuenta") + 'End If + + If gvr.DataKey("TipoMovto").ToDouble > 0 Then + Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble + TipoMovto = True + Else + Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble + TipoMovto = False + End If + + If CveConcepto <> 30 Then + + If CveConcepto = 41 Then + CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero + Else + CveIE = -1 + End If + + End If + + + If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then + idCuentaContabilizacion = 0 + End If + If Importe <> 0 Then + Dim tCveCuenta As Integer = gvr.DataKey("CveCuenta").ToEntero + + 'If gvr.datakey("CveConcepto") = "299" Then + ' tCveCuenta = gvr.DataKey("CveCuenta").ToEntero + 'End If + + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text, + TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE, + CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveCompra:=gvr.DataKey("CveCompra").ToEntero, + CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero, + ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, + CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCuenta:=tCveCuenta) Then + Else + MsgError = "No se pudo insertar el detalle de la póliza2" + Exit For + End If + End If + Next + + If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then + If ObjMov.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + MsgError = ObjMov.MensajePolizaDescuadre + End If + End If + + + 'El movimiento 2 es el de Pago + If ChkAutoConta.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If idCuentaContabilizacion > 0 Then + If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + + 'MENSAJE PRINCIPAL + MensajeAlert.AppendFormat("

Folio de Salida:
{1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) + 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) + Else + Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") + End If + Else + Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas") + End If + Else + MensajeAlert.AppendFormat("

Folio: {1}", CvePrePoliza, ObjMov.ContaFolio) + End If + + Else + MsgError = "No se pudo insertar la póliza" + End If + Catch ex As Exception + MsgError = "Error" + End Try + + If MsgError = "" Then + 'MENSAJE IE + If CveIE Then + MensajeAlert.AppendFormat("

Folio Bancario: {1}", CveIE, FolioIE) + Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") + Else + Alert(If(MensajeAlert.ToString = "", "Se registro con exito.", MensajeAlert.ToString), TipoMensaje.MsgInformacion, "window.location.reload()") + End If + + ObjIE.Commit() + If Conta IsNot Nothing Then Conta.Commit() + + UPPDocumento.Update() + + TxtObservaciones.Text = "" + GvMov.DataBind() + TxtFecha.Text = "" + TxtObservaciones.Text = "" + Else + Alert(MsgError.ToString, ModExtensiones.TipoMensaje.MsgError) + ObjIE.RollBack() + If Conta IsNot Nothing Then Conta.RollBack() + End If + + ObjIE.Dispose() + ObjMov.Dispose() + If Conta IsNot Nothing Then Conta.Dispose() + End If + End Sub + + Private Sub ActualizarPrePoliza() + + Dim OcurrioError As Boolean = False + Dim ObjContabilidad As New ClsContabilidad + ObjContabilidad.IniciaTransacSQL() + + ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) + + For Each row As GridViewRow In GvPrePoliza.Rows + If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then + If row.FCCheckBox("chkModificado").Checked Then + If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, + row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, + row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), + CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, + CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, CveCuenta:=row.DataKey("CveCuenta").ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + OcurrioError = True + Exit For + End If + End If + Else + If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, + row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString, + row.DataKey("CveConceptoContable").ToEntero, row.FCLiteral("TxtConcepto").Text, Now, + row.DataKey("IdCtaContable").ToEntero, 0, CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero, + CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), + ImporteMX:=If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, + row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveProveedor:=row.DataKey("CveProveedor").ToEntero, + CveCompra:=row.DataKey("CveCompra").ToEntero, CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, + CvePersonal:=row.DataKey("CvePersonal").ToEntero) Then + OcurrioError = True + Exit For + End If + End If + + Next + + If Not OcurrioError Then + ObjContabilidad.Commit() + Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion) + Else + ObjContabilidad.RollBack() + Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError) + End If + + ObjContabilidad.Dispose() + CargaPrePoliza() + End Sub + Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs) + RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) + LtlTitulo.Text = "Agregar Concepto" + BtnAceptar.Text = "Agregar" + LimpiaCampos() + + CargaConceptosContablesE() + CargaSubProyectoE() + CargaTipoGastoE() + CargaCtaContableE() + + + UpdatePanel1.Update() + End Sub + Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating + RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) + LtlTitulo.Text = "Editar Concepto" + BtnAceptar.Text = "Aceptar" + LimpiaCampos() + IndiceGrid = e.RowIndex + + Dim CveConceptoContable As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveConceptoContable").ToEntero + Dim CveProveedor As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveProveedor").ToEntero + Dim CveCompra As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCompra").ToEntero + Dim CvePersonal As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CvePersonal").ToEntero + Dim CveCliente As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCliente").ToEntero + Dim CveVenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveVenta").ToEntero + 'Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text + Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtConcepto").Text + Dim Referencia As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtRef").Text + Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveSubProyecto").ToString.ToEntero + Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveTipoGasto").ToString.ToEntero + Dim CveCuenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCuenta").ToString.ToEntero + Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDouble + Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDouble + + CargaConceptosContablesE() + DdlConceptosContablesE.SelectedValueExist(CveConceptoContable) + DdlConceptosContablesE_SelectedIndexChanged(DdlConceptosContablesE, e) + + DdlProveedoresE.SelectedValueExist(CveProveedor) + DdlProveedoresE_SelectedIndexChanged(DdlProveedoresE, e) + DdlComprasE.SelectedValueExist(CveCompra) + + DdlPersonalE.SelectedValueExist(CvePersonal) + + DdlClientesE.SelectedValue = CveCliente + DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") + DdlClientesE_SelectedIndexChanged(DdlClientesE, e) + DdlVentasE.SelectedValueExist(CveVenta) + + TxtConceptoE.Text = Concepto + TxtReferenciaE.Text = Referencia + + CargaSubProyectoE() + DdlSubProyectoE.SelectedValueExist(CveSubProyecto) + CargaTipoGastoE() + DdlTipoGastoE.SelectedValueExist(CveTipoGasto) + CargaCtaContableE() + DdlCtaContableE.SelectedValueExist(CveCuenta) + + If Cargo <> 0 Then + TxtCargoE.Text = Cargo + End If + + If Abono <> 0 Then + TxtAbonoE.Text = Abono + End If + + UpdatePanel1.Update() + + End Sub + Private Sub LimpiaCampos() + IndiceGrid = -1 + TxtConceptoE.Text = "" + TxtCargoE.Text = "" + TxtAbonoE.Text = "" + TxtReferenciaE.Text = "" + End Sub + Private Sub CargaConceptosContablesE() + DdlConceptosContablesE.DataSource = GlobalDTContaConceptosContables(-1) + DdlConceptosContablesE.DataBind() + End Sub + Private Sub CargaSubProyectoE() + DdlSubProyectoE.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + DdlSubProyectoE.DataBind() + DdlSubProyectoE.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + Private Sub CargaTipoGastoE() + DdlTipoGastoE.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + DdlTipoGastoE.DataBind() + DdlTipoGastoE.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + Private Sub CargaCtaContableE() + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + DdlCtaContableE.DataSource = ObjConta.DtResultados + End If + ObjConta.Dispose() + + DdlCtaContableE.DataBind() + DdlCtaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then + CargaProveedoresE() + DdlProveedoresE.Visible = True + DdlComprasE.Visible = True + Else + DdlProveedoresE.Visible = False + DdlComprasE.Visible = False + End If + + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(28, 29) Then + CargaPersonalE() + DdlPersonalE.Visible = True + 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, 12, 91) Then + CargaClientesE() + DdlClientesE.Visible = True + DdlVentasE.Visible = True + Else + DdlClientesE.Visible = False + DdlVentasE.Visible = False + End If + End Sub + Private Sub CargaProveedoresE() + DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedoresE.DataBind() + DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + Private Sub CargaComprasE(CveProveedor As Integer) + If Not DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(21) Then + Dim ObjCompras As New ClsCompras + + DdlComprasE.ClearSelection() + If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then + DdlComprasE.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") + DdlComprasE.DataBind() + DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlComprasE.DataSource = Nothing + DdlComprasE.DataBind() + DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjCompras.Dispose() + End If + End Sub + Private Sub CargaClientesE() + DdlClientesE.setEsWebService(True) + DdlClientesE.Attributes.Add("data-metodo", "getcliente") + DdlClientesE.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + DdlClientesE.DataBind() + ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + Private Sub CargaVentasE(CveCliente As Integer) + Dim ObjVentas As New ClsVentas + + DdlVentasE.ClearSelection() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + DdlVentasE.DataBind() + DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlVentasE.DataSource = Nothing + DdlVentasE.DataBind() + DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjVentas.Dispose() + End Sub + Private Sub CargaPersonalE() + 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) + End Sub + Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange + CargaVentasE(DdlClientesE.SelectedValue.ToEntero) + End Sub + Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click + + If IndiceGrid = -1 Then + If DtMovimientos Is Nothing Then CreaDT() + If CvePrePoliza > 0 Then + Dim dr As DataRow = DtMovimientos.NewRow + dr("IdCtaContable") = DdlCtaContableE.SelectedValue + dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + dr("Concepto") = TxtConceptoE.Text + dr("Referencia") = TxtReferenciaE.Text + dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) + dr("Cargo") = TxtCargoE.Text.ToDouble + dr("Abono") = TxtAbonoE.Text.ToDouble + dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text + dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) + + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + + If CvePrePoliza > 0 Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Update() + End If + Else + 'Dim dr As DataRow = DtMovimientos.NewRow + 'Dim CodigoCuenta As String = "" + 'Dim NombreCuenta As String = "" + + 'dr("IdCuenta") = DdlCtaContableE.SelectedValue + + 'If DdlCtaContableE.SelectedValue.ToEntero > 0 Then + ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContableE.SelectedValue)) + ' If drr IsNot Nothing Then + ' CodigoCuenta = drr("CuentaFormato").ToString() + ' NombreCuenta = drr("Nombre").ToString() + ' End If + 'End If + + 'dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta + 'dr("Cuenta") = DdlConceptosContablesE.SelectedItem.Text + 'dr("Referencia") = TxtReferenciaE.Text + 'dr("Concepto") = TxtConceptoE.Text + 'dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) + 'dr("EsComodin") = 0 + 'dr("CveConcepto") = DdlConceptosContablesE.SelectedValue + 'dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + 'dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + 'dr("Cargo") = TxtCargoE.Text.ToDouble + 'dr("Abono") = TxtAbonoE.Text.ToDouble + ''dr("Descripcion") = TxtDescripcionE.Text + 'dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + 'dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + 'dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + 'dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + 'dr("CveClasificacion") = -1 + 'dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + 'dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero + 'DtMovimientos.Rows.Add(dr) + 'DtMovimientos.AcceptChanges() + + 'GvMov.DataSource = DtMovimientos + 'GvMov.DataBind() + 'UPMovs.Update() + 'Actualizar = False + + End If + Else + Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero + Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle) + + If Rows.Count > 0 Then + Dim dr As DataRow = Rows(0) + dr("IdCtaContable") = DdlCtaContableE.SelectedValue + dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + dr("Concepto") = TxtConceptoE.Text + dr("Referencia") = TxtReferenciaE.Text + dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) + dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text + dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) + dr("CveCuenta") = DdlCtaContableE.SelectedValue.ToEntero + dr("CodigoNombreCuenta") = DdlCtaContableE.SelectedItem.Text + + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnConceptoContable").Value = DdlConceptosContablesE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnProveedor").Value = DdlProveedoresE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCompra").Value = DdlComprasE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnPersonal").Value = DdlPersonalE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCliente").Value = DdlClientesE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnVenta").Value = DdlVentasE.SelectedValue.ToEntero + + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnSubProyecto").Value = DdlSubProyectoE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnTipoGasto").Value = DdlTipoGastoE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCtaContable").Value = DdlCtaContableE.SelectedValue.ToEntero + + If TxtCargoE.Text <> "" Then + dr("Cargo") = TxtCargoE.Text.ToDouble + dr("Abono") = "".ToDouble + Else + dr("Abono") = TxtAbonoE.Text.ToDouble + dr("Cargo") = "".ToDouble + End If + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.AcceptChanges() + GvPrePoliza.EditIndex = -1 + + If CvePrePoliza > 0 Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Update() + End If + GvPrePoliza.Columns(11).Visible = True + + GvPrePoliza.Rows(IndiceGrid).FCCheckBox("chkModificado").Checked = True + End If + End If + + UpPrePoliza.Update() + RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") + End Sub + Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting + + Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero + + Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov) + If Rows.Count > 0 Then + DtMovimientos.Rows.Remove(Rows(0)) + DtMovimientos.AcceptChanges() + End If + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + + TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero + TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero + + 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria + + End Sub + + Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click + + If DtMovimientos Is Nothing Then CreaDT() + + If Actualizar Then + + Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & HdnCve.Value) + + If Rows.Count > 0 Then + Dim dr As DataRow = Rows(0) + Dim CodigoCuenta As String = "" + Dim NombreCuenta As String = "" + dr("CveCuenta") = DdlCtaContable.SelectedValue + + If DdlCtaContable.SelectedValue.ToEntero > 0 Then + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) + If drr IsNot Nothing Then + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + End If + End If + + dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta + dr("Cuenta") = DdlConceptosContables.SelectedItem + dr("Referencia") = TxtReferencia.Text + dr("Concepto") = TxtObservaciones.Text + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("EsComodin") = 0 + dr("CveConcepto") = DdlConceptosContables.SelectedValue + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("Descripcion") = TxtDescripcion.Text + dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + dr("CveClasificacion") = -1 + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + dr("CveCuenta") = DdlCtaContable.SelectedValue.ToEntero + End If + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() + LbCancelarEdicion.Visible = False + LbAgregar.Text = "Agregar" + + Else + + If CvePrePoliza > 0 Then + Dim dr As DataRow = DtMovimientos.NewRow + dr("IdCtaContable") = -1 'DdlCtaContable.SelectedValue + dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContables.SelectedValue + dr("Concepto") = TxtDescripcion.Text + dr("Referencia") = TxtReferencia.Text + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + dr("SubProyecto") = DdlSubProyecto.SelectedItem.Text + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + + If CvePrePoliza > 0 Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Update() + End If + Else + Dim dr As DataRow = DtMovimientos.NewRow + Dim CodigoCuenta As String = "" + Dim NombreCuenta As String = "" + + dr("CveCuenta") = DdlCtaContable.SelectedValue + + If DdlCtaContable.SelectedValue.ToEntero > 0 Then + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) + If drr IsNot Nothing Then + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + End If + End If + + dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta + dr("Cuenta") = DdlConceptosContables.SelectedItem.Text + dr("Referencia") = TxtReferencia.Text + dr("Concepto") = TxtObservaciones.Text + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("EsComodin") = 0 + dr("CveConcepto") = DdlConceptosContables.SelectedValue + dr("CveConceptoContable") = DdlConceptosContables.SelectedValue + dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("Descripcion") = TxtDescripcion.Text + dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + dr("CveClasificacion") = -1 + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + + 'If CvePrePoliza > 0 Then + ' GvPrePoliza.DataSource = DtMovimientos + ' GvPrePoliza.DataBind() + ' UpPrePoliza.Update() + 'End If + + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() + Actualizar = False + + End If + + End If + + TxtCargo.Text = "" + TxtAbono.Text = "" + TxtReferencia.Text = "" + TxtDescripcion.Text = "" + End Sub + +#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" + Public Sub Bancos_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + RowIndex = GvRow.RowIndex + + If GvRow.FCTextBox("TxtAbono").Text = "" Then + CargaTipoTransaccion("Ing") + Else + CargaTipoTransaccion("Egs") + End If + + + TxtDocumentoImporte.Text = If(GvRow.FCTextBox("TxtAbono").Text = "", GvRow.FCTextBox("TxtCargo").Text.FormatoNumero, GvRow.FCTextBox("TxtAbono").Text.FormatoNumero) + UpBancos.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DivContadoModal")) + End Sub + Private Sub CargaTipoTransaccion(Tipo As String) + DdlTipoTransaccion.Items.Clear() + DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}' AND Estatus = 1 ") + DdlTipoTransaccion.DataBind() + DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1")) + End Sub + Private Sub CargaCuentas() + DdlCuenta.Items.Clear() + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) + DdlCuenta.DataBind() + DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) + End Sub + Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click + CveConcepto = 30 + CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero + CveCuenta = DdlCuenta.SelectedValue.ToEntero + Folio = TxtDocumentoFolio.Text + ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal + Observaciones = TxtDocumentoObservaciones.Text + Beneficiario = TxtDocumentoBeneficiario.Text + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) + GvMov.Rows(RowIndex).FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" + UPMovs.Update() + End Sub + + Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click + Dim ObjContabilidad As New ClsContabilidad + + If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then + Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion) + Else + Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError) + End If + + ObjContabilidad.Dispose() + End Sub +#End Region + + Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs) + If UpPrePoliza.Visible Then + For Each Gvr As GridViewRow In GvPrePoliza.Rows + Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) + Next + UpPrePoliza.Update() + End If + If UPMovs.Visible Then + For Each Gvr As GridViewRow In GvMov.Rows + Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) + Next + UPMovs.Update() + End If + End Sub + Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs) + Dim Ddl As DropDownList = CType(sender, DropDownList) + For Each Gvr As GridViewRow In GvPrePoliza.Rows + If Ddl.SelectedValue.ToEntero > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then + Gvr.Visible = True + Else + Gvr.Visible = False + End If + Else + Gvr.Visible = True + End If + Next + UpPrePoliza.Update() + RegistraScript("calculateAbono()", "cargo") + RegistraScript("calculateCargo()", "abono") + RegistraScript("comparar()", "compara") + End Sub + Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs) + For Each Gvr As GridViewRow In GvMov.Rows + If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then + Gvr.Visible = True + Else + Gvr.Visible = False + End If + Else + Gvr.Visible = True + End If + Next + UpPrePoliza.Update() + RegistraScript("calculateAbono()", "cargo") + RegistraScript("calculateCargo()", "abono") + RegistraScript("comparar()", "compara") + End Sub + + Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing + Actualizar = True + GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero + Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero + + Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex) + + If DrM IsNot Nothing Then + HdnCve.Value = idMov.ToString + + DdlCtaContable.SelectedValue = DrM("CveCuenta") + TxtReferencia.Text = DrM("Referencia") + TxtObservaciones.Text = DrM("Concepto") + ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto") + DrM("EsComodin") = 0 + DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString + TxtCargo.Text = DrM("Cargo").ToString + TxtAbono.Text = DrM("Abono").ToString + TxtDescripcion.Text = DrM("Descripcion") + DdlSubProyecto.SelectedValue = DrM("CveSubProyecto") + DdlProveedores.SelectedValue = DrM("CveProveedor") + DdlCompras.SelectedValue = DrM("CveCompra") + DdlPersonal.SelectedValue = DrM("CvePersonal") + ' DrM("CveClasificacion") = -1 + DdlClientes.SelectedValue = DrM("CveCliente") + DdlVentas.SelectedValue = DrM("CveVenta") + LbCancelarEdicion.Visible = True + LbAgregar.Text = "Actualizar" + + End If + + UPPDocumento.Update() + DivAgregarConceptos.Visible = True + + 'If DtMovimientos Is Nothing Then CreaDT() + + 'Dim dr As DataRow = DtMovimientos.NewRow + 'Dim CodigoCuenta As String = "" + 'Dim NombreCuenta As String = "" + + 'dr("IdCuenta") = DdlCtaContable.SelectedValue + + 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then + ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) + ' If drr IsNot Nothing Then + ' CodigoCuenta = drr("CuentaFormato").ToString() + ' NombreCuenta = drr("Nombre").ToString() + ' End If + 'End If + + 'dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta + 'dr("Cuenta") = DdlConceptosContables.SelectedItem + 'dr("Referencia") = TxtReferencia.Text + 'dr("Concepto") = TxtObservaciones.Text + 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + 'dr("EsComodin") = 0 + 'dr("CveConcepto") = DdlConceptosContables.SelectedValue + 'dr("Cargo") = TxtCargo.Text.ToDouble + 'dr("Abono") = TxtAbono.Text.ToDouble + 'dr("Descripcion") = TxtDescripcion.Text + 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + 'dr("CveClasificacion") = -1 + 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + 'DtMovimientos.Rows.Add(dr) + + 'If CvePrePoliza > 0 Then + ' GvPrePoliza.DataSource = DtMovimientos + ' GvPrePoliza.DataBind() + 'End If + + + 'GvMov.DataSource = DtMovimientos + 'GvMov.DataBind() + 'UPMovs.Update() + + + End Sub + + Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click + LbCancelarEdicion.Visible = False + TxtObservaciones.Text = "" + Actualizar = False + LbAgregar.Text = "Agregar" + End Sub + + Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click + + Dim ObjConta As New ClsContabilidad + + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + Else + + Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + End If + + ObjConta.Dispose() + + + End Sub + + +#Region "COMPLEMENTO DE PAGO" + + Private Sub GeneraTimbre(CvePrePoliza As Integer) + Dim Str As New StringBuilder + Dim Banco As New ClsBancos + Banco.IniciaTransacSQL() + If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then + If Banco.Mensaje = "" Then + Banco.Commit() + PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False) + Str.AppendFormat("Folio: {0}  ", Banco.ComplementoSerieFolio) + Str.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) + Str.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) + MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo) + End If + Else + Banco.RollBack() + Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje) + End If + Banco.Dispose() + Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") + End Sub + + Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) + Try + Dim Msg As String = "" + If NombreArchivo <> "-1" Then ' + Dim ObjMail As New ClsSisMail() + Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo) + Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo) + Dim Cuerpo As String = "Se hace entrega del comprobante de pago" + Dim Asunto As String = "Entrega de comprobante de pago" + If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF}) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML}) + If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then + If ConAlerta Then + 'RegistraScript("$('#ModalDivMail').modal('hide');") + Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) + End If + Else + Msg = "No se pudo enviar el correo electrónico." + End If + Else + Msg = "No se pudo adjuntar el correo electrónico." + End If + End If + If ConAlerta AndAlso Msg <> "" Then + Alert(Msg, TipoMensaje.MsgError) + End If + Catch ex As Exception + OnError("Ocurrió error al mandar MAIL", ex) + End Try + End Sub + + Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) + GeneraTimbre(CvePrePoliza) + End Sub +#End Region + + + +#Region "E X C E L" + + + Private Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivCargaExcel")) + + End Sub + + Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click + Dim NombreArchivo As String + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + Dim workbook As New ExcelFile() + Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString) + + Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero + Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") + + Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows + Select New With + { + .ConceptoAdministrativo = row.Item("ConceptoContable"), + .Cuenta = row.Item("Codigo"), + .NombreCuenta = row.Item("NombreCuenta"), + .Cargo = "", + .Abono = "", + .Referencia = "", + .Concepto = "", + .SubProyecto = row.Item("SubProyecto"), + .CveConceptoContable = row.Item("CveConcepto"), + .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), + .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1), + .CveCuenta = row.Item("CveCuenta") + }).QueryToDataTable(True) + + worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0, + .StartColumn = 0 + }) + + Dim columnCount = worksheet.CalculateMaxUsedColumns() + For i = 0 To columnCount + worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) + Next + worksheet.Columns("I").Hidden = True + worksheet.Columns("J").Hidden = True + worksheet.Columns("K").Hidden = True + worksheet.Columns("L").Hidden = True + + + NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString + workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault) + + + End Sub + + Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click + If TxtExcel.getfiles().Archivos.Count > 0 Then + Dim file As Archivo = TxtExcel.getfiles().Archivos(0) + + Dim Directorio As String = Server.MapPath("~") & file.patch + + Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + CargarArchivo(Directorio, file.filename, Tipo) + Else + Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) + End If + End Sub + Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) + Dim dt As New DataTable + ' Conexion As Odbc.OdbcConnection = Nothing + Dim ErrorArchivo = False + Dim ErrorExcel = False + DdlPlantilla.SelectedValue = DdlPlantilla2.SelectedValue + dt = ReadExcelFile(Ruta + FileName, True) + + + If Not ErrorArchivo Then + + If Not dt.Columns(0).ColumnName = "ConceptoAdministrativo" Then + Alert("El nombre de la primera columna debe ser 'ConceptoAdmin'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(1).ColumnName = "Cuenta" Then + Alert("El nombre de la segunda columna debe ser 'Cuenta'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(2).ColumnName = "NombreCuenta" Then + Alert("El nombre de la tercera columna debe ser 'NombreCuenta'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(3).ColumnName = "Cargo" Then + Alert("El nombre de la cuarta columna debe ser 'Cargo'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(4).ColumnName = "Abono" Then + Alert("El nombre de la quinta columna debe ser 'Abono' .Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(5).ColumnName = "Referencia" Then + Alert("El nombre de la sexta columna debe ser 'Referencia'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(6).ColumnName = "Concepto" Then + Alert("El nombre de la séptima columna debe ser 'Concepto'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(7).ColumnName = "SubProyecto" Then + Alert("El nombre de la octava columna debe ser 'SubProyecto'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + End If + + If Not ErrorArchivo Then + + DtMovimientos.Clear() + + Dim ObjConta As New ClsContabilidad() + ObjConta.IniciaTransacSQL() + Try + + + For Each Row As DataRow In dt.FiltraParametros("ConceptoAdministrativo <> ''").Rows + + Dim NombreCuenta As String = Row("NombreCuenta").ToString + Dim Cuenta As String = Row("Cuenta").ToString + Dim ConceptoAdministrativo As String = Row("ConceptoAdministrativo").ToString + + Dim CveSubProyecto As Integer = -1 + Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) + Dim CveConceptoContable As Integer = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable ='{0}'", Row("ConceptoAdministrativo"))).ToEntero ' Row("CveConceptoContable").ToString.ToEntero + 'Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero + Dim CveClasificacion As Integer = -1 + Dim CveCuenta As Integer = -1 + Dim ObjConta2 As New ClsContabilidad + If ObjConta2.GetCuentas(-1, Row("Cuenta").ToString.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then + CveCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CveCuenta", "").ToEntero + NombreCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CtaCodigo", "") + End If + ObjConta2.Dispose() + + If CveCuenta <= 0 AndAlso CveConceptoContable <> 30 Then + Alert(String.Format("La cuenta {0} no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString)) + DtMovimientos.Clear() + Exit For + End If + + 'sino viene el cveconcepto, busca por le nombre del concepto + If CveConceptoContable = 0 Then + Alert(String.Format("El concepto {0} no se reconoció, favor de verificar el archivo.", Row("ConceptoAdministrativo"))) + DtMovimientos.Clear() + Exit For + End If + + If Row("SubProyecto").ToString.Trim <> "" Then + CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=-1).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto = '{0}'", Row("SubProyecto").ToString.Trim)).ToEntero 'Row("CveSubProyecto").ToString.ToEntero + + If CveSubProyecto = 0 Then + Alert(String.Format("El subproyecto {0} no se reconoció, favor de verificar el archivo.", Row("SubProyecto"))) + DtMovimientos.Clear() + Exit For + End If + + End If + + If CveConceptoContable = 69 Then + CveClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", "").ToEntero + End If + + Dim dr As DataRow = DtMovimientos.NewRow + Dim CodigoCuenta As String = "" + + dr("CodigoCuenta") = NombreCuenta 'Cuenta & "
" & NombreCuenta + dr("Cuenta") = ConceptoAdministrativo + dr("Referencia") = Row("Referencia").ToString + dr("Concepto") = Row("Concepto").ToString + dr("TipoMovto") = TipoMovto + dr("EsComodin") = 0 + dr("CveConcepto") = CveConceptoContable + dr("CveConceptoContable") = CveConceptoContable + dr("ConceptoContable") = Row("ConceptoAdministrativo").ToString + dr("Cargo") = Row("Cargo").ToString.ToDecimal.RoundSQL + dr("Abono") = Row("Abono").ToString.ToDecimal.RoundSQL + dr("Descripcion") = Row("Concepto").ToString + dr("CveSubProyecto") = CveSubProyecto + dr("CveProveedor") = -1 + dr("CveCompra") = -1 + dr("CvePersonal") = -1 + dr("CveClasificacion") = CveClasificacion + dr("CveCliente") = -1 + dr("CveVenta") = -1 + dr("CveCuenta") = CveCuenta + + + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + Next + + TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero + TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero + + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() + + Catch ex As Exception + Alert("No se pudo cargar el excel") + End Try + End If + End Sub +#End Region + +#Region "Paquete Egresos" + Protected Sub LnkImprimirPDF_Click(sender As Object, e As EventArgs) + ImprimirPolizaPDF(IdPoliza) + End Sub + Private Function ImprimirPolizaPDF(IdPoliza As Integer) As String + Dim ObjConta As New ClsContabilidad + 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) + Dim params As New List(Of ReportParameter) + Dim Bytes As Byte() = Nothing + + + 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then + If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + Dim dtVC As DataTable + Dim dr As DataRow + dtVC = ObjConta.DtResultados.FiltraParametros("Contabilizable = 1", "Orden") + dr = dtVC.Rows(0) + Dim ruta As String = "" + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString)) + params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString)) + params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString)) + params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) + 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) + 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) + params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) + params.Add(New ReportParameter("Moneda", "")) + params.Add(New ReportParameter("CodigoPostal", "")) + If UsuarioActual.CveEmpresa = 119 Then + params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre"))) + End If + If UsuarioActual.CveEmpresa = 140 Then + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + End If + If Archivo.Exists Then + ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc" + Else + ruta = "Empresas/Grales/Formatos/Polizas.rdlc" + End If + ImprimirbytesPDF(StreamPDF(ruta, dtVC, params, "ppoliza"), String.Format("{0}-{1}", TipoPoliza, dr("FolioPoliza").ToString), "PDF", True) + + End If + Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) + ObjConta.Dispose() + + End Function + + +#End Region + +End Class + diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 52d7f470c..209f43a40 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -4844,13 +4844,17 @@ - + - + + + + + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 7c8ceedc8..32780864d 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6434,7 +6434,7 @@ Partial Class Compras_Compras ' End If Case 6 'Compra - Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141, 152, 153, 154, 159, 160, 161, 162, 163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" + Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 145, 141, 152, 153, 154, 159, 160, 161, 162, 163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" @@ -6826,7 +6826,7 @@ Partial Class Compras_Compras Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal 'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) 'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) - importeMNTemp = (Gvr.DataKey("PU").ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * Gvr.DataKey("TipoCambio").ToDecimal).RoundSQL + importeMNTemp = (Gvr.FCTextBox("TxtPU").Text.ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * Gvr.DataKey("TipoCambio").ToDecimal).RoundSQL ImporteTransito += importeMNTemp 'se registra por cada compra relacionada If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMNTemp, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMNTemp, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=Gvr.DataKey("TipoCambio").ToDecimal, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index fdb758268..9cb7e9dd9 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -194,7 +194,8 @@ Partial Class PopUpVerFactura If UrlParametros("OP") IsNot Nothing AndAlso UrlParametros("OP").ToString <> "" Then SeleccionaReporte(UrlParametros) End If - End If + End If + If Request("onlyPrint") IsNot Nothing Then If Request("onlyPrint").ToString() = "Pallet" Then imprimirpallet2(Request("CvePallet").ToString.ToEntero()) @@ -202,11 +203,102 @@ Partial Class PopUpVerFactura If Request("onlyPrint").ToString() = "PalletCaja" Then imprimirpallet(Request("CvePallet").ToString.ToEntero()) End If + If Request("onlyPrint").ToString() = "manifiesto" Then + imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero()) + End If End If End If End Sub + Private Sub imprimirManifiesto(cveEmbarqueManifiesto As Integer) + Dim NoEmbarque As String = "" + Dim Fecha As String = "" + Dim SubProyecto As String = "" + Dim AgenciaAduanalUSA As String = "" + Dim AgenciaAduanalMEX As String = "" + Dim Temperatura As String = "" + Dim Hora As String = "" + Dim Chofer As String = "" + Dim CamPlaca As String = "" + Dim Camion As String = "" + Dim Rem1Placa As String = "" + Dim Remolque1 As String = "" + Dim NoPallets As String = "" + Dim NoBultos As String = "" + Dim NoKgManifiesto As String = "" + Dim tablaReporte As New DataTable + + 'Envase = "1 1/9" + 'Tamano = "Small" + 'Cultivo = "Tomate" + 'noPallet = "000001" + 'Variedad = "Golden" + Using objnom As New ClsNominas + If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then + Dim row As DataRow = objnom.DtResultados.Rows(0) + NoEmbarque = row("NoEmbarque").ToString() + Fecha = String.Format("{0:dd/MM/yyyy}", row("Fecha")) + SubProyecto = row("SubProyecto").ToString() + AgenciaAduanalUSA = row("AgenciaAduanalUSA").ToString() + AgenciaAduanalMEX = row("AgenciaAduanalMEX").ToString() + Temperatura = row("Temperatura").ToString() + Hora = String.Format("{0:hh }:{0:mm }:{0:ss tt}:", row("FechaIng")) + Chofer = row("Chofer").ToString() + CamPlaca = row("CamPlaca").ToString() + Camion = String.Format("{0} {1}", row("CamAnio"), row("CamEspecificacion")) + Rem1Placa = row("Rem1Placa").ToString() + Remolque1 = String.Format("{0} {1}", row("Rem1Anio"), row("Rem1Especificacion")) + If row("CveCamionRemolque1").ToString() = "1" Then + Rem1Placa = "12-TF-5E" + Remolque1 = "Remolque 1" + Else + Rem1Placa = "15-TF-7f" + Remolque1 = "Remolque 2" + + End If + + If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then + NoPallets = objnom.DtResultados.Rows.Count.ToString() + NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2") + NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0") + tablaReporte = objnom.DtResultados + End If + End If + 'Remolque 1 12-TF-5E' }, { cveCamion: 2, placa: 'Remolque 2 15-TF-7f + End Using + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("NoEmbarque", NoEmbarque)) + params.Add(New ReportParameter("Fecha", Fecha)) + params.Add(New ReportParameter("SubProyecto", SubProyecto)) + params.Add(New ReportParameter("AgenciaAduanalUSA", AgenciaAduanalUSA)) + params.Add(New ReportParameter("AgenciaAduanalMEX", AgenciaAduanalMEX)) + params.Add(New ReportParameter("Temperatura", Temperatura)) + params.Add(New ReportParameter("Hora", Hora)) + params.Add(New ReportParameter("Chofer", Chofer)) + params.Add(New ReportParameter("CamPlaca", CamPlaca)) + params.Add(New ReportParameter("Camion", Camion)) + params.Add(New ReportParameter("Rem1Placa", Rem1Placa)) + params.Add(New ReportParameter("Remolque1", Remolque1)) + + + params.Add(New ReportParameter("NoBultos", NoBultos)) + params.Add(New ReportParameter("NoPallets", NoPallets)) + params.Add(New ReportParameter("NoKgManifiesto", NoKgManifiesto)) + + + + + + + + Dim lrds As New List(Of ReportDataSource) + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte} + lrds.Add(rds) + '"Empresas/Grales/Formatos/EquiposGPS.rdlc" + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + ImprimirPDF("GPS/EmbarqueManifiesto.rdlc", lrds, params, "Equipo GPS") + End Sub Private Sub imprimirpallet2(cvePallet As Integer) Dim Envase As String = "" Dim Tamano As String = "" @@ -1558,7 +1650,7 @@ Partial Class PopUpVerFactura Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT - Timbre.Comprobante.Subtotal = Obj.SubTotal + Timbre.Comprobante.SubTotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento Timbre.Comprobante.Moneda = Obj.MonedaSAT Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString) diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx index 5e0ac6e38..1a81be565 100644 --- a/Compras/eFacturas.aspx +++ b/Compras/eFacturas.aspx @@ -410,7 +410,7 @@ - + diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 8ce5406bd..f3e2ed114 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -805,18 +805,20 @@ Partial Class Compras_eFacturas End If End If - - If ObjDatos.GetFacturas(-1, Folio, FechaI, FechaF, RFC, Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa, Opcion:=2) Then - - If ObjDatos.DtResultados.Rows.Count > 0 Then - - DTTrasaldos = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'") - - End If - End If - LblRegistros.Text = String.Format("{0} Registros", ObjDatos.DtResultados.FiltraParametros("TipoComprobante <> 'P' and TipoComprobante <> 'T' ").Rows.Count.ToString("N0")) LblTotalPagos.Text = String.Format("{0} Pagos", ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'P'").Rows.Count.ToString("N0")) + + If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then + TabTraslados.Visible = True + If ObjDatos.GetFacturas(-1, Folio, FechaI, FechaF, RFC, Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa, Opcion:=2) Then + + If ObjDatos.DtResultados.Rows.Count > 0 Then + + DTTrasaldos = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'") + + End If + End If + End If LblTotalTraslados.Text = String.Format("{0} Traslados", ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'").Rows.Count.ToString("N0")) If DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then @@ -988,13 +990,14 @@ Partial Class Compras_eFacturas Case "E" e.Row.FCLabel("LtTipoComprobante").Text = "Egreso" e.Row.FCLabel("LtTipoComprobante").CssClass = "label label-sm label-warning" - e.Row.FCLabel("LtTipoComprobante").Attributes.Add("data-toggle", "tooltip") + e.Row.FCLabel("LtTipoComprobante").Attributes.Add("data-toggle", "tooltip") ' e.Row.FCLabel("LtTipoComprobante").Attributes.Add("title", "Egreso") Case "P" e.Row.FCLabel("LtTipoComprobante").Text = "Pago" e.Row.FCLabel("LtTipoComprobante").CssClass = "label label-sm label-primary" e.Row.FCLabel("LtTipoComprobante").Attributes.Add("data-toggle", "tooltip") e.Row.FCLabel("LtTipoComprobante").Attributes.Add("title", "Complemento Pago") + End Select e.Row.Cells(2).Attributes.Add("data-order", e.Row.DBCampo("FechaFactura").ToDate.Ticks.ToString) diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx index 9796dade0..644b42cd9 100644 --- a/Contabilidad/RepIVA.aspx +++ b/Contabilidad/RepIVA.aspx @@ -132,13 +132,12 @@ - + - + - - + @@ -149,11 +148,10 @@ - - - + + - + diff --git a/Documentacion/TableroMaterialidad.aspx b/Documentacion/TableroMaterialidad.aspx index c7a5d2ecc..744690695 100644 --- a/Documentacion/TableroMaterialidad.aspx +++ b/Documentacion/TableroMaterialidad.aspx @@ -11,6 +11,9 @@ #C_Tab_Tlablero tr td:nth-child(n+2) { text-align: center } + .spanfoliofiscal{ + white-space:nowrap; + } @@ -36,7 +39,7 @@ - +
@@ -111,7 +114,14 @@ XML Timbrados PDF Timbrados - + + Enviar + + + + + + @@ -149,7 +159,8 @@ <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalPDF"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> - <%# string.Format("Enviar",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> + + <%-- <%# string.Format("Enviar",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %>--%> @@ -159,163 +170,524 @@ - -